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=1764677&r1=1764676&r2=1764677&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] Thu Oct 13 13:50:40 2016
@@ -24,8 +24,6 @@ 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;
 import org.apache.sis.test.DependsOn;
@@ -42,7 +40,7 @@ import static org.apache.sis.internal.ut
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  */
 @DependsOn(MeasurementRangeTest.class)
@@ -167,34 +165,34 @@ public final strictfp class RangeFormatT
         assertEquals("maxPos.endIndex",   7, maxPos.getEndIndex());
 
         // Positive infinity with integers
-        assertEquals("[50 … ∞)", format(new 
NumberRange<Integer>(Integer.class, 50, true, null, true)));
+        assertEquals("[50 … ∞)", format(new NumberRange<>(Integer.class, 50, 
true, null, true)));
         assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
         assertEquals("minPos.endIndex",   3, minPos.getEndIndex());
         assertEquals("maxPos.beginIndex", 6, maxPos.getBeginIndex());
         assertEquals("maxPos.endIndex",   7, maxPos.getEndIndex());
 
         // Negative infinity with integers
-        assertEquals("(-∞ … 40]", format(new 
NumberRange<Integer>(Integer.class, null, true, 40, true)));
+        assertEquals("(-∞ … 40]", format(new NumberRange<>(Integer.class, 
null, true, 40, true)));
         assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
         assertEquals("minPos.endIndex",   3, minPos.getEndIndex());
         assertEquals("maxPos.beginIndex", 6, maxPos.getBeginIndex());
         assertEquals("maxPos.endIndex",   8, maxPos.getEndIndex());
 
         // Measurement
-        assertEquals("[-10 … 20] m", format(MeasurementRange.create(-10, true, 
20, true, SI.METRE)));
+        assertEquals("[-10 … 20] m", format(MeasurementRange.create(-10, true, 
20, true, Units.METRE)));
         assertEquals("minPos.beginIndex", 1, minPos.getBeginIndex());
         assertEquals("minPos.endIndex",   4, minPos.getEndIndex());
         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("[-10 … 20]°", format(MeasurementRange.create(-10, true, 
20, true, Units.DEGREE)));
         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("[-1 … 2] km", format(MeasurementRange.create(-1, true, 
2, true, Units.KILOMETRE)));
         assertEquals("unitPos.beginIndex", 9, maxPos.getBeginIndex());
         assertEquals("unitPos.endIndex",  11, maxPos.getEndIndex());
     }

Modified: 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/SexagesimalConverterTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/SexagesimalConverterTest.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/SexagesimalConverterTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/SexagesimalConverterTest.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -16,14 +16,13 @@
  */
 package org.apache.sis.measure;
 
-import javax.measure.unit.Unit;
-import javax.measure.quantity.Quantity;
-import javax.measure.converter.UnitConverter;
+import javax.measure.Unit;
+import javax.measure.Quantity;
+import javax.measure.UnitConverter;
 import org.apache.sis.internal.util.PatchedUnitFormat;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static javax.measure.unit.NonSI.DEGREE_ANGLE;
 import static org.apache.sis.measure.SexagesimalConverter.*;
 import static org.apache.sis.test.Assert.*;
 
