Package org.akubraproject.map

Examples of org.akubraproject.map.IdMapper


import com.bhle.access.download.storage.FileStorageIdMapper;

public class OfflineTest {
  @Test
  public void testOfflineProductIdMapper(){
    IdMapper mapper = new FileStorageIdMapper();
    URI externalId = URI.create("mailto:bhletech@bhle.com/a0hhmgs3_122344.jpg");
    URI internalId = mapper.getInternalId(externalId);
    Assert.assertEquals("file:bhletech%40bhle.com/a0hhmgs3_122344.jpg", internalId.toString());
  }
View Full Code Here


    }

    /** getExternalId should produce the expected URIs. */
    @Test
    public void testGetExternalId() {
        IdMapper mapper = new HashPathIdMapper("##/##/##");
        assertEquals(URI1, mapper.getExternalId(URI1_ENCODED));
        assertEquals(URI2, mapper.getExternalId(URI2_ENCODED));
        assertEquals(URI3, mapper.getExternalId(URI3_ENCODED));
    }
View Full Code Here

    }

    /** getInternalId should produce the expected URIs. */
    @Test
    public void testGetInternalId() {
        IdMapper mapper = new HashPathIdMapper("##/##/##");
        assertEquals(URI1_ENCODED, mapper.getInternalId(URI1));
        assertEquals(URI2_ENCODED, mapper.getInternalId(URI2));
        assertEquals(URI3_ENCODED, mapper.getInternalId(URI3));
    }
View Full Code Here

        assertNull(new HashPathIdMapper("#").getInternalPrefix("urn:test"));
    }

    private static void runGenericTests(String pattern)
            throws Exception {
        IdMapper mapper = new HashPathIdMapper(pattern);
        checkRoundtrip(mapper, URI1);
        checkRoundtrip(mapper, URI2);
        checkRoundtrip(mapper, URI3);
    }
View Full Code Here

TOP

Related Classes of org.akubraproject.map.IdMapper

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.