Package io.apigee.trireme.core.internal

Examples of io.apigee.trireme.core.internal.PathTranslator


{
    @Test
    public void testIdentity()
        throws IOException
    {
        PathTranslator trans = new PathTranslator();
        File xl = trans.translate("./target/test-classes/io/apigee/trireme/core/test/PathTranslatorTest.class");
        File realFile = new File("./target/test-classes/io/apigee/trireme/core/test/PathTranslatorTest.class");
        assertTrue(realFile.exists());
        assertEquals(realFile.getCanonicalPath(), xl.getCanonicalPath());
    }
View Full Code Here


    @Test
    public void testBasicPath()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("/io/apigee/trireme/core/test/PathTranslatorTest.class");
        File realFile = new File("./target/test-classes/io/apigee/trireme/core/test/PathTranslatorTest.class");
        assertTrue(realFile.exists());
        assertEquals(realFile.getCanonicalPath(), xl.getCanonicalPath());
    }
View Full Code Here

    @Test
    public void testDot()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate(".");
        File realFile = new File("./target/test-classes");
        assertTrue(realFile.exists());
        assertEquals(realFile.getCanonicalPath(), xl.getCanonicalPath());
    }
View Full Code Here

    @Test
    public void testSlash()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("/");
        File realFile = new File("./target/test-classes");
       
        String canonXL = trimPath(xl.getCanonicalPath());
        String canonTrans = trimPath(realFile.getCanonicalPath());
       
View Full Code Here

    @Test
    public void testDotDot()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("..");
        assertNull(xl);
    }
View Full Code Here

    @Test
    public void testNotRealPath()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("/io/apigee/trireme/corecore/test/PathTranslatorTest.foobar");
        File realFile = new File("./target/test-classes/io/apigee/trireme/corecore/test/PathTranslatorTest.foobar");
        assertFalse(realFile.exists());
        assertEquals(realFile.getCanonicalPath(), xl.getCanonicalPath());
    }
View Full Code Here

    @Test
    public void testComplexPath()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("/io/apigee/trireme/../../apigee/trireme/core/../core/test/PathTranslatorTest.class");
        File realFile = new File("./target/test-classes/io/apigee/trireme/core/test/PathTranslatorTest.class");
        assertTrue(realFile.exists());
        assertEquals(realFile.getCanonicalPath(), xl.getCanonicalPath());
    }
View Full Code Here

    @Test
    public void testCraftyRoot()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("/io/apigee/trireme/core/../../../..");
        File realFile = new File("./target/test-classes");
        assertTrue(realFile.exists());
        assertEquals(realFile.getCanonicalPath(), xl.getCanonicalPath());
    }
View Full Code Here

    @Test
    public void testCraftyEscape()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("/io/apigee/trireme/core/../../../../..");
        assertNull(xl);
    }
View Full Code Here

    @Test
    public void testCraftyEscape2()
        throws IOException
    {
        PathTranslator trans = new PathTranslator("./target/test-classes");
        File xl = trans.translate("/io/apigee/../../org/../..");
        assertNull(xl);
    }
View Full Code Here

TOP

Related Classes of io.apigee.trireme.core.internal.PathTranslator

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.