@Test(expected=ServiceException.class)
public void checkProxyWhenServiceGoes() throws ServiceException, NamingException
{

  BundleMock mock = new BundleMock("scooby.doo", new Properties());
  
  Thread.currentThread().setContextClassLoader(mock.getClassLoader());
  InitialContext ctx = new InitialContext();
  
  Runnable r = (Runnable) ctx.lookup("osgi:service/java.lang.Runnable");
  
  r.run();
  
  Skeleton.getSkeleton(service).assertCalled(new MethodCall(Runnable.class, "run"));
  
  reg.unregister();
  
  r.run();
}