@@ -33,7 +32,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.6
+ * @version 0.8
  * @module
  */
 public final strictfp class SexagesimalConverterTest extends TestCase {
@@ -46,7 +45,7 @@ public final strictfp class SexagesimalC
      * Converts the given value to an other unit, compares with the expected 
value, and verify
      * the inverse conversion. Then tries again with the negative of the given 
values.
      */
-    private static <Q extends Quantity> void checkConversion(
+    private static <Q extends Quantity<Q>> void checkConversion(
             final double expected, final Unit<Q> unitExpected,
             final double actual,   final Unit<Q> unitActual)
     {
@@ -63,11 +62,11 @@ public final strictfp class SexagesimalC
      */
     @Test
     public void testDM() {
-        checkConversion(10.00,              DEGREE_ANGLE, 10.0000,    DM);
-        checkConversion(10.006,             DEGREE_ANGLE, 10.0036,    DM);
-        checkConversion(10.50,              DEGREE_ANGLE, 10.3000,    DM);
-        checkConversion(10.987333333333333, DEGREE_ANGLE, 10.5924,    DM);
-        checkConversion(44.503354166666666, DEGREE_ANGLE, 44.3020125, DM);
+        checkConversion(10.00,              Units.DEGREE, 10.0000,    DM);
+        checkConversion(10.006,             Units.DEGREE, 10.0036,    DM);
+        checkConversion(10.50,              Units.DEGREE, 10.3000,    DM);
+        checkConversion(10.987333333333333, Units.DEGREE, 10.5924,    DM);
+        checkConversion(44.503354166666666, Units.DEGREE, 44.3020125, DM);
     }
 
     /**
@@ -75,11 +74,11 @@ public final strictfp class SexagesimalC
      */
     @Test
     public void testDMS() {
-        checkConversion(10.00,              DEGREE_ANGLE, 10.0000,    DMS);
-        checkConversion(10.01,              DEGREE_ANGLE, 10.0036,    DMS);
-        checkConversion(10.50,              DEGREE_ANGLE, 10.3000,    DMS);
-        checkConversion(10.99,              DEGREE_ANGLE, 10.5924,    DMS);
-        checkConversion(44.505590277777777, DEGREE_ANGLE, 44.3020125, DMS);
+        checkConversion(10.00,              Units.DEGREE, 10.0000,    DMS);
+        checkConversion(10.01,              Units.DEGREE, 10.0036,    DMS);
+        checkConversion(10.50,              Units.DEGREE, 10.3000,    DMS);
+        checkConversion(10.99,              Units.DEGREE, 10.5924,    DMS);
+        checkConversion(44.505590277777777, Units.DEGREE, 44.3020125, DMS);
     }
 
     /**
@@ -87,11 +86,11 @@ public final strictfp class SexagesimalC
      */
     @Test
     public void testDMS_Scaled() {
-        checkConversion(10.00,              DEGREE_ANGLE, 100000,     
DMS_SCALED);
-        checkConversion(10.01,              DEGREE_ANGLE, 100036,     
DMS_SCALED);
-        checkConversion(10.50,              DEGREE_ANGLE, 103000,     
DMS_SCALED);
-        checkConversion(10.99,              DEGREE_ANGLE, 105924,     
DMS_SCALED);
-        checkConversion(44.505590277777777, DEGREE_ANGLE, 443020.125, 
DMS_SCALED);
+        checkConversion(10.00,              Units.DEGREE, 100000,     
DMS_SCALED);
+        checkConversion(10.01,              Units.DEGREE, 100036,     
DMS_SCALED);
+        checkConversion(10.50,              Units.DEGREE, 103000,     
DMS_SCALED);
+        checkConversion(10.99,              Units.DEGREE, 105924,     
DMS_SCALED);
+        checkConversion(44.505590277777777, Units.DEGREE, 443020.125, 
DMS_SCALED);
     }
 
     /**

Modified: 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -16,34 +16,11 @@
  */
 package org.apache.sis.measure;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static javax.measure.unit.Unit.ONE;
-import static javax.measure.unit.SI.CELSIUS;
-import static javax.measure.unit.SI.KELVIN;
-import static javax.measure.unit.SI.METRE;
-import static javax.measure.unit.SI.METRES_PER_SECOND;
-import static javax.measure.unit.SI.SQUARE_METRE;
-import static javax.measure.unit.SI.KILOMETRE;
-import static javax.measure.unit.SI.KILOGRAM;
-import static javax.measure.unit.SI.JOULE;
-import static javax.measure.unit.SI.PASCAL;
-import static javax.measure.unit.SI.SECOND;
-import static javax.measure.unit.SI.HERTZ;
-import static javax.measure.unit.SI.RADIAN;
-import static javax.measure.unit.NonSI.CENTIRADIAN;
-import static javax.measure.unit.NonSI.DEGREE_ANGLE;
-import static javax.measure.unit.NonSI.MINUTE_ANGLE;
-import static javax.measure.unit.NonSI.SECOND_ANGLE;
-import static javax.measure.unit.NonSI.GRADE;
-import static javax.measure.unit.NonSI.DAY;
-import static javax.measure.unit.NonSI.SPHERE;
-import static javax.measure.unit.NonSI.ATMOSPHERE;
-import static javax.measure.unit.NonSI.NAUTICAL_MILE;
-import static javax.measure.unit.NonSI.PERCENT;
 import static org.apache.sis.measure.SexagesimalConverter.*;
 import static org.apache.sis.measure.Units.*;
 import static org.apache.sis.test.Assert.*;
@@ -54,7 +31,7 @@ import static org.apache.sis.test.Assert
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -80,10 +57,10 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testSerialization() {
-        assertEquals(DEGREE_ANGLE,         
assertSerializedEquals(DEGREE_ANGLE));
-        assertEquals(DMS,      assertSerializedEquals(DMS));
+        assertEquals(DEGREE,     assertSerializedEquals(DEGREE));
+        assertEquals(DMS,        assertSerializedEquals(DMS));
         assertEquals(DMS_SCALED, assertSerializedEquals(DMS_SCALED));
-        assertEquals(PPM,                  assertSerializedEquals(PPM));
+        assertEquals(PPM,        assertSerializedEquals(PPM));
     }
 
     /**
@@ -96,14 +73,11 @@ public final strictfp class UnitsTest ex
         assertFalse(isTemporal(ONE));
         assertFalse(isTemporal(METRE));
         assertFalse(isTemporal(RADIAN));
-        assertFalse(isTemporal(CENTIRADIAN));
-        assertFalse(isTemporal(DEGREE_ANGLE));
-        assertFalse(isTemporal(MINUTE_ANGLE));
-        assertFalse(isTemporal(SECOND_ANGLE));
-        assertFalse(isTemporal(GRADE));
+        assertFalse(isTemporal(DEGREE));
+        assertFalse(isTemporal(ARC_MINUTE));
+        assertFalse(isTemporal(ARC_SECOND));
+        assertFalse(isTemporal(GRAD));
         assertTrue (isTemporal(DAY));
-        assertFalse(isTemporal(SPHERE));
-        assertFalse(isTemporal(ATMOSPHERE));
         assertFalse(isTemporal(NAUTICAL_MILE));
 
         // Additional units
@@ -123,14 +97,11 @@ public final strictfp class UnitsTest ex
         assertFalse(isLinear(ONE));
         assertTrue (isLinear(METRE));
         assertFalse(isLinear(RADIAN));
-        assertFalse(isLinear(CENTIRADIAN));
-        assertFalse(isLinear(DEGREE_ANGLE));
-        assertFalse(isLinear(MINUTE_ANGLE));
-        assertFalse(isLinear(SECOND_ANGLE));
-        assertFalse(isLinear(GRADE));
+        assertFalse(isLinear(DEGREE));
+        assertFalse(isLinear(ARC_MINUTE));
+        assertFalse(isLinear(ARC_SECOND));
+        assertFalse(isLinear(GRAD));
         assertFalse(isLinear(DAY));
-        assertFalse(isLinear(SPHERE));
-        assertFalse(isLinear(ATMOSPHERE));
         assertTrue (isLinear(NAUTICAL_MILE));
 
         // Additional units
@@ -150,14 +121,11 @@ public final strictfp class UnitsTest ex
         assertFalse(isAngular(ONE));
         assertFalse(isAngular(METRE));
         assertTrue (isAngular(RADIAN));
-        assertTrue (isAngular(CENTIRADIAN));
-        assertTrue (isAngular(DEGREE_ANGLE));
-        assertTrue (isAngular(MINUTE_ANGLE));
-        assertTrue (isAngular(SECOND_ANGLE));
-        assertTrue (isAngular(GRADE));
+        assertTrue (isAngular(DEGREE));
+        assertTrue (isAngular(ARC_MINUTE));
+        assertTrue (isAngular(ARC_SECOND));
+        assertTrue (isAngular(GRAD));
         assertFalse(isAngular(DAY));
-        assertFalse(isAngular(SPHERE));
-        assertFalse(isAngular(ATMOSPHERE));
         assertFalse(isAngular(NAUTICAL_MILE));
 
         // Additional units
@@ -177,14 +145,11 @@ public final strictfp class UnitsTest ex
         assertTrue (isScale(ONE));
         assertFalse(isScale(METRE));
         assertFalse(isScale(RADIAN));
-        assertFalse(isScale(CENTIRADIAN));
-        assertFalse(isScale(DEGREE_ANGLE));
-        assertFalse(isScale(MINUTE_ANGLE));
-        assertFalse(isScale(SECOND_ANGLE));
-        assertFalse(isScale(GRADE));
+        assertFalse(isScale(DEGREE));
+        assertFalse(isScale(ARC_MINUTE));
+        assertFalse(isScale(ARC_SECOND));
+        assertFalse(isScale(GRAD));
         assertFalse(isScale(DAY));
-        assertFalse(isScale(SPHERE));
-        assertFalse(isScale(ATMOSPHERE));
         assertFalse(isScale(NAUTICAL_MILE));
 
         // Additional units
@@ -201,7 +166,6 @@ public final strictfp class UnitsTest ex
     public void testIsPressure() {
         assertFalse(isPressure(null));
         assertFalse(isPressure(METRE));
-        assertTrue (isPressure(ATMOSPHERE));
     }
 
     /**
@@ -210,7 +174,7 @@ public final strictfp class UnitsTest ex
     @Test
     public void testToStandardUnit() {
         assertEquals(1000.0,               toStandardUnit(KILOMETRE),    
1E-15);
-        assertEquals(0.017453292519943295, toStandardUnit(DEGREE_ANGLE), 
1E-15);
+        assertEquals(0.017453292519943295, toStandardUnit(DEGREE), 1E-15);
     }
 
     /**
@@ -218,8 +182,8 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testMultiply() {
-        assertSame(KILOMETRE,    multiply(METRE,  1000));
-        assertSame(DEGREE_ANGLE, multiply(RADIAN, 0.017453292519943295));
+        assertSame(KILOMETRE, multiply(METRE,  1000));
+        assertSame(DEGREE, multiply(RADIAN, 0.017453292519943295));
     }
 
     /**
@@ -227,18 +191,18 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testValueOf() {
-        assertSame(DEGREE_ANGLE, valueOf("°"));
-        assertSame(DEGREE_ANGLE, valueOf("deg"));
-        assertSame(DEGREE_ANGLE, valueOf("degree"));
-        assertSame(DEGREE_ANGLE, valueOf("degrees"));
-        assertSame(DEGREE_ANGLE, valueOf("degrées"));
-        assertSame(DEGREE_ANGLE, valueOf("DEGREES"));
-        assertSame(DEGREE_ANGLE, valueOf("DEGRÉES"));
-        assertSame(DEGREE_ANGLE, valueOf("degrees_east"));
-        assertSame(DEGREE_ANGLE, valueOf("degrees_north"));
-        assertSame(DEGREE_ANGLE, valueOf("degrées_north"));
-        assertSame(DEGREE_ANGLE, valueOf("decimal_degree"));
-        assertSame(SECOND_ANGLE, valueOf("arcsec"));
+        assertSame(DEGREE,       valueOf("°"));
+        assertSame(DEGREE,       valueOf("deg"));
+        assertSame(DEGREE,       valueOf("degree"));
+        assertSame(DEGREE,       valueOf("degrees"));
+        assertSame(DEGREE,       valueOf("degrées"));
+        assertSame(DEGREE,       valueOf("DEGREES"));
+        assertSame(DEGREE,       valueOf("DEGRÉES"));
+        assertSame(DEGREE,       valueOf("degrees_east"));
+        assertSame(DEGREE,       valueOf("degrees_north"));
+        assertSame(DEGREE,       valueOf("degrées_north"));
+        assertSame(DEGREE,       valueOf("decimal_degree"));
+        assertSame(ARC_SECOND,   valueOf("arcsec"));
         assertSame(RADIAN,       valueOf("rad"));
         assertSame(RADIAN,       valueOf("radian"));
         assertSame(RADIAN,       valueOf("radians"));
@@ -269,7 +233,7 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testAdvancedValueOf() {
-        assertSame  (Units.MILLISECOND,             valueOf("ms"));
+        assertSame  (MILLISECOND,                   valueOf("ms"));
         assertEquals(METRES_PER_SECOND,             valueOf("m/s"));
         assertEquals(METRES_PER_SECOND,             valueOf("m.s-1"));
         assertEquals(SQUARE_METRE.divide(SECOND),   valueOf("m2.s-1"));
@@ -279,14 +243,14 @@ public final strictfp class UnitsTest ex
         assertSame  (HERTZ,                         valueOf("1/s"));
         assertSame  (HERTZ,                         valueOf("s-1"));
         assertSame  (PERCENT,                       valueOf("%"));
-        assertSame  (Unit.ONE,                      valueOf("kg/kg"));
-        assertSame  (Unit.ONE,                      valueOf("kg.kg-1"));
-        assertSame  (Units.PPM,                     valueOf("ppm")); // Parts 
per million
-        assertSame  (Units.PSU,                     valueOf("psu")); // 
Pratical Salinity Unit
-        assertSame  (Units.SIGMA,                   valueOf("sigma"));
+        assertSame  (ONE,                           valueOf("kg/kg"));
+        assertSame  (ONE,                           valueOf("kg.kg-1"));
+        assertSame  (PPM,                           valueOf("ppm"));           
 // Parts per million
+        assertSame  (PSU,                           valueOf("psu"));           
 // Pratical Salinity Unit
+        assertSame  (SIGMA,                         valueOf("sigma"));
 
         // Potential vorticity surface
-        
assertEquals(KELVIN.times(SQUARE_METRE).divide(KILOGRAM.times(SECOND)), 
valueOf("K.m2.kg-1.s-1"));
+        
assertEquals(KELVIN.multiply(SQUARE_METRE).divide(KILOGRAM.multiply(SECOND)), 
valueOf("K.m2.kg-1.s-1"));
     }
 
     /**
@@ -294,14 +258,14 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testValueOfEPSG() {
-        assertSame(METRE,        valueOfEPSG(9001));
-        assertSame(DEGREE_ANGLE, valueOfEPSG(9102)); // Used in prime meridian 
and operation parameters.
-        assertSame(DEGREE_ANGLE, valueOfEPSG(9122)); // Used in coordinate 
system axes.
-        assertSame(METRE,        valueOf("EPSG:9001"));
-        assertSame(DEGREE_ANGLE, valueOf(" epsg : 9102"));
-        assertSame(DEGREE_ANGLE, valueOf("urn:ogc:def:uom:EPSG::9102"));
-        assertSame(METRE,        
valueOf("http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])"));
-        assertSame(METRE,        valueOf("gmxUom.xml#m"));
+        assertSame(METRE,  valueOfEPSG(9001));
+        assertSame(DEGREE, valueOfEPSG(9102));              // Used in prime 
meridian and operation parameters.
+        assertSame(DEGREE, valueOfEPSG(9122));              // Used in 
coordinate system axes.
+        assertSame(METRE,  valueOf("EPSG:9001"));
+        assertSame(DEGREE, valueOf(" epsg : 9102"));
+        assertSame(DEGREE, valueOf("urn:ogc:def:uom:EPSG::9102"));
+        assertSame(METRE,  
valueOf("http://schemas.opengis.net/iso/19139/20070417/resources/uom/gmxUom.xml#xpointer(//*[@gml:id='m'])"));
+        assertSame(METRE,  valueOf("gmxUom.xml#m"));
     }
 
     /**
@@ -309,10 +273,10 @@ public final strictfp class UnitsTest ex
      */
     @Test
     public void testGetEpsgCode() {
-        assertEquals(Integer.valueOf(9001), getEpsgCode(METRE, false));
-        assertEquals(Integer.valueOf(9102), getEpsgCode(DEGREE_ANGLE, false));
-        assertEquals(Integer.valueOf(9122), getEpsgCode(DEGREE_ANGLE, true));
-        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS, false));
-        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS, true));
+        assertEquals(Integer.valueOf(9001), getEpsgCode(METRE,  false));
+        assertEquals(Integer.valueOf(9102), getEpsgCode(DEGREE, false));
+        assertEquals(Integer.valueOf(9122), getEpsgCode(DEGREE, true));
+        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS,    false));
+        assertEquals(Integer.valueOf(9110), getEpsgCode(DMS,    true));
     }
 }

