Package org.springframework.osgi.mock

Examples of org.springframework.osgi.mock.MockBundle


   * (non-Javadoc)
   *
   * @see junit.framework.TestCase#setUp()
   */
  protected void setUp() throws Exception {
    bundle = new MockBundle();
    resolver = new OsgiBundleResourcePatternResolver(bundle);

  }
View Full Code Here


  private String path;


  protected void setUp() throws Exception {
    path = OsgiBundleResourceTest.class.getName().replace('.', '/').concat(".class");
    bundle = new MockBundle();
    resource = new OsgiBundleResource(bundle, path);
  }
View Full Code Here

   */
  public void testEqualsObject() {
    assertEquals(resource, new OsgiBundleResource(bundle, path));
    assertEquals(resource, resource);
    assertFalse(resource.equals(new OsgiBundleResource(bundle, "")));
    assertFalse(resource.equals(new OsgiBundleResource(new MockBundle(), path)));
  }
View Full Code Here

  protected void setUp() throws Exception {
    deployment = new WarDeployment() {

      public WarDeploymentContext getDeploymentContext() {
        return new DefaultWarDeploymentContext(new MockBundle(), "/context", new MockServletContext());
      }

      public boolean isActive() {
        return false;
      }
View Full Code Here

  }

  public void testDeploySuccesful() throws Exception {
    BundleContext bc = new MockBundleContext();

    final Bundle bnd = new MockBundle();
    final String ctxPath = "/context";
    final Boolean[] started = new Boolean[1];

    deployer = new ParentWarDeployer() {
View Full Code Here

  protected void tearDown() throws Exception {
    strategy = null;
  }

  private Bundle createBundleWithLocation(final String location) {
    return new MockBundle() {

      public String getLocation() {
        return location;
      }
    };
View Full Code Here

    final String expectedContextPath = "someName";

    final Dictionary dict = new Properties();
    dict.put(Constants.BUNDLE_NAME, expectedContextPath);

    Bundle bundle = new MockBundle() {

      public Dictionary getHeaders() {
        return dict;
      }
View Full Code Here

    assertEquals("/" + expectedContextPath, strategy.getContextPath(bundle));
  }

  public void testFallBackToSymbolicName() throws Exception {
    final String expectedContextPath = "this.is.my.symbolic.name";
    Bundle bundle = new MockBundle(expectedContextPath) {

      public String getLocation() {
        return null;
      }
    };
View Full Code Here

    assertEquals("/" + expectedContextPath, strategy.getContextPath(bundle));
  }

  public void testFallBackToIdentity() throws Exception {
    Bundle bundle = new MockBundle() {

      public Dictionary getHeaders() {
        return null;
      }
View Full Code Here

  public void testBundleHeader() throws Exception {
    String value = "bla";
    Dictionary headers = new Properties();
    headers.put("Web-ContextPath", value);
    Bundle bundle = new MockBundle(headers);

    String path = strategy.getContextPath(bundle);
    assertTrue(path.startsWith("/"));
    assertEquals("/" + value, path);
  }
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.