sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1576108 [2/2] - in /sis/branches/JDK7/core: sis-metadata/src/main/java/org/apache/sis/io/wkt/ sis-referencing/src/main/java/org/apache/sis/internal/referencing/ sis-referencing/src/main/java/org/apache/sis/parameter/ sis-referencing/src/ma...
Date Mon, 10 Mar 2014 22:24:32 GMT
Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java?rev=1576108&r1=1576107&r2=1576108&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java
[UTF-8] Mon Mar 10 22:24:31 2014
@@ -17,6 +17,7 @@
 package org.apache.sis.measure;
 
 import javax.measure.unit.SI;
+import javax.measure.unit.NonSI;
 import javax.measure.converter.ConversionException;
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
@@ -30,7 +31,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (IRD)
  * @since   0.3 (derived from geotk-2.4)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 @DependsOn(NumberRangeTest.class)
@@ -80,8 +81,10 @@ public final strictfp class MeasurementR
      */
     @Test
     public void testToString() {
-        final MeasurementRange<Float> range = MeasurementRange.create(10f, true, 20f,
true, SI.KILOMETRE);
+        MeasurementRange<Float> range = MeasurementRange.create(10f, true, 20f, true,
SI.KILOMETRE);
         assertEquals("[10.0 … 20.0] km", range.toString());
+        range = MeasurementRange.create(10f, true, 20f, true, NonSI.DEGREE_ANGLE);
+        assertEquals("[10.0 … 20.0] deg", range.toString());
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java?rev=1576108&r1=1576107&r2=1576108&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/RangeFormatTest.java
[UTF-8] Mon Mar 10 22:24:31 2014
@@ -24,6 +24,7 @@ import java.text.FieldPosition;
 import java.text.ParsePosition;
 import java.text.ParseException;
 import java.text.AttributedCharacterIterator;
+import javax.measure.unit.NonSI;
 import javax.measure.unit.SI;
 import org.junit.Test;
 import org.apache.sis.test.TestCase;
@@ -40,7 +41,7 @@ import static java.lang.Double.NEGATIVE_
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.06)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 @DependsOn(MeasurementRangeTest.class)
@@ -185,6 +186,12 @@ public final strictfp class RangeFormatT
         assertEquals("maxPos.beginIndex", 7, maxPos.getBeginIndex());
         assertEquals("maxPos.endIndex",   9, maxPos.getEndIndex());
 
+        assertEquals("[-10 … 20]°", format(MeasurementRange.create(-10, true, 20, true,
NonSI.DEGREE_ANGLE)));
+        assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
+        assertEquals("minPos.endIndex",   4, minPos.getEndIndex());
+        assertEquals("maxPos.beginIndex", 7, maxPos.getBeginIndex());
+        assertEquals("maxPos.endIndex",   9, maxPos.getEndIndex());
+
         maxPos = new FieldPosition(RangeFormat.Field.UNIT);
         assertEquals("[-1 … 2] km", format(MeasurementRange.create(-1, true, 2, true, SI.KILOMETRE)));
         assertEquals("unitPos.beginIndex", 9, maxPos.getBeginIndex());



Mime
View raw message