Connect Mainframe Using Java/Groovy?

388 Views Asked by At

I am currently working on a web service project which is exposed.. I need to automate the below process

Step 1: Connect Mainframe and collect test data from the Mainframe and storing data in xls.
Step 2: Run the Soap Request and Verify that the response is 200
Step 3: Connect Mainframe again and Extract each parameter from Response and validate those against in MF data.

Related to Webservice Test, i have worked on Soap UI.. Step 1 can be optional may be i can run a batch jobs to get that..

Step 2 and Step 3 is it possible in Soap UI itself. I am using Rocket Bluezone Emulator to test this..

There is a way that I can write a vb script and call that vbscript using groovy that is the least option..

Is there any other way that i can connect Rocket Bluezone using Java/Groovy to achieve this instead of running separately vbscript.

1

There are 1 best solutions below

7
ou_ryperd On

To answer a part of your question, you can call VBScript from Groovy.

A script:

if WScript.Arguments.Count = 0 then
    WScript.Echo "Missing parameters"
end if

function func(parm)
    Wscript.Echo("You sent " & parm )
    func = "You sent " & parm
end function

func(Wscript.Arguments(0))

You can call it, pass a parameter, and get the return value from Groovy like this:

def script = "src/myScript.vbs"
def exe = "C:\\Windows\\System32\\cscript.exe"
def parm = "Hello"
def cmd = "${exe} ${script} \"${parm}\""
def proc = cmd.execute()
def outputStream = new StringBuffer()
proc.waitForProcessOutput(outputStream, System.err)
println outputStream.toString()

Hope that helps.