Package org.springframework.osgi.mock

Examples of org.springframework.osgi.mock.MockBundleContext


        return new ArrayEnumerator(new URL[] { getClass().getResource(
          "/org/springframework/osgi/extender/internal/support/extender-custom-config.xml") });
      }
    };

    bundleContext = new MockBundleContext(bundle);
    config = new ExtenderConfiguration(bundleContext);
  }
View Full Code Here


  protected void setUp() throws Exception {
    service = new Object();

    ServiceReference reference = new MockServiceReference();

    BundleContext ctx = new MockBundleContext() {
      public Object getService(ServiceReference reference) {
        return service;
      }
    };
View Full Code Here

      public Bundle getBundle() {
        return null;
      }
    };

    interceptor = new ServiceStaticInterceptor(new MockBundleContext(), reference);

    Object target = new Object();
    Method m = target.getClass().getDeclaredMethod("hashCode", null);

    MethodInvocation invocation = new MockMethodInvocation(m);
View Full Code Here

    services.put(ref3, service3);

    bindServices = new ArrayList();
    unbindServices = new ArrayList();

    bundleContext = new MockBundleContext() {

      public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
        return new ServiceReference[] { ref1, ref2, ref3 };
      }
View Full Code Here

    // special mock context
    // 1. will return no service for the null Filter ("null")
    // 2. will return ref2 for filter serv2Filter

    // the same goes with getService
    ctx = new MockBundleContext() {

      public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
        if (serv2Filter.equals(filter))
          return new ServiceReference[] { ref2 };
        else if (nullFilter.equals(filter)) {
View Full Code Here

TOP

Related Classes of org.springframework.osgi.mock.MockBundleContext

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.