use of org.apache.axis2.transport.base.threads.WorkerPool in project wso2-synapse by wso2.
the class FIXIncomingMessageHandlerTest method testFromAdmin.
@Test
public void testFromAdmin() throws Exception {
SessionID id = new SessionID(new BeginString("FIX.4.1"), new SenderCompID("SYNAPSE"), new TargetCompID("BANZAI"), "FIX.4.1:SYNAPSE->BANZAI");
Message message = new NewOrderSingle();
message.getHeader().setField(new BeginString("FIX.4.1"));
message.getHeader().setField(new SenderCompID("SYNAPSE"));
message.getHeader().setField(new TargetCompID("BANZAI"));
message.getHeader().setField(new MsgSeqNum(1));
message.getHeader().setField(new MsgType("A"));
ConfigurationContext cfgCtx = new ConfigurationContext(new AxisConfiguration());
WorkerPool pool = new NativeWorkerPool(3, 4, 10, 10, "name", "id");
FIXIncomingMessageHandler handler = new FIXIncomingMessageHandler(cfgCtx, pool, service, true);
handler.fromAdmin(message, id);
}
use of org.apache.axis2.transport.base.threads.WorkerPool in project wso2-synapse by wso2.
the class FIXIncomingMessageHandlerTest method testInitialization.
@Test
public void testInitialization() throws Exception {
AxisService axisService = new AxisService("testFIXService");
axisService.addParameter(new Parameter(FIXConstants.FIX_ACCEPTOR_EVENT_HANDLER, "randomClass"));
ConfigurationContext cfgCtx = new ConfigurationContext(new AxisConfiguration());
WorkerPool pool = new NativeWorkerPool(3, 4, 10, 10, "name", "id");
FIXIncomingMessageHandler handler = new FIXIncomingMessageHandler(cfgCtx, pool, axisService, true);
Assert.assertNotNull("FIXIncomingMessageHandler not initialized!", handler);
}
use of org.apache.axis2.transport.base.threads.WorkerPool in project wso2-synapse by wso2.
the class FIXIncomingMessageHandlerTest method testToAdmin.
@Test
public void testToAdmin() throws Exception {
initMocks(this);
SessionID id = new SessionID(new BeginString("FIX.4.1"), new SenderCompID("SYNAPSE"), new TargetCompID("BANZAI"), "FIX.4.1:SYNAPSE->BANZAI");
Message message = new NewOrderSingle();
message.getHeader().setField(new BeginString("FIX.4.1"));
message.getHeader().setField(new SenderCompID("SYNAPSE"));
message.getHeader().setField(new TargetCompID("BANZAI"));
message.getHeader().setField(new MsgSeqNum(1));
message.getHeader().setField(new MsgType("A"));
PowerMockito.when(service.getParameter(FIXConstants.FIX_USERNAME)).thenReturn(new Parameter(FIXConstants.FIX_USERNAME, "wos2"));
PowerMockito.when(service.getParameter(FIXConstants.FIX_PASSWORD)).thenReturn(new Parameter(FIXConstants.FIX_PASSWORD, "wos2"));
ConfigurationContext cfgCtx = new ConfigurationContext(new AxisConfiguration());
WorkerPool pool = new NativeWorkerPool(3, 4, 10, 10, "name", "id");
FIXIncomingMessageHandler handler = new FIXIncomingMessageHandler(cfgCtx, pool, service, true);
handler.toAdmin(message, id);
}
use of org.apache.axis2.transport.base.threads.WorkerPool in project wso2-synapse by wso2.
the class FIXIncomingMessageHandlerTest method testToApp.
@Test
public void testToApp() throws Exception {
SessionID id = new SessionID(new BeginString("FIX.4.1"), new SenderCompID("SYNAPSE"), new TargetCompID("BANZAI"), "FIX.4.1:SYNAPSE->BANZAI");
Message message = new NewOrderSingle();
message.getHeader().setField(new BeginString("FIX.4.1"));
message.getHeader().setField(new SenderCompID("SYNAPSE"));
message.getHeader().setField(new TargetCompID("BANZAI"));
message.getHeader().setField(new MsgSeqNum(1));
message.getHeader().setField(new MsgType("A"));
ConfigurationContext cfgCtx = new ConfigurationContext(new AxisConfiguration());
WorkerPool pool = new NativeWorkerPool(3, 4, 10, 10, "name", "id");
FIXIncomingMessageHandler handler = new FIXIncomingMessageHandler(cfgCtx, pool, service, true);
handler.toApp(message, id);
}
Aggregations