Package org.apache.aries.mocks

Examples of org.apache.aries.mocks.BundleMock


   * @throws NamingException
   */
  @Test(expected=NameNotFoundException.class)
  public void testLookupForServiceWeNeverHad() throws NamingException
  {
    BundleMock mock = new BundleMock("scooby.doo", new Properties());
   
    Thread.currentThread().setContextClassLoader(mock.getClassLoader());

    InitialContext ctx = new InitialContext();
   
    ctx.lookup("osgi:service/java.lang.Integer");
  }
View Full Code Here


  }

  @Test
  public void checkProxyDynamism() throws NamingException
  {
    BundleMock mock = new BundleMock("scooby.doo", new Properties());
   
    Thread.currentThread().setContextClassLoader(mock.getClassLoader());

    InitialContext ctx = new InitialContext();
   
    String className = Runnable.class.getName();
   
View Full Code Here

  }
 
  @Test
  public void checkServiceListLookup() throws NamingException
  {
    BundleMock mock = new BundleMock("scooby.doo", new Properties());
   
    Thread.currentThread().setContextClassLoader(mock.getClassLoader());

    InitialContext ctx = new InitialContext();
   
    String className = Runnable.class.getName();
   
View Full Code Here

  }
 
  @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();
   
View Full Code Here

  }

  @Test
  public void checkServiceListListBindings() throws NamingException
  {
    BundleMock mock = new BundleMock("scooby.doo", new Properties());
   
    Thread.currentThread().setContextClassLoader(mock.getClassLoader());

    InitialContext ctx = new InitialContext();
   
    String className = Runnable.class.getName();
   
View Full Code Here

  }

  @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");
   
View Full Code Here

  }
 
  @Test
  public void checkServiceOrderObserved() throws NamingException
  {
    BundleMock mock = new BundleMock("scooby.doo", new Properties());
   
    Thread.currentThread().setContextClassLoader(mock.getClassLoader());

    InitialContext ctx = new InitialContext();
   
    String className = Runnable.class.getName();
   
View Full Code Here

 
  private Bundle testBundle;
 
  @Before
  public void setup() {
    testBundle = Skeleton.newMock(new BundleMock("test",
        new Hashtable<Object, Object>()), Bundle.class);
  }
View Full Code Here

    private Bundle hostBundle;

    @Before
    public void setUp() throws Exception {
        hostBundle = Skeleton.newMock(new BundleMock("scooby.doo",
                new Hashtable<String, Object>()), Bundle.class);
    }
View Full Code Here

    private Bundle makeBundleWithExports(String symbolicName, String version,
            String exports) {
        Hashtable<String, Object> headers = new Hashtable<String, Object>();
        headers.put(Constants.BUNDLE_VERSION, version);
        headers.put(Constants.EXPORT_PACKAGE, exports);
        Bundle exportBundle = Skeleton.newMock(new BundleMock(symbolicName,
                headers), Bundle.class);
        return exportBundle;
    }
View Full Code Here

TOP

Related Classes of org.apache.aries.mocks.BundleMock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.