Search in sources :

Example 6 with BlockingResponseCallback

use of org.kie.server.client.jms.BlockingResponseCallback in project droolsjbpm-integration by kiegroup.

the class JmsResponseHandlerIntegrationTest method testStartProcessUseOfAsyncResponseHandlerWithMarshaller.

@Test
public void testStartProcessUseOfAsyncResponseHandlerWithMarshaller() throws Exception {
    ResponseCallback callback = new BlockingResponseCallback(createMarshaller());
    testStartProcessResponseHandler(new AsyncResponseHandler(callback));
    // now let's check if response has arrived
    Long processInstanceId = callback.get(Long.class);
    assertThat(processInstanceId).isNotNull().isPositive();
}
Also used : AsyncResponseHandler(org.kie.server.client.jms.AsyncResponseHandler) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) ResponseCallback(org.kie.server.client.jms.ResponseCallback) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) Test(org.junit.Test) JbpmKieServerBaseIntegrationTest(org.kie.server.integrationtests.jbpm.JbpmKieServerBaseIntegrationTest)

Example 7 with BlockingResponseCallback

use of org.kie.server.client.jms.BlockingResponseCallback in project droolsjbpm-integration by kiegroup.

the class JmsResponseHandlerIntegrationTest method testGlobalConfigurationOfAsyncResponseHandler.

@Test
public void testGlobalConfigurationOfAsyncResponseHandler() throws Exception {
    ResponseCallback callback = new BlockingResponseCallback(createMarshaller());
    testStartProcessWithGlobalConfiguration(new AsyncResponseHandler(callback));
    Long processInstanceId = callback.get(Long.class);
    assertThat(processInstanceId).isNotNull().isPositive();
}
Also used : AsyncResponseHandler(org.kie.server.client.jms.AsyncResponseHandler) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) ResponseCallback(org.kie.server.client.jms.ResponseCallback) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) Test(org.junit.Test) JbpmKieServerBaseIntegrationTest(org.kie.server.integrationtests.jbpm.JbpmKieServerBaseIntegrationTest)

Example 8 with BlockingResponseCallback

use of org.kie.server.client.jms.BlockingResponseCallback in project droolsjbpm-integration by kiegroup.

the class JmsResponseHandlerIntegrationTest method testGetProcessInstancesUseOfAsyncResponseHandlerWithMarshaller.

@Test
public void testGetProcessInstancesUseOfAsyncResponseHandlerWithMarshaller() throws Exception {
    ResponseCallback callback = new BlockingResponseCallback(createMarshaller());
    testGetProcessInstancesResponseHandler(new AsyncResponseHandler(callback));
    // now let's check if response has arrived
    ProcessInstanceList processInstanceList = callback.get(ProcessInstanceList.class);
    assertThat(processInstanceList).isNotNull();
    assertThat(processInstanceList.getItems()).isNotNull().hasSize(1);
}
Also used : ProcessInstanceList(org.kie.server.api.model.instance.ProcessInstanceList) AsyncResponseHandler(org.kie.server.client.jms.AsyncResponseHandler) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) ResponseCallback(org.kie.server.client.jms.ResponseCallback) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) Test(org.junit.Test) JbpmKieServerBaseIntegrationTest(org.kie.server.integrationtests.jbpm.JbpmKieServerBaseIntegrationTest)

Example 9 with BlockingResponseCallback

use of org.kie.server.client.jms.BlockingResponseCallback in project droolsjbpm-integration by kiegroup.

the class JmsResponseHandlerIntegrationTest method testQueryRegistrationUseOfAsyncResponseHandler.

@Test
public void testQueryRegistrationUseOfAsyncResponseHandler() throws Exception {
    ResponseCallback callback = new BlockingResponseCallback(null);
    testQueryRegistration(new AsyncResponseHandler(callback));
}
Also used : AsyncResponseHandler(org.kie.server.client.jms.AsyncResponseHandler) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) ResponseCallback(org.kie.server.client.jms.ResponseCallback) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) Test(org.junit.Test) JbpmKieServerBaseIntegrationTest(org.kie.server.integrationtests.jbpm.JbpmKieServerBaseIntegrationTest)

Example 10 with BlockingResponseCallback

use of org.kie.server.client.jms.BlockingResponseCallback in project droolsjbpm-integration by kiegroup.

the class ContainerJmsResponseHandlerIntegrationTest method setupClients.

@Before
public void setupClients() throws Exception {
    asyncClient = createDefaultClient();
    Marshaller marshaller = MarshallerFactory.getMarshaller(new HashSet<Class<?>>(extraClasses.values()), configuration.getMarshallingFormat(), asyncClient.getClassLoader());
    responseCallback = new BlockingResponseCallback(marshaller);
    asyncClient.setResponseHandler(new AsyncResponseHandler(responseCallback));
    fireAndForgetClient = createDefaultClient();
    fireAndForgetClient.setResponseHandler(new FireAndForgetResponseHandler());
}
Also used : FireAndForgetResponseHandler(org.kie.server.client.jms.FireAndForgetResponseHandler) Marshaller(org.kie.server.api.marshalling.Marshaller) AsyncResponseHandler(org.kie.server.client.jms.AsyncResponseHandler) BlockingResponseCallback(org.kie.server.client.jms.BlockingResponseCallback) BeforeClass(org.junit.BeforeClass) Before(org.junit.Before)

Aggregations

AsyncResponseHandler (org.kie.server.client.jms.AsyncResponseHandler)10 BlockingResponseCallback (org.kie.server.client.jms.BlockingResponseCallback)10 Test (org.junit.Test)9 ResponseCallback (org.kie.server.client.jms.ResponseCallback)9 JbpmKieServerBaseIntegrationTest (org.kie.server.integrationtests.jbpm.JbpmKieServerBaseIntegrationTest)7 Marshaller (org.kie.server.api.marshalling.Marshaller)3 FireAndForgetResponseHandler (org.kie.server.client.jms.FireAndForgetResponseHandler)3 BeforeClass (org.junit.BeforeClass)2 RequestReplyResponseHandler (org.kie.server.client.jms.RequestReplyResponseHandler)2 ResponseHandler (org.kie.server.client.jms.ResponseHandler)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Before (org.junit.Before)1 BatchExecutionCommand (org.kie.api.command.BatchExecutionCommand)1 Command (org.kie.api.command.Command)1 ExecutionResults (org.kie.api.runtime.ExecutionResults)1 ServiceResponsesList (org.kie.server.api.model.ServiceResponsesList)1 ProcessInstanceList (org.kie.server.api.model.instance.ProcessInstanceList)1 SolverInstance (org.kie.server.api.model.instance.SolverInstance)1 SolverInstanceList (org.kie.server.api.model.instance.SolverInstanceList)1