Modified: 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -16,7 +16,7 @@
  */
 package org.apache.sis.test.mock;
 
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.CoordinateSystemAxis;

Modified: 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -17,9 +17,7 @@
 package org.apache.sis.test.mock;
 
 import java.util.Date;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
+import javax.measure.Unit;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.referencing.crs.VerticalCRS;
 import org.opengis.referencing.cs.AxisDirection;
@@ -29,6 +27,7 @@ import org.opengis.referencing.cs.Vertic
 import org.opengis.referencing.datum.VerticalDatum;
 import org.opengis.referencing.datum.VerticalDatumType;
 import org.opengis.util.InternationalString;
+import org.apache.sis.measure.Units;
 
 
 /**
@@ -36,7 +35,7 @@ import org.opengis.util.InternationalStr
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.6
+ * @version 0.8
  * @module
  */
 @SuppressWarnings("serial")
@@ -47,31 +46,31 @@ public final strictfp class VerticalCRSM
      * Height in metres.
      */
     public static final VerticalCRS HEIGHT = new VerticalCRSMock("Height",
-            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, 
Double.POSITIVE_INFINITY, SI.METRE, true);
+            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, 
Double.POSITIVE_INFINITY, Units.METRE, true);
 
     /**
      * Height in feet.
      */
     public static final VerticalCRS HEIGHT_ft = new VerticalCRSMock("Height",
-            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, 
Double.POSITIVE_INFINITY, NonSI.FOOT, true);
+            VerticalDatumType.GEOIDAL, Double.NEGATIVE_INFINITY, 
Double.POSITIVE_INFINITY, Units.FOOT, true);
 
     /**
      * Height estimated from hPa.
      */
     public static final VerticalCRS BAROMETRIC_HEIGHT = new 
