Package org.springframework.osgi.mock

Examples of org.springframework.osgi.mock.MockBundleContext


*/
public class OsgiSingleReferenceParserWithInvalidFilesTest extends TestCase {
  private GenericApplicationContext appContext;

  protected void setUp() throws Exception {
    BundleContext bundleContext = new MockBundleContext() {
      // service reference already registered
      public ServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException {
        return new ServiceReference[0];
      }
    };
View Full Code Here



  protected void setUp() throws Exception {
    services = new LinkedHashMap();

    context = new MockBundleContext() {

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

  private ServiceReference ref;


  protected void setUp() throws Exception {
    ref = new MockServiceReference();
    bundleContext = new MockBundleContext() {

      public ServiceReference getServiceReference(String clazz) {
        return ref;
      }
View Full Code Here

  //
  // TESTS on object with an EQUAL defined on it
  //
  public void testDifferentInterceptorsButTargetHasEquals() throws Exception {
    target = new Implementor();
    bundleContext = new MockBundleContext() {

      public Object getService(ServiceReference reference) {
        return target;
      }
    };
View Full Code Here

    assertFalse("interceptors should not be equal", interceptorA1.equals(interceptorB1));
  }

  private BundleContext createObjectTrackingBundleContext(final Object trackedObject) {
    return new MockBundleContext() {

      public ServiceReference getServiceReference(String clazz) {
        return ref;
      }
View Full Code Here


  protected void setUp() throws Exception {
    deployer = new JettyWarDeployer();
    server = new Server();
    context = new MockBundleContext();
    deployer.setServer(server);
    deployer.setBundleContext(context);

  }
View Full Code Here

    deployer.afterPropertiesSet();
  }

  public void testCreateDeployment() throws Exception {
    deployer.afterPropertiesSet();
    BundleContext bundleCtx = new MockBundleContext();
    String contextPath = "/path";
    WarDeployment deployment = deployer.createDeployment(bundleCtx.getBundle(), contextPath);
    assertNotNull(deployment);
    JettyWarDeployment jettyDeployment = (JettyWarDeployment) deployment;
    assertTrue(jettyDeployment.isActive());
    WebAppContext ctx = jettyDeployment.getWebAppContext();
    assertSame(server, ctx.getServer());
View Full Code Here

        assertEquals(HandlerCollection.class, byclass);
        return new HandlerCollection();
      }
    };

    BundleContext bundleCtx = new MockBundleContext();
    String contextPath = "/path";
    deployer.setServer(tempServer);
    deployer.afterPropertiesSet();
    WarDeployment deployment = deployer.createDeployment(bundleCtx.getBundle(), contextPath);
    deployment.undeploy();
  }
View Full Code Here


  protected void setUp() throws Exception {
    services = new LinkedHashMap();

    BundleContext ctx = new MockBundleContext() {

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

  protected void setUp() throws Exception {
    exporter = new OsgiServiceFactoryBean();
    beanFactoryControl = MockControl.createControl(ConfigurableBeanFactory.class);
    beanFactory = (ConfigurableBeanFactory) this.beanFactoryControl.getMock();
    bundleContext = new MockBundleContext();
    ctxCtrl = MockControl.createControl(BundleContext.class);
    ctx = (BundleContext) ctxCtrl.getMock();

    exporter.setBeanFactory(beanFactory);
    exporter.setBundleContext(bundleContext);
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.