You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2014/03/17 00:20:40 UTC
svn commit: r1578178 [2/2] - in /sis/branches/JDK6: ./
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-metadata/src/main/java/org/apache/sis/io/wkt/
core/sis-referencing/src/main/java/org/apache/sis/parameter/
core/sis-referencing/src/m...
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] Sun Mar 16 23:20:39 2014
@@ -63,11 +63,11 @@ public final strictfp class ParameterFor
ParameterBuilder builder = new ParameterBuilder();
builder.setCodeSpace(OGP, "EPSG").setRequired(true);
ParameterDescriptor<?>[] parameters = {
- builder.addName("Latitude of natural origin") .addName(OGC, "latitude_of_origin").createBounded( -80, +84, 40, NonSI.DEGREE_ANGLE),
- builder.addName("Longitude of natural origin") .addName(OGC, "central_meridian") .createBounded(-180, +180, -60, NonSI.DEGREE_ANGLE),
- builder.addName("Scale factor at natural origin").addName(OGC, "scale_factor") .createStrictlyPositive(1, Unit.ONE),
- builder.addName("False easting") .addName(OGC, "FalseEasting") .create( 5000, SI.METRE),
- builder.addName("False northing") .addName(OGC, "FalseNorthing") .create(10000, SI.METRE)
+ builder.addName("Latitude of natural origin") .addName(OGC, "latitude_of_origin").createBounded( -80, +84, 40, NonSI.DEGREE_ANGLE),
+ builder.addName("Longitude of natural origin") .addName(OGC, "central_meridian") .createBounded(-180, +180, -60, NonSI.DEGREE_ANGLE),
+ builder.addName("Scale factor at natural origin") .addName(OGC, "scale_factor") .createStrictlyPositive(1, Unit.ONE),
+ builder.addName("False easting").setRequired(false).addName(OGC, "false_easting") .create( 5000, SI.METRE),
+ builder.addName("False northing") .addName(OGC, "false_northing") .create(10000, SI.METRE)
};
builder.addIdentifier("9804")
.addName("Mercator (variant A)")
@@ -86,55 +86,76 @@ public final strictfp class ParameterFor
/**
* Creates parameter values with some arbitrary values different than the default values.
+ * This method intentionally leaves {@code "central_meridian"} (a mandatory parameter) and
+ * {@code "false_easting"} (an optional parameter) undefined, in order to test whether the
+ * formatter fallback on default values.
*/
private static ParameterValueGroup createParameterValues() {
final ParameterValueGroup group = descriptor.createValue();
group.parameter("latitude_of_origin").setValue(20);
- group.parameter("central_meridian").setValue(-70);
group.parameter("scale_factor").setValue(0.997);
- group.parameter("FalseNorthing").setValue(20, SI.KILOMETRE);
+ group.parameter("false_northing").setValue(20, SI.KILOMETRE);
return group;
}
/**
- * Tests {@link ParameterFormat#format(Object, Appendable)} with {@code ContentLevel.BRIEF}.
+ * Tests {@link ParameterFormat#format(Object, Appendable)} for descriptors with {@code ContentLevel.BRIEF}.
+ * All parameter shall unconditionally be shown, even if optional. The table contains a column saying whether
+ * the parameter is mandatory or optional.
*/
@Test
- public void testFormatBrief() {
+ public void testFormatBriefDescriptors() {
final ParameterFormat format = new ParameterFormat(null, null);
format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
- String text = format.format(descriptor);
+ final String text = format.format(descriptor);
assertMultilinesEquals(
"EPSG: Mercator (variant A)\n" +
- "┌────────────────────────────────┬────────┬───────────────┬───────────────┐\n" +
- "│ Name (EPSG) │ Type │ Value domain │ Default value │\n" +
- "├────────────────────────────────┼────────┼───────────────┼───────────────┤\n" +
- "│ Latitude of natural origin │ Double │ [-80 … 84]° │ 40.0° │\n" +
- "│ Longitude of natural origin │ Double │ [-180 … 180]° │ -60.0° │\n" +
- "│ Scale factor at natural origin │ Double │ (0 … ∞) │ 1.0 │\n" +
- "│ False easting │ Double │ (-∞ … ∞) m │ 5000.0 m │\n" +
- "│ False northing │ Double │ (-∞ … ∞) m │ 10000.0 m │\n" +
- "└────────────────────────────────┴────────┴───────────────┴───────────────┘\n", text);
+ "┌────────────────────────────────┬────────┬────────────┬───────────────┬───────────────┐\n" +
+ "│ Name (EPSG) │ Type │ Obligation │ Value domain │ Default value │\n" +
+ "├────────────────────────────────┼────────┼────────────┼───────────────┼───────────────┤\n" +
+ "│ Latitude of natural origin │ Double │ Mandatory │ [-80 … 84]° │ 40.0° │\n" +
+ "│ Longitude of natural origin │ Double │ Mandatory │ [-180 … 180]° │ -60.0° │\n" +
+ "│ Scale factor at natural origin │ Double │ Mandatory │ (0 … ∞) │ 1.0 │\n" +
+ "│ False easting │ Double │ Optional │ (-∞ … ∞) m │ 5000.0 m │\n" +
+ "│ False northing │ Double │ Optional │ (-∞ … ∞) m │ 10000.0 m │\n" +
+ "└────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘\n", text);
+ }
- text = format.format(createParameterValues());
+ /**
+ * Tests {@link ParameterFormat#format(Object, Appendable)} for values with {@code ContentLevel.BRIEF}.
+ * Expected behavior:
+ *
+ * <ul>
+ * <li>{@code "Longitude of natural origin"} parameter, while not defined, shall be shown with its default
+ * value, because this parameter is defined as mandatory in this test suite.</li>
+ * <li>{@code "False easting"} parameter shall be omitted, because this parameter is defined as
+ * optional in this test suite and its value has not been defined.</li>
+ * <li>The obligation column is omitted, because not very useful in the case of parameter values..</li>
+ * </ul>
+ */
+ @Test
+ @DependsOnMethod("testFormatBriefDescriptors")
+ public void testFormatBriefValues() {
+ final ParameterFormat format = new ParameterFormat(null, null);
+ format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
+ final String text = format.format(createParameterValues());
assertMultilinesEquals(
"EPSG: Mercator (variant A)\n" +
- "┌────────────────────────────────┬────────┬───────────────┬───────────┐\n" +
- "│ Name (EPSG) │ Type │ Value domain │ Value │\n" +
- "├────────────────────────────────┼────────┼───────────────┼───────────┤\n" +
- "│ Latitude of natural origin │ Double │ [-80 … 84]° │ 20.0° │\n" +
- "│ Longitude of natural origin │ Double │ [-180 … 180]° │ -70.0° │\n" +
- "│ Scale factor at natural origin │ Double │ (0 … ∞) │ 0.997 │\n" +
- "│ False easting │ Double │ (-∞ … ∞) m │ 5000.0 m │\n" +
- "│ False northing │ Double │ (-∞ … ∞) m │ 20.0 km │\n" +
- "└────────────────────────────────┴────────┴───────────────┴───────────┘\n", text);
+ "┌────────────────────────────────┬────────┬───────────────┬──────────┐\n" +
+ "│ Name (EPSG) │ Type │ Value domain │ Value │\n" +
+ "├────────────────────────────────┼────────┼───────────────┼──────────┤\n" +
+ "│ Latitude of natural origin │ Double │ [-80 … 84]° │ 20.0° │\n" +
+ "│ Longitude of natural origin │ Double │ [-180 … 180]° │ -60.0° │\n" +
+ "│ Scale factor at natural origin │ Double │ (0 … ∞) │ 0.997 │\n" +
+ "│ False northing │ Double │ (-∞ … ∞) m │ 20.0 km │\n" +
+ "└────────────────────────────────┴────────┴───────────────┴──────────┘\n", text);
}
/**
* Tests formatting in a non-English locale.
*/
@Test
- @DependsOnMethod("testFormatBrief")
+ @DependsOnMethod("testFormatBriefValues")
public void testFormatLocalized() {
final ParameterFormat format = new ParameterFormat(Locale.FRANCE, null);
format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
@@ -145,67 +166,73 @@ public final strictfp class ParameterFor
"│ Nom (EPSG) │ Type │ Domaine des valeurs │ Valeur │\n" +
"├────────────────────────────────┼────────┼─────────────────────┼──────────┤\n" +
"│ Latitude of natural origin │ Double │ [-80 … 84]° │ 20° │\n" +
- "│ Longitude of natural origin │ Double │ [-180 … 180]° │ -70° │\n" +
+ "│ Longitude of natural origin │ Double │ [-180 … 180]° │ -60° │\n" +
"│ Scale factor at natural origin │ Double │ (0 … ∞) │ 0,997 │\n" +
- "│ False easting │ Double │ (-∞ … ∞) m │ 5 000 m │\n" +
"│ False northing │ Double │ (-∞ … ∞) m │ 20 km │\n" +
"└────────────────────────────────┴────────┴─────────────────────┴──────────┘\n", text);
}
/**
- * Tests {@link ParameterFormat#format(Object, Appendable)} with {@code ContentLevel.DETAILED}.
+ * Tests {@link ParameterFormat#format(Object, Appendable)} for descriptors with {@code ContentLevel.DETAILED}.
*/
@Test
- public void testFormatDetailed() {
+ public void testFormatDetailedDescriptors() {
final ParameterFormat format = new ParameterFormat(null, null);
format.setContentLevel(ParameterFormat.ContentLevel.DETAILED);
- String text = format.format(descriptor);
+ final String text = format.format(descriptor);
assertMultilinesEquals(
"EPSG: Mercator (variant A) (9804)\n" +
"EPSG: Mercator (1SP)\n" +
"OGC: Mercator_1SP\n" +
- "╔══════════════════════════════════════╤════════╤═══════════════╤═══════════════╗\n" +
- "║ Name │ Type │ Value domain │ Default value ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
- "║ EPSG: Latitude of natural origin │ Double │ [-80 … 84]° │ 40.0° ║\n" +
- "║ OGC: latitude_of_origin │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
- "║ EPSG: Longitude of natural origin │ Double │ [-180 … 180]° │ -60.0° ║\n" +
- "║ OGC: central_meridian │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
- "║ EPSG: Scale factor at natural origin │ Double │ (0 … ∞) │ 1.0 ║\n" +
- "║ OGC: scale_factor │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
- "║ EPSG: False easting │ Double │ (-∞ … ∞) m │ 5000.0 m ║\n" +
- "║ OGC: FalseEasting │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
- "║ EPSG: False northing │ Double │ (-∞ … ∞) m │ 10000.0 m ║\n" +
- "║ OGC: FalseNorthing │ │ │ ║\n" +
- "╚══════════════════════════════════════╧════════╧═══════════════╧═══════════════╝\n", text);
+ "╔══════════════════════════════════════╤════════╤════════════╤═══════════════╤═══════════════╗\n" +
+ "║ Name │ Type │ Obligation │ Value domain │ Default value ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+ "║ EPSG: Latitude of natural origin │ Double │ Mandatory │ [-80 … 84]° │ 40.0° ║\n" +
+ "║ OGC: latitude_of_origin │ │ │ │ ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+ "║ EPSG: Longitude of natural origin │ Double │ Mandatory │ [-180 … 180]° │ -60.0° ║\n" +
+ "║ OGC: central_meridian │ │ │ │ ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+ "║ EPSG: Scale factor at natural origin │ Double │ Mandatory │ (0 … ∞) │ 1.0 ║\n" +
+ "║ OGC: scale_factor │ │ │ │ ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+ "║ EPSG: False easting │ Double │ Optional │ (-∞ … ∞) m │ 5000.0 m ║\n" +
+ "║ OGC: false_easting │ │ │ │ ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+ "║ EPSG: False northing │ Double │ Optional │ (-∞ … ∞) m │ 10000.0 m ║\n" +
+ "║ OGC: false_northing │ │ │ │ ║\n" +
+ "╚══════════════════════════════════════╧════════╧════════════╧═══════════════╧═══════════════╝\n", text);
+ }
- text = format.format(createParameterValues());
+ /**
+ * Tests {@link ParameterFormat#format(Object, Appendable)} for values with {@code ContentLevel.DETAILED}.
+ * The same comments than {@link #testFormatBriefValues()} apply, except that the column of obligation is
+ * still shown.
+ */
+ @Test
+ public void testFormatDetailedValues() {
+ final ParameterFormat format = new ParameterFormat(null, null);
+ format.setContentLevel(ParameterFormat.ContentLevel.DETAILED);
+ final String text = format.format(createParameterValues());
assertMultilinesEquals(
"EPSG: Mercator (variant A) (9804)\n" +
"EPSG: Mercator (1SP)\n" +
"OGC: Mercator_1SP\n" +
- "╔══════════════════════════════════════╤════════╤═══════════════╤═══════════╗\n" +
- "║ Name │ Type │ Value domain │ Value ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
- "║ EPSG: Latitude of natural origin │ Double │ [-80 … 84]° │ 20.0° ║\n" +
- "║ OGC: latitude_of_origin │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
- "║ EPSG: Longitude of natural origin │ Double │ [-180 … 180]° │ -70.0° ║\n" +
- "║ OGC: central_meridian │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
- "║ EPSG: Scale factor at natural origin │ Double │ (0 … ∞) │ 0.997 ║\n" +
- "║ OGC: scale_factor │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
- "║ EPSG: False easting │ Double │ (-∞ … ∞) m │ 5000.0 m ║\n" +
- "║ OGC: FalseEasting │ │ │ ║\n" +
- "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
- "║ EPSG: False northing │ Double │ (-∞ … ∞) m │ 20.0 km ║\n" +
- "║ OGC: FalseNorthing │ │ │ ║\n" +
- "╚══════════════════════════════════════╧════════╧═══════════════╧═══════════╝\n", text);
+ "╔══════════════════════════════════════╤════════╤════════════╤═══════════════╤══════════╗\n" +
+ "║ Name │ Type │ Obligation │ Value domain │ Value ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+ "║ EPSG: Latitude of natural origin │ Double │ Mandatory │ [-80 … 84]° │ 20.0° ║\n" +
+ "║ OGC: latitude_of_origin │ │ │ │ ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+ "║ EPSG: Longitude of natural origin │ Double │ Mandatory │ [-180 … 180]° │ -60.0° ║\n" +
+ "║ OGC: central_meridian │ │ │ │ ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+ "║ EPSG: Scale factor at natural origin │ Double │ Mandatory │ (0 … ∞) │ 0.997 ║\n" +
+ "║ OGC: scale_factor │ │ │ │ ║\n" +
+ "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+ "║ EPSG: False northing │ Double │ Optional │ (-∞ … ∞) m │ 20.0 km ║\n" +
+ "║ OGC: false_northing │ │ │ │ ║\n" +
+ "╚══════════════════════════════════════╧════════╧════════════╧═══════════════╧══════════╝\n", text);
}
/**
@@ -232,8 +259,8 @@ public final strictfp class ParameterFor
"│ Latitude of natural origin │ latitude_of_origin │\n" +
"│ Longitude of natural origin │ central_meridian │\n" +
"│ Scale factor at natural origin │ scale_factor │\n" +
- "│ False easting │ FalseEasting │\n" +
- "│ False northing │ FalseNorthing │\n" +
+ "│ False easting │ false_easting │\n" +
+ "│ False northing │ false_northing │\n" +
"└────────────────────────────────┴────────────────────┘\n", text);
}
@@ -241,7 +268,7 @@ public final strictfp class ParameterFor
* Tests the effect of {@link ParameterFormat#setPreferredCodespaces(String[])}.
*/
@Test
- @DependsOnMethod({"testFormatNameSummary", "testFormatBrief"})
+ @DependsOnMethod({"testFormatNameSummary", "testFormatBriefValues"})
public void testPreferredCodespaces() {
final ParameterFormat format = new ParameterFormat(null, null);
format.setContentLevel(ParameterFormat.ContentLevel.NAME_SUMMARY);
@@ -270,14 +297,36 @@ public final strictfp class ParameterFor
text = format.format(createParameterValues());
assertMultilinesEquals(
"OGC: Mercator_1SP\n" +
- "┌────────────────────┬────────┬───────────────┬───────────┐\n" +
- "│ Name (OGC) │ Type │ Value domain │ Value │\n" +
- "├────────────────────┼────────┼───────────────┼───────────┤\n" +
- "│ latitude_of_origin │ Double │ [-80 … 84]° │ 20.0° │\n" +
- "│ central_meridian │ Double │ [-180 … 180]° │ -70.0° │\n" +
- "│ scale_factor │ Double │ (0 … ∞) │ 0.997 │\n" +
- "│ FalseEasting │ Double │ (-∞ … ∞) m │ 5000.0 m │\n" +
- "│ FalseNorthing │ Double │ (-∞ … ∞) m │ 20.0 km │\n" +
- "└────────────────────┴────────┴───────────────┴───────────┘\n", text);
+ "┌────────────────────┬────────┬───────────────┬──────────┐\n" +
+ "│ Name (OGC) │ Type │ Value domain │ Value │\n" +
+ "├────────────────────┼────────┼───────────────┼──────────┤\n" +
+ "│ latitude_of_origin │ Double │ [-80 … 84]° │ 20.0° │\n" +
+ "│ central_meridian │ Double │ [-180 … 180]° │ -60.0° │\n" +
+ "│ scale_factor │ Double │ (0 … ∞) │ 0.997 │\n" +
+ "│ false_northing │ Double │ (-∞ … ∞) m │ 20.0 km │\n" +
+ "└────────────────────┴────────┴───────────────┴──────────┘\n", text);
+ }
+
+ /**
+ * Tests the formatting of a parameter value group with an invalid cardinality.
+ * While not allowed by ISO 19111, the Apache SIS implementation shall be robust
+ * to those cases.
+ */
+ @Test
+ @DependsOnMethod("testFormatBriefDescriptors")
+ public void testInvalidCardinality() {
+ final ParameterFormat format = new ParameterFormat(null, null);
+ format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
+ final String text = format.format(DefaultParameterDescriptorGroupTest.M1_M1_O1_O2);
+ assertMultilinesEquals(
+ "Test group\n" +
+ "┌─────────────┬─────────┬────────────┬──────────────┬───────────────┐\n" +
+ "│ Name │ Type │ Obligation │ Value domain │ Default value │\n" +
+ "├─────────────┼─────────┼────────────┼──────────────┼───────────────┤\n" +
+ "│ Mandatory 1 │ Integer │ Mandatory │ │ 10 │\n" +
+ "│ Mandatory 2 │ Integer │ Mandatory │ │ 10 │\n" +
+ "│ Optional 3 │ Integer │ Optional │ │ 10 │\n" +
+ "│ Optional 4 │ Integer │ 0 … 2 │ │ 10 │\n" +
+ "└─────────────┴─────────┴────────────┴──────────────┴───────────────┘\n", text);
}
}
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] Sun Mar 16 23:20:39 2014
@@ -43,8 +43,11 @@ import static org.junit.Assert.*;
* @version 0.4
* @module
*/
-@DependsOn({DefaultParameterDescriptorTest.class, DefaultParameterValueTest.class})
-public final class ParametersTest extends TestCase {
+@DependsOn({
+ DefaultParameterDescriptorTest.class,
+ DefaultParameterValueTest.class
+})
+public final strictfp class ParametersTest extends TestCase {
/**
* Tests the {@link Parameters#cast(ParameterDescriptor, Class)} and
* {@link Parameters#cast(ParameterValue, Class)} methods.
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Sun Mar 16 23:20:39 2014
@@ -58,6 +58,8 @@ import org.junit.BeforeClass;
org.apache.sis.parameter.ParametersTest.class,
org.apache.sis.parameter.ParameterBuilderTest.class,
org.apache.sis.parameter.ParameterFormatTest.class,
+ org.apache.sis.parameter.TensorParametersTest.class,
+ org.apache.sis.parameter.TensorValuesTest.class,
org.apache.sis.referencing.datum.BursaWolfParametersTest.class,
org.apache.sis.referencing.datum.TimeDependentBWPTest.class,
org.apache.sis.referencing.datum.DefaultEllipsoidTest.class,
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java [UTF-8] Sun Mar 16 23:20:39 2014
@@ -199,8 +199,9 @@ public final class Numerics extends Stat
}
/**
- * Returns {@code true} if the given doubles are equals. Positive and negative zero are
- * considered different, while a NaN value is considered equal to all other NaN values.
+ * Returns {@code true} if the given doubles are equal.
+ * Positive and negative zeros are considered different.
+ * NaN values are considered equal to all other NaN values.
*
* @param o1 The first value to compare.
* @param o2 The second value to compare.
@@ -213,6 +214,18 @@ public final class Numerics extends Stat
}
/**
+ * Returns {@code true} if the given doubles are equal, ignoring the sign of zero values.
+ * NaN values are considered equal to all other NaN values.
+ *
+ * @param o1 The first value to compare.
+ * @param o2 The second value to compare.
+ * @return {@code true} if both values are equal.
+ */
+ public static boolean equalsIgnoreZeroSign(final double o1, final double o2) {
+ return (o1 == o2) || Double.doubleToLongBits(o1) == Double.doubleToLongBits(o2);
+ }
+
+ /**
* Returns {@code true} if the given values are approximatively equal,
* up to the {@linkplain #COMPARISON_THRESHOLD comparison threshold}.
*
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Sun Mar 16 23:20:39 2014
@@ -708,6 +708,11 @@ public final class Errors extends Indexe
public static final short UnexpectedFileFormat_2 = 111;
/**
+ * Parameter “{0}” was not expected.
+ */
+ public static final short UnexpectedParameter_1 = 152;
+
+ /**
* Parameter “{0}” has no unit.
*/
public static final short UnitlessParameter_1 = 139;
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Sun Mar 16 23:20:39 2014
@@ -153,6 +153,7 @@ UnexpectedChange_1 = Unex
UnexpectedEndOfFile_1 = Unexpected end of file while reading \u201c{0}\u201d.
UnexpectedEndOfString_1 = More characters were expected at the end of \u201c{0}\u201d.
UnexpectedFileFormat_2 = File \u201c{1}\u201d seems to be encoded in an other format than {0}.
+UnexpectedParameter_1 = Parameter \u201c{0}\u201d was not expected.
UnitlessParameter_1 = Parameter \u201c{0}\u201d has no unit.
UnknownAuthority_1 = Authority \u201c{0}\u201d is unknown.
UnknownAxisDirection_1 = Axis direction \u201c{0}\u201d is unknown.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Sun Mar 16 23:20:39 2014
@@ -142,7 +142,8 @@ UnexpectedChange_1 = Chan
UnexpectedEndOfFile_1 = Fin de fichier inattendue lors de la lecture de \u00ab\u202f{0}\u202f\u00bb.
UnexpectedEndOfString_1 = D\u2019autres caract\u00e8res \u00e9taient attendus \u00e0 la fin du texte \u00ab\u202f{0}\u202f\u00bb.
UnexpectedFileFormat_2 = Le fichier \u00ab\u202f{1}\u202f\u00bb semble \u00eatre encod\u00e9 dans un autre format que {0}.
-UnitlessParameter_1 = Le param\u00e8tre \u201c{0}\u201d n\u2019a pas d\u2019unit\u00e9.
+UnexpectedParameter_1 = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb est inattendu.
+UnitlessParameter_1 = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb n\u2019a pas d\u2019unit\u00e9.
UnknownAuthority_1 = L\u2019autorit\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est pas reconnue.
UnknownAxisDirection_1 = La direction d\u2019axe \u00ab\u202f{0}\u202f\u00bb n\u2019est pas reconnue.
UnknownCommand_1 = La commande \u00ab\u202f{0}\u202f\u00bb n\u2019est pas reconnue.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] Sun Mar 16 23:20:39 2014
@@ -90,6 +90,11 @@ public final class Vocabulary extends In
public static final short BarometricAltitude = 5;
/**
+ * Cardinality
+ */
+ public static final short Cardinality = 76;
+
+ /**
* Character encoding
*/
public static final short CharacterEncoding = 6;
@@ -245,6 +250,11 @@ public final class Vocabulary extends In
public static final short Longitude = 32;
/**
+ * Mandatory
+ */
+ public static final short Mandatory = 77;
+
+ /**
* Maximum value
*/
public static final short MaximumValue = 33;
@@ -280,6 +290,11 @@ public final class Vocabulary extends In
public static final short NumberOfValues = 39;
/**
+ * Obligation
+ */
+ public static final short Obligation = 78;
+
+ /**
* {0} ({1} of {2})
*/
public static final short Of_3 = 40;
@@ -295,6 +310,11 @@ public final class Vocabulary extends In
public static final short OperatingSystem = 42;
/**
+ * Optional
+ */
+ public static final short Optional = 79;
+
+ /**
* Options
*/
public static final short Options = 43;
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] Sun Mar 16 23:20:39 2014
@@ -21,6 +21,7 @@ AngularMinutes = Minutes
AngularSeconds = Seconds
Attributes = Attributes
BarometricAltitude = Barometric altitude
+Cardinality = Cardinality
CharacterEncoding = Character encoding
Classpath = Classpath
Code_1 = {0} code
@@ -52,6 +53,7 @@ LocalConfiguration = Local configur
Locale = Locale
Localization = Localization
Logging = Logging
+Mandatory = Mandatory
MaximumValue = Maximum value
MeanValue = Mean value
MinimumValue = Minimum value
@@ -59,9 +61,11 @@ ModifiedJulian = Modified Julia
Name = Name
NumberOfValues = Number of values
NumberOfNaN = Number of \u2018NaN\u2019
+Obligation = Obligation
Of_3 = {0} ({1} of {2})
Offset = Offset
OperatingSystem = Operating system
+Optional = Optional
Options = Options
Others = Others
OtherSurface = Other surface
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] Sun Mar 16 23:20:39 2014
@@ -21,6 +21,7 @@ AngularMinutes = Minutes
AngularSeconds = Secondes
Attributes = Attributs
BarometricAltitude = Altitude barom\u00e9trique
+Cardinality = Cardinalit\u00e9
CharacterEncoding = Encodage des caract\u00e8res
Classpath = Chemin de classes
Code_1 = Code {0}
@@ -52,6 +53,7 @@ LocalConfiguration = Configuration
Locale = Locale
Localization = R\u00e9gionalisation
Logging = Journalisation
+Mandatory = Requis
MaximumValue = Valeur maximale
MeanValue = Valeur moyenne
MinimumValue = Valeur minimale
@@ -59,9 +61,11 @@ ModifiedJulian = Julien modifi\
Name = Nom
NumberOfValues = Nombre de valeurs
NumberOfNaN = Nombre de \u2018NaN\u2019
+Obligation = Obligation
Of_3 = {0} ({1} de {2})
Offset = D\u00e9calage
OperatingSystem = Syst\u00e8me d'exploitation
+Optional = Optionnel
Options = Options
Others = Autres
OtherSurface = Autre surface
Modified: sis/branches/JDK6/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/pom.xml?rev=1578178&r1=1578177&r2=1578178&view=diff
==============================================================================
--- sis/branches/JDK6/pom.xml (original)
+++ sis/branches/JDK6/pom.xml Sun Mar 16 23:20:39 2014
@@ -443,7 +443,7 @@ Apache SIS is a free software, Java lang
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.16</version> <!-- TODO: Remove after parent pom.xml has upgraded. -->
+ <version>2.17</version> <!-- TODO: Remove after parent pom.xml has upgraded. -->
<configuration>
<includes>
<include>**/*TestSuite.java</include>
@@ -743,7 +743,7 @@ Apache SIS is a free software, Java lang
<!-- Unit tests report -->
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.16</version>
+ <version>2.17</version>
<reportSets> <!-- Workaround for http://jira.codehaus.org/browse/SUREFIRE-257 -->
<reportSet>
<reports>