public void testManyToMany() throws Exception
{
EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
test.manyToManyCreate();
Flight one = test.findFlightById(new Long(1));
assertTrue(one.getCompany().getName().equals("Air France"));
Flight two = test.findFlightById(new Long(2));
assertTrue(two.getCompany().getName().equals("USAir"));
System.out.println("Air France customers");
for (Customer c : one.getCustomers())
{
System.out.println(c.getName());
}
System.out.println("USAir customers");
for (Customer c : two.getCustomers())
{
System.out.println(c.getName());
}
}