public void testAddressEndpointScenarioOne() throws Exception { String inputXML = "<endpoint xmlns=\"http://ws.apache.org/ns/synapse\">" + "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" />" + "</endpoint>" ; OMElement inputElement = createOMElement(inputXML); AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement( inputElement,true,null); OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint); assertTrue(compare(serializedOut,inputElement)); }
public void testAddressEndpointScenarioFour() throws Exception { String inputXML = "<endpoint xmlns=\"http://ws.apache.org/ns/synapse\">" + "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" >" + "</address>"+ "</endpoint>" ; OMElement inputElement = createOMElement(inputXML); AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement( inputElement, true, null); //assertNotNull(endpoint.getName()); // make sure we generate names for anonymous endpoints OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint); // the generated name should not show up in the serialization assertTrue(compare(serializedOut,inputElement)); }
public void testAddressEndpointScenarioTwo() throws Exception { String inputXML = "<endpoint name=\"testEndpoint\" onError=\"foo\" xmlns=" + "\"http://ws.apache.org/ns/synapse\">" + "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" >" + "</address>"+ "</endpoint>" ; OMElement inputElement = createOMElement(inputXML); AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement( inputElement,false,null); OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint); assertTrue(compare(serializedOut,inputElement)); }
public void testAddressEndpointScenarioThree() throws Exception { String inputXML = "<endpoint xmlns=\"http://ws.apache.org/ns/synapse\">" + "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" >" + "<markForSuspension>" + "<errorCodes>101507,101508</errorCodes>" + "<retriesBeforeSuspension>3</retriesBeforeSuspension>" + "<retryDelay>1000</retryDelay>" + "</markForSuspension>" + "<suspendOnFailure>" + "<errorCodes>101505,101506</errorCodes>" + "<initialDuration>5000</initialDuration>" + "<progressionFactor>2.0</progressionFactor>" + "<maximumDuration>60000</maximumDuration>" + "</suspendOnFailure>" + "<retryConfig>" + "<disabledErrorCodes>101501,101502</disabledErrorCodes>" + "</retryConfig>" + "</address>" + "</endpoint>" ; OMElement inputElement = createOMElement(inputXML); AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement( inputElement,true,null); OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint); assertTrue(compare(serializedOut,inputElement)); }
public void testAddressEndpointScenarioDe() throws Exception { String inputXML = "<endpoint xmlns=\"http://ws.apache.org/ns/synapse\">" + "<address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" >" + "<markForSuspension>" + "<errorCodes>101507,101508</errorCodes>" + "<retriesBeforeSuspension>3</retriesBeforeSuspension>" + "<retryDelay>1000</retryDelay>" + "</markForSuspension>" + "<suspendOnFailure>" + "<errorCodes>101505,101506</errorCodes>" + "<initialDuration>5000</initialDuration>" + "<progressionFactor>2.0</progressionFactor>" + "<maximumDuration>60000</maximumDuration>" + "</suspendOnFailure>" + "<retryConfig>" + "<enabledErrorCodes>101501,101502</enabledErrorCodes>" + "</retryConfig>" + "</address>" + "</endpoint>" ; OMElement inputElement = createOMElement(inputXML); AddressEndpoint endpoint = (AddressEndpoint) AddressEndpointFactory.getEndpointFromElement( inputElement,true,null); OMElement serializedOut = AddressEndpointSerializer.getElementFromEndpoint(endpoint); assertTrue(compare(serializedOut,inputElement)); }