}
@Test
public void test1() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.drools.grid" );
WhitePages wp = new JpaWhitePages( emf );
wp.create( "s1", "grid0" );
wp.create( "s2", "grid0" );
wp.create( "s3", "grid0" );
GridServiceDescription<String> gs1 = wp.lookup( "s1" );
gs1.addAddress( "p1" ).setObject( "v1" );
gs1.addAddress( "p2" ).setObject( "v2" );
gs1 = wp.lookup( "s1" );
assertEquals( 2,
gs1.getAddresses().size() );
assertEquals( "v1",
gs1.getAddresses().get( "p1" ).getObject() );
assertEquals( "v2",
gs1.getAddresses().get( "p2" ).getObject() );
gs1.removeAddress( "p2" );
gs1 = wp.lookup( "s1" );
assertEquals( 1,
gs1.getAddresses().size() );
assertEquals( "v1",
gs1.getAddresses().get( "p1" ).getObject() );
wp.remove( "s1" );
assertNull( wp.lookup( "s1" ) );
GridServiceDescription gs2 = wp.lookup( "s2" );
assertNotNull( gs2 );
}