Code example for Permission

Methods: getActions

0
     * @tests java.util.zip.ZipFile#ZipFile(java.io.File, int) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        method = "ZipFile", 
        args = {java.io.File.class, int.class}
    ) 
    public void test_ConstructorLjava_io_FileI() throws IOException { 
        zfile.close(); // about to reopen the same temp file
        File file = new File(tempFileName);
        ZipFile zip = new ZipFile(file, ZipFile.OPEN_DELETE | ZipFile.OPEN_READ);
        zip.close();
        assertTrue("Zip should not exist", !file.exists());
        file = new File(tempFileName);
        file.delete();
        try { 
            zip = new ZipFile(file, ZipFile.OPEN_READ);
            fail("IOException expected");
        } catch (IOException ee) {
            // expected 
        }