Package org.springframework.osgi.mock

Examples of org.springframework.osgi.mock.MockBundle


  private Bundle mockBundle;
  private Properties props;
 
  protected void setUp() throws Exception {
    super.setUp();
    this.mockBundle = new MockBundle();
    this.props = new Properties();
  }
View Full Code Here


  private Version min, max, version;

  protected void setUp() throws Exception {
    props = new Properties();
    bundle = new MockBundle(props);

    min = Version.parseVersion("1.2");
    max = Version.parseVersion("1.3");
    version = Version.parseVersion("1.2.5");
  }
View Full Code Here

    startBundleMC = MockControl.createControl(Bundle.class);
    startBundle = (Bundle) startBundleMC.getMock();
    startBundleMC.expectAndReturn(startBundle.getSymbolicName(), "startBundle", MockControl.ONE_OR_MORE);

    bundleA = new MockBundle("bundleA");

    final Bundle[] bundles = new Bundle[] { installBundle, startBundle, updateBundle, bundleA };

    BundleContext bundleContext = new MockBundleContext() {
      // return proper bundles
View Full Code Here

  private ServletContext servletContext;
  private String contextPath;


  protected void setUp() throws Exception {
    bundle = new MockBundle();
    servletContext = new MockServletContext();
    contextPath = "somePath";
  }
View Full Code Here

    assertSame(servletContext, context.getServletContext());
  }

  public void testBundleContextPresenceInServletContext() throws Exception {
    BundleContext bundleCtx = new MockBundleContext();
    bundle = new MockBundle(bundleCtx);

    createWarDeployer();
    ServletContext ctx = context.getServletContext();
    Object attribute = ctx.getAttribute(WarDeploymentContext.OSGI_BUNDLE_CONTEXT_ATTRIBUTE);
    assertNotNull("bundle context not saved", attribute);
View Full Code Here

    MockControl mc = MockControl.createNiceControl(Context.class);
    context = (Context) mc.getMock();
    mc.expectAndReturn(context.getPath(), path);
    mc.expectAndReturn(context.getServletContext(), sc);
    mc.replay();
    Bundle bundle = new MockBundle();
    deployment = new TomcatWarDeployment(new Undeployer(), bundle, context);
  }
View Full Code Here

        undeployed = true;
      }
    };
    wac = new WebAppContext(webApp, contextPath);

    bundle = new MockBundle();
    deployment = new JettyWarDeployment(undeployer, bundle, wac);

  }
View Full Code Here

      // expected
    }
  }

  public void testStartDeployment() throws Exception {
    Bundle bundle = new MockBundle();
    final boolean[] started = new boolean[1];
    started[0] = false;

    final WebAppContext tempCtx = new WebAppContext() {
View Full Code Here

  private Bundle bundle;


  protected void setUp() throws Exception {
    OsgiStringUtilsTest.state = Bundle.UNINSTALLED;
    bundle = new MockBundle() {

      public int getState() {
        return state;
      }
    };
View Full Code Here

    assertEquals("UNKNOWN EVENT TYPE", OsgiStringUtils.nullSafeToString(new ServiceEvent(-123,
      new MockServiceReference())));
  }

  public void testNullSafeToStringFrameworkEvent() throws Exception {
    Bundle bundle = new MockBundle();
    Throwable th = new Exception();
    assertEquals("STARTED",
      OsgiStringUtils.nullSafeToString(new FrameworkEvent(FrameworkEvent.STARTED, bundle, th)));
    assertEquals("ERROR", OsgiStringUtils.nullSafeToString(new FrameworkEvent(FrameworkEvent.ERROR, bundle, th)));
View Full Code Here

TOP

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

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.