final List<?> list = new ArrayList<Object>();
session.setGlobal( "results",
list );
Order order = new Order();
OrderItem item1 = new OrderItem( order,
1,
"Adventure Guide Brazil",
OrderItem.TYPE_BOOK,
24 );
order.addItem( item1 );
FactHandle item1Fh = session.insert( item1 );
OrderItem item2 = new OrderItem( order,
2,
"Prehistoric Britain",
OrderItem.TYPE_BOOK,
15 );
order.addItem( item2 );
FactHandle item2Fh = session.insert( item2 );
OrderItem item3 = new OrderItem( order,
3,
"Holiday Music",
OrderItem.TYPE_CD,
9 );
order.addItem( item3 );
FactHandle item3Fh = session.insert( item3 );
OrderItem item4 = new OrderItem( order,
4,
"Very Best of Mick Jagger",
OrderItem.TYPE_CD,
11 );
order.addItem( item4 );
FactHandle item4Fh = session.insert( item4 );
session.insert( order );
session.fireAllRules();
assertEquals( 11, list.size() );