01: package org.apache.synapse.samples.n2n;
02:
03: import org.apache.synapse.SynapseConstants;
04: import org.apache.axis2.AxisFault;
05: import samples.userguide.StockQuoteClient;
06:
07: /**
08: *
09: */
10: public class SynapseSample_102_Integration extends
11: AbstractAutomationTestCase {
12:
13: protected void setUp() throws Exception {
14: System.setProperty(SynapseConstants.SYNAPSE_XML,
15: SAMPLE_CONFIG_ROOT_PATH + "synapse_sample_102.xml");
16: super .setUp();
17: }
18:
19: public void testSample() throws Exception {
20: System.setProperty("trpurl",
21: "http://localhost:8080/soap/StockQuoteProxy");
22: try {
23: getStringResultOfTest(StockQuoteClient.executeTestClient());
24: } catch (AxisFault f) {
25: assertEquals(
26: "The service cannot be found for the endpoint reference (EPR) "
27: + "/soap/StockQuoteProxy", f.getReason());
28: }
29:
30: System.setProperty("trpurl",
31: "https://localhost:8443/soap/StockQuoteProxy");
32: String resultString = getStringResultOfTest(StockQuoteClient
33: .executeTestClient());
34: assertXpathExists("ns:getQuoteResponse", resultString);
35: assertXpathExists("ns:getQuoteResponse/ns:return", resultString);
36: }
37: }
|