FileDocCategorySizeDatePackage
TestEncryptedFile.javaAPI DocApache Poi 3.0.12526Sun Mar 11 12:59:32 GMT 2007org.apache.poi.hslf

TestEncryptedFile

public class TestEncryptedFile extends TestCase
Tests that HSLFSlideShow does the right thing with an encrypted file
author
Nick Burch (nick at torchbox dot com)

Fields Summary
private String
ss_ne
private String
ss_e
private String
ss_np_e
private String
ss_56_e
Constructors Summary
public TestEncryptedFile()

		String dirname = System.getProperty("HSLF.testdata.path");
		
		ss_ne = dirname + "/basic_test_ppt_file.ppt";
		ss_e = dirname + "/Password_Protected-hello.ppt";
		ss_np_e = dirname + "/Password_Protected-np-hello.ppt";
		ss_56_e = dirname + "/Password_Protected-56-hello.ppt";
    
Methods Summary
public voidtestLoadEncrypted()

    	try {
    		new HSLFSlideShow(ss_e);
    		fail();
    	} catch(EncryptedPowerPointFileException e) {
    		// Good
    	}
    	
    	try {
    		new HSLFSlideShow(ss_np_e);
    		fail();
    	} catch(EncryptedPowerPointFileException e) {
    		// Good
    	}
    	
    	try {
    		new HSLFSlideShow(ss_56_e);
    		fail();
    	} catch(EncryptedPowerPointFileException e) {
    		// Good
    	}
    
public voidtestLoadNonEncrypted()

    	HSLFSlideShow hss = new HSLFSlideShow(ss_ne);
    	
    	assertNotNull(hss);