VerticalCRSMock("Barometric height",
-            VerticalDatumType.BAROMETRIC, 0, Double.POSITIVE_INFINITY, 
SI.MetricPrefix.HECTO(SI.PASCAL), true);
+            VerticalDatumType.BAROMETRIC, 0, Double.POSITIVE_INFINITY, 
Units.HECTOPASCAL, true);
 
     /**
      * Depth in metres.
      */
     public static final VerticalCRS DEPTH = new VerticalCRSMock("Depth",
-            VerticalDatumType.DEPTH, 0, Double.POSITIVE_INFINITY, SI.METRE, 
false);
+            VerticalDatumType.DEPTH, 0, Double.POSITIVE_INFINITY, Units.METRE, 
false);
 
     /**
      * Depth as a fraction of the sea floor depth at the location of the point 
for which the depth is evaluated.
      */
     public static final VerticalCRS SIGMA_LEVEL = new VerticalCRSMock("Sigma 
level",
-            VerticalDatumType.OTHER_SURFACE, 0, 1, Unit.ONE, false);
+            VerticalDatumType.OTHER_SURFACE, 0, 1, Units.ONE, false);
 
     /**
      * The datum type (geoidal, barometric, etc.).

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties 
[ISO-8859-1] (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties 
[ISO-8859-1] Thu Oct 13 13:50:40 2016
@@ -82,8 +82,8 @@ project.GeoAPI       = ../../../../GeoAP
 # Those dependencies must exist in the local Maven repository.
 # Those numbers should match the ones declared in the pom.xml files.
 #
-unit-api.version     = 0.6.1
-jsr275.version       = 0.9.3
+jsr363.version       = 1.0
+jsr363-ri.version    = 1.0.1
 jama.version         = 1.0.3
 geometry.version     = 1.2.1
 georss.version       = 0.9.8
@@ -108,7 +108,8 @@ maven.repository   = ${user.home}/.m2/re
 endorsed.classpath=
 javac.classpath=\
     ${project.GeoAPI}/dist/geoapi.jar:\
-    
${maven.repository}/javax/measure/jsr-275/${jsr275.version}/jsr-275-${jsr275.version}.jar:\
+    
${maven.repository}/javax/measure/unit-api/${jsr363.version}/unit-api-${jsr363.version}.jar:\
+    
${maven.repository}/tec/units/unit-ri/${jsr363-ri.version}/unit-ri-${jsr363-ri.version}.jar:\
     
${maven.repository}/com/esri/geometry/esri-geometry-api/${geometry.version}/esri-geometry-api-${geometry.version}.jar:\
     
${maven.repository}/org/geonames/georss-rome/${georss.version}/georss-rome-${georss.version}.jar:\
     ${maven.repository}/rome/rome/${rome.version}/rome-${rome.version}.jar:\

Modified: sis/branches/JDK7/pom.xml
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- sis/branches/JDK7/pom.xml (original)
+++ sis/branches/JDK7/pom.xml Thu Oct 13 13:50:40 2016
@@ -571,6 +571,7 @@ Apache SIS is a free software, Java lang
           <includes>
             <include>**/*TestSuite.java</include>
           </includes>
