Instance producerApam1 = producer01Impl.createInstance(null, null);
Instance consumerApam = consumerImpl.createInstance(null, null);
M1ConsumerImpl01 consumer = (M1ConsumerImpl01) consumerApam
.getServiceObject();
M1ProducerImpl producer1 = (M1ProducerImpl) producerApam1
.getServiceObject();
// TODO message: force wire in message test
consumer.getQueue();
consumer.getList();
consumer.getSet();
producer1.pushMessage("message 1");
producer1.pushMessage("message 2");
producer1.pushMessage("message 3");
// ensure queue is inject
Assert.assertTrue(String.format(usecase,
"but the queue was not injected (has null value assigned)"),
consumer.getQueue() != null);
Assert.assertTrue(
String.format(
usecase,
"but the queue was not injected (has size different than the number of messages sent)"),
consumer.getQueue().size() == 3);
Assert.assertTrue(
String.format(usecase,
"but the queue was not injected (the message is different than the one sent)"),
consumer.getQueue().poll()
.equals(new EletronicMsg("message 1")));
// ensure that list and set type are not injected
Assert.assertTrue(
String.format(usecase, "the type List received the messages"),
consumer.getList() == null);
Assert.assertTrue(
String.format(usecase, "the type Set received the messages"),
consumer.getSet() == null);
}