public void testClassEndpointScenarioOne() throws Exception { String inputXML = "<endpoint xmlns=\"http://ws.apache.org/ns/synapse\">" + "<class name=\"org.apache.synapse.config.xml.endpoints.CustomClassEndpoint\"/>" + "</endpoint>"; OMElement inputElement = createOMElement(inputXML); ClassEndpoint endpoint = (ClassEndpoint) ClassEndpointFactory.getEndpointFromElement(inputElement, true, null); OMElement serializedOut = ClassEndpointSerializer.getElementFromEndpoint(endpoint); assertTrue(compare(serializedOut, inputElement)); }
public void testClassEndpointScenarioTwo() throws Exception { String inputXML = "<endpoint name=\"testEndpoint\" xmlns=" + "\"http://ws.apache.org/ns/synapse\">" + "<class name=\"org.apache.synapse.config.xml.endpoints.CustomClassEndpoint\"/>" + "</endpoint>"; OMElement inputElement = createOMElement(inputXML); ClassEndpoint endpoint = (ClassEndpoint) ClassEndpointFactory.getEndpointFromElement( inputElement,false,null); OMElement serializedOut = ClassEndpointSerializer.getElementFromEndpoint(endpoint); assertTrue(compare(serializedOut,inputElement)); }
public void testClassEndpointScenarioThree() throws Exception { String inputXML = "<endpoint name=\"testEndpoint\" xmlns=" + "\"http://ws.apache.org/ns/synapse\">" + "<class name=\"org.apache.synapse.config.xml.endpoints.CustomClassEndpoint\">" + "<parameter xmlns=" + "\"\" name=\"foo\">XYZ</parameter>" + "</class>" + "</endpoint>"; OMElement inputElement = createOMElement(inputXML); ClassEndpoint endpoint = (ClassEndpoint) ClassEndpointFactory.getEndpointFromElement( inputElement,false,null); OMElement serializedOut = ClassEndpointSerializer.getElementFromEndpoint(endpoint); assertTrue(compare(serializedOut,inputElement)); }