+          <skipTests>true</skipTests>   <!-- Temporary, while we migrate from 
JSR-275 to JSR-363. -->
           <systemProperties>
             <property>
               <name>derby.stream.error.file</name>

Modified: 
sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -25,8 +25,6 @@ import java.util.Locale;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.io.LineNumberReader;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
 
 import org.opengis.metadata.Metadata;
 import org.opengis.metadata.citation.Citation;
@@ -42,6 +40,7 @@ import org.opengis.referencing.operation
 import org.opengis.util.NoSuchIdentifierException;
 import org.opengis.util.FactoryException;
 
+import org.apache.sis.measure.Units;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.metadata.iso.DefaultIdentifier;
 import org.apache.sis.metadata.iso.citation.Citations;
@@ -802,7 +801,7 @@ final class LandsatReader {
             band = new DefaultBand();
             band.setDescription(new 
SimpleInternationalString(BAND_NAMES[index]));
             band.setPeakResponse((double) WAVELENGTHS[index]);
-            band.setBoundUnits(SI.MetricPrefix.NANO(SI.METRE));
+            band.setBoundUnits(Units.NANOMETRE);
             bands[index] = band;
         }
         return band;
@@ -818,7 +817,7 @@ final class LandsatReader {
      */
     private void setProjectionParameter(final String key, final String name, 
final String value, final boolean isLinear) {
         if (projection != null) {
-            projection.parameter(name).setValue(Double.parseDouble(value), 
isLinear ? SI.METRE : NonSI.DEGREE_ANGLE);
+            projection.parameter(name).setValue(Double.parseDouble(value), 
isLinear ? Units.METRE : Units.DEGREE);
         } else {
             
listeners.warning(errors().getString(Errors.Keys.UnexpectedProperty_2, 
filename, key), null);
         }

Modified: 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Decoder.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -19,7 +19,8 @@ package org.apache.sis.internal.netcdf;
 import java.util.Date;
 import java.io.Closeable;
 import java.io.IOException;
-import javax.measure.unit.Unit;
+import javax.measure.Unit;
+import javax.measure.format.ParserException;
 import org.apache.sis.measure.Units;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.util.logging.WarningListeners;
@@ -146,7 +147,7 @@ public abstract class Decoder implements
         final String unit = stringValue(name);
         if (unit != null) try {
             return Units.valueOf(unit);
-        } catch (IllegalArgumentException e) {
+        } catch (ParserException e) {
             listeners.warning(null, e);
         }
         return null;

Modified: 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -31,8 +31,9 @@ import java.util.regex.Pattern;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.channels.ReadableByteChannel;
-import javax.measure.converter.UnitConverter;
-import javax.measure.converter.ConversionException;
+import javax.measure.UnitConverter;
+import javax.measure.IncommensurableException;
+import javax.measure.format.ParserException;
 import org.opengis.parameter.InvalidParameterCardinalityException;
 import org.apache.sis.internal.netcdf.DataType;
 import org.apache.sis.internal.netcdf.Decoder;
@@ -729,7 +730,7 @@ public final class ChannelDecoder extend
                     dates[i] = new Date(epoch + 
Math.round(converter.convert(value.doubleValue())));
                 }
             }
-        } catch (ConversionException | DateTimeException | ArithmeticException 
e) {
+        } catch (IncommensurableException | ParserException | 
DateTimeException | ArithmeticException e) {
             listeners.warning(null, e);
         }
         return dates;

Modified: 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -27,11 +27,10 @@ import java.util.HashMap;
 import java.util.Arrays;
 import java.util.Collection;
 import java.io.IOException;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-import javax.measure.converter.UnitConverter;
-import javax.measure.converter.ConversionException;
+import javax.measure.Unit;
+import javax.measure.UnitConverter;
+import javax.measure.IncommensurableException;
+import javax.measure.format.ParserException;
 
 import org.opengis.util.NameFactory;
 import org.opengis.util.InternationalString;
@@ -685,8 +684,8 @@ final class MetadataReader {
          * If at least one geographic ordinates above is available, add a 
GeographicBoundingBox.
          */
         if (xmin != null || xmax != null || ymin != null || ymax != null) {
-            final UnitConverter xConv = 
getConverterTo(decoder.unitValue(LONGITUDE.UNITS), NonSI.DEGREE_ANGLE);
-            final UnitConverter yConv = 
getConverterTo(decoder.unitValue(LATITUDE .UNITS), NonSI.DEGREE_ANGLE);
+            final UnitConverter xConv = 
getConverterTo(decoder.unitValue(LONGITUDE.UNITS), Units.DEGREE);
+            final UnitConverter yConv = 
getConverterTo(decoder.unitValue(LATITUDE .UNITS), Units.DEGREE);
             extent = new DefaultExtent(null, new DefaultGeographicBoundingBox(
                     valueOf(xmin, xConv), valueOf(xmax, xConv),
                     valueOf(ymin, yConv), valueOf(ymax, yConv)), null, null);
@@ -695,7 +694,7 @@ final class MetadataReader {
          * If at least one vertical ordinates above is available, add a 
VerticalExtent.
          */
         if (zmin != null || zmax != null) {
-            final UnitConverter c = 
getConverterTo(decoder.unitValue(VERTICAL.UNITS), SI.METRE);
+            final UnitConverter c = 
getConverterTo(decoder.unitValue(VERTICAL.UNITS), Units.METRE);
             double min = valueOf(zmin, c);
             double max = valueOf(zmax, c);
             if (CF.POSITIVE_DOWN.equals(stringValue(VERTICAL.POSITIVE))) {
@@ -761,7 +760,7 @@ final class MetadataReader {
     private UnitConverter getConverterTo(final Unit<?> source, final Unit<?> 
target) {
         if (source != null) try {
             return source.getConverterToAny(target);
-        } catch (ConversionException e) {
+        } catch (IncommensurableException e) {
             warning(e);
         }
         return null;
@@ -867,7 +866,7 @@ final class MetadataReader {
         final String units = variable.getUnitsString();
         if (units != null) try {
             band.setUnits(Units.valueOf(units));
-        } catch (IllegalArgumentException e) {
+        } catch (ParserException e) {
             
decoder.listeners.warning(errors().getString(Errors.Keys.CanNotAssignUnitToDimension_2,
 name, units), e);
         }
         return band;

Modified: 
sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -29,10 +29,8 @@ import java.io.LineNumberReader;
 import java.io.IOException;
 import java.net.URI;
 import java.nio.charset.Charset;
-import javax.measure.unit.Unit;
-import javax.measure.unit.SI;
-import javax.measure.unit.NonSI;
-import javax.measure.quantity.Duration;
+import javax.measure.Unit;
+import javax.measure.quantity.Time;
 import org.opengis.metadata.Metadata;
 import org.opengis.util.FactoryException;
 import org.opengis.metadata.maintenance.ScopeCode;
@@ -59,6 +57,7 @@ import org.apache.sis.util.ObjectConvert
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.IndexedResourceBundle;
 import org.apache.sis.util.collection.BackingStoreException;
+import org.apache.sis.measure.Units;
 
 // Branch-dependent imports
 import org.apache.sis.internal.jdk8.Instant;
@@ -260,13 +259,13 @@ public final class Store extends DataSto
     @SuppressWarnings("fallthrough")
     private GeneralEnvelope parseEnvelope(final List<String> elements) throws 
DataStoreException, FactoryException {
         CoordinateReferenceSystem crs = null;
-        int spatialDimensionCount     = 2;
-        double[]       lowerCorner    = ArraysExt.EMPTY_DOUBLE;
-        double[]       upperCorner    = ArraysExt.EMPTY_DOUBLE;
-        Instant        startTime      = null;
-        Instant        endTime        = null;
-        Unit<Duration> timeUnit       = SI.SECOND;
-        boolean        isTimeAbsolute = false;
+        int spatialDimensionCount = 2;
+        double[]   lowerCorner    = ArraysExt.EMPTY_DOUBLE;
+        double[]   upperCorner    = ArraysExt.EMPTY_DOUBLE;
+        Instant    startTime      = null;
+        Instant    endTime        = null;
+        Unit<Time> timeUnit       = Units.SECOND;
+        boolean    isTimeAbsolute = false;
         int ordinal = -1;
         for (final String element : elements) {
             ordinal++;
@@ -294,10 +293,10 @@ public final class Store extends DataSto
                     case 6: endTime     = Instant.parse(element); continue;
                     case 7: switch (element.toLowerCase(Locale.US)) {
                                 case "sec":
-                                case "second":   /* Already SI.SECOND. */ 
continue;
-                                case "minute":   timeUnit = NonSI.MINUTE; 
continue;
-                                case "hour":     timeUnit = NonSI.HOUR;   
continue;
-                                case "day":      timeUnit = NonSI.DAY;    
continue;
+                                case "second":   /* Already SECOND. */    
continue;
+                                case "minute":   timeUnit = Units.MINUTE; 
continue;
+                                case "hour":     timeUnit = Units.HOUR;   
continue;
+                                case "day":      timeUnit = Units.DAY;    
continue;
                                 case "absolute": isTimeAbsolute = true;   
continue;
                                 default: throw new 
DataStoreContentException(errors().getString(Errors.Keys.UnknownUnit_1, 
element));
                             }

Modified: 
sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/TimeEncoding.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -16,9 +16,8 @@
  */
 package org.apache.sis.internal.storage.csv;
 
-import javax.measure.unit.Unit;
-import javax.measure.unit.NonSI;
-import javax.measure.quantity.Duration;
+import javax.measure.Unit;
+import javax.measure.quantity.Time;
 import org.opengis.referencing.datum.TemporalDatum;
 import org.apache.sis.internal.converter.SurjectiveConverter;
 import org.apache.sis.referencing.CommonCRS;
@@ -47,7 +46,7 @@ class TimeEncoding extends SurjectiveCon
     /**
      * Times are formatted as ISO dates.
      */
-    static final TimeEncoding ABSOLUTE = new TimeEncoding(DEFAULT.datum(), 
NonSI.DAY) {
+    static final TimeEncoding ABSOLUTE = new TimeEncoding(DEFAULT.datum(), 
Units.DAY) {
         @Override public Instant apply(final String time) {
             return Instant.parse(time);
         }
@@ -66,7 +65,7 @@ class TimeEncoding extends SurjectiveCon
     /**
      * Creates a new time encoding.
      */
-    TimeEncoding(final TemporalDatum datum, final Unit<Duration> unit) {
+    TimeEncoding(final TemporalDatum datum, final Unit<Time> unit) {
         this.origin   = datum.getOrigin().getTime();
         this.interval = unit.getConverterTo(Units.MILLISECOND).convert(1);
     }

Modified: 
sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java?rev=1764677&r1=1764676&r2=1764677&view=diff
==============================================================================
--- 
sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/wkt/StoreTest.java
 [UTF-8] Thu Oct 13 13:50:40 2016
@@ -52,7 +52,7 @@ public final strictfp class StoreTest ex
             "  DATUM[\"Nouvelle Triangulation Francaise (Paris)\",\n" +
             "    SPHEROID[\"Clarke 1880 (IGN)\", 6378249.2, 
293.4660212936269]],\n" +
             "    PRIMEM[\"Paris\", 2.5969213, AUTHORITY[\"EPSG\", 
\"8903\"]],\n" +
-            "  UNIT[\"grade\", 0.015707963267948967],\n" +
+            "  UNIT[\"grad\", 0.015707963267948967],\n" +
             "  AXIS[\"Latitude\", NORTH],\n" +
             "  AXIS[\"Longitude\", EAST]]";
 



Reply via email to