Author: nick
Date: Tue Nov 12 11:32:10 2013
New Revision: 1541005
URL: http://svn.apache.org/r1541005
Log:
Fix whitespace
Modified:
poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java
Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java?rev=1541005&r1=1541004&r2=1541005&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java Tue Nov
12 11:32:10 2013
@@ -16,37 +16,37 @@ import org.apache.poi.xwpf.extractor.XWP
import org.apache.poi.xwpf.usermodel.XWPFDocument;
public class TestXWPFBugs extends TestCase {
- /**
- * A word document that's encrypted with non-standard
- * Encryption options, and no cspname section. See bug 53475
- */
- public void test53475() throws Exception {
- try {
- Biff8EncryptionKey.setCurrentUserPassword("solrcell");
- File file =
POIDataSamples.getDocumentInstance().getFile("bug53475-password-is-solrcell.docx");
- NPOIFSFileSystem filesystem = new NPOIFSFileSystem(file, true);
-
- // Check the encryption details
- EncryptionInfo info = new EncryptionInfo(filesystem);
- assertEquals(128, info.getHeader().getKeySize());
- assertEquals(EncryptionHeader.ALGORITHM_AES_128,
info.getHeader().getAlgorithm());
- assertEquals(EncryptionHeader.HASH_SHA1,
info.getHeader().getHashAlgorithm());
-
- // Check it can be decoded
- Decryptor d = Decryptor.getInstance(info);
- assertTrue("Unable to process: document is encrypted",
d.verifyPassword("solrcell"));
-
- // Check we can read the word document in that
- InputStream dataStream = d.getDataStream(filesystem);
- OPCPackage opc = OPCPackage.open(dataStream);
- XWPFDocument doc = new XWPFDocument(opc);
- XWPFWordExtractor ex = new XWPFWordExtractor(doc);
- String text = ex.getText();
- assertNotNull(text);
- assertEquals("This is password protected Word document.",
text.trim());
- ex.close();
- } finally {
- Biff8EncryptionKey.setCurrentUserPassword(null);
- }
- }
+ /**
+ * A word document that's encrypted with non-standard
+ * Encryption options, and no cspname section. See bug 53475
+ */
+ public void test53475() throws Exception {
+ try {
+ Biff8EncryptionKey.setCurrentUserPassword("solrcell");
+ File file =
POIDataSamples.getDocumentInstance().getFile("bug53475-password-is-solrcell.docx");
+ NPOIFSFileSystem filesystem = new NPOIFSFileSystem(file, true);
+
+ // Check the encryption details
+ EncryptionInfo info = new EncryptionInfo(filesystem);
+ assertEquals(128, info.getHeader().getKeySize());
+ assertEquals(EncryptionHeader.ALGORITHM_AES_128,
info.getHeader().getAlgorithm());
+ assertEquals(EncryptionHeader.HASH_SHA1,
info.getHeader().getHashAlgorithm());
+
+ // Check it can be decoded
+ Decryptor d = Decryptor.getInstance(info);
+ assertTrue("Unable to process: document is encrypted",
d.verifyPassword("solrcell"));
+
+ // Check we can read the word document in that
+ InputStream dataStream = d.getDataStream(filesystem);
+ OPCPackage opc = OPCPackage.open(dataStream);
+ XWPFDocument doc = new XWPFDocument(opc);
+ XWPFWordExtractor ex = new XWPFWordExtractor(doc);
+ String text = ex.getText();
+ assertNotNull(text);
+ assertEquals("This is password protected Word document.",
text.trim());
+ ex.close();
+ } finally {
+ Biff8EncryptionKey.setCurrentUserPassword(null);
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]