diff options
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/pdf/Version.java | 4 | ||||
-rw-r--r-- | fop-core/src/test/java/org/apache/fop/pdf/VersionTestCase.java | 17 |
2 files changed, 15 insertions, 6 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/pdf/Version.java b/fop-core/src/main/java/org/apache/fop/pdf/Version.java index 4bdc7a1b4..f94959a93 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/Version.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/Version.java @@ -39,7 +39,9 @@ public enum Version { /** PDF v1.6 */ V1_6("1.6"), /** PDF v1.7 */ - V1_7("1.7"); + V1_7("1.7"), + /** PDF v2.0 */ + V2_0("2.0"); private String version; diff --git a/fop-core/src/test/java/org/apache/fop/pdf/VersionTestCase.java b/fop-core/src/test/java/org/apache/fop/pdf/VersionTestCase.java index dd2731d8b..ef01b6489 100644 --- a/fop-core/src/test/java/org/apache/fop/pdf/VersionTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/pdf/VersionTestCase.java @@ -37,7 +37,11 @@ public class VersionTestCase { public void testGetValue() { int index = 0; for (Version version : Version.values()) { - assertEquals(version, Version.getValueOf("1." + index++)); + if (index > 7) { + assertEquals(version, Version.getValueOf("2.0")); + } else { + assertEquals(version, Version.getValueOf("1." + index++)); + } } } @@ -55,7 +59,11 @@ public class VersionTestCase { // Test all the normal values int index = 0; for (Version version : Version.values()) { - assertTrue(version.toString().equals("1." + index++)); + if (index > 7) { + assertTrue(version.toString().equals("2.0")); + } else { + assertTrue(version.toString().equals("1." + index++)); + } } } @@ -73,16 +81,15 @@ public class VersionTestCase { Version.V1_4, Version.V1_5, Version.V1_6, - Version.V1_7 + Version.V1_7, + Version.V2_0 }; Version[] actual = Version.values(); for (int i = 0; i < actual.length - 1; i++) { assertEquals(-1, actual[i].compareTo(expected[i + 1])); - assertEquals(0, actual[i].compareTo(expected[i])); - assertEquals(1, actual[i + 1].compareTo(expected[i])); } } |