Author: yegor
Date: Mon Jun 20 08:01:23 2011
New Revision: 1137538
URL: http://svn.apache.org/viewvc?rev=1137538&view=rev
Log:
junit test for sprm, added missing line from r1137143
Added:
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java (with props)
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java?rev=1137538&r1=1137537&r2=1137538&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java Mon
Jun 20 08:01:23 2011
@@ -347,6 +347,7 @@ public final class ParagraphSprmUncompre
break;
case 0x41:
// sprmPFBiDi
+ newPAP.setFBiDi((byte) sprm.getOperand());
break;
case 0x43:
Added: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java?rev=1137538&view=auto
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java (added)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java Mon Jun 20
08:01:23 2011
@@ -0,0 +1,61 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+package org.apache.poi.hwpf.sprm;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+import org.apache.poi.POIDataSamples;
+import org.apache.poi.hwpf.HWPFDocument;
+
+public class TestSprms extends TestCase {
+ /**
+ * Test correct processing of "sprmPJc" by uncompressor
+ */
+ public void testSprmPJc() throws IOException {
+ InputStream resourceAsStream = POIDataSamples.getDocumentInstance()
+ .openResourceAsStream("Bug49820.doc");
+ HWPFDocument hwpfDocument = new HWPFDocument(resourceAsStream);
+ assertEquals(1, hwpfDocument.getStyleSheet().getParagraphStyle(8)
+ .getJustification());
+ resourceAsStream.close();
+ }
+
+ /**
+ * Test correct processing of "sprmPJc" by compressor and uncompressor
+ */
+ public void testSprmPJcResave() throws IOException {
+ InputStream resourceAsStream = POIDataSamples.getDocumentInstance()
+ .openResourceAsStream("Bug49820.doc");
+ HWPFDocument hwpfDocument = new HWPFDocument(resourceAsStream);
+ resourceAsStream.close();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ hwpfDocument.write(baos);
+ hwpfDocument = new HWPFDocument(
+ new ByteArrayInputStream(baos.toByteArray()));
+
+ assertEquals(1, hwpfDocument.getStyleSheet().getParagraphStyle(8)
+ .getJustification());
+ }
+}
Propchange: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TestSprms.java
------------------------------------------------------------------------------
svn:executable = *
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org
|