Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,9 +16,7 @@ */ package org.apache.sis.parameter; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; -import javax.measure.unit.Unit; +import javax.measure.Unit; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.datum.VerticalDatumType; import org.opengis.parameter.ParameterDescriptor; @@ -42,7 +40,7 @@ import static org.apache.sis.test.Metada * * @author Martin Desruisseaux (IRD, Geomatys) * @since 0.4 - * @version 0.6 + * @version 0.8 * @module */ @SuppressWarnings("UnnecessaryBoxing") @@ -141,7 +139,7 @@ public final strictfp class DefaultParam * Invalid operation: this parameter does not have unit of measurement. */ try { - parameter.doubleValue(SI.METRE); + parameter.doubleValue(Units.METRE); fail("doubleValue(METRE)"); } catch (IllegalStateException exception) { final String message = exception.getMessage(); @@ -238,7 +236,7 @@ public final strictfp class DefaultParam * This shall be an invalid operation since we created a unitless parameter. */ try { - parameter.setValue(10.0, SI.METRE); + parameter.setValue(10.0, Units.METRE); fail("setValue(double,Unit)"); } catch (InvalidParameterValueException exception) { final String message = exception.getMessage(); @@ -252,18 +250,18 @@ public final strictfp class DefaultParam */ @Test public void testMeasure() { - final Watcher<Double> parameter = create("Numerical param", 3, SI.METRE); + final Watcher<Double> parameter = create("Numerical param", 3, Units.METRE); final ParameterDescriptor<Double> descriptor = parameter.getDescriptor(); validate(parameter); assertEquals("name", "Numerical param", descriptor.getName().getCode()); - assertEquals("defaultUnit", SI.METRE, descriptor.getUnit()); - assertEquals("unit", SI.METRE, parameter .getUnit()); + assertEquals("defaultUnit", Units.METRE, descriptor.getUnit()); + assertEquals("unit", Units.METRE, parameter .getUnit()); assertNull ("defaultValue", descriptor.getDefaultValue()); assertEquals("value", Double.valueOf(3), parameter .getValue()); assertEquals("intValue", 3, parameter .intValue()); assertEquals("doubleValue", 3, parameter .doubleValue(), STRICT); - assertEquals("doubleValue", 300, parameter .doubleValue(SI.CENTIMETRE), STRICT); + assertEquals("doubleValue", 300, parameter .doubleValue(Units.CENTIMETRE), STRICT); assertNull ("minimum", descriptor.getMinimumValue()); assertNull ("maximum", descriptor.getMaximumValue()); assertNull ("validValues", descriptor.getValidValues()); @@ -283,12 +281,12 @@ public final strictfp class DefaultParam /* * Sets a value in centimetres. */ - parameter.setValue(400, SI.CENTIMETRE); + parameter.setValue(400, Units.CENTIMETRE); parameter.assertValueEquals(Double.valueOf(400), Double.valueOf(4)); - assertEquals("unit", SI.CENTIMETRE, parameter.getUnit()); - assertEquals("doubleValue", 400, parameter.doubleValue(), STRICT); - assertEquals("doubleValue", 400, parameter.doubleValue(SI.CENTIMETRE), STRICT); - assertEquals("doubleValue", 4, parameter.doubleValue(SI.METRE), STRICT); + assertEquals("unit", Units.CENTIMETRE, parameter.getUnit()); + assertEquals("doubleValue", 400, parameter.doubleValue(), STRICT); + assertEquals("doubleValue", 400, parameter.doubleValue(Units.CENTIMETRE), STRICT); + assertEquals("doubleValue", 4, parameter.doubleValue(Units.METRE), STRICT); validate(parameter); } @@ -344,18 +342,18 @@ public final strictfp class DefaultParam @DependsOnMethod({"testMeasure", "testBoundedDouble"}) public void testBoundedMeasure() { final Watcher<Double> parameter = new Watcher<>( - DefaultParameterDescriptorTest.create("Length measure", 4, 20, 12, SI.METRE)); + DefaultParameterDescriptorTest.create("Length measure", 4, 20, 12, Units.METRE)); assertEquals("value", Double.valueOf(12), parameter.getValue()); assertEquals("intValue", 12, parameter.intValue()); - assertEquals("unit", SI.METRE, parameter.getUnit()); + assertEquals("unit", Units.METRE, parameter.getUnit()); validate(parameter); for (int i=4; i<=20; i++) { parameter.setValue(i); parameter.assertValueEquals(Double.valueOf(i)); - assertEquals("unit", SI.METRE, parameter.getUnit()); - assertEquals("value", i, parameter.doubleValue(SI.METRE), STRICT); - assertEquals("value", 100*i, parameter.doubleValue(SI.CENTIMETRE), STRICT); + assertEquals("unit", Units.METRE, parameter.getUnit()); + assertEquals("value", i, parameter.doubleValue(Units.METRE), STRICT); + assertEquals("value", 100*i, parameter.doubleValue(Units.CENTIMETRE), STRICT); } try { parameter.setValue(3.0); @@ -364,7 +362,7 @@ public final strictfp class DefaultParam assertEquals("Length measure", exception.getParameterName()); } try { - parameter.setValue(10.0, SI.KILOMETRE); // Out of range only after unit conversion. + parameter.setValue(10.0, Units.KILOMETRE); // Out of range only after unit conversion. fail("setValue(> max)"); } catch (InvalidParameterValueException exception) { assertEquals("Length measure", exception.getParameterName()); @@ -377,10 +375,10 @@ public final strictfp class DefaultParam } for (int i=400; i<=2000; i+=100) { final double metres = i / 100.0; - parameter.setValue(i, SI.CENTIMETRE); + parameter.setValue(i, Units.CENTIMETRE); parameter.assertValueEquals(Double.valueOf(i), Double.valueOf(metres)); - assertEquals("unit", SI.CENTIMETRE, parameter.getUnit()); - assertEquals("value", metres, parameter.doubleValue(SI.METRE), EPS); + assertEquals("unit", Units.CENTIMETRE, parameter.getUnit()); + assertEquals("value", metres, parameter.doubleValue(Units.METRE), EPS); } } @@ -391,32 +389,32 @@ public final strictfp class DefaultParam public void testArray() { double[] values = {5, 10, 15}; final Watcher<double[]> parameter = new Watcher<>( - DefaultParameterDescriptorTest.createForArray("myValues", 4, 4000, SI.METRE)); + DefaultParameterDescriptorTest.createForArray("myValues", 4, 4000, Units.METRE)); parameter.setValue(values); assertArrayEquals(values, parameter.getValue(), 0); assertArrayEquals(values, parameter.convertedValue, 0); assertArrayEquals(values, parameter.doubleValueList(), 0); - assertArrayEquals(new double[] {500, 1000, 1500}, parameter.doubleValueList(SI.CENTIMETRE), 0); + assertArrayEquals(new double[] {500, 1000, 1500}, parameter.doubleValueList(Units.CENTIMETRE), 0); /* * New values in kilometres. */ values = new double[] {3, 2, 4}; final double[] metres = new double[] {3000, 2000, 4000}; - parameter.setValue(values, SI.KILOMETRE); + parameter.setValue(values, Units.KILOMETRE); assertArrayEquals(values, parameter.getValue(), 0); assertArrayEquals(metres, parameter.convertedValue, 0); assertArrayEquals(values, parameter.doubleValueList(), 0); - assertArrayEquals(metres, parameter.doubleValueList(SI.METRE), 0); + assertArrayEquals(metres, parameter.doubleValueList(Units.METRE), 0); /* * Values out of range. */ try { - parameter.setValue(new double[] {5, 10, -5}, SI.METRE); + parameter.setValue(new double[] {5, 10, -5}, Units.METRE); } catch (InvalidParameterValueException e) { assertTrue(e.getMessage().contains("myValues[2]")); } try { - parameter.setValue(new double[] {4, 5}, SI.KILOMETRE); // Out of range only after unit conversion. + parameter.setValue(new double[] {4, 5}, Units.KILOMETRE); // Out of range only after unit conversion. } catch (InvalidParameterValueException e) { assertTrue(e.getMessage().contains("myValues[1]")); } @@ -533,7 +531,7 @@ public final strictfp class DefaultParam assertEquals ("Expected integer value", i, p.intValue()); assertEquals ("Expected integer value", i, p.doubleValue(), STRICT); - p = create("Dimensionless double value", i, Unit.ONE); + p = create("Dimensionless double value", i, Units.ONE); d = p.getDescriptor(); validate(p); @@ -544,11 +542,11 @@ public final strictfp class DefaultParam assertNull ("Expected no enumeration.", d.getValidValues()); assertEquals ("Expected double type.", Double.class, d.getValueClass()); assertTrue ("Expected double type.", p.getValue() instanceof Double); - assertEquals ("Expected dimensionless.", Unit.ONE, p.getUnit()); + assertEquals ("Expected dimensionless.", Units.ONE, p.getUnit()); assertEquals ("Expected integer value", i, p.intValue()); assertEquals ("Expected integer value", i, p.doubleValue(), STRICT); - p = create("Angular double value", i, NonSI.DEGREE_ANGLE); + p = create("Angular double value", i, Units.DEGREE); d = p.getDescriptor(); validate(p); @@ -559,10 +557,10 @@ public final strictfp class DefaultParam assertNull ("Expected no enumeration.", d.getValidValues()); assertEquals ("Expected double type.", Double.class, d.getValueClass()); assertTrue ("Expected double type.", p.getValue() instanceof Double); - assertEquals ("Expected angular unit.", NonSI.DEGREE_ANGLE, p.getUnit()); + assertEquals ("Expected angular unit.", Units.DEGREE, p.getUnit()); assertEquals ("Expected integer value", i, p.intValue()); assertEquals ("Expected integer value", i, p.doubleValue(), STRICT); - assertEquals ("Expected unit conversion.", toRadians(i), p.doubleValue(SI.RADIAN), EPS); + assertEquals ("Expected unit conversion.", toRadians(i), p.doubleValue(Units.RADIAN), EPS); } } @@ -571,7 +569,7 @@ public final strictfp class DefaultParam */ @Test public void testClone() { - final DefaultParameterValue<Double> parameter = create("Clone test", 3, SI.METRE); + final DefaultParameterValue<Double> parameter = create("Clone test", 3, Units.METRE); assertEquals("equals(clone)", parameter, parameter.clone()); } @@ -580,7 +578,7 @@ public final strictfp class DefaultParam */ @Test public void testSerialization() { - final DefaultParameterValue<Double> parameter = create("Serialization test", 3, SI.METRE); + final DefaultParameterValue<Double> parameter = create("Serialization test", 3, Units.METRE); assertNotSame(parameter, assertSerializedEquals(parameter)); } @@ -590,7 +588,7 @@ public final strictfp class DefaultParam @Test public void testWKT() { final DefaultParameterValue<Integer> count = createOptional("Count", 4); - final DefaultParameterValue<Double> length = create("Length", 30, SI.CENTIMETRE); + final DefaultParameterValue<Double> length = create("Length", 30, Units.CENTIMETRE); assertWktEquals(Convention.WKT1, "PARAMETER[“Count”, 4]", count); assertWktEquals(Convention.WKT1, "PARAMETER[“Length”, 30.0]", length); assertWktEquals(Convention.WKT2, "PARAMETER[“Count”, 4]", count); @@ -613,7 +611,7 @@ public final strictfp class DefaultParam assertWktEquals(Convention.WKT2, "PARAMETER[“Angle”, 10.5, ANGLEUNIT[“degree”, 0.017453292519943295]]", p); assertWktEquals(Convention.INTERNAL, "Parameter[“Angle”, 10.3]", p); // Value in same unit than descriptor. - p = create("Angle", 0, NonSI.DEGREE_ANGLE); + p = create("Angle", 0, Units.DEGREE); p.setValue(10.3, degreesAndMinutes); // Can not be formatted in WKT1. assertWktEquals(Convention.WKT2, "PARAMETER[“Angle”, 10.5, ANGLEUNIT[“degree”, 0.017453292519943295]]", p); assertWktEquals(Convention.INTERNAL, "Parameter[“Angle”, 10.3, Unit[“D.M”, 0.017453292519943295, Id[“EPSG”, 9111]]]", p);
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterBuilderTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,12 +16,10 @@ */ package org.apache.sis.parameter; -import javax.measure.unit.Unit; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; import org.opengis.util.GenericName; import org.opengis.parameter.ParameterDescriptor; import org.apache.sis.metadata.iso.citation.Citations; +import org.apache.sis.measure.Units; import org.apache.sis.test.DependsOnMethod; import org.apache.sis.test.DependsOn; import org.apache.sis.test.TestCase; @@ -35,7 +33,7 @@ import static org.junit.Assert.*; * * @author Martin Desruisseaux (Geomatys) * @since 0.4 - * @version 0.6 + * @version 0.8 * @module */ @DependsOn({ @@ -50,26 +48,26 @@ public final strictfp class ParameterBui @Test public void testCreate() { final ParameterBuilder builder = new ParameterBuilder(); - ParameterDescriptor<Double> p = builder.addName("Test 1").create(0, SI.METRE); + ParameterDescriptor<Double> p = builder.addName("Test 1").create(0, Units.METRE); assertEquals("name", "Test 1", p.getName().getCode()); assertEquals("defaultValue", 0.0, p.getDefaultValue(), 0); assertNull ("minimumValue", p.getMinimumValue()); assertNull ("maximumValue", p.getMaximumValue()); - assertEquals("unit", SI.METRE, p.getUnit()); + assertEquals("unit", Units.METRE, p.getUnit()); - p = builder.addName("Test 2").create(Double.NaN, SI.METRE); + p = builder.addName("Test 2").create(Double.NaN, Units.METRE); assertEquals("name", "Test 2", p.getName().getCode()); assertNull ("defaultValue", p.getDefaultValue()); assertNull ("minimumValue", p.getMinimumValue()); assertNull ("maximumValue", p.getMaximumValue()); - assertEquals("unit", SI.METRE, p.getUnit()); + assertEquals("unit", Units.METRE, p.getUnit()); - p = builder.addName("Test 3").createBounded(1, 4, 3, SI.METRE); + p = builder.addName("Test 3").createBounded(1, 4, 3, Units.METRE); assertEquals("name", "Test 3", p.getName().getCode()); assertEquals("defaultValue", 3.0, p.getDefaultValue(), 0); assertEquals("minimumValue", 1.0, p.getMinimumValue()); assertEquals("maximumValue", 4.0, p.getMaximumValue()); - assertEquals("unit", SI.METRE, p.getUnit()); + assertEquals("unit", Units.METRE, p.getUnit()); } /** @@ -85,18 +83,18 @@ public final strictfp class ParameterBui builder.addName("Longitude of natural origin") .addName(Citations.OGC, "central_meridian") .addName(Citations.GEOTIFF, "NatOriginLong") - .setRemarks("Some remarks.") .createBounded(-180, +180, 0, NonSI.DEGREE_ANGLE), - builder.addName("Latitude of natural origin") .createBounded( -80, +84, 0, NonSI.DEGREE_ANGLE), - builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Unit.ONE), - builder.addName("False easting") .create(0, SI.METRE), - builder.addName("False northing") .create(0, SI.METRE) + .setRemarks("Some remarks.") .createBounded(-180, +180, 0, Units.DEGREE), + builder.addName("Latitude of natural origin") .createBounded( -80, +84, 0, Units.DEGREE), + builder.addName("Scale factor at natural origin") .createStrictlyPositive(1, Units.ONE), + builder.addName("False easting") .create(0, Units.METRE), + builder.addName("False northing") .create(0, Units.METRE) }; // Tests random properties. assertEquals("EPSG", parameters[1].getName().getCodeSpace()); assertEquals("False easting", parameters[3].getName().getCode()); assertEquals("Some remarks.", parameters[0].getRemarks().toString()); assertEquals(Double.valueOf(84), parameters[1].getMaximumValue()); - assertEquals(SI.METRE, parameters[4].getUnit()); + assertEquals(Units.METRE, parameters[4].getUnit()); assertTrue ( parameters[1].getAlias().isEmpty()); final GenericName alias = parameters[0].getAlias().iterator().next(); Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -18,15 +18,13 @@ package org.apache.sis.parameter; import java.util.List; import java.util.Locale; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; -import javax.measure.unit.Unit; import org.opengis.referencing.IdentifiedObject; import org.opengis.parameter.ParameterDescriptor; import org.opengis.parameter.ParameterDescriptorGroup; import org.opengis.parameter.GeneralParameterDescriptor; import org.opengis.parameter.ParameterValueGroup; import org.opengis.parameter.ParameterValue; +import org.apache.sis.measure.Units; import org.apache.sis.test.DependsOnMethod; import org.apache.sis.test.DependsOn; import org.apache.sis.test.TestCase; @@ -79,11 +77,11 @@ public final strictfp class ParameterFor ParameterDescriptor<?>[] parameters = { builder.addIdentifier("8801").addName("Latitude of natural origin").addName(OGC, "latitude_of_origin") .setRemarks("This parameter is shown for completeness, but should never have a value different than 0 for this projection.") - .createBounded( -80, +84, 40, NonSI.DEGREE_ANGLE), - builder.addIdentifier("8802").addName("Longitude of natural origin") .addName(OGC, "central_meridian") .createBounded(-180, +180, -60, NonSI.DEGREE_ANGLE), - builder.addIdentifier("8805").addName("Scale factor at natural origin") .addName(OGC, "scale_factor") .createStrictlyPositive(1, Unit.ONE), - builder.addIdentifier("8806").addName("False easting").setRequired(false).addName(OGC, "false_easting") .create( 5000, SI.METRE), - builder.addIdentifier("8807").addName("False northing") .addName(OGC, "false_northing") .create(10000, SI.METRE) + .createBounded( -80, +84, 40, Units.DEGREE), + builder.addIdentifier("8802").addName("Longitude of natural origin") .addName(OGC, "central_meridian") .createBounded(-180, +180, -60, Units.DEGREE), + builder.addIdentifier("8805").addName("Scale factor at natural origin") .addName(OGC, "scale_factor") .createStrictlyPositive(1, Units.ONE), + builder.addIdentifier("8806").addName("False easting").setRequired(false).addName(OGC, "false_easting") .create( 5000, Units.METRE), + builder.addIdentifier("8807").addName("False northing") .addName(OGC, "false_northing") .create(10000, Units.METRE) }; builder.addIdentifier("9804") .addName("Mercator (variant A)") @@ -110,7 +108,7 @@ public final strictfp class ParameterFor final ParameterValueGroup group = descriptor.createValue(); group.parameter("latitude_of_origin").setValue(20); group.parameter("scale_factor").setValue(0.997); - group.parameter("false_northing").setValue(20, SI.KILOMETRE); + group.parameter("false_northing").setValue(20, Units.KILOMETRE); return group; } Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterMarshallingTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -21,15 +21,14 @@ import java.util.Iterator; import java.net.URI; import java.net.URISyntaxException; import javax.xml.bind.JAXBException; -import javax.measure.unit.Unit; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; +import javax.measure.Unit; import org.opengis.test.Validators; import org.opengis.parameter.ParameterValue; import org.opengis.parameter.ParameterDescriptor; import org.opengis.parameter.ParameterDescriptorGroup; import org.opengis.parameter.GeneralParameterValue; import org.opengis.parameter.GeneralParameterDescriptor; +import org.apache.sis.measure.Units; import org.apache.sis.measure.Range; import org.apache.sis.measure.MeasurementRange; import org.apache.sis.test.DependsOn; @@ -50,7 +49,7 @@ import java.util.Objects; * * @author Martin Desruisseaux (Geomatys) * @since 0.6 - * @version 0.7 + * @version 0.8 * @module */ @DependsOn({ @@ -246,8 +245,8 @@ public final strictfp class ParameterMar @DependsOnMethod("testStringValue") public void testDoubleValue() throws JAXBException { final DefaultParameterValue<Double> parameter = create(Double.class, - new MeasurementRange<Double>(Double.class, null, false, null, false, SI.METRE)); - parameter.setValue(3000, SI.METRE); + new MeasurementRange<>(Double.class, null, false, null, false, Units.METRE)); + parameter.setValue(3000, Units.METRE); testMarshallAndUnmarshall(parameter, "<gml:ParameterValue xmlns:gml=\"" + Namespaces.GML + "\">\n" + " <gml:value uom=\"urn:ogc:def:uom:EPSG::9001\">3000.0</gml:value>\n" @@ -268,8 +267,8 @@ public final strictfp class ParameterMar @DependsOnMethod("testStringValue") public void testValueList() throws JAXBException { final DefaultParameterValue<double[]> parameter = create(double[].class, - new MeasurementRange<Double>(Double.class, null, false, null, false, SI.METRE)); - parameter.setValue(new double[] {203, 207, 204}, SI.METRE); + new MeasurementRange<>(Double.class, null, false, null, false, Units.METRE)); + parameter.setValue(new double[] {203, 207, 204}, Units.METRE); testMarshallAndUnmarshall(parameter, "<gml:ParameterValue xmlns:gml=\"" + Namespaces.GML + "\">\n" + " <gml:valueList uom=\"urn:ogc:def:uom:EPSG::9001\">203.0 207.0 204.0</gml:valueList>\n" @@ -406,9 +405,9 @@ public final strictfp class ParameterMar verifyDescriptorGroup(group.getDescriptor()); final Iterator<GeneralParameterValue> it = group.values().iterator(); final Iterator<GeneralParameterDescriptor> itd = group.getDescriptor().descriptors().iterator(); - verifyParameter(8801, "Latitude of natural origin", "latitude_of_origin", 40, NonSI.DEGREE_ANGLE, itd.next(), it.next()); - verifyParameter(8802, "Longitude of natural origin", "central_meridian", -60, NonSI.DEGREE_ANGLE, itd.next(), it.next()); - verifyParameter(8805, "Scale factor at natural origin", "scale_factor", 1, Unit.ONE, itd.next(), it.next()); + verifyParameter(8801, "Latitude of natural origin", "latitude_of_origin", 40, Units.DEGREE, itd.next(), it.next()); + verifyParameter(8802, "Longitude of natural origin", "central_meridian", -60, Units.DEGREE, itd.next(), it.next()); + verifyParameter(8805, "Scale factor at natural origin", "scale_factor", 1, Units.ONE, itd.next(), it.next()); assertFalse("Unexpected parameter.", it.hasNext()); } } Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -19,8 +19,7 @@ package org.apache.sis.parameter; import java.util.Set; import java.util.Collection; import java.util.Collections; -import javax.measure.unit.SI; -import javax.measure.unit.Unit; +import javax.measure.Unit; import org.opengis.parameter.ParameterDescriptor; import org.opengis.parameter.ParameterDirection; import org.opengis.parameter.ParameterValue; @@ -31,6 +30,7 @@ import org.opengis.util.InternationalStr import org.apache.sis.measure.Range; import org.apache.sis.measure.NumberRange; import org.apache.sis.measure.MeasurementRange; +import org.apache.sis.measure.Units; import org.apache.sis.test.DependsOn; import org.apache.sis.test.TestCase; import org.apache.sis.test.TestUtilities; @@ -44,7 +44,7 @@ import static org.junit.Assert.*; * * @author Martin Desruisseaux (Geomatys) * @since 0.4 - * @version 0.6 + * @version 0.8 * @module */ @DependsOn({ @@ -96,8 +96,8 @@ public final strictfp class ParametersTe DefaultParameterDescriptorTest.createSimpleOptional("No range", String.class)); verifyValueDomain(NumberRange.create(1, true, 4, true), DefaultParameterDescriptorTest.create("Integers", 1, 4, 2)); - verifyValueDomain(MeasurementRange.create(1d, true, 4d, true, SI.METRE), - DefaultParameterDescriptorTest.create("Doubles", 1d, 4d, 2d, SI.METRE)); + verifyValueDomain(MeasurementRange.create(1d, true, 4d, true, Units.METRE), + DefaultParameterDescriptorTest.create("Doubles", 1d, 4d, 2d, Units.METRE)); } /** Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectVerifier.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,8 +16,6 @@ */ package org.apache.sis.referencing; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; import org.opengis.metadata.Identifier; import org.opengis.metadata.extent.Extent; import org.opengis.metadata.extent.GeographicExtent; @@ -34,6 +32,7 @@ import org.opengis.referencing.cs.Ellips import org.opengis.referencing.cs.RangeMeaning; import org.opengis.referencing.crs.GeodeticCRS; import org.apache.sis.internal.metadata.AxisNames; +import org.apache.sis.measure.Units; import static org.apache.sis.test.Assert.*; @@ -44,7 +43,7 @@ import static org.apache.sis.test.Assert * * @author Martin Desruisseaux (Geomatys) * @since 0.4 - * @version 0.4 + * @version 0.8 * @module * * @todo Move this class to GeoAPI. @@ -124,7 +123,7 @@ public final strictfp class GeodeticObje * <tr><td>{@linkplain PrimeMeridian#getGreenwichLongitude() Greenwich longitude}</td> * <td>0</td></tr> * <tr><td>{@linkplain PrimeMeridian#getAngularUnit() Angular unit}</td> - * <td>{@link NonSI#DEGREE_ANGLE}</td></tr> + * <td>{@link Units#DEGREE}</td></tr> * </table> * * @param meridian The prime meridian to verify. @@ -132,7 +131,7 @@ public final strictfp class GeodeticObje public static void assertIsGreenwich(final PrimeMeridian meridian) { assertEquals("name", "Greenwich", meridian.getName().getCode()); assertEquals("greenwichLongitude", 0, meridian.getGreenwichLongitude(), STRICT); - assertEquals("angularUnit", NonSI.DEGREE_ANGLE, meridian.getAngularUnit()); + assertEquals("angularUnit", Units.DEGREE, meridian.getAngularUnit()); } /** @@ -147,15 +146,15 @@ public final strictfp class GeodeticObje * <tr><td>{@linkplain PrimeMeridian#getGreenwichLongitude() Greenwich longitude}</td> * <td>2.5969213</td></tr> * <tr><td>{@linkplain PrimeMeridian#getAngularUnit() Angular unit}</td> - * <td>{@link NonSI#GRADE}</td></tr> + * <td>{@link Units#GRAD}</td></tr> * </table> * * @param meridian The prime meridian to verify. */ public static void assertIsParis(final PrimeMeridian meridian) { - assertEquals("name", "Paris", meridian.getName().getCode()); - assertEquals("greenwichLongitude", 2.5969213, meridian.getGreenwichLongitude(), STRICT); - assertEquals("angularUnit", NonSI.GRADE, meridian.getAngularUnit()); + assertEquals("name", "Paris", meridian.getName().getCode()); + assertEquals("greenwichLongitude", 2.5969213, meridian.getGreenwichLongitude(), STRICT); + assertEquals("angularUnit", Units.GRAD, meridian.getAngularUnit()); } /** @@ -168,7 +167,7 @@ public final strictfp class GeodeticObje * <tr><td>{@linkplain Identifier#getCode() Code} of the {@linkplain Ellipsoid#getName() name}</td> * <td>{@code "WGS 84"}</td></tr> * <tr><td>{@linkplain Ellipsoid#getAxisUnit() Axis unit}</td> - * <td>{@link SI#METRE}</td></tr> + * <td>{@link Units#METRE}</td></tr> * <tr><td>{@linkplain Ellipsoid#getSemiMajorAxis() Semi-major axis}</td> * <td>6378137</td></tr> * <tr><td>{@linkplain Ellipsoid#getSemiMinorAxis() Semi-minor axis}</td> @@ -183,7 +182,7 @@ public final strictfp class GeodeticObje */ public static void assertIsWGS84(final Ellipsoid ellipsoid) { assertEquals("name", "WGS 84", ellipsoid.getName().getCode()); - assertEquals("axisUnit", SI.METRE, ellipsoid.getAxisUnit()); + assertEquals("axisUnit", Units.METRE, ellipsoid.getAxisUnit()); assertEquals("semiMajorAxis", 6378137, ellipsoid.getSemiMajorAxis(), STRICT); assertEquals("semiMinorAxis", 6356752.314245179, ellipsoid.getSemiMinorAxis(), 0.001); assertEquals("inverseFlattening", 298.257223563, ellipsoid.getInverseFlattening(), STRICT); @@ -291,8 +290,8 @@ public final strictfp class GeodeticObje * <td>{@link AxisDirection#EAST EAST}</td> * <td>{@link AxisDirection#NORTH NORTH}</td></tr> * <tr><td>Axes {@linkplain CoordinateSystemAxis#getUnit() units}</td> - * <td>{@link SI#METRE}</td> - * <td>{@link SI#METRE}</td></tr> + * <td>{@link Units#METRE}</td> + * <td>{@link Units#METRE}</td></tr> * <tr><td>Axes range</td> * <td>[-∞ … ∞]</td> * <td>[-∞ … ∞]</td></tr> @@ -315,8 +314,8 @@ public final strictfp class GeodeticObje assertEquals("axis[1].abbreviation", "N", N.getAbbreviation()); assertEquals("axis[0].direction", AxisDirection.EAST, E.getDirection()); assertEquals("axis[1].direction", AxisDirection.NORTH, N.getDirection()); - assertEquals("axis[0].unit", SI.METRE, E.getUnit()); - assertEquals("axis[1].unit", SI.METRE, N.getUnit()); + assertEquals("axis[0].unit", Units.METRE, E.getUnit()); + assertEquals("axis[1].unit", Units.METRE, N.getUnit()); verifyRange(E, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null, true); verifyRange(N, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, null, true); } @@ -337,8 +336,8 @@ public final strictfp class GeodeticObje * <td>{@link AxisDirection#NORTH NORTH}</td> * <td>{@link AxisDirection#EAST EAST}</td></tr> * <tr><td>Axes {@linkplain CoordinateSystemAxis#getUnit() units}</td> - * <td>{@link NonSI#DEGREE_ANGLE}</td> - * <td>{@link NonSI#DEGREE_ANGLE}</td></tr> + * <td>{@link Units#DEGREE}</td> + * <td>{@link Units#DEGREE}</td></tr> * <tr><td>Axes range</td> * <td>[-90 … 90] (see below)</td> * <td>[-180 … 180] (see below)</td></tr> @@ -368,8 +367,8 @@ public final strictfp class GeodeticObje assertEquals("axis[1].name", AxisNames.GEODETIC_LONGITUDE, longitude.getName().getCode()); assertEquals("axis[0].direction", AxisDirection.NORTH, latitude .getDirection()); assertEquals("axis[1].direction", AxisDirection.EAST, longitude.getDirection()); - assertEquals("axis[0].unit", NonSI.DEGREE_ANGLE, latitude .getUnit()); - assertEquals("axis[1].unit", NonSI.DEGREE_ANGLE, longitude.getUnit()); + assertEquals("axis[0].unit", Units.DEGREE, latitude .getUnit()); + assertEquals("axis[1].unit", Units.DEGREE, longitude.getUnit()); verifyRange(latitude, -90, +90, RangeMeaning.EXACT, isRangeMandatory); verifyRange(longitude, -180, +180, RangeMeaning.WRAPAROUND, isRangeMandatory); } Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -18,8 +18,6 @@ package org.apache.sis.referencing.crs; import java.util.Collections; import javax.xml.bind.JAXBException; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; import org.opengis.referencing.crs.SingleCRS; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.CoordinateSystem; @@ -33,6 +31,7 @@ import org.apache.sis.referencing.operat import org.apache.sis.referencing.operation.DefaultConversionTest; import org.apache.sis.referencing.operation.transform.MathTransforms; import org.apache.sis.referencing.cs.HardCodedCS; +import org.apache.sis.measure.Units; import org.apache.sis.test.DependsOnMethod; import org.apache.sis.test.DependsOn; import org.apache.sis.test.XMLTestCase; @@ -46,7 +45,7 @@ import static org.apache.sis.test.Refere * * @author Martin Desruisseaux (Geomatys) * @since 0.6 - * @version 0.7 + * @version 0.8 * @module */ @DependsOn({ @@ -181,7 +180,7 @@ public final strictfp class DefaultDeriv " BASEGEODCRS[“NTF (Paris)”,\n" + " DATUM[“Nouvelle Triangulation Francaise”,\n" + " ELLIPSOID[“NTF”, 6378249.2, 293.4660212936269, LENGTHUNIT[“metre”, 1]]],\n" + - " PRIMEM[“Paris”, 2.5969213, ANGLEUNIT[“grade”, 0.015707963267948967]]],\n" + + " PRIMEM[“Paris”, 2.5969213, ANGLEUNIT[“grad”, 0.015707963267948967]]],\n" + " DERIVINGCONVERSION[“Paris to Greenwich”,\n" + " METHOD[“Longitude rotation”, ID[“EPSG”, 9601]],\n" + " PARAMETER[“Longitude offset”, 2.33722917, ID[“EPSG”, 8602]]],\n" + @@ -203,7 +202,7 @@ public final strictfp class DefaultDeriv " BaseGeodCRS[“NTF (Paris)”,\n" + " Datum[“Nouvelle Triangulation Francaise”,\n" + " Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],\n" + - " PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967]],\n" + + " PrimeMeridian[“Paris”, 2.5969213, Unit[“grad”, 0.015707963267948967]],\n" + " Unit[“degree”, 0.017453292519943295]],\n" + " DerivingConversion[“Paris to Greenwich”,\n" + " Method[“Longitude rotation”],\n" + @@ -233,9 +232,9 @@ public final strictfp class DefaultDeriv final Conversion conversion = crs.getConversionFromBase(); final ParameterValueGroup pg = conversion.getParameterValues(); assertEpsgNameAndIdentifierEqual("Geographic/topocentric conversions", 9837, conversion.getMethod()); - assertEquals("Latitude", 55, pg.parameter("Latitude of topocentric origin" ).doubleValue(NonSI.DEGREE_ANGLE), STRICT); - assertEquals("Longitude", 5, pg.parameter("Longitude of topocentric origin").doubleValue(NonSI.DEGREE_ANGLE), STRICT); - assertEquals("Height", 0, pg.parameter("Ellipsoidal height of topocentric origin").doubleValue(SI.METRE), STRICT); + assertEquals("Latitude", 55, pg.parameter("Latitude of topocentric origin" ).doubleValue(Units.DEGREE), STRICT); + assertEquals("Longitude", 5, pg.parameter("Longitude of topocentric origin").doubleValue(Units.DEGREE), STRICT); + assertEquals("Height", 0, pg.parameter("Ellipsoidal height of topocentric origin").doubleValue(Units.METRE), STRICT); /* * Test marshalling and compare with the original file. */ Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,7 +16,6 @@ */ package org.apache.sis.referencing.crs; -import javax.measure.unit.SI; import org.opengis.referencing.cs.CartesianCS; import org.opengis.referencing.cs.CoordinateSystem; import org.opengis.referencing.cs.CoordinateSystemAxis; @@ -24,6 +23,7 @@ import org.apache.sis.io.wkt.Convention; import org.apache.sis.referencing.IdentifiedObjects; import org.apache.sis.referencing.cs.AxesConvention; import org.apache.sis.internal.referencing.Legacy; +import org.apache.sis.measure.Units; import org.apache.sis.test.DependsOn; import org.apache.sis.test.DependsOnMethod; import org.apache.sis.test.TestCase; @@ -38,7 +38,7 @@ import static org.apache.sis.test.Metada * * @author Martin Desruisseaux (Geomatys) * @since 0.4 - * @version 0.7 + * @version 0.8 * @module */ @DependsOn({ @@ -117,7 +117,7 @@ public final strictfp class DefaultGeoce public void testWKT1_kilometres() { DefaultGeocentricCRS crs = HardCodedCRS.GEOCENTRIC; crs = new DefaultGeocentricCRS(IdentifiedObjects.getProperties(crs), crs.getDatum(), - Legacy.replaceUnit((CartesianCS) crs.getCoordinateSystem(), SI.KILOMETRE)); + Legacy.replaceUnit((CartesianCS) crs.getCoordinateSystem(), Units.KILOMETRE)); assertWktEquals(Convention.WKT1, "GEOCCS[“Geocentric”,\n" + " DATUM[“World Geodetic System 1984”,\n" + Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -238,7 +238,7 @@ public final strictfp class DefaultGeogr * Tests WKT 2 formatting of a CRS using a prime meridian other than Greenwich. * * <p>This CRS used in this test is equivalent to {@code EPSG:4807} except for axis order, - * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grades.</p> + * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grads.</p> */ @Test @DependsOnMethod("testWKT2") @@ -247,11 +247,11 @@ public final strictfp class DefaultGeogr "GeodeticCRS[“NTF (Paris)”,\n" + " Datum[“Nouvelle Triangulation Francaise”,\n" + // Formatter should replace "ç" by "c". " Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],\n" + - " PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967]],\n" + + " PrimeMeridian[“Paris”, 2.5969213, Unit[“grad”, 0.015707963267948967]],\n" + " CS[ellipsoidal, 2],\n" + " Axis[“Longitude (L)”, east],\n" + // See method javadoc. " Axis[“Latitude (B)”, north],\n" + - " Unit[“grade”, 0.015707963267948967]]", + " Unit[“grad”, 0.015707963267948967]]", HardCodedCRS.NTF); } @@ -259,7 +259,7 @@ public final strictfp class DefaultGeogr * Tests WKT 1 formatting on a CRS using a prime meridian other than Greenwich. * * <p>This CRS used in this test is equivalent to {@code EPSG:4807} except for axis order, - * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grades.</p> + * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grads.</p> */ @Test @DependsOnMethod("testWKT2") @@ -269,7 +269,7 @@ public final strictfp class DefaultGeogr " DATUM[“Nouvelle Triangulation Francaise”,\n" + // Formatter should replace "ç" by "c". " SPHEROID[“NTF”, 6378249.2, 293.4660212936269]],\n" + " PRIMEM[“Paris”, 2.5969213],\n" + - " UNIT[“grade”, 0.015707963267948967],\n" + + " UNIT[“grad”, 0.015707963267948967],\n" + " AXIS[“Longitude”, EAST],\n" + " AXIS[“Latitude”, NORTH]]", HardCodedCRS.NTF); @@ -288,7 +288,7 @@ public final strictfp class DefaultGeogr " DATUM[“Nouvelle Triangulation Francaise”,\n" + // Formatter should replace "ç" by "c". " SPHEROID[“NTF”, 6378249.2, 293.4660212936269]],\n" + " PRIMEM[“Paris”, 2.33722917],\n" + // Would be 2.5969213 in standard-compliant WKT. - " UNIT[“grade”, 0.015707963267948967],\n" + + " UNIT[“grad”, 0.015707963267948967],\n" + " AXIS[“Longitude”, EAST],\n" + " AXIS[“Latitude”, NORTH]]", HardCodedCRS.NTF); Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,9 +16,6 @@ */ package org.apache.sis.referencing.crs; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; -import javax.measure.unit.Unit; import javax.xml.bind.JAXBException; import org.opengis.util.FactoryException; import org.opengis.referencing.crs.ProjectedCRS; @@ -36,6 +33,7 @@ import org.apache.sis.internal.system.Lo import org.apache.sis.io.wkt.Convention; import org.apache.sis.util.ComparisonMode; import org.apache.sis.util.LenientComparable; +import org.apache.sis.measure.Units; // Test dependencies import org.opengis.test.Validators; @@ -55,7 +53,7 @@ import static org.apache.sis.test.Refere * * @author Martin Desruisseaux (Geomatys) * @since 0.6 - * @version 0.7 + * @version 0.8 * @module */ @DependsOn({ @@ -108,8 +106,8 @@ public final strictfp class DefaultProje } /** - * Creates the "NTF (Paris) / Lambert zone II" CRS. The prime meridian is always in grades, - * but the axes can be in degrees or in grades depending if the {@code baseCRS} argument is + * Creates the "NTF (Paris) / Lambert zone II" CRS. The prime meridian is always in grads, + * but the axes can be in degrees or in grads depending if the {@code baseCRS} argument is * {@link HardCodedCRS.NTF_NORMALIZED_AXES} or {@link HardCodedCRS.NTF} respectively. * * @see HardCodedCRS#NTF @@ -118,10 +116,10 @@ public final strictfp class DefaultProje return new GeodeticObjectBuilder() .setConversionMethod("Lambert Conic Conformal (1SP)") .setConversionName("Lambert zone II") - .setParameter("Latitude of natural origin", 52, NonSI.GRADE) - .setParameter("Scale factor at natural origin", 0.99987742, Unit.ONE) - .setParameter("False easting", 600000, SI.METRE) - .setParameter("False northing", 2200000, SI.METRE) + .setParameter("Latitude of natural origin", 52, Units.GRAD) + .setParameter("Scale factor at natural origin", 0.99987742, Units.ONE) + .setParameter("False easting", 600000, Units.METRE) + .setParameter("False northing", 2200000, Units.METRE) .setCodeSpace(Citations.EPSG, Constants.EPSG) .addName("NTF (Paris) / Lambert zone II") .addIdentifier("27572") @@ -133,11 +131,11 @@ public final strictfp class DefaultProje * or something equivalent. */ private static void verifyParameters(final ParameterValueGroup pg) { - assertEquals("Latitude of natural origin", 52, pg.parameter("Latitude of natural origin") .doubleValue(NonSI.GRADE), STRICT); - assertEquals("Longitude of natural origin", 0, pg.parameter("Longitude of natural origin") .doubleValue(NonSI.GRADE), STRICT); + assertEquals("Latitude of natural origin", 52, pg.parameter("Latitude of natural origin") .doubleValue(Units.GRAD), STRICT); + assertEquals("Longitude of natural origin", 0, pg.parameter("Longitude of natural origin") .doubleValue(Units.GRAD), STRICT); assertEquals("Scale factor at natural origin", 0.99987742, pg.parameter("Scale factor at natural origin").doubleValue(), STRICT); - assertEquals("False easting", 600000, pg.parameter("False easting") .doubleValue(SI.METRE), STRICT); - assertEquals("False northing", 2200000, pg.parameter("False northing") .doubleValue(SI.METRE), STRICT); + assertEquals("False easting", 600000, pg.parameter("False easting") .doubleValue(Units.METRE), STRICT); + assertEquals("False northing", 2200000, pg.parameter("False northing") .doubleValue(Units.METRE), STRICT); } /** @@ -155,7 +153,7 @@ public final strictfp class DefaultProje " DATUM[“Nouvelle Triangulation Francaise”,\n" + " SPHEROID[“NTF”, 6378249.2, 293.4660212936269]],\n" + " PRIMEM[“Paris”, 2.5969213],\n" + - " UNIT[“grade”, 0.015707963267948967],\n" + + " UNIT[“grad”, 0.015707963267948967],\n" + " AXIS[“Longitude”, EAST],\n" + " AXIS[“Latitude”, NORTH]],\n" + " PROJECTION[“Lambert_Conformal_Conic_1SP”, AUTHORITY[“EPSG”, “9801”]],\n" + @@ -186,7 +184,7 @@ public final strictfp class DefaultProje " DATUM[“Nouvelle Triangulation Francaise”,\n" + " SPHEROID[“NTF”, 6378249.2, 293.4660212936269]],\n" + " PRIMEM[“Paris”, 2.33722917],\n" + // Note the conversion from 2.5969213 grads. - " UNIT[“grade”, 0.015707963267948967],\n" + + " UNIT[“grad”, 0.015707963267948967],\n" + " AXIS[“Longitude”, EAST],\n" + " AXIS[“Latitude”, NORTH]],\n" + " PROJECTION[“Lambert_Conformal_Conic_1SP”, AUTHORITY[“EPSG”, “9801”]],\n" + @@ -257,7 +255,7 @@ public final strictfp class DefaultProje " CS[ellipsoidal, 2],\n" + " Axis[“Longitude (λ)”, east],\n" + " Axis[“Latitude (φ)”, north],\n" + - " Unit[“grade”, 0.015707963267948967, Id[“EPSG”, 9105]]],\n" + + " Unit[“grad”, 0.015707963267948967, Id[“EPSG”, 9105]]],\n" + " Conversion[“Lambert zone II”,\n" + " Method[“Lambert Conic Conformal (1SP)”, Id[“EPSG”, 9801], Id[“GeoTIFF”, 9]],\n" + " Parameter[“Latitude of natural origin”, 52.0, Id[“EPSG”, 8801]],\n" + @@ -288,7 +286,7 @@ public final strictfp class DefaultProje " Datum[“Nouvelle Triangulation Francaise”,\n" + " Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],\n" + " PrimeMeridian[“Paris”, 2.5969213],\n" + - " Unit[“grade”, 0.015707963267948967]],\n" + + " Unit[“grad”, 0.015707963267948967]],\n" + " Conversion[“Lambert zone II”,\n" + " Method[“Lambert Conic Conformal (1SP)”],\n" + " Parameter[“Latitude of natural origin”, 52.0],\n" + @@ -312,11 +310,11 @@ public final strictfp class DefaultProje " BaseGeodCRS[“NTF (Paris)”,\n" + " Datum[“Nouvelle Triangulation Francaise”,\n" + " Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],\n" + - " PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967]],\n" + + " PrimeMeridian[“Paris”, 2.5969213, Unit[“grad”, 0.015707963267948967]],\n" + " Unit[“degree”, 0.017453292519943295]],\n" + " Conversion[“Lambert zone II”,\n" + " Method[“Lambert Conic Conformal (1SP)”],\n" + - " Parameter[“Latitude of natural origin”, 52.0, Unit[“grade”, 0.015707963267948967]],\n" + + " Parameter[“Latitude of natural origin”, 52.0, Unit[“grad”, 0.015707963267948967]],\n" + " Parameter[“Longitude of natural origin”, 0.0],\n" + " Parameter[“Scale factor at natural origin”, 0.99987742],\n" + " Parameter[“False easting”, 600000.0],\n" + @@ -344,10 +342,10 @@ public final strictfp class DefaultProje " BASEGEODCRS[“NTF (Paris)”,\n" + " DATUM[“Nouvelle Triangulation Francaise”,\n" + " ELLIPSOID[“NTF”, 6378249.2, 293.4660212936269, LENGTHUNIT[“metre”, 1]]],\n" + - " PRIMEM[“Paris”, 2.5969213, ANGLEUNIT[“grade”, 0.015707963267948967]]],\n" + + " PRIMEM[“Paris”, 2.5969213, ANGLEUNIT[“grad”, 0.015707963267948967]]],\n" + " CONVERSION[“Lambert zone II”,\n" + " METHOD[“Lambert Conic Conformal (1SP)”, ID[“EPSG”, 9801]],\n" + - " PARAMETER[“Latitude of natural origin”, 52.0, ANGLEUNIT[“grade”, 0.015707963267948967], ID[“EPSG”, 8801]],\n" + + " PARAMETER[“Latitude of natural origin”, 52.0, ANGLEUNIT[“grad”, 0.015707963267948967], ID[“EPSG”, 8801]],\n" + " PARAMETER[“Longitude of natural origin”, 0.0, ANGLEUNIT[“degree”, 0.017453292519943295], ID[“EPSG”, 8802]],\n" + " PARAMETER[“Scale factor at natural origin”, 0.99987742, SCALEUNIT[“unity”, 1], ID[“EPSG”, 8805]],\n" + " PARAMETER[“False easting”, 600000.0, LENGTHUNIT[“metre”, 1], ID[“EPSG”, 8806]],\n" + @@ -364,11 +362,11 @@ public final strictfp class DefaultProje " BaseGeodCRS[“NTF (Paris)”,\n" + " Datum[“Nouvelle Triangulation Francaise”,\n" + " Ellipsoid[“NTF”, 6378249.2, 293.4660212936269]],\n" + - " PrimeMeridian[“Paris”, 2.5969213, Unit[“grade”, 0.015707963267948967]],\n" + + " PrimeMeridian[“Paris”, 2.5969213, Unit[“grad”, 0.015707963267948967]],\n" + " Unit[“degree”, 0.017453292519943295]],\n" + " Conversion[“Lambert zone II”,\n" + " Method[“Lambert Conic Conformal (1SP)”],\n" + - " Parameter[“Latitude of natural origin”, 52.0, Unit[“grade”, 0.015707963267948967]],\n" + + " Parameter[“Latitude of natural origin”, 52.0, Unit[“grad”, 0.015707963267948967]],\n" + " Parameter[“Longitude of natural origin”, 0.0],\n" + " Parameter[“Scale factor at natural origin”, 0.99987742],\n" + " Parameter[“False easting”, 600000.0],\n" + @@ -396,8 +394,8 @@ public final strictfp class DefaultProje final ProjectedCRS crs = new GeodeticObjectBuilder() .setConversionMethod("Mercator (variant A)") .setConversionName("Popular Visualisation Pseudo-Mercator") - .setParameter("semi-major", 6378137, SI.METRE) - .setParameter("semi-minor", 6378137, SI.METRE) + .setParameter("semi-major", 6378137, Units.METRE) + .setParameter("semi-minor", 6378137, Units.METRE) .addName("WGS 84 / Pseudo-Mercator") .createProjectedCRS(HardCodedCRS.WGS84, HardCodedCS.PROJECTED); @@ -439,8 +437,8 @@ public final strictfp class DefaultProje final ProjectedCRS crs = new GeodeticObjectBuilder() .setConversionMethod("Equirectangular") .setConversionName("Equidistant Cylindrical (Spherical)") - .setParameter("False easting", 1000, SI.METRE) - .setParameter("False northing", 2000, SI.METRE) + .setParameter("False easting", 1000, Units.METRE) + .setParameter("False northing", 2000, Units.METRE) .addName("Equidistant Cylindrical (Spherical)") .createProjectedCRS(HardCodedCRS.WGS84, HardCodedCS.PROJECTED); Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -79,7 +79,7 @@ public final strictfp class HardCodedCRS * A two-dimensional geographic coordinate reference system using the Paris prime meridian. * This CRS uses (<var>longitude</var>, <var>latitude</var>) ordinates with longitude values * increasing towards the East and latitude values increasing towards the North. - * The angular units for the prime meridian and the axes are grades. + * The angular units for the prime meridian and the axes are grads. * * <p>This CRS is equivalent to {@code EPSG:4807} except for axis order, since EPSG defines * (<var>latitude</var>, <var>longitude</var>).</p> @@ -95,10 +95,10 @@ public final strictfp class HardCodedCRS * This CRS uses (<var>longitude</var>, <var>latitude</var>) ordinates with longitude values * increasing towards the East and latitude values increasing towards the North. * The angular units are decimal degrees except for the prime meridian (Paris), - * which is measured in grades. + * which is measured in grads. * * <p>This CRS is equivalent to {@code EPSG:4807} except for axis order and units of measurement, - * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grades. The main purpose of + * since EPSG defines (<var>latitude</var>, <var>longitude</var>) in grads. The main purpose of * this CRS is to test the convolved case where the unit of prime meridian is different than the * axis units.</p> * Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,9 +16,9 @@ */ package org.apache.sis.referencing.cs; -import javax.measure.unit.SI; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.CoordinateSystemAxis; +import org.apache.sis.measure.Units; import org.apache.sis.util.resources.Vocabulary; import org.apache.sis.test.DependsOnMethod; import org.apache.sis.test.DependsOn; @@ -101,9 +101,9 @@ public final strictfp class AbstractCSTe * if it is not really the purpose of this test. */ final DefaultCoordinateSystemAxis EASTING = new DefaultCoordinateSystemAxis( - singletonMap(NAME_KEY, Vocabulary.format(Vocabulary.Keys.Unnamed)), "E", AxisDirection.EAST, SI.METRE); + singletonMap(NAME_KEY, Vocabulary.format(Vocabulary.Keys.Unnamed)), "E", AxisDirection.EAST, Units.METRE); final DefaultCoordinateSystemAxis HEIGHT = new DefaultCoordinateSystemAxis( - singletonMap(NAME_KEY, "Height"), "h", AxisDirection.UP, SI.METRE); + singletonMap(NAME_KEY, "Height"), "h", AxisDirection.UP, Units.METRE); assertEquals("minimumValue", Double.NEGATIVE_INFINITY, EASTING.getMinimumValue(), STRICT); assertEquals("maximumValue", Double.POSITIVE_INFINITY, EASTING.getMaximumValue(), STRICT); assertNull ("rangeMeaning", EASTING.getRangeMeaning()); Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,10 +16,8 @@ */ package org.apache.sis.referencing.cs; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; -import javax.measure.unit.Unit; -import javax.measure.converter.ConversionException; +import javax.measure.Unit; +import javax.measure.IncommensurableException; import org.opengis.referencing.operation.Matrix; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.CoordinateSystem; @@ -164,10 +162,10 @@ public final strictfp class CoordinateSy * Tests {@link CoordinateSystems#swapAndScaleAxes(CoordinateSystem, CoordinateSystem)} for (λ,φ) ↔ (φ,λ). * This very common conversion is of critical importance to Apache SIS. * - * @throws ConversionException Should not happen. + * @throws IncommensurableException if a conversion between incompatible units was attempted. */ @Test - public void testSwapAndScaleAxes2D() throws ConversionException { + public void testSwapAndScaleAxes2D() throws IncommensurableException { final CoordinateSystem λφ = new DefaultEllipsoidalCS(singletonMap(NAME_KEY, "(λ,φ)"), HardCodedAxes.GEODETIC_LONGITUDE, HardCodedAxes.GEODETIC_LATITUDE); @@ -188,11 +186,11 @@ public final strictfp class CoordinateSy * Tests {@link CoordinateSystems#swapAndScaleAxes(CoordinateSystem, CoordinateSystem)} for (λ,φ,h) ↔ (φ,λ,h). * This very common conversion is of critical importance to Apache SIS. * - * @throws ConversionException Should not happen. + * @throws IncommensurableException if a conversion between incompatible units was attempted. */ @Test @DependsOnMethod("testSwapAndScaleAxes2D") - public void testSwapAndScaleAxes3D() throws ConversionException { + public void testSwapAndScaleAxes3D() throws IncommensurableException { final CoordinateSystem λφh = new DefaultEllipsoidalCS(singletonMap(NAME_KEY, "(λ,φ,h)"), HardCodedAxes.GEODETIC_LONGITUDE, HardCodedAxes.GEODETIC_LATITUDE, @@ -216,11 +214,11 @@ public final strictfp class CoordinateSy * Tests {@link CoordinateSystems#swapAndScaleAxes(CoordinateSystem, CoordinateSystem)} * with a more arbitrary case, which include unit conversions. * - * @throws ConversionException Should not happen. + * @throws IncommensurableException if a conversion between incompatible units was attempted. */ @Test @DependsOnMethod("testSwapAndScaleAxes3D") - public void testSwapAndScaleAxes() throws ConversionException { + public void testSwapAndScaleAxes() throws IncommensurableException { final CoordinateSystem hxy = new DefaultCartesianCS(singletonMap(NAME_KEY, "(h,x,y)"), HardCodedAxes.HEIGHT_cm, HardCodedAxes.EASTING, @@ -247,14 +245,14 @@ public final strictfp class CoordinateSy /** * Tests {@link CoordinateSystems#swapAndScaleAxes(CoordinateSystem, CoordinateSystem)} with a non-square matrix. * - * @throws ConversionException Should not happen. + * @throws IncommensurableException if a conversion between incompatible units was attempted. */ @Test @DependsOnMethod("testSwapAndScaleAxes") - public void testScaleAndSwapAxesNonSquare() throws ConversionException { + public void testScaleAndSwapAxesNonSquare() throws IncommensurableException { final DefaultCartesianCS cs = new DefaultCartesianCS(singletonMap(NAME_KEY, "Test"), - new DefaultCoordinateSystemAxis(getProperties(HardCodedAxes.SOUTHING), "y", AxisDirection.SOUTH, SI.CENTIMETRE), - new DefaultCoordinateSystemAxis(getProperties(HardCodedAxes.EASTING), "x", AxisDirection.EAST, SI.MILLIMETRE)); + new DefaultCoordinateSystemAxis(getProperties(HardCodedAxes.SOUTHING), "y", AxisDirection.SOUTH, Units.CENTIMETRE), + new DefaultCoordinateSystemAxis(getProperties(HardCodedAxes.EASTING), "x", AxisDirection.EAST, Units.MILLIMETRE)); Matrix matrix = swapAndScaleAxes(HardCodedCS.CARTESIAN_2D, cs); assertMatrixEquals("(x,y) → (y,x)", Matrices.create(3, 3, new double[] { @@ -288,7 +286,7 @@ public final strictfp class CoordinateSy @Override public Unit<?> getUnitReplacement(CoordinateSystemAxis axis, Unit<?> unit) { if (Units.isAngular(unit)) { - unit = NonSI.GRADE; + unit = Units.GRAD; } return unit; } Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -18,11 +18,11 @@ package org.apache.sis.referencing.cs; import java.util.Map; import javax.xml.bind.JAXBException; -import javax.measure.unit.SI; import org.opengis.test.Validators; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.CoordinateSystemAxis; import org.apache.sis.referencing.GeodeticObjectVerifier; +import org.apache.sis.measure.Units; import org.apache.sis.test.XMLTestCase; import org.apache.sis.test.DependsOn; import org.apache.sis.test.DependsOnMethod; @@ -39,7 +39,7 @@ import static org.apache.sis.test.Refere * * @author Martin Desruisseaux (IRD, Geomatys) * @since 0.4 - * @version 0.5 + * @version 0.8 * @module */ @DependsOn({ @@ -131,7 +131,7 @@ public final strictfp class DefaultCarte if (c.equals(AxisDirection.EAST)) return HardCodedAxes.EASTING; if (c.equals(AxisDirection.SOUTH)) return HardCodedAxes.SOUTHING; if (c.equals(AxisDirection.WEST)) return HardCodedAxes.WESTING; - return new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, c.name()), "?", c, SI.METRE); + return new DefaultCoordinateSystemAxis(singletonMap(NAME_KEY, c.name()), "?", c, Units.METRE); } /** @@ -218,8 +218,8 @@ public final strictfp class DefaultCarte assertEpsgIdentifierEquals("4400", getSingleton(cs.getIdentifiers())); assertEpsgIdentifierEquals("1", getSingleton(E.getIdentifiers())); assertEpsgIdentifierEquals("2", getSingleton(N.getIdentifiers())); - assertAxisEquals("Easting", "E", AxisDirection.EAST, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null, E); - assertAxisEquals("Northing", "N", AxisDirection.NORTH, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METRE, null, N); + assertAxisEquals("Easting", "E", AxisDirection.EAST, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Units.METRE, null, E); + assertAxisEquals("Northing", "N", AxisDirection.NORTH, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Units.METRE, null, N); /* * Marshal and compare with the original file. */ Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCompoundCSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -45,6 +45,6 @@ public final strictfp class DefaultCompo HardCodedAxes.HEIGHT_cm.getName()), HardCodedAxes.HEIGHT_cm), HardCodedCS.DAYS ); - assertEquals("Compound CS: East (m), North (m), Up (cm), Future (d).", cs.getName().getCode()); + assertEquals("Compound CS: East (m), North (m), Up (cm), Future (day).", cs.getName().getCode()); } } Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -16,11 +16,10 @@ */ package org.apache.sis.referencing.cs; -import javax.measure.unit.SI; -import javax.measure.unit.NonSI; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.RangeMeaning; import org.opengis.test.Validators; +import org.apache.sis.measure.Units; import org.apache.sis.io.wkt.Convention; import org.apache.sis.util.ComparisonMode; import org.apache.sis.test.DependsOnMethod; @@ -39,7 +38,7 @@ import static org.apache.sis.referencing * * @author Martin Desruisseaux (IRD, Geomatys) * @since 0.4 - * @version 0.6 + * @version 0.8 * @module */ @DependsOn({ @@ -92,8 +91,8 @@ public final strictfp class DefaultCoord assertWktEquals("AXIS[“x”, east, LENGTHUNIT[“metre”, 1]]", X); assertWktEquals("AXIS[“y”, north, LENGTHUNIT[“metre”, 1]]", Y); assertWktEquals("AXIS[“z”, up, LENGTHUNIT[“metre”, 1]]", Z); - assertWktEquals("AXIS[“Longitude (λ)”, east, ANGLEUNIT[“grade”, 0.015707963267948967]]", LONGITUDE_gon); - assertWktEquals("AXIS[“Latitude (φ)”, north, ANGLEUNIT[“grade”, 0.015707963267948967]]", LATITUDE_gon); + assertWktEquals("AXIS[“Longitude (λ)”, east, ANGLEUNIT[“grad”, 0.015707963267948967]]", LONGITUDE_gon); + assertWktEquals("AXIS[“Latitude (φ)”, north, ANGLEUNIT[“grad”, 0.015707963267948967]]", LATITUDE_gon); assertWktEquals("AXIS[“Altitude (h)”, up, LENGTHUNIT[“metre”, 1]]", ALTITUDE); assertWktEquals("AXIS[“Time (t)”, future, TIMEUNIT[“day”, 86400]]", TIME); assertWktEquals("AXIS[“Longitude (λ)”, east, ANGLEUNIT[“degree”, 0.017453292519943295]]", GEODETIC_LONGITUDE); @@ -118,7 +117,7 @@ public final strictfp class DefaultCoord public void testMeridianWKT() { assertWktEquals("AXIS[“South along 90°W (x)”, south, MERIDIAN[-90.0, ANGLEUNIT[“degree”, 0.017453292519943295]], LENGTHUNIT[“metre”, 1]]", new DefaultCoordinateSystemAxis(singletonMap(DefaultCoordinateSystemAxis.NAME_KEY, "South along 90°W"), - "x", new DirectionAlongMeridian(AxisDirection.SOUTH, -90).getDirection(), SI.METRE)); + "x", new DirectionAlongMeridian(AxisDirection.SOUTH, -90).getDirection(), Units.METRE)); } /** @@ -146,9 +145,9 @@ public final strictfp class DefaultCoord * (GEODETIC_LONGITUDE, GEODETIC_LATITUDE) except for the name. */ final DefaultCoordinateSystemAxis LONGITUDE = new DefaultCoordinateSystemAxis(getProperties(LONGITUDE_gon), - "λ", AxisDirection.EAST, NonSI.DEGREE_ANGLE); + "λ", AxisDirection.EAST, Units.DEGREE); final DefaultCoordinateSystemAxis LATITUDE = new DefaultCoordinateSystemAxis(getProperties(LATITUDE_gon), - "φ", AxisDirection.NORTH, NonSI.DEGREE_ANGLE); + "φ", AxisDirection.NORTH, Units.DEGREE); /* * Verifies the properties inferred by the constructor. */ Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCylindricalCSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCylindricalCSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCylindricalCSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCylindricalCSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -17,10 +17,10 @@ package org.apache.sis.referencing.cs; import java.util.Collections; -import javax.measure.unit.SI; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.RangeMeaning; import org.apache.sis.internal.metadata.AxisDirections; +import org.apache.sis.measure.Units; import org.apache.sis.test.TestCase; import org.apache.sis.test.DependsOn; import org.junit.Test; @@ -33,7 +33,7 @@ import static org.opengis.test.Assert.*; * * @author Martin Desruisseaux (Geomatys) * @since 0.7 - * @version 0.7 + * @version 0.8 * @module */ @DependsOn(DefaultPolarCSTest.class) @@ -60,7 +60,7 @@ public final strictfp class DefaultCylin @Test public void testChangeAxisOrder() { final DefaultCoordinateSystemAxis radius = HardCodedAxes.create("Radius", "r", - AxisDirection.SOUTH, SI.METRE, 0, Double.POSITIVE_INFINITY, RangeMeaning.EXACT); + AxisDirection.SOUTH, Units.METRE, 0, Double.POSITIVE_INFINITY, RangeMeaning.EXACT); final DefaultCylindricalCS cs = new DefaultCylindricalCS( Collections.singletonMap(DefaultCylindricalCS.NAME_KEY, "Cylindrical"), Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -17,11 +17,11 @@ package org.apache.sis.referencing.cs; import javax.xml.bind.JAXBException; -import javax.measure.unit.NonSI; import org.opengis.test.Validators; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.CoordinateSystemAxis; import org.opengis.referencing.cs.RangeMeaning; +import org.apache.sis.measure.Units; import org.apache.sis.test.XMLTestCase; import org.apache.sis.test.DependsOn; import org.apache.sis.test.DependsOnMethod; @@ -37,7 +37,7 @@ import static org.apache.sis.test.TestUt * * @author Martin Desruisseaux (IRD, Geomatys) * @since 0.4 - * @version 0.4 + * @version 0.8 * @module */ @DependsOn(AbstractCSTest.class) @@ -99,7 +99,7 @@ public final strictfp class DefaultEllip public void testUnitConversion() { final DefaultEllipsoidalCS cs = HardCodedCS.ELLIPSOIDAL_gon; CoordinateSystemAxis axis = cs.getAxis(0); - assertEquals("unit", NonSI.GRADE, axis.getUnit()); + assertEquals("unit", Units.GRAD, axis.getUnit()); assertEquals("longitude.minimumValue", -200, axis.getMinimumValue(), STRICT); assertEquals("longitude.maximumValue", +200, axis.getMaximumValue(), STRICT); @@ -108,7 +108,7 @@ public final strictfp class DefaultEllip Validators.validate(converted); axis = converted.getAxis(0); - assertEquals("unit", NonSI.DEGREE_ANGLE, axis.getUnit()); + assertEquals("unit", Units.DEGREE, axis.getUnit()); assertEquals("longitude.minimumValue", -180, axis.getMinimumValue(), STRICT); assertEquals("longitude.maximumValue", +180, axis.getMaximumValue(), STRICT); } @@ -131,8 +131,8 @@ public final strictfp class DefaultEllip final CoordinateSystemAxis λ = cs.getAxis(1); assertEquals("name", "Latitude (north), Longitude (east)", cs.getName().getCode()); assertEquals("remarks", "Used in two-dimensional GeographicCRS.", cs.getRemarks().toString()); - assertAxisEquals("Geodetic latitude", "φ", AxisDirection.NORTH, -90, +90, NonSI.DEGREE_ANGLE, RangeMeaning.EXACT, φ); - assertAxisEquals("Geodetic longitude", "λ", AxisDirection.EAST, -180, +180, NonSI.DEGREE_ANGLE, RangeMeaning.WRAPAROUND, λ); + assertAxisEquals("Geodetic latitude", "φ", AxisDirection.NORTH, -90, +90, Units.DEGREE, RangeMeaning.EXACT, φ); + assertAxisEquals("Geodetic longitude", "λ", AxisDirection.EAST, -180, +180, Units.DEGREE, RangeMeaning.WRAPAROUND, λ); assertEpsgIdentifierEquals("6422", getSingleton(cs.getIdentifiers())); assertEpsgIdentifierEquals("106", getSingleton(φ.getIdentifiers())); assertEpsgIdentifierEquals("107", getSingleton(λ.getIdentifiers())); Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultPolarCSTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultPolarCSTest.java?rev=1764673&r1=1764672&r2=1764673&view=diff ============================================================================== --- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultPolarCSTest.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultPolarCSTest.java [UTF-8] Thu Oct 13 13:38:49 2016 @@ -17,10 +17,10 @@ package org.apache.sis.referencing.cs; import java.util.Collections; -import javax.measure.unit.SI; import org.opengis.referencing.cs.AxisDirection; import org.opengis.referencing.cs.RangeMeaning; import org.apache.sis.internal.metadata.AxisDirections; +import org.apache.sis.measure.Units; import org.apache.sis.test.TestCase; import org.apache.sis.test.DependsOn; import org.junit.Test; @@ -33,7 +33,7 @@ import static org.opengis.test.Assert.*; * * @author Martin Desruisseaux (Geomatys) * @since 0.7 - * @version 0.7 + * @version 0.8 * @module */ @DependsOn(AbstractCSTest.class) @@ -59,7 +59,7 @@ public final strictfp class DefaultPolar @Test public void testChangeAxisOrder() { final DefaultCoordinateSystemAxis radius = HardCodedAxes.create("Radius", "r", - AxisDirection.SOUTH, SI.METRE, 0, Double.POSITIVE_INFINITY, RangeMeaning.EXACT); + AxisDirection.SOUTH, Units.METRE, 0, Double.POSITIVE_INFINITY, RangeMeaning.EXACT); final DefaultPolarCS cs = new DefaultPolarCS( Collections.singletonMap(DefaultPolarCS.NAME_KEY, "Polar"),