Modified:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFLibraryTestSuite.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFLibraryTestSuite.java?rev=1233854&r1=1233853&r2=1233854&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFLibraryTestSuite.java
(original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFLibraryTestSuite.java
Fri Jan 20 10:39:42 2012
@@ -1,54 +1,54 @@
-/*
- * 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.
- */
-
-/* $Id$ */
-
-package org.apache.fop.pdf;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- * Test suite for FOP's utility classes.
- */
-public class PDFLibraryTestSuite {
-
- /**
- * Builds the test suite
- * @return the test suite
- */
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Test suite for FOP's utility classes");
- //$JUnit-BEGIN$
- suite.addTest(new TestSuite(PDFArrayTestCase.class));
- suite.addTest(new TestSuite(PDFDictionaryTestCase.class));
- suite.addTest(new TestSuite(PDFNumberTestCase.class));
- suite.addTest(new TestSuite(PDFObjectTestCase.class));
- suite.addTest(new TestSuite(PDFNameTestCase.class));
- suite.addTest(new TestSuite(AbstractPDFStreamTestCase.class));
- suite.addTest(new TestSuite(PDFDestsTestCase.class));
- suite.addTest(new TestSuite(PDFDocumentTestCase.class));
- suite.addTest(new TestSuite(PDFNullTestCase.class));
- suite.addTest(new TestSuite(PDFNumsArrayTestCase.class));
- suite.addTest(new TestSuite(PDFRectangleTestCase.class));
- suite.addTest(new TestSuite(PDFReferenceTestCase.class));
- //$JUnit-END$
- return suite;
- }
-}
+/*
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.pdf;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * Test suite for FOP's utility classes.
+ */
+public class PDFLibraryTestSuite {
+
+ /**
+ * Builds the test suite
+ * @return the test suite
+ */
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test suite for FOP's utility classes");
+ //$JUnit-BEGIN$
+ suite.addTest(new TestSuite(PDFArrayTestCase.class));
+ suite.addTest(new TestSuite(PDFDictionaryTestCase.class));
+ suite.addTest(new TestSuite(PDFNumberTestCase.class));
+ suite.addTest(new TestSuite(PDFObjectTestCase.class));
+ suite.addTest(new TestSuite(PDFNameTestCase.class));
+ suite.addTest(new TestSuite(AbstractPDFStreamTestCase.class));
+ suite.addTest(new TestSuite(PDFDestsTestCase.class));
+ suite.addTest(new TestSuite(PDFDocumentTestCase.class));
+ suite.addTest(new TestSuite(PDFNullTestCase.class));
+ suite.addTest(new TestSuite(PDFNumsArrayTestCase.class));
+ suite.addTest(new TestSuite(PDFRectangleTestCase.class));
+ suite.addTest(new TestSuite(PDFReferenceTestCase.class));
+ //$JUnit-END$
+ return suite;
+ }
+}
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFLibraryTestSuite.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFLibraryTestSuite.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNameTestCase.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNameTestCase.java?rev=1233854&r1=1233853&r2=1233854&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNameTestCase.java
(original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNameTestCase.java Fri
Jan 20 10:39:42 2012
@@ -1,169 +1,169 @@
-/*
- * 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.
- */
-
-/* $Id$ */
-
-package org.apache.fop.pdf;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import org.apache.commons.io.output.CountingOutputStream;
-import org.junit.Before;
-import org.junit.Test;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertEquals;
-
-/**
- * Test class for {@link PDFName}.
- */
-public class PDFNameTestCase extends PDFObjectTestCase {
- private PDFName pdfName;
-
- /**
- * Sets up the local variables
- */
- @Before
- public void setUp() {
- pdfName = new PDFName("TestName");
- pdfName.setParent(parent);
- pdfName.setDocument(doc);
-
- pdfObjectUnderTest = pdfName;
- }
-
- /**
- * Tests escapeName() - tests that this method escapes the necessary
characters.
- */
- @Test
- public void testEscapeName() {
- try {
- // Test for null, this is a programming error thus the NPE
- PDFName.escapeName(null);
- fail("NPE not thrown when null object given to escapeName()");
- } catch (NullPointerException e) {
- // PASS
- }
- // All names are prefixed by "/", check the PDF spec for further
details.
- assertEquals("/Test", PDFName.escapeName("Test"));
- // Check that if the name is already prefixed with "/" it doens't do
it twice
- assertEquals("/Test", PDFName.escapeName("/Test"));
- // Test with a space in the middle
- assertEquals("/Test#20test", PDFName.escapeName("Test test"));
- // Test that all chars apart from ASCII '!' --> '~' are escaped
- nonEscapedCharactersTests();
- escapedCharactersTests();
- }
-
- private void escapedCharactersTests() {
- for (char i = 0; i < '!'; i++) {
- String str = Integer.toHexString(i >>> 4 & 0x0f).toUpperCase();
- str += Integer.toHexString(i & 0x0f).toUpperCase();
- assertEquals("/#" + str, PDFName.escapeName(String.valueOf(i)));
- }
- for (char i = '~' + 1; i < 256; i++) {
- String str = Integer.toHexString(i >>> 4 & 0x0f).toUpperCase();
- str += Integer.toHexString(i & 0x0f).toUpperCase();
- assertEquals("/#" + str, PDFName.escapeName(String.valueOf(i)));
- }
- checkCharacterIsEscaped('#');
- checkCharacterIsEscaped('%');
- checkCharacterIsEscaped('(');
- checkCharacterIsEscaped(')');
- checkCharacterIsEscaped('<');
- checkCharacterIsEscaped('>');
- checkCharacterIsEscaped('[');
- checkCharacterIsEscaped(']');
- checkCharacterIsEscaped('>');
- }
-
- private void checkCharacterIsEscaped(char c) {
- String str = Integer.toHexString(c >>> 4 & 0x0f).toUpperCase();
- str += Integer.toHexString(c & 0x0f).toUpperCase();
- assertEquals("/#" + str, PDFName.escapeName(String.valueOf(c)));
- }
-
- private void nonEscapedCharactersTests() {
- charactersNotEscapedBetween('!', '"');
- charactersNotEscapedBetween('*', ';');
- charactersNotEscapedBetween('?', 'Z');
- charactersNotEscapedBetween('^', '~');
- }
-
- private void charactersNotEscapedBetween(char c1, char c2) {
- for (char i = c1; i <= c2; i++) {
- String str = String.valueOf(i);
- String expected = !str.equals("/") ? "/" + str : str;
- assertEquals(expected, PDFName.escapeName(str));
- }
- }
-
- /**
- * Tests toString() - this has been overridden to return the String that
PDFName wraps.
- */
- @Test
- public void testToString() {
- // The escape characters have already been tested in testEscapeName()
so this doesn't need
- // to be done twice.
- PDFName test1 = new PDFName("test1");
- assertEquals("/test1", test1.toString());
- PDFName test2 = new PDFName("another test");
- assertEquals("/another#20test", test2.toString());
- try {
- new PDFName(null);
- fail("NPE not thrown when null passed to constructor");
- } catch (NullPointerException e) {
- // PASS
- }
- }
-
- /**
- * Tests output() - check that this object can stream itself in the
correct format.
- * @throws IOException error caused by I/O
- */
- @Test
- public void testOutput() throws IOException {
- testOutputStreams("/TestName", pdfName);
- testOutputStreams("/test#20test", new PDFName("test test"));
- }
-
- /**
- * Test outputInline() - this writes the object reference if it is a
direct object (has an
- * object number), or writes the String representation if there is no
object number.
- */
- @Test
- public void testOutputInline() {
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- CountingOutputStream cout = new CountingOutputStream(outStream);
- StringBuilder textBuffer = new StringBuilder();
- try {
- // test with no object number set.
- pdfName.outputInline(outStream, textBuffer);
- PDFDocument.flushTextBuffer(textBuffer, cout);
- assertEquals("/TestName", outStream.toString());
-
- outStream.reset();
- // test with object number set
- pdfName.setObjectNumber(1);
- pdfName.outputInline(outStream, textBuffer);
- PDFDocument.flushTextBuffer(textBuffer, cout);
- assertEquals("1 0 R", outStream.toString());
- } catch (IOException e) {
- fail("IOException: " + e.getMessage());
- }
- }
-}
+/*
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.pdf;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import org.apache.commons.io.output.CountingOutputStream;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Test class for {@link PDFName}.
+ */
+public class PDFNameTestCase extends PDFObjectTestCase {
+ private PDFName pdfName;
+
+ /**
+ * Sets up the local variables
+ */
+ @Before
+ public void setUp() {
+ pdfName = new PDFName("TestName");
+ pdfName.setParent(parent);
+ pdfName.setDocument(doc);
+
+ pdfObjectUnderTest = pdfName;
+ }
+
+ /**
+ * Tests escapeName() - tests that this method escapes the necessary
characters.
+ */
+ @Test
+ public void testEscapeName() {
+ try {
+ // Test for null, this is a programming error thus the NPE
+ PDFName.escapeName(null);
+ fail("NPE not thrown when null object given to escapeName()");
+ } catch (NullPointerException e) {
+ // PASS
+ }
+ // All names are prefixed by "/", check the PDF spec for further
details.
+ assertEquals("/Test", PDFName.escapeName("Test"));
+ // Check that if the name is already prefixed with "/" it doens't do
it twice
+ assertEquals("/Test", PDFName.escapeName("/Test"));
+ // Test with a space in the middle
+ assertEquals("/Test#20test", PDFName.escapeName("Test test"));
+ // Test that all chars apart from ASCII '!' --> '~' are escaped
+ nonEscapedCharactersTests();
+ escapedCharactersTests();
+ }
+
+ private void escapedCharactersTests() {
+ for (char i = 0; i < '!'; i++) {
+ String str = Integer.toHexString(i >>> 4 & 0x0f).toUpperCase();
+ str += Integer.toHexString(i & 0x0f).toUpperCase();
+ assertEquals("/#" + str, PDFName.escapeName(String.valueOf(i)));
+ }
+ for (char i = '~' + 1; i < 256; i++) {
+ String str = Integer.toHexString(i >>> 4 & 0x0f).toUpperCase();
+ str += Integer.toHexString(i & 0x0f).toUpperCase();
+ assertEquals("/#" + str, PDFName.escapeName(String.valueOf(i)));
+ }
+ checkCharacterIsEscaped('#');
+ checkCharacterIsEscaped('%');
+ checkCharacterIsEscaped('(');
+ checkCharacterIsEscaped(')');
+ checkCharacterIsEscaped('<');
+ checkCharacterIsEscaped('>');
+ checkCharacterIsEscaped('[');
+ checkCharacterIsEscaped(']');
+ checkCharacterIsEscaped('>');
+ }
+
+ private void checkCharacterIsEscaped(char c) {
+ String str = Integer.toHexString(c >>> 4 & 0x0f).toUpperCase();
+ str += Integer.toHexString(c & 0x0f).toUpperCase();
+ assertEquals("/#" + str, PDFName.escapeName(String.valueOf(c)));
+ }
+
+ private void nonEscapedCharactersTests() {
+ charactersNotEscapedBetween('!', '"');
+ charactersNotEscapedBetween('*', ';');
+ charactersNotEscapedBetween('?', 'Z');
+ charactersNotEscapedBetween('^', '~');
+ }
+
+ private void charactersNotEscapedBetween(char c1, char c2) {
+ for (char i = c1; i <= c2; i++) {
+ String str = String.valueOf(i);
+ String expected = !str.equals("/") ? "/" + str : str;
+ assertEquals(expected, PDFName.escapeName(str));
+ }
+ }
+
+ /**
+ * Tests toString() - this has been overridden to return the String that
PDFName wraps.
+ */
+ @Test
+ public void testToString() {
+ // The escape characters have already been tested in testEscapeName()
so this doesn't need
+ // to be done twice.
+ PDFName test1 = new PDFName("test1");
+ assertEquals("/test1", test1.toString());
+ PDFName test2 = new PDFName("another test");
+ assertEquals("/another#20test", test2.toString());
+ try {
+ new PDFName(null);
+ fail("NPE not thrown when null passed to constructor");
+ } catch (NullPointerException e) {
+ // PASS
+ }
+ }
+
+ /**
+ * Tests output() - check that this object can stream itself in the
correct format.
+ * @throws IOException error caused by I/O
+ */
+ @Test
+ public void testOutput() throws IOException {
+ testOutputStreams("/TestName", pdfName);
+ testOutputStreams("/test#20test", new PDFName("test test"));
+ }
+
+ /**
+ * Test outputInline() - this writes the object reference if it is a
direct object (has an
+ * object number), or writes the String representation if there is no
object number.
+ */
+ @Test
+ public void testOutputInline() {
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ CountingOutputStream cout = new CountingOutputStream(outStream);
+ StringBuilder textBuffer = new StringBuilder();
+ try {
+ // test with no object number set.
+ pdfName.outputInline(outStream, textBuffer);
+ PDFDocument.flushTextBuffer(textBuffer, cout);
+ assertEquals("/TestName", outStream.toString());
+
+ outStream.reset();
+ // test with object number set
+ pdfName.setObjectNumber(1);
+ pdfName.outputInline(outStream, textBuffer);
+ PDFDocument.flushTextBuffer(textBuffer, cout);
+ assertEquals("1 0 R", outStream.toString());
+ } catch (IOException e) {
+ fail("IOException: " + e.getMessage());
+ }
+ }
+}
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNameTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNameTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNullTestCase.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNullTestCase.java?rev=1233854&r1=1233853&r2=1233854&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNullTestCase.java
(original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNullTestCase.java Fri
Jan 20 10:39:42 2012
@@ -1,49 +1,49 @@
-/*
- * 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.
- */
-
-/* $Id$ */
-
-package org.apache.fop.pdf;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-/**
- * Test case for {@link PDFNull}.
- */
-public class PDFNullTestCase extends PDFObjectTestCase {
-
- /**
- * Test outputInline() - test that "null" is printed to the output stream.
- */
- @Test
- public void testOutputInline() throws IOException {
- PDFNull obj = PDFNull.INSTANCE;
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- StringBuilder text = new StringBuilder();
- obj.outputInline(out, text);
- assertEquals("null", text.toString());
-
- // Ensure previously written text is not discarded
- obj.outputInline(out, text);
- assertEquals("nullnull", text.toString());
- }
-}
+/*
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.pdf;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+/**
+ * Test case for {@link PDFNull}.
+ */
+public class PDFNullTestCase extends PDFObjectTestCase {
+
+ /**
+ * Test outputInline() - test that "null" is printed to the output stream.
+ */
+ @Test
+ public void testOutputInline() throws IOException {
+ PDFNull obj = PDFNull.INSTANCE;
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ StringBuilder text = new StringBuilder();
+ obj.outputInline(out, text);
+ assertEquals("null", text.toString());
+
+ // Ensure previously written text is not discarded
+ obj.outputInline(out, text);
+ assertEquals("nullnull", text.toString());
+ }
+}
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNullTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNullTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumberTestCase.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumberTestCase.java?rev=1233854&r1=1233853&r2=1233854&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumberTestCase.java
(original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumberTestCase.java
Fri Jan 20 10:39:42 2012
@@ -1,162 +1,162 @@
-/*
- * 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.
- */
-
-/* $Id$ */
-
-package org.apache.fop.pdf;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.IOException;
-
-/**
- * This test tests PDFNumber's doubleOut() methods.
- */
-public class PDFNumberTestCase extends PDFObjectTestCase {
- /**
- * Sets up the local variables, most of these are inherited from
PDFObjectTestCase
- */
- @Before
- public void setUp() {
- pdfObjectUnderTest = new PDFNumber();
- pdfObjectUnderTest.setParent(parent);
- pdfObjectUnderTest.setDocument(doc);
- }
-
- /**
- * Tests PDFNumber.doubleOut().
- * @throws Exception if the test fails
- */
- @Test
- public void testDoubleOut1() throws Exception {
- //Default is 6 decimal digits
- assertEquals("0", PDFNumber.doubleOut(0.0f));
- assertEquals("0", PDFNumber.doubleOut(0.0000000000000000000123f));
- assertEquals("0.1", PDFNumber.doubleOut(0.1f));
- assertEquals("100", PDFNumber.doubleOut(100.0f));
- assertEquals("100", PDFNumber.doubleOut(99.99999999999999999999999f));
-
- //You'd expect 100.123456 here but DecimalFormat uses the
BigDecimal.ROUND_HALF_EVEN
- //strategy. I don't know if that's a problem. The strange thing
testDoubleOut2
- //seems to return the normally expected value. Weird.
- assertEquals("100.123459", PDFNumber.doubleOut(100.12345611111111f));
- assertEquals("-100.123459", PDFNumber.doubleOut(-100.12345611111111f));
- }
-
- /**
- * Tests PDFNumber.doubleOut().
- * @throws Exception if the test fails
- */
- public void testDoubleOut2() throws Exception {
- //4 decimal digits in this case
- assertEquals("0", PDFNumber.doubleOut(0.0f, 4));
- assertEquals("0", PDFNumber.doubleOut(0.0000000000000000000123f, 4));
- assertEquals("0.1", PDFNumber.doubleOut(0.1f, 4));
- assertEquals("100", PDFNumber.doubleOut(100.0f, 4));
- assertEquals("100", PDFNumber.doubleOut(99.99999999999999999999999f,
4));
- assertEquals("100.1234", PDFNumber.doubleOut(100.12341111111111f, 4));
- assertEquals("-100.1234", PDFNumber.doubleOut(-100.12341111111111f,
4));
- }
-
- /**
- * Tests PDFNumber.doubleOut().
- * @throws Exception if the test fails
- */
- public void testDoubleOut3() throws Exception {
- //0 decimal digits in this case
- assertEquals("0", PDFNumber.doubleOut(0.0f, 0));
- assertEquals("0", PDFNumber.doubleOut(0.1f, 0));
- assertEquals("1", PDFNumber.doubleOut(0.6f, 0));
- assertEquals("100", PDFNumber.doubleOut(100.1234f, 0));
- assertEquals("-100", PDFNumber.doubleOut(-100.1234f, 0));
- }
-
- /**
- * Tests PDFNumber.doubleOut(). Special cases (former bugs).
- * @throws Exception if the test fails
- */
- public void testDoubleOut4() throws Exception {
- double d = Double.parseDouble("5.7220458984375E-6");
- assertEquals("0.000006", PDFNumber.doubleOut(d));
- assertEquals("0", PDFNumber.doubleOut(d, 4));
- assertEquals("0.00000572", PDFNumber.doubleOut(d, 8));
- }
-
- /**
- * Tests PDFNumber.doubleOut(). Tests for wrong parameters.
- * @throws Exception if the test fails
- */
- public void testDoubleOutWrongParameters() throws Exception {
- try {
- PDFNumber.doubleOut(0.1f, -1);
- fail("IllegalArgument expected!");
- } catch (IllegalArgumentException iae) {
- //we want that
- }
- try {
- PDFNumber.doubleOut(0.1f, 17); //We support max 16 decimal digits
- fail("IllegalArgument expected!");
- } catch (IllegalArgumentException iae) {
- //we want that
- }
- try {
- PDFNumber.doubleOut(0.1f, 98274659);
- fail("IllegalArgument expected!");
- } catch (IllegalArgumentException iae) {
- //we want that
- }
- try {
- PDFNumber.doubleOut(null);
- fail("NullPointer expected!");
- } catch (NullPointerException e) {
- // PASS
- }
- }
-
- /**
- * Tests both getNumber() and setNumber() - basic getter/setter methods...
Why there isn't a
- * constructor is beyond me...
- */
- public void testGetSetNumber() {
- PDFNumber pdfNum = new PDFNumber();
- // Check with a floating point number
- pdfNum.setNumber(1.111f);
- assertEquals(1.111f, pdfNum.getNumber());
- // try with an int
- pdfNum.setNumber(2);
- assertEquals(2, pdfNum.getNumber());
- // See what happens with a null... make sure it doesn't explode
- pdfNum.setNumber(null);
- assertEquals(null, pdfNum.getNumber());
- }
-
- /**
- * Tests toPDFString() - this serializes PDFNumber to PDF format.
- * @throws IOException error caused by I/O
- */
- public void testToPDFString() throws IOException {
- PDFNumber testSubject = new PDFNumber();
- testSubject.setNumber(1.0001);
- testOutputStreams("1.0001", testSubject);
- testSubject.setNumber(999);
- testOutputStreams("999", testSubject);
- }
-}
+/*
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.pdf;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * This test tests PDFNumber's doubleOut() methods.
+ */
+public class PDFNumberTestCase extends PDFObjectTestCase {
+ /**
+ * Sets up the local variables, most of these are inherited from
PDFObjectTestCase
+ */
+ @Before
+ public void setUp() {
+ pdfObjectUnderTest = new PDFNumber();
+ pdfObjectUnderTest.setParent(parent);
+ pdfObjectUnderTest.setDocument(doc);
+ }
+
+ /**
+ * Tests PDFNumber.doubleOut().
+ * @throws Exception if the test fails
+ */
+ @Test
+ public void testDoubleOut1() throws Exception {
+ //Default is 6 decimal digits
+ assertEquals("0", PDFNumber.doubleOut(0.0f));
+ assertEquals("0", PDFNumber.doubleOut(0.0000000000000000000123f));
+ assertEquals("0.1", PDFNumber.doubleOut(0.1f));
+ assertEquals("100", PDFNumber.doubleOut(100.0f));
+ assertEquals("100", PDFNumber.doubleOut(99.99999999999999999999999f));
+
+ //You'd expect 100.123456 here but DecimalFormat uses the
BigDecimal.ROUND_HALF_EVEN
+ //strategy. I don't know if that's a problem. The strange thing
testDoubleOut2
+ //seems to return the normally expected value. Weird.
+ assertEquals("100.123459", PDFNumber.doubleOut(100.12345611111111f));
+ assertEquals("-100.123459", PDFNumber.doubleOut(-100.12345611111111f));
+ }
+
+ /**
+ * Tests PDFNumber.doubleOut().
+ * @throws Exception if the test fails
+ */
+ public void testDoubleOut2() throws Exception {
+ //4 decimal digits in this case
+ assertEquals("0", PDFNumber.doubleOut(0.0f, 4));
+ assertEquals("0", PDFNumber.doubleOut(0.0000000000000000000123f, 4));
+ assertEquals("0.1", PDFNumber.doubleOut(0.1f, 4));
+ assertEquals("100", PDFNumber.doubleOut(100.0f, 4));
+ assertEquals("100", PDFNumber.doubleOut(99.99999999999999999999999f,
4));
+ assertEquals("100.1234", PDFNumber.doubleOut(100.12341111111111f, 4));
+ assertEquals("-100.1234", PDFNumber.doubleOut(-100.12341111111111f,
4));
+ }
+
+ /**
+ * Tests PDFNumber.doubleOut().
+ * @throws Exception if the test fails
+ */
+ public void testDoubleOut3() throws Exception {
+ //0 decimal digits in this case
+ assertEquals("0", PDFNumber.doubleOut(0.0f, 0));
+ assertEquals("0", PDFNumber.doubleOut(0.1f, 0));
+ assertEquals("1", PDFNumber.doubleOut(0.6f, 0));
+ assertEquals("100", PDFNumber.doubleOut(100.1234f, 0));
+ assertEquals("-100", PDFNumber.doubleOut(-100.1234f, 0));
+ }
+
+ /**
+ * Tests PDFNumber.doubleOut(). Special cases (former bugs).
+ * @throws Exception if the test fails
+ */
+ public void testDoubleOut4() throws Exception {
+ double d = Double.parseDouble("5.7220458984375E-6");
+ assertEquals("0.000006", PDFNumber.doubleOut(d));
+ assertEquals("0", PDFNumber.doubleOut(d, 4));
+ assertEquals("0.00000572", PDFNumber.doubleOut(d, 8));
+ }
+
+ /**
+ * Tests PDFNumber.doubleOut(). Tests for wrong parameters.
+ * @throws Exception if the test fails
+ */
+ public void testDoubleOutWrongParameters() throws Exception {
+ try {
+ PDFNumber.doubleOut(0.1f, -1);
+ fail("IllegalArgument expected!");
+ } catch (IllegalArgumentException iae) {
+ //we want that
+ }
+ try {
+ PDFNumber.doubleOut(0.1f, 17); //We support max 16 decimal digits
+ fail("IllegalArgument expected!");
+ } catch (IllegalArgumentException iae) {
+ //we want that
+ }
+ try {
+ PDFNumber.doubleOut(0.1f, 98274659);
+ fail("IllegalArgument expected!");
+ } catch (IllegalArgumentException iae) {
+ //we want that
+ }
+ try {
+ PDFNumber.doubleOut(null);
+ fail("NullPointer expected!");
+ } catch (NullPointerException e) {
+ // PASS
+ }
+ }
+
+ /**
+ * Tests both getNumber() and setNumber() - basic getter/setter methods...
Why there isn't a
+ * constructor is beyond me...
+ */
+ public void testGetSetNumber() {
+ PDFNumber pdfNum = new PDFNumber();
+ // Check with a floating point number
+ pdfNum.setNumber(1.111f);
+ assertEquals(1.111f, pdfNum.getNumber());
+ // try with an int
+ pdfNum.setNumber(2);
+ assertEquals(2, pdfNum.getNumber());
+ // See what happens with a null... make sure it doesn't explode
+ pdfNum.setNumber(null);
+ assertEquals(null, pdfNum.getNumber());
+ }
+
+ /**
+ * Tests toPDFString() - this serializes PDFNumber to PDF format.
+ * @throws IOException error caused by I/O
+ */
+ public void testToPDFString() throws IOException {
+ PDFNumber testSubject = new PDFNumber();
+ testSubject.setNumber(1.0001);
+ testOutputStreams("1.0001", testSubject);
+ testSubject.setNumber(999);
+ testOutputStreams("999", testSubject);
+ }
+}
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumberTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumberTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumsArrayTestCase.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumsArrayTestCase.java?rev=1233854&r1=1233853&r2=1233854&view=diff
==============================================================================
---
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumsArrayTestCase.java
(original)
+++
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumsArrayTestCase.java
Fri Jan 20 10:39:42 2012
@@ -1,54 +1,54 @@
-/*
- * 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.
- */
-
-/* $Id$ */
-
-package org.apache.fop.pdf;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.IOException;
-
-/**
- * Test case for {@link PDFNumsArray}.
- */
-public class PDFNumsArrayTestCase extends PDFObjectTestCase {
- private PDFNumsArray numsArray;
- private String expectedString = "[0 /Test#20name 1 10]";
-
- @Before
- public void setUp() {
- numsArray = new PDFNumsArray(parent);
- numsArray.put(0, new PDFName("Test name"));
- PDFNumber num = new PDFNumber();
- num.setNumber(10);
- numsArray.put(1, num);
- numsArray.setDocument(doc);
-
- pdfObjectUnderTest = numsArray;
- }
-
- /**
- * Test output() - ensure that this object is properly outputted to the
PDF document.
- * @throws IOException if an I/O error occurs
- */
- @Test
- public void testOutput() throws IOException {
- testOutputStreams(expectedString, numsArray);
- }
-}
+/*
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.pdf;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+/**
+ * Test case for {@link PDFNumsArray}.
+ */
+public class PDFNumsArrayTestCase extends PDFObjectTestCase {
+ private PDFNumsArray numsArray;
+ private String expectedString = "[0 /Test#20name 1 10]";
+
+ @Before
+ public void setUp() {
+ numsArray = new PDFNumsArray(parent);
+ numsArray.put(0, new PDFName("Test name"));
+ PDFNumber num = new PDFNumber();
+ num.setNumber(10);
+ numsArray.put(1, num);
+ numsArray.setDocument(doc);
+
+ pdfObjectUnderTest = numsArray;
+ }
+
+ /**
+ * Test output() - ensure that this object is properly outputted to the
PDF document.
+ * @throws IOException if an I/O error occurs
+ */
+ @Test
+ public void testOutput() throws IOException {
+ testOutputStreams(expectedString, numsArray);
+ }
+}
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumsArrayTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFNumsArrayTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFRectangleTestCase.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFRectangleTestCase.java?rev=1233854&r1=1233853&r2=1233854&view=diff
==============================================================================
---
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFRectangleTestCase.java
(original)
+++
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFRectangleTestCase.java
Fri Jan 20 10:39:42 2012
@@ -1,52 +1,52 @@
-/*
- * 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.
- */
-
-/* $Id$ */
-
-package org.apache.fop.pdf;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * Test case for {@link PDFRectangle}.
- */
-public class PDFRectangleTestCase {
-
- /**
- * Test outputInline() - ensure properly formatted co-ords are printed to
the output stream.
- * @throws IOException if an I/O error occurs
- */
- @Test
- public void testOutputInline() throws IOException {
- OutputStream out = new ByteArrayOutputStream();
- // These are arbitrary values thus have no meaning
- PDFRectangle rect = new PDFRectangle(1, 2, 3, 4);
-
- StringBuilder textBuffer = new StringBuilder();
- // Ensure text before the outputInline() is maintained
- textBuffer.append("Test ");
-
- rect.outputInline(out, textBuffer);
- assertEquals("Test [1 2 3 4]", textBuffer.toString());
- }
-}
+/*
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.pdf;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * Test case for {@link PDFRectangle}.
+ */
+public class PDFRectangleTestCase {
+
+ /**
+ * Test outputInline() - ensure properly formatted co-ords are printed to
the output stream.
+ * @throws IOException if an I/O error occurs
+ */
+ @Test
+ public void testOutputInline() throws IOException {
+ OutputStream out = new ByteArrayOutputStream();
+ // These are arbitrary values thus have no meaning
+ PDFRectangle rect = new PDFRectangle(1, 2, 3, 4);
+
+ StringBuilder textBuffer = new StringBuilder();
+ // Ensure text before the outputInline() is maintained
+ textBuffer.append("Test ");
+
+ rect.outputInline(out, textBuffer);
+ assertEquals("Test [1 2 3 4]", textBuffer.toString());
+ }
+}
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFRectangleTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFRectangleTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFReferenceTestCase.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFReferenceTestCase.java?rev=1233854&r1=1233853&r2=1233854&view=diff
==============================================================================
---
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFReferenceTestCase.java
(original)
+++
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFReferenceTestCase.java
Fri Jan 20 10:39:42 2012
@@ -1,64 +1,64 @@
-/*
- * 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.
- */
-
-/* $Id$ */
-
-package org.apache.fop.pdf;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-/**
- * Test case for {@link PDFReference}.
- */
-public class PDFReferenceTestCase {
-
- /**
- * Tests outputInline() - ensure that this object is properly formatted
when printed to the
- * output stream.
- * @throws IOException if an I/O error occurs
- */
- @Test
- public void testOutputInline() throws IOException {
- PDFName name = new PDFName("Test name");
- name.setObjectNumber(2);
- PDFReference pdfRef = new PDFReference(name);
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- StringBuilder textBuffer = new StringBuilder();
- // Ensure that text before outputInline() is kept
- textBuffer.append("Text ");
-
- pdfRef.outputInline(out, textBuffer);
- assertEquals("Text 2 0 R", textBuffer.toString());
- }
-
- /**
- * Tests toString() - since this is used quite a lot, we have to ensure
the format is correct.
- */
- @Test
- public void testToString() {
- PDFName name = new PDFName("arbitrary");
- name.setObjectNumber(10);
- PDFReference ref = new PDFReference(name);
- assertEquals("10 0 R", ref.toString());
- }
-}
+/*
+ * 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.pdf;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+/**
+ * Test case for {@link PDFReference}.
+ */
+public class PDFReferenceTestCase {
+
+ /**
+ * Tests outputInline() - ensure that this object is properly formatted
when printed to the
+ * output stream.
+ * @throws IOException if an I/O error occurs
+ */
+ @Test
+ public void testOutputInline() throws IOException {
+ PDFName name = new PDFName("Test name");
+ name.setObjectNumber(2);
+ PDFReference pdfRef = new PDFReference(name);
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ StringBuilder textBuffer = new StringBuilder();
+ // Ensure that text before outputInline() is kept
+ textBuffer.append("Text ");
+
+ pdfRef.outputInline(out, textBuffer);
+ assertEquals("Text 2 0 R", textBuffer.toString());
+ }
+
+ /**
+ * Tests toString() - since this is used quite a lot, we have to ensure
the format is correct.
+ */
+ @Test
+ public void testToString() {
+ PDFName name = new PDFName("arbitrary");
+ name.setObjectNumber(10);
+ PDFReference ref = new PDFReference(name);
+ assertEquals("10 0 R", ref.toString());
+ }
+}
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFReferenceTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFReferenceTestCase.java
------------------------------------------------------------------------------
svn:keywords = Id
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]