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_600_Integration extends
11: AbstractAutomationTestCase {
12:
13: protected void setUp() throws Exception {
14: System.setProperty(SynapseConstants.SYNAPSE_XML,
15: SAMPLE_CONFIG_ROOT_PATH + "synapse_sample_600.xml");
16: System.setProperty("addurl", SYNAPSE_BASE_URL);
17: System.setProperty("mode", "quote");
18: System.setProperty("symbol", "IBM");
19: super .setUp();
20: }
21:
22: public void testSample() throws Exception {
23: getStringResultOfTest(StockQuoteClient.executeTestClient());
24: getStringResultOfTest(StockQuoteClient.executeTestClient());
25: getStringResultOfTest(StockQuoteClient.executeTestClient());
26: String resultString = getStringResultOfTest(StockQuoteClient
27: .executeTestClient());
28: assertXpathExists("ns:getQuoteResponse", resultString);
29: assertXpathExists("ns:getQuoteResponse/ns:return", resultString);
30:
31: try {
32: getStringResultOfTest(StockQuoteClient.executeTestClient());
33: } catch (AxisFault f) {
34: assertEquals("**Access Denied**", f.getReason());
35: }
36: }
37: }
|