use of org.apache.synapse.samples.framework.Axis2BackEndServerController in project wso2-synapse by wso2.
the class MediatorTestCase method doCleanup.
/**
* shutting down servers, cleaning temp files
*/
private void doCleanup() {
if (synapseController != null) {
log.debug("Stopping Synapse");
synapseController.stopProcess();
}
List<ProcessController> removed = new ArrayList<ProcessController>();
for (ProcessController bsc : backendServerControllers) {
if (bsc instanceof Axis2BackEndServerController) {
log.info("Stopping Server: " + bsc.getServerName());
bsc.stopProcess();
removed.add(bsc);
}
}
for (ProcessController bsc : removed) {
backendServerControllers.remove(bsc);
}
for (ProcessController bsc : backendServerControllers) {
log.info("Stopping Server: " + bsc.getServerName());
bsc.stopProcess();
}
}
use of org.apache.synapse.samples.framework.Axis2BackEndServerController in project wso2-synapse by wso2.
the class Sample253 method testPlaceOrder.
public void testPlaceOrder() throws Exception {
Axis2BackEndServerController axis2Server = getAxis2Server();
if (axis2Server == null) {
fail("Failed to load the Axis2BackEndServerController");
}
assertEquals("Invalid message count at the backend", 0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
String trpUrl = "http://localhost:8280/services/OneWayProxy";
StockQuoteSampleClient client = getStockQuoteClient();
client.placeOrder(null, trpUrl, null, "IBM");
boolean expectedMessageCountReceived = SynapseTestUtils.waitForMessageCount(axis2Server, "SimpleStockQuoteService", "placeOrder", 1, 2000);
assertTrue("Backend service not received the expected message count", expectedMessageCountReceived);
}
use of org.apache.synapse.samples.framework.Axis2BackEndServerController in project wso2-synapse by wso2.
the class Sample250 method testPlaceOrder.
public void testPlaceOrder() throws Exception {
System.setProperty("java.naming.provider.url", "tcp://localhost:62626");
Axis2BackEndServerController axis2Server = getAxis2Server();
if (axis2Server == null) {
fail("Failed to load the Axis2BackEndServerController");
}
assertEquals(0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
JMSSampleClient client = new JMSSampleClient();
client.connect("dynamicQueues/StockQuoteProxy");
client.sendAsPox("IBM");
Thread.sleep(2000);
assertEquals(1, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
client.shutdown();
}
use of org.apache.synapse.samples.framework.Axis2BackEndServerController in project wso2-synapse by wso2.
the class Sample252 method testPlaceOrderTypePOX.
public void testPlaceOrderTypePOX() throws Exception {
JMSSampleClient client = new JMSSampleClient();
Axis2BackEndServerController axis2Server = getAxis2Server();
if (axis2Server == null) {
fail("Failed to load the Axis2BackEndServerController");
}
assertEquals(0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
try {
client.connect("dynamicQueues/JMSPoxProxy");
client.sendAsPox("MSFT");
boolean expectedMessageCountReceived = SynapseTestUtils.waitForMessageCount(axis2Server, "SimpleStockQuoteService", "placeOrder", 1, 2000);
assertTrue("Backend service not received the expected message count", expectedMessageCountReceived);
} finally {
client.shutdown();
}
}
use of org.apache.synapse.samples.framework.Axis2BackEndServerController in project wso2-synapse by wso2.
the class Sample252 method testPlaceOrderTypeText.
public void testPlaceOrderTypeText() throws Exception {
JMSSampleClient client = new JMSSampleClient();
Axis2BackEndServerController axis2Server = getAxis2Server();
if (axis2Server == null) {
fail("Failed to load the Axis2BackEndServerController");
}
assertEquals(0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder"));
try {
client.connect("dynamicQueues/JMSTextProxy");
client.sendTextMessage("12.33 1000 ACP");
boolean expectedMessageCountReceived = SynapseTestUtils.waitForMessageCount(axis2Server, "SimpleStockQuoteService", "placeOrder", 1, 2000);
assertTrue("Backend service not received the expected message count", expectedMessageCountReceived);
} finally {
client.shutdown();
}
}
Aggregations