使用JavaGroovy连接大型机?

问题描述 投票:-1回答:1

我目前正在做一个web服务项目,这是暴露。 我需要自动完成以下过程

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.

与Webservice测试相关,我曾在Soap UI上工作过。步骤1可以是可选的,我可以运行一个批处理作业来获得。

第2步和第3步是否可以在Soap UI中实现。 我正在使用Rocket Bluezone模拟器来测试这个。

有一种方法,我可以写一个vb脚本,然后用groovy调用vb脚本,这是最小的选择。

有没有其他的方法,我可以连接Rocket Bluezone使用JavaGroovy来实现,而不是单独运行vbscript。

java groovy soapui bluezone
1个回答
1
投票

为了回答你的部分问题,你可以从Groovy中调用VBScript。

一个脚本。

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))

你可以调用它,传递一个参数,然后从Groovy中得到返回值,就像这样。

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()

希望能帮到你

© www.soinside.com 2019 - 2024. All rights reserved.