use of net.dempsy.lifecycle.annotations.TestMps.TestMp in project Dempsy by Dempsy.
the class MessageProcessMessageHandlingTest method testMessageTypeResolution.
@Test
public void testMessageTypeResolution() throws Exception {
final MessageProcessor<TestMp> helper = new MessageProcessor<TestMp>(new TestMp());
helper.validate();
final Message m = new Message("yo");
final TestMp instance = helper.newInstance();
helper.invoke(instance, km(m));
}
use of net.dempsy.lifecycle.annotations.TestMps.TestMp in project Dempsy by Dempsy.
the class MessageProcessorTest method testMethodHandleWithParameters.
@Test
public void testMethodHandleWithParameters() throws Throwable {
final MessageProcessor<TestMp> helper = new MessageProcessor<TestMp>(new TestMp());
helper.validate();
final TestMp mp = helper.newInstance();
assertFalse(mp.activated);
helper.activate(mp, "activate", new Object());
assertTrue(mp.activated);
assertFalse(mp.passivateCalled);
helper.passivate(mp);
assertTrue(mp.passivateCalled);
}
Aggregations