You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by je...@apache.org on 2008/04/16 07:52:17 UTC

svn commit: r648536 - in /xmlgraphics/commons/trunk: src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java

Author: jeremias
Date: Tue Apr 15 22:52:17 2008
New Revision: 648536

URL: http://svn.apache.org/viewvc?rev=648536&view=rev
Log:
Adjusted the test case to the new behaviour of ImageUtil.needPageIndexFromURI().

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java
    xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java?rev=648536&r1=648535&r2=648536&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/loader/util/ImageUtil.java Tue Apr 15 22:52:17 2008
@@ -376,7 +376,7 @@
      * An example: <code>http://www.foo.bar/images/scan1.tif#page=4</code> (The method will return
      * 3.)
      * <p>
-     * If no page index information is found in the URI or if the URI cannot be parsed, the
+     * If no page index information is found in the URI, the
      * method just returns 0 which indicates the first page.
      * @param uri the URI that should be inspected
      * @return the page index (0 is the first page)

Modified: xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java?rev=648536&r1=648535&r2=648536&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java (original)
+++ xmlgraphics/commons/trunk/test/java/org/apache/xmlgraphics/image/loader/ImageUtilTestCase.java Tue Apr 15 22:52:17 2008
@@ -51,8 +51,12 @@
         assertEquals(1, pageIndex);
 
         //Not a valid URI
-        pageIndex = ImageUtil.needPageIndexFromURI("C:\\images\\scan1.tif#page=44");
-        assertEquals(0, pageIndex);
+        try {
+            pageIndex = ImageUtil.needPageIndexFromURI("C:\\images\\scan1.tif#page=44");
+            fail("Invalid URI. Method must fail.");
+        } catch (IllegalArgumentException e) {
+            //expected
+        }
         //Valid URI
         pageIndex = ImageUtil.needPageIndexFromURI("file:///C:/images/scan1.tif#page=44");
         assertEquals(43, pageIndex);



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org