Package org.apache.felix.ipojo.manipulator.store

Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper.externalize()


        ResourceMapper mapper = new WABResourceMapper();

        String normalized = "jndi.properties";
        String resource = "WEB-INF/classes/jndi.properties";

        Assert.assertEquals(normalized, mapper.externalize(resource));
        Assert.assertEquals(resource, mapper.internalize(normalized));
    }

    public void testWebInfLibResourceIsUnchanged() throws Exception {
        ResourceMapper mapper = new WABResourceMapper();
View Full Code Here


        ResourceMapper mapper = new WABResourceMapper();

        String normalized = "WEB-INF/lib/commons-logging.jar";
        String resource = "WEB-INF/lib/commons-logging.jar";

        Assert.assertEquals(normalized, mapper.externalize(resource));
        Assert.assertEquals(resource, mapper.internalize(normalized));
    }

    public void testMetaInfManifestIsUnchanged() throws Exception {
        ResourceMapper mapper = new WABResourceMapper();
View Full Code Here

        ResourceMapper mapper = new WABResourceMapper();

        String normalized = "META-INF/MANIFEST.MF";
        String resource = "META-INF/MANIFEST.MF";

        Assert.assertEquals(normalized, mapper.externalize(resource));
        Assert.assertEquals(resource, mapper.internalize(normalized));
    }

    public void testResourceNotMapped() throws Exception {
        ResourceMapper mapper = new WABResourceMapper();
View Full Code Here

        ResourceMapper delegate = mock(ResourceMapper.class);
        FileSystemResourceMapper mapper = new FileSystemResourceMapper(delegate);

        String path = "this/is/a/unix/like/path.extension";
        when(delegate.externalize(eq(path))).thenReturn(path);

        String result = mapper.externalize(path);

        // unix path is already normalized
        Assert.assertEquals(path, result);
View Full Code Here

        // Grrr doesn't work as expected
        ResourceMapper delegate = mock(ResourceMapper.class);
        FileSystemResourceMapper mapper = new FileSystemResourceMapper(delegate);

        String path = "c:\\this\\is\\a\\windows\\like\\path.extension";
        when(delegate.externalize(eq(path))).thenReturn(path);

        String expected = "c:/this/is/a/windows/like/path.extension";
        String result = mapper.externalize(path);

        // unix path is already normalized
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.