use of com.hack23.cia.model.internal.application.data.impl.DataAgentWorkOrder in project cia by Hack23.
the class DataAgentApiITest method importWorldbankDataSuccessTest.
@Test
public void importWorldbankDataSuccessTest() throws JMSException {
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(dataAgentApi, "jmsSender", jmsSenderMock);
dataAgentApi.execute(new DataAgentWorkOrder().withOperation(DataAgentOperation.IMPORT).withTarget(DataAgentTarget.MODEL_EXTERNAL_WORLDBANK));
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, times(4)).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
// waitUntilQueueIsEmpty("worldbank");
}
use of com.hack23.cia.model.internal.application.data.impl.DataAgentWorkOrder in project cia by Hack23.
the class DataAgentApiITest method importRiksdagenDataSuccessTest.
/**
* Import riksdagen data success test.
* @throws JMSException
*/
@Test
public void importRiksdagenDataSuccessTest() throws JMSException {
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(dataAgentApi, "jmsSender", jmsSenderMock);
dataAgentApi.execute(new DataAgentWorkOrder().withOperation(DataAgentOperation.IMPORT).withTarget(DataAgentTarget.MODEL_EXTERNAL_RIKSDAGEN));
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, times(7)).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
// waitUntilQueueIsEmpty("riksdagen");
}
use of com.hack23.cia.model.internal.application.data.impl.DataAgentWorkOrder in project cia by Hack23.
the class DataAgentApiTest method importRiksdagenDataSuccessTest.
@Test
public void importRiksdagenDataSuccessTest() throws JMSException {
final DataAgentApiImpl dataAgentApiImpl = new DataAgentApiImpl();
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(dataAgentApiImpl, "jmsSender", jmsSenderMock);
dataAgentApiImpl.execute(new DataAgentWorkOrder().withOperation(DataAgentOperation.IMPORT).withTarget(DataAgentTarget.MODEL_EXTERNAL_RIKSDAGEN));
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, times(7)).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
}
use of com.hack23.cia.model.internal.application.data.impl.DataAgentWorkOrder in project cia by Hack23.
the class StartAgentClickListener method buttonClick.
@Override
public void buttonClick(final ClickEvent event) {
final DataAgentWorkOrder dataAgentWorkOrder = new DataAgentWorkOrder();
dataAgentWorkOrder.setTarget(dataAgentTarget);
dataAgentWorkOrder.setOperation(dataAgentOperation);
LOGGER.info(LOG_MSG_EXECUTE_WORKORDER, dataAgentWorkOrder);
ApplicationMangerAccess.getApplicationManager().getAgentContainer().execute(dataAgentWorkOrder);
}
use of com.hack23.cia.model.internal.application.data.impl.DataAgentWorkOrder in project cia by Hack23.
the class DataAgentApiTest method importWorldbankDataSuccessTest.
@Test
public void importWorldbankDataSuccessTest() throws JMSException {
final DataAgentApiImpl dataAgentApiImpl = new DataAgentApiImpl();
final JmsSender jmsSenderMock = mock(JmsSender.class);
ReflectionTestUtils.setField(dataAgentApiImpl, "jmsSender", jmsSenderMock);
dataAgentApiImpl.execute(new DataAgentWorkOrder().withOperation(DataAgentOperation.IMPORT).withTarget(DataAgentTarget.MODEL_EXTERNAL_WORLDBANK));
final ArgumentCaptor<Destination> destCaptor = ArgumentCaptor.forClass(Destination.class);
final ArgumentCaptor<Serializable> stringCaptor = ArgumentCaptor.forClass(Serializable.class);
verify(jmsSenderMock, times(4)).send(destCaptor.capture(), stringCaptor.capture());
final List<Serializable> capturedStrings = stringCaptor.getAllValues();
final List<Destination> capturedDestinations = destCaptor.getAllValues();
assertNotNull(capturedStrings);
assertNotNull(capturedDestinations);
}
Aggregations