@Test
public void checkServiceListList() throws NamingException
{

  BundleMock mock = new BundleMock("scooby.doo", new Properties());
  
  Thread.currentThread().setContextClassLoader(mock.getClassLoader());
  InitialContext ctx = new InitialContext();
  
  String className = Runnable.class.getName();
  
  Runnable t = Skeleton.newMock(Runnable.class);
  
  // we don't want the default service
  reg.unregister();
  
  ServiceRegistration reg = bc.registerService(className, t, null);
  ServiceRegistration reg2 = bc.registerService(className, new Thread(), null);
  
  NamingEnumeration<NameClassPair> ne = ctx.list("osgi:servicelist/" + className);
  
  assertTrue(ne.hasMoreElements());
  
  NameClassPair ncp = ne.nextElement();
  
  assertEquals(String.valueOf(reg.getReference().getProperty(Constants.SERVICE_ID)), ncp.getName());
  assertTrue("Class name not correct. Was: " + ncp.getClassName(), ncp.getClassName().contains("Proxy"));
  
  assertTrue(ne.hasMoreElements());
  
  ncp = ne.nextElement();
  
  assertEquals(String.valueOf(reg2.getReference().getProperty(Constants.SERVICE_ID)), ncp.getName());
  assertEquals("Class name not correct.", Thread.class.getName(), ncp.getClassName());
  
  assertFalse(ne.hasMoreElements());
}