01: package org.apache.synapse.samples.n2n;
02:
03: import org.apache.synapse.SynapseConstants;
04: import org.apache.axis2.engine.ListenerManager;
05: import samples.userguide.LoadbalanceFailoverClient;
06:
07: /**
08: *
09: */
10: public class SynapseSample_54_Integration extends
11: AbstractAutomationTestCase {
12:
13: ListenerManager listenerManager = null;
14:
15: protected void setUp() throws Exception {
16: System.setProperty(SynapseConstants.SYNAPSE_XML,
17: SAMPLE_CONFIG_ROOT_PATH + "synapse_sample_54.xml");
18: System.setProperty("addurl", SYNAPSE_BASE_URL);
19: System.setProperty("symbol", "IBM");
20: System.setProperty("mode", "quote");
21: System.setProperty("repository",
22: "modules/samples/target/test_repos/axis2Client");
23: setUpNSContext();
24: System.setProperty("test_mode", "true");
25: System.setProperty("i", "3");
26: }
27:
28: public void testSample() throws Exception {
29: setUpSynapseEnv();
30: startCustomAxis2Server("9001", "9005");
31: startCustomAxis2Server("9002", "9006");
32: startCustomAxis2Server("9003", "9007");
33: String resultString = (new LoadbalanceFailoverClient())
34: .sessionlessClient();
35: assertTrue(resultString.contains("9001"));
36: assertTrue(resultString.contains("9002"));
37: assertTrue(resultString.contains("9003"));
38: resultString = (new LoadbalanceFailoverClient())
39: .sessionlessClient();
40: assertTrue(resultString.contains("9001"));
41: assertTrue(resultString.contains("9002"));
42: assertFalse(resultString.contains("9003"));
43: }
44: }
|