Examples of ResourceMapper


Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper

import org.apache.felix.ipojo.manipulator.store.ResourceMapper;

public class WABResourceMapperTestCase extends TestCase {

    public void testWebInfClassesResourceIsMapped() throws Exception {
        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));
    }
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper

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

    public void testWebInfLibResourceIsUnchanged() throws Exception {
        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));
    }
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper

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

    public void testMetaInfManifestIsUnchanged() throws Exception {
        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));
    }
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper

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

    public void testResourceNotMapped() throws Exception {
        ResourceMapper mapper = new WABResourceMapper();

        String resource = "images/logo.png";

        Assert.assertEquals(resource, mapper.internalize(resource));
    }
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper

public class FileSystemResourceMapperTestCase extends TestCase {

    public void testUnixInternalize() throws Exception {

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

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

        String result = mapper.internalize(path);

        Assert.assertEquals(path, result);
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper

    }

    public void testUnixExternalize() throws Exception {

        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

Examples of org.apache.felix.ipojo.manipulator.store.ResourceMapper

    }

    public void ignoreWindowsExternalize() throws Exception {
        // As Java doesn't like '\' alone in Strings I have to replace them on the fly :'(
        // 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

Examples of org.apache.wicket.core.request.mapper.ResourceMapper

  {
    if (reference.canBeRegistered())
    {
      getResourceReferenceRegistry().registerResourceReference(reference);
    }
    mount(new ResourceMapper(path, reference));
  }
View Full Code Here

Examples of org.apache.wicket.core.request.mapper.ResourceMapper

  {
    if (reference.canBeRegistered())
    {
      getResourceReferenceRegistry().registerResourceReference(reference);
    }
    ResourceMapper mapper = new ResourceMapper(path, reference);
    mount(mapper);
    return mapper;
  }
View Full Code Here

Examples of org.apache.wicket.core.request.mapper.ResourceMapper

  {
    if (reference.canBeRegistered())
    {
      getResourceReferenceRegistry().registerResourceReference(reference);
    }
    mount(new ResourceMapper(path, reference));
  }
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.