@Test
public void testList() throws Exception { 

  InitialContext ctx = new InitialContext();
  NamingEnumeration<NameClassPair> compList = ctx.list("blueprint:comp");
  
  Set<String> expectedCompIds = new BlueprintContainerStub().getComponentIds();
  while (compList.hasMore()) { 
    NameClassPair ncp = compList.next();
    String compId = ncp.getName();
    String compClass = ncp.getClassName();
    if (compId.equals("comp1")) { 
      assertEquals ("comp1 class wrong in list", SimpleComponent.class.getName(), compClass);
    } else if (compId.equals("comp2")) { 
      assertEquals ("comp2 class wrong in list", AnotherComponent.class.getName(), compClass);
    }
    expectedCompIds.remove(compId);
  }
  assertEquals ("Not all expected components were found", expectedCompIds.size(), 0);
}