private IMXMLWebServiceNode getMXMLWebServiceNode(String[] code) { IMXMLFileNode fileNode = getMXMLFileNodeWithFlex(code); IMXMLWebServiceNode node = (IMXMLWebServiceNode) findFirstDescendantOfType(fileNode, IMXMLWebServiceNode.class); assertThat("getNodeID", node.getNodeID(), is(ASTNodeID.MXMLWebServiceID)); assertThat("getName", node.getName(), is("mx.rpc.soap.mxml.WebService")); return node; }
@Test public void MXMLWebServiceNode_twoOperations() { String[] code = new String[] { "<mx:WebService id='ws' wsdl='http://whatever'>", " <mx:operation name='op1'/>", " <mx:operation name='op2'/>", "</mx:WebService>" }; IMXMLWebServiceNode node = getMXMLWebServiceNode(code); assertThat("getChildCount", node.getChildCount(), is(3)); IMXMLPropertySpecifierNode wsdlNode = (IMXMLPropertySpecifierNode) node.getChild(0); assertThat("", wsdlNode.getName(), is("wsdl")); IMXMLWebServiceOperationNode op1Node = (IMXMLWebServiceOperationNode) node.getChild(1); assertThat("", op1Node.getName(), is("mx.rpc.soap.mxml.Operation")); assertThat("", op1Node.getOperationName(), is("op1")); IMXMLWebServiceOperationNode op2Node = (IMXMLWebServiceOperationNode) node.getChild(2); assertThat("", op2Node.getName(), is("mx.rpc.soap.mxml.Operation")); assertThat("", op2Node.getOperationName(), is("op2")); }