commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1650896 - /commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
Date Sun, 11 Jan 2015 12:23:23 GMT
Author: britter
Date: Sun Jan 11 12:23:23 2015
New Revision: 1650896

URL: http://svn.apache.org/r1650896
Log:
Simplify test by using TiffOutputDirectoy.findField(TagInfo)

Modified:
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java?rev=1650896&r1=1650895&r2=1650896&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
Sun Jan 11 12:23:23 2015
@@ -44,19 +44,10 @@ public class TiffOutputSetTest {
         tiffOutputSet.setGPSInDegrees(1.0, 1.0);
 
         TiffOutputDirectory gpsDirectory = tiffOutputSet.getGPSDirectory();
-        TiffOutputField gpsVersionId = getGpsVersionId(gpsDirectory);
-        
+        TiffOutputField gpsVersionId = gpsDirectory.findField(GpsTagConstants.GPS_TAG_GPS_VERSION_ID);
+
         assertNotNull(gpsVersionId);
         assertTrue(gpsVersionId.bytesEqual(GpsTagConstants.GPS_VERSION));
     }
 
-    private static TiffOutputField getGpsVersionId(TiffOutputDirectory gpsDirectory) {
-        List<TiffOutputField> fields = gpsDirectory.getFields();
-        for (TiffOutputField field : fields) {
-            if (field.tagInfo.equals(GpsTagConstants.GPS_TAG_GPS_VERSION_ID)) {
-                return field;
-            }
-        }
-        return null;
-    }
 }



Mime
View raw message