Examples of ArrayEnumerator


Examples of org.springframework.osgi.mock.ArrayEnumerator

  public void testConvertURLEnumerationToResourceArray() throws Exception {
    URL[] urls = new URL[] { new URL("file:///"),
      getClass().getResource("/" + getClass().getName().replace('.', '/') + ".class") };

    ArrayEnumerator enm = new ArrayEnumerator(urls);
    Resource[] resources = OsgiResourceUtils.convertURLEnumerationToResourceArray(enm);

    assertNotNull(resources);
    assertEquals(2, resources.length);
View Full Code Here

Examples of org.springframework.osgi.mock.ArrayEnumerator

      public Enumeration findEntries(String path, String filePattern, boolean recurse) {
        assertEquals("/", path);
        assertEquals("WEB-INF", filePattern);
        assertEquals(false, recurse);
        return new ArrayEnumerator(new Object[] { new Object() });
      }
    };

    assertTrue(scanner.isWar(bundle));
  }
View Full Code Here

Examples of org.springframework.osgi.mock.ArrayEnumerator

          return null;

        assertEquals("WEB-INF", path);
        assertNull(filePattern);
        assertEquals(false, recurse);
        return new ArrayEnumerator(new Object[] { new Object() });
      }
    };

    assertTrue(scanner.isWar(bundle));
  }
View Full Code Here

Examples of org.springframework.osgi.mock.ArrayEnumerator

  }

  public void testGetBundleResource() throws Exception {
    String res = "foo.txt";
    URL url = new URL("file:/" + res);
    control.expectAndReturn(bundle.findEntries("/", res, false), new ArrayEnumerator(new URL[] {url}));
    control.replay();

    Resource resource = loader.getResource("osgibundle:/" + res);
    assertNotNull(resource);
    assertSame(url, resource.getURL());
View Full Code Here

Examples of org.springframework.osgi.mock.ArrayEnumerator

    Bundle mock = (Bundle) control.getMock();

    String location = "foo";
    URL result = new URL("file:/" + location);

    control.expectAndReturn(mock.findEntries("/", "foo", false), new ArrayEnumerator(new URL[] { result }));
    control.replay();

    resource = new OsgiBundleResource(mock, location);

    assertEquals(result, resource.getResourceFromBundleSpace(location).getURL());
View Full Code Here

Examples of org.springframework.osgi.mock.ArrayEnumerator

    RefContainer.reference = null;

    MockBundle bundle = new MockBundle() {
      public Enumeration findEntries(String path, String filePattern, boolean recurse) {
        try {
          return new ArrayEnumerator(
              new URL[] { new ClassPathResource(
                  "/org/springframework/osgi/internal/context/support/serviceReferenceConversion.xml").getURL() });
        }
        catch (IOException io) {
          throw new RuntimeException(io);
View Full Code Here

Examples of org.springframework.osgi.mock.ArrayEnumerator

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

      public Enumeration findEntries(String path, String filePattern, boolean recurse) {
        return new ArrayEnumerator(new URL[] { getClass().getResource(
          "/org/springframework/osgi/extender/internal/support/extender-custom-config.xml") });
      }
    };

    bundleContext = new MockBundleContext(bundle);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.