}
public void testPushStructured() throws Exception
{
// setup test data
StructuredEventMessage _event = new StructuredEventMessage(getORB());
StructuredEvent _data = getTestUtils().getEmptyStructuredEvent();
_data.filterable_data = new Property[] {
new Property("operation", toAny(DRINKING_COFFEE_ID)),
new Property("name", toAny("alphonse")), new Property("minutes", toAny(10)) };
_event.setStructuredEvent(_data, false, false);
// setup mock
MockCoffee _mockCoffee = new MockCoffee()
{
public void drinking_coffee(String name, int minutes)
{
super.drinking_coffee(name, minutes);
assertEquals("alphonse", name);
assertEquals(10, minutes);
}
};
_mockCoffee.drinking_coffee_expect = 1;
// setup and connect consumer
final Coffee _coffee = _mockCoffee._this(getClientORB());
MockTypedPushConsumer _mockConsumer = new MockTypedPushConsumer()
{
public org.omg.CORBA.Object get_typed_consumer()
{
return _coffee;
}
};
TypedPushConsumer _consumer = _mockConsumer._this(getClientORB());
proxyPushSupplier_.connect_typed_push_consumer(_consumer);
// run test
objectUnderTest_.getMessageConsumer().queueMessage(_event.getHandle());
// verify results
_mockCoffee.verify();
}