copfee / owasp-esapi-java

Automatically exported from code.google.com/p/owasp-esapi-java
Other
0 stars 1 forks source link

missing assertions in SafeFileTest.java #275

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. No assertion; Class SafeFileTest.java; Method testEscapeCharactersInFilename
2. No assertion; Class SafeFileTest.java; Method 
testEscapeCharacterInDirectoryInjection

What is the expected output? What do you see instead?
1. Expect to see output of unit test assertion

What version of the product are you using? On what operating system?
1. ESAPI_2.0 subversion trunk

Does this issue affect only a specified browser or set of browsers?
1. n/a

updated tests with assertions :

    public void testEscapeCharactersInFilename() {
        System.out.println("testEscapeCharactersInFilenameInjection");
        File tf = testFile;
        if (tf.exists()) {
            System.out.println("File is there: " + tf);
        }

        File sf = new File(testDir, "test^.file");

        assertFalse("Injection didn't work " + sf.getAbsolutePath(),
                sf.exists());
        assertTrue("  Injection allowed " + sf.getAbsolutePath(), sf.exists());
    }

    public void testEscapeCharacterInDirectoryInjection() {
        System.out.println("testEscapeCharacterInDirectoryInjection");
        File sf = new File(testDir, "test\\^.^.\\file");
        assertFalse("  Injection didn't work " + sf.getAbsolutePath(),
                sf.exists());
        assertTrue("  Injection allowed " + sf.getAbsolutePath(), sf.exists());
    }

Please provide any additional information below.

Original issue reported on code.google.com by alan.cha...@gmail.com on 11 Jul 2012 at 5:55

Attachments:

GoogleCodeExporter commented 9 years ago
initially uploaded original class

Original comment by alan.cha...@gmail.com on 11 Jul 2012 at 6:07

Attachments: