Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Linux集群 > Architecture > » 正文

soapui test

来源: bochuxt 分享至:
import com.fedex.services.awad.dto.CommandDto
import com.fedex.services.awad.dto.UndoStackDto

// get holder for response
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def holder = groovyUtils.getXmlHolder( "ReassignAccept#ResponseAsXml" )
//log.info holder.getPrettyXml()
def nodesState = holder.getDomNodes( "/flex.messaging.io.amf.ASObject/map/flex.messaging.io.ArrayCollection/object-array//map/string[2]" )
def nodesType = holder.getDomNodes( "/flex.messaging.io.amf.ASObject/map/flex.messaging.io.ArrayCollection/object-array//map/string[4]" )

def listState = []   
def listType = []
def undoDto=new com.fedex.services.awad.dto.UndoStackDto();

for( node in nodesState )
{

    def nodeList = node.getChildNodes();
    for(childnode in nodeList)
         {
listState.add( childnode.getNodeValue().toString() )
         }
}
def x=0
def pojoType=''
def pojoState=''
for( node in nodesType )
{
   def nodeList = node.getChildNodes();
         for(childnode in nodeList)
         {
listType.add( childnode.getNodeValue().toString() )
pojoType  =  childnode.getNodeValue()
pojoState =  listState[x]

def commandDto=new com.fedex.services.awad.dto.CommandDto(type: pojoType,   state: pojoState);
undoDto.commands.add(commandDto)

log.info("child node value--"+  pojoType)
log.info(pojoState)
x=x+1
         }
}
parameters['UndoStackDto']=undoDto

Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史