@Test
public void testFormat() throws Exception
{
mockTaskProcessor_.processMessage(null);
controlTaskProcessor_.setMatcher(new AbstractMatcher()
{
public boolean matches(Object[] expected, Object[] actual)
{
if (expected[0] != null)
{
try
{
Property[] _props = ((Message) expected[0]).toTypedEvent();
assertEquals(3, _props.length);
assertEquals("event_type", _props[0].name);
EventType et = EventTypeHelper.extract(_props[0].value);
assertEquals(PullCoffeeHelper.id(), et.domain_name);
assertEquals(
"::org::jacorb::test::notification::typed::PullCoffee::drinking_coffee",
et.type_name);
assertEquals("jacorb", _props[1].value.extract_string());
assertEquals(20, _props[2].value.extract_long());
return true;
} catch (Exception e)
{
return false;
}
}
return true;
}
});
mockPullCoffee_.try_drinking_coffee(null, null);
controlPullCoffeeOperations_.setMatcher(new AbstractMatcher()
{
public boolean matches(Object[] expected, Object[] actual)
{
StringHolder name = (StringHolder) expected[0];
IntHolder minutes = (IntHolder) expected[1];
// need to set the out params
if (name != null)
{
name.value = "jacorb";
}
if (minutes != null)
{
minutes.value = 20;
}
return true;
}
});
controlPullCoffeeOperations_.setReturnValue(true);
mockPullCoffee_.try_cancel_coffee(null);
controlPullCoffeeOperations_.setMatcher(new AbstractMatcher()
{
public boolean matches(Object[] expected, Object[] actual)
{
StringHolder name = (StringHolder) expected[0];