dependency-check-cli/src/test/java/org/owasp/dependencycheck/AppTest.java
/**
     * Test of ensureCanonicalPath method, of class App.
     */
Test of ensureCanonicalPath method, of class App.
Test of ensureCanonicalPath method of class App .
@Test
    public void testEnsureCanonicalPath() {
        String file = "../*.jar";
        App instance = new App();
        String result = instance.ensureCanonicalPath(file);
        assertFalse(result.contains(".."));
        assertTrue(result.endsWith("*.jar"));
        file = "../some/skip/../path/file.txt";
        String expResult = "/some/path/file.txt";
        result = instance.ensureCanonicalPath(file);
        assertTrue("result=" + result, result.endsWith(expResult));
    }
@ Test public void testEnsureCanonicalPath ( ) { String file = "../*.jar" ; App instance = new App ( ) ; String result = instance . ensureCanonicalPath ( file ) ; assertFalse ( result . contains ( ".." ) ) ; assertTrue ( result . endsWith ( "*.jar" ) ) ; file = "../some/skip/../path/file.txt" ; String expResult = "/some/path/file.txt" ; result = instance . ensureCanonicalPath ( file ) ; assertTrue ( "result=" + result , result . endsWith ( expResult ) ) ; }
Test of ensureCanonicalPath method, of class App.
Test of ensureCanonicalPath method of class App .