@Test
public void testListBindings() throws Exception { 

  InitialContext ctx = new InitialContext();
  NamingEnumeration<Binding> bindings = ctx.listBindings("blueprint:comp");
  
  Set<String> expectedCompIds = new BlueprintContainerStub().getComponentIds();
  while (bindings.hasMore()) { 
    Binding b = bindings.next();
    String compId = b.getName();
    Object component = b.getObject();
    if (compId.equals("comp1")) { 
      SimpleComponent sc = (SimpleComponent) component;
      assertEquals ("comp1 message wrong", "comp1_message", sc.getIdMessage());
    } else if (compId.equals("comp2")) { 
      AnotherComponent ac = (AnotherComponent) component;
      assertEquals ("comp2 message wrong", "AnotherComponent with id comp2", ac.getIdMessage());
    }
    expectedCompIds.remove(compId);
  }
  assertEquals ("Not all expected components were found", expectedCompIds.size(), 0);
}