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 2018/02/27 15:48:07 UTC
svn commit: r1825465 [2/2] - in /sis/branches/JDK8: core/sis-metadata/
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/
core/sis-metadata/src/main/java/org/apache/sis/intern...
Copied: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CodeLists.java (from r1825357, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/CodeListFilter.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CodeLists.java?p2=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CodeLists.java&p1=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/CodeListFilter.java&r1=1825357&r2=1825465&rev=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/CodeListFilter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/CodeLists.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -14,22 +14,35 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.util.iso;
+package org.apache.sis.internal.util;
+import java.lang.reflect.Array;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.UndeclaredThrowableException;
import org.opengis.util.CodeList;
+import org.opengis.util.ControlledVocabulary;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.Characters.Filter;
/**
- * The filters used by {@link Types#forCodeName(Class, String, boolean)}.
+ * Implementation of some {@link org.apache.sis.util.iso.Types} methods needed by {@code sis-utility} module.
+ * This class opportunistically implements {@link CodeList.Filter} interface, but this should be considered
+ * an implementation details.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.3
- * @since 0.3
+ * @version 1.0
+ * @since 1.0
* @module
*/
-final class CodeListFilter implements CodeList.Filter {
+public final class CodeLists implements CodeList.Filter {
+ /**
+ * The name of bundle resources for code list titles. The resources should be loaded with
+ * the same class loader than {@code org.opengis.annotation.UML.class.getClassLoader()}.
+ * Keys are {@link CodeList#identifier()}.
+ */
+ public static final String RESOURCES = "org.opengis.metadata.CodeLists";
+
/**
* The name to compare during filtering operation.
*/
@@ -43,7 +56,7 @@ final class CodeListFilter implements Co
/**
* Creates a new filter for the specified code name.
*/
- CodeListFilter(final String codename, final boolean canCreate) {
+ private CodeLists(final String codename, final boolean canCreate) {
this.codename = codename;
this.canCreate = canCreate;
}
@@ -74,7 +87,94 @@ final class CodeListFilter implements Co
* This is defined in a separated method in order to ensure that all code paths
* use the same criterion.
*/
- static boolean accept(final String candidate, final String codename) {
+ private static boolean accept(final String candidate, final String codename) {
return CharSequences.equalsFiltered(candidate, codename, Filter.LETTERS_AND_DIGITS, true);
}
+
+ /**
+ * Returns the code of the given type that matches the given name,
+ * or optionally returns a new one if none match the name.
+ *
+ * @param <T> the compile-time type given as the {@code codeType} parameter.
+ * @param codeType the type of code list.
+ * @param name the name of the code to obtain, or {@code null}.
+ * @param canCreate {@code true} if this method is allowed to create new code.
+ * @return a code matching the given name, or {@code null}.
+ *
+ * @see org.apache.sis.util.iso.Types#forCodeName(Class, String, boolean)
+ */
+ public static <T extends CodeList<T>> T forName(final Class<T> codeType, String name, final boolean canCreate) {
+ name = CharSequences.trimWhitespaces(name);
+ if (name == null || name.isEmpty()) {
+ return null;
+ }
+ return CodeList.valueOf(codeType, new CodeLists(name, canCreate));
+ }
+
+ /**
+ * Returns the enumeration value of the given type that matches the given name, or {@code null} if none.
+ *
+ * @param <T> the compile-time type given as the {@code enumType} parameter.
+ * @param enumType the type of enumeration.
+ * @param name the name of the enumeration value to obtain, or {@code null}.
+ * @return a value matching the given name, or {@code null}.
+ *
+ * @see org.apache.sis.util.iso.Types#forEnumName(Class, String)
+ */
+ public static <T extends Enum<T>> T forName(final Class<T> enumType, String name) {
+ name = CharSequences.trimWhitespaces(name);
+ if (name != null && !name.isEmpty()) try {
+ return Enum.valueOf(enumType, name);
+ } catch (IllegalArgumentException e) {
+ final T[] values = enumType.getEnumConstants();
+ if (values == null) {
+ throw e;
+ }
+ if (values instanceof ControlledVocabulary[]) {
+ for (final ControlledVocabulary code : (ControlledVocabulary[]) values) {
+ for (final String candidate : code.names()) {
+ if (accept(candidate, name)) {
+ return enumType.cast(code);
+ }
+ }
+ }
+ } else {
+ for (final Enum<?> code : values) {
+ if (accept(code.name(), name)) {
+ return enumType.cast(code);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns all known values for the given type of code list or enumeration.
+ *
+ * @param <T> the compile-time type given as the {@code codeType} parameter.
+ * @param codeType the type of code list or enumeration.
+ * @return the list of values for the given code list or enumeration, or an empty array if none.
+ *
+ * @see org.apache.sis.util.iso.Types#getCodeValues(Class)
+ */
+ @SuppressWarnings("unchecked")
+ public static <T extends ControlledVocabulary> T[] values(final Class<T> codeType) {
+ Object values;
+ try {
+ values = codeType.getMethod("values", (Class<?>[]) null).invoke(null, (Object[]) null);
+ } catch (InvocationTargetException e) {
+ final Throwable cause = e.getCause();
+ if (cause instanceof RuntimeException) {
+ throw (RuntimeException) cause;
+ }
+ if (cause instanceof Error) {
+ throw (Error) cause;
+ }
+ throw new UndeclaredThrowableException(cause);
+ } catch (NoSuchMethodException | IllegalAccessException e) {
+ values = Array.newInstance(codeType, 0);
+ }
+ return (T[]) values;
+ }
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -19,10 +19,13 @@ package org.apache.sis.internal.util;
import java.text.Format;
import java.util.Locale;
import java.util.TimeZone;
-import org.opengis.metadata.citation.Citation;
-import org.apache.sis.internal.simple.CitationConstant;
+import java.util.ResourceBundle;
+import java.util.MissingResourceException;
+import org.opengis.annotation.UML;
+import org.opengis.util.ControlledVocabulary;
import org.apache.sis.internal.system.Modules;
import org.apache.sis.internal.system.OptionalDependency;
+import org.apache.sis.util.CharSequences;
/**
@@ -101,28 +104,32 @@ public class MetadataServices extends Op
}
/**
- * Returns the constant defined in the {@link org.apache.sis.metadata.iso.citation.Citations} class for the
- * given name. This is used at {@link org.apache.sis.internal.simple.CitationConstant} deserialization time,
- * for which the two citations of interest are {@code "ISBN"} (International Standard Book Number) and
- * {@code "ISSN"} (International Standard Serial Number) citation.
+ * Returns the title of the given enumeration or code list value.
*
- * @param name the name of one of the citation constants defined in the {@code Citations} class.
- * @return the requested citation, or {@code null} if the {@code sis-metadata} module is not available.
- */
- public CitationConstant getCitationConstant(final String name) {
- return null;
- }
-
- /**
- * Returns the build-in citation for the given primary key, or {@code null} if none.
- * The metadata module will search in a database for information like a descriptive
- * title, abbreviations, identifiers, URL to a web site, <i>etc</i>.
- *
- * @param key the primary key of the desired citation.
- * @return the requested citation, or {@code null} if the {@code sis-metadata} module is not available.
- */
- public Citation createCitation(final String key) {
- return null;
+ * @param code the code for which to get the title.
+ * @param locale desired locale for the title.
+ * @return the title.
+ *
+ * @see org.apache.sis.util.iso.Types#getCodeTitle(ControlledVocabulary)
+ */
+ public String getCodeTitle(final ControlledVocabulary code, final Locale locale) {
+ /*
+ * Following code reproduces the work done by org.apache.sis.util.iso.Types.getCodeList(…)
+ * with less handling of special cases. It is executed only if the sis-metadata module is
+ * not on the classpath, otherwise the sis-metadata implementation will be used.
+ */
+ final UML uml = code.getClass().getAnnotation(UML.class);
+ if (uml != null) try {
+ return ResourceBundle.getBundle(CodeLists.RESOURCES, locale, UML.class.getClassLoader())
+ .getString(uml.identifier() + '.' + code.identifier());
+ } catch (MissingResourceException e) {
+ /*
+ * Ignore. The reason for not finding the resource may because of above code not covering enough cases.
+ * Usually the sis-metadata module will be present on the classpath, in which case this implementation
+ * will not be used. We need just enough code for allowing sis-utility tests to pass.
+ */
+ }
+ return CharSequences.camelCaseToSentence(code.identifier()).toString();
}
/**
@@ -151,8 +158,6 @@ public class MetadataServices extends Op
* @param locale the locale for the new {@code Format}, or {@code null} for {@code Locale.ROOT}.
* @param timezone the timezone, or {@code null} for UTC.
* @return a {@link org.apache.sis.geometry.CoordinateFormat}.
- *
- * @since 0.8
*/
public Format createCoordinateFormat(final Locale locale, final TimeZone timezone) {
throw moduleNotFound();
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/io/IdentifiedObjectFormat.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -24,7 +24,6 @@ import org.opengis.util.GenericName;
import org.opengis.metadata.Identifier;
import org.opengis.referencing.IdentifiedObject;
import org.apache.sis.internal.util.Citations;
-import org.apache.sis.util.iso.DefaultNameSpace;
import org.apache.sis.util.resources.Vocabulary;
@@ -74,7 +73,7 @@ final class IdentifiedObjectFormat exten
cs = Citations.getIdentifier(identifier.getAuthority(), true);
}
if (cs != null) {
- toAppendTo.append(cs).append(DefaultNameSpace.DEFAULT_SEPARATOR);
+ toAppendTo.append(cs).append(Citations.DEFAULT_SEPARATOR);
}
return toAppendTo.append(code);
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -21,8 +21,8 @@ import java.io.Serializable;
import java.util.function.LongConsumer;
import java.util.function.DoubleConsumer;
import org.opengis.util.InternationalString;
+import org.apache.sis.util.iso.SimpleInternationalString;
import org.apache.sis.util.ArgumentChecks;
-import org.apache.sis.util.iso.Types;
import static java.lang.Math.*;
import static java.lang.Double.NaN;
@@ -84,7 +84,7 @@ import static java.lang.Double.doubleToL
* }
*
* @author Martin Desruisseaux (MPO, IRD, Geomatys)
- * @version 0.3
+ * @version 1.0
* @since 0.3
* @module
*/
@@ -160,7 +160,11 @@ public class Statistics implements Doubl
* formatted by {@link StatisticsFormat}.
*/
public Statistics(final CharSequence name) {
- this.name = Types.toInternationalString(name);
+ if (name == null || name instanceof InternationalString) {
+ this.name = (InternationalString) name;
+ } else {
+ this.name = new SimpleInternationalString(name.toString());
+ }
}
/**
@@ -192,8 +196,6 @@ public class Statistics implements Doubl
* <li><i>etc</i>.</li>
* </ul>
*
- *
- *
* @param name the phenomenon for which this object is collecting statistics, or {@code null}
* if none. If non-null, then this name will be shown as column header in the table
* formatted by {@link StatisticsFormat}.
@@ -548,12 +550,12 @@ public class Statistics implements Doubl
public boolean equals(final Object object) {
if (object != null && getClass() == object.getClass()) {
final Statistics cast = (Statistics) object;
- return Objects.equals(name, cast.name)
- && count == cast.count && countNaN == cast.countNaN
+ return count == cast.count && countNaN == cast.countNaN
&& doubleToLongBits(minimum) == doubleToLongBits(cast.minimum)
&& doubleToLongBits(maximum) == doubleToLongBits(cast.maximum)
&& doubleToLongBits(sum) == doubleToLongBits(cast.sum)
- && doubleToLongBits(squareSum) == doubleToLongBits(cast.squareSum);
+ && doubleToLongBits(squareSum) == doubleToLongBits(cast.squareSum)
+ && Objects.equals(name, cast.name);
}
return false;
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -32,6 +32,7 @@ import java.io.IOException;
import javax.measure.Dimension;
import javax.measure.Unit;
import javax.measure.format.ParserException;
+import org.apache.sis.internal.util.Citations;
import org.apache.sis.internal.util.Constants;
import org.apache.sis.internal.util.DefinitionURI;
import org.apache.sis.internal.util.XPaths;
@@ -43,7 +44,6 @@ import org.apache.sis.util.Localized;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.CorruptedObjectException;
import org.apache.sis.util.collection.WeakValueHashMap;
-import org.apache.sis.util.iso.DefaultNameSpace;
/**
@@ -966,7 +966,7 @@ public class UnitFormat extends Format i
failure = e;
}
throw (ParserException) new ParserException(Errors.format(Errors.Keys.UnknownUnit_1,
- Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code),
+ Constants.EPSG + Citations.DEFAULT_SEPARATOR + code),
symbols, start + Math.max(0, uom.lastIndexOf(code))).initCause(failure);
}
/*
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -24,7 +24,7 @@ import java.util.NoSuchElementException;
import java.io.Serializable;
import java.lang.reflect.Modifier;
import org.opengis.util.CodeList;
-import org.apache.sis.util.iso.Types;
+import org.apache.sis.internal.util.CodeLists;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.NullArgumentException;
import org.apache.sis.internal.util.CheckedArrayList;
@@ -138,7 +138,7 @@ public class CodeListSet<E extends CodeL
public CodeListSet(final Class<E> elementType, final boolean fill) throws IllegalArgumentException {
this(elementType);
if (fill) {
- codes = POOL.unique(Types.getCodeValues(elementType));
+ codes = POOL.unique(CodeLists.values(elementType));
int n = codes.length;
if (n < Long.SIZE) {
values = (1L << n) - 1;
@@ -169,7 +169,7 @@ public class CodeListSet<E extends CodeL
final E valueOf(final int ordinal) {
E[] array = codes;
if (array == null || ordinal >= array.length) {
- codes = array = POOL.unique(Types.getCodeValues(elementType));
+ codes = array = POOL.unique(CodeLists.values(elementType));
}
return array[ordinal];
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TableColumn.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -22,9 +22,9 @@ import java.io.Serializable;
import java.io.ObjectStreamException;
import java.io.InvalidObjectException;
import org.opengis.util.InternationalString;
-import org.apache.sis.util.iso.Types;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.resources.Vocabulary;
+import org.apache.sis.util.iso.SimpleInternationalString;
/**
@@ -92,7 +92,7 @@ import org.apache.sis.util.resources.Voc
* The constants defined in this class use a similar approach for providing serialization support.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 1.0
*
* @param <V> base type of all values in the column identified by this instance.
*
@@ -277,7 +277,11 @@ public class TableColumn<V> implements C
* @return the text to display as column header.
*/
public synchronized InternationalString getHeader() {
- final InternationalString i18n = Types.toInternationalString(header);
+ CharSequence t = header;
+ if (t == null || t instanceof InternationalString) {
+ return (InternationalString) t;
+ }
+ final InternationalString i18n = new SimpleInternationalString(t.toString());
header = i18n;
return i18n;
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeTableFormat.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -41,13 +41,13 @@ import org.apache.sis.io.LineAppender;
import org.apache.sis.io.TableAppender;
import org.apache.sis.io.TabularFormat;
import org.apache.sis.io.CompoundFormat;
-import org.apache.sis.util.iso.Types;
import org.apache.sis.util.Workaround;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.resources.Vocabulary;
import org.apache.sis.internal.util.Acyclic;
+import org.apache.sis.internal.util.MetadataServices;
import org.apache.sis.internal.util.LocalizedParseException;
import static org.apache.sis.util.Characters.NO_BREAK_SPACE;
@@ -680,7 +680,7 @@ public class TreeTableFormat extends Tab
} else if (value instanceof CharSequence) {
text = value.toString();
} else if (value instanceof ControlledVocabulary) {
- text = Types.getCodeTitle((ControlledVocabulary) value).toString(getDisplayLocale());
+ text = MetadataServices.getInstance().getCodeTitle((ControlledVocabulary) value, getDisplayLocale());
} else if (value instanceof Enum<?>) {
text = CharSequences.upperCaseToSentence(((Enum<?>) value).name());
} else if (value instanceof Type) {
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -38,9 +38,9 @@ import org.apache.sis.util.Classes;
import org.apache.sis.util.Localized;
import org.apache.sis.util.Exceptions;
import org.apache.sis.util.CharSequences;
-import org.apache.sis.util.iso.Types;
import org.apache.sis.util.logging.Logging;
import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.util.MetadataServices;
/**
@@ -418,7 +418,7 @@ public class IndexedResourceBundle exten
} else if (element instanceof Class<?>) {
replacement = Classes.getShortName(getPublicType((Class<?>) element));
} else if (element instanceof ControlledVocabulary) {
- replacement = Types.getCodeTitle((ControlledVocabulary) element).toString(getLocale());
+ replacement = MetadataServices.getInstance().getCodeTitle((ControlledVocabulary) element, getLocale());
}
/*
* No need to check for Numbers or Dates instances, since they are
Copied: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationMock.java (from r1825357, sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationMock.java?p2=sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationMock.java&p1=sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java&r1=1825357&r2=1825465&rev=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleCitation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationMock.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -14,13 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.internal.simple;
+package org.apache.sis.internal.util;
import java.util.Date;
-import java.util.Objects;
import java.util.Collection;
import java.util.Collections;
-import java.io.Serializable;
+import java.util.List;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.citation.CitationDate;
@@ -36,91 +35,66 @@ import org.apache.sis.util.Debug;
/**
* A trivial implementation of {@link Citation} containing only a title.
- *
- * <div class="note"><b>Design note:</b>
- * we do not put more field than {@link #title} in this {@code SimpleCitation} in order to keep it simple,
- * because the title is the only "universal" property (the need for all other fields will be determined in
- * subclasses on a case-by-case basis) and because {@code SimpleCitation} are sometime only proxy identified
- * by the {@link #title}.</div>
+ * Opportunistically implements also the identifier interface.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.3
- * @since 0.3
+ * @version 1.0
+ * @since 1.0
* @module
*/
-public class SimpleCitation implements Citation, Serializable {
- /**
- * For cross-version compatibility.
- */
- private static final long serialVersionUID = 4818846034764528263L;
-
+@SuppressWarnings("ReturnOfCollectionOrArrayField")
+final strictfp class CitationMock implements Citation, Identifier {
/**
* The title to be returned by {@link #getTitle()}.
*/
- public final String title;
-
- /**
- * Creates a new object for the given title.
- *
- * @param title the title to be returned by {@link #getTitle()}.
- */
- public SimpleCitation(final String title) {
- this.title = title;
- }
+ private final String title;
/**
- * Returns the title as an international string.
- *
- * @return the title given at construction time.
+ * Alphanumeric value identifying an instance in the namespace.
*/
- @Override
- public InternationalString getTitle() {
- return new SimpleInternationalString(title);
- }
+ private final String codeSpace, code;
/**
- * Methods inherited from the {@link Citation} interface which are not of interest to this
- * {@code SimpleCitation} implementation. Those methods may be removed in the JDK8 branch.
- *
- * @return an empty list.
+ * The identifiers, built from the given code and code space by default.
*/
- @Override public Collection<? extends InternationalString> getAlternateTitles() {return Collections.emptyList();}
- @Override public Collection<? extends CitationDate> getDates() {return Collections.emptyList();}
- @Override public InternationalString getEdition() {return null;}
- @Override public Date getEditionDate() {return null;}
- @Override public Collection<? extends Identifier> getIdentifiers() {return Collections.emptyList();}
- @Override public Collection<? extends Responsibility> getCitedResponsibleParties() {return Collections.emptyList();}
- @Override public Collection<PresentationForm> getPresentationForms() {return Collections.emptyList();}
- @Override public Series getSeries() {return null;}
- @Override public Collection<? extends InternationalString> getOtherCitationDetails() {return Collections.emptyList();}
- @Override public Collection<? extends OnlineResource> getOnlineResources() {return Collections.emptyList();}
- @Override public Collection<? extends BrowseGraphic> getGraphics() {return Collections.emptyList();}
- @Override public String getISBN() {return null;}
- @Override public String getISSN() {return null;}
- @Deprecated
- @Override public InternationalString getCollectiveTitle() {return null;}
+ List<Identifier> identifiers;
/**
- * Compares the given object with this citation for equality.
+ * Creates a new object for the given title.
*
- * @param obj the object to compare with this citation.
- * @return {@code true} if both objects are equal.
- */
- @Override
- public boolean equals(final Object obj) {
- if (obj != null && obj.getClass() == getClass()) {
- return Objects.equals(title, ((SimpleCitation) obj).title);
- }
- return false;
+ * @param title the title to be returned by {@link #getTitle()}.
+ * @param code alphanumeric value identifying an instance in the namespace.
+ * @param codeSpace space in which the code is valid.
+ */
+ @SuppressWarnings("ThisEscapedInObjectConstruction")
+ public CitationMock(final String title, final String codeSpace, final String code) {
+ this.title = title;
+ this.codeSpace = codeSpace;
+ this.code = code;
+ identifiers = (code != null) ? Collections.singletonList(this) : Collections.emptyList();
}
- /**
- * Returns a hash code value for this citation.
- */
- @Override
- public int hashCode() {
- return Objects.hashCode(title) ^ (int) serialVersionUID;
- }
+ @Override public Citation getAuthority() {return this;}
+ @Override public InternationalString getTitle() {return new SimpleInternationalString(title);}
+ @Override public Collection<InternationalString> getAlternateTitles() {return Collections.emptyList();}
+ @Override public Collection<CitationDate> getDates() {return Collections.emptyList();}
+ @Override public InternationalString getEdition() {return null;}
+ @Override public Date getEditionDate() {return null;}
+ @Override public Collection<Identifier> getIdentifiers() {return identifiers;}
+ @Override public String getCode() {return code;}
+ @Override public String getCodeSpace() {return codeSpace;}
+ @Override public String getVersion() {return null;}
+ @Override public InternationalString getDescription() {return null;}
+ @Override public Collection<Responsibility> getCitedResponsibleParties() {return Collections.emptyList();}
+ @Override public Collection<PresentationForm> getPresentationForms() {return Collections.emptyList();}
+ @Override public Series getSeries() {return null;}
+ @Override public Collection<InternationalString> getOtherCitationDetails() {return Collections.emptyList();}
+ @Override public Collection<OnlineResource> getOnlineResources() {return Collections.emptyList();}
+ @Override public Collection<BrowseGraphic> getGraphics() {return Collections.emptyList();}
+ @Override public String getISBN() {return null;}
+ @Override public String getISSN() {return null;}
+ @Deprecated
+ @Override public InternationalString getCollectiveTitle() {return null;}
/**
* Returns a string representation of this citation for debugging purpose.
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -21,8 +21,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
-import org.apache.sis.internal.simple.SimpleCitation;
-import org.apache.sis.internal.simple.SimpleIdentifier;
import org.apache.sis.test.TestCase;
import org.junit.Test;
@@ -41,25 +39,17 @@ public final strictfp class CitationsTes
/**
* Creates a citation with the given title and the given identifiers.
*/
- @SuppressWarnings("serial")
- private static SimpleCitation citation(final String title, final Identifier... identifiers) {
- return new SimpleCitation(title) {
- @Override public List<Identifier> getIdentifiers() {
- return Arrays.asList(identifiers);
- }
- };
+ private static CitationMock citation(final String title, final Identifier... identifiers) {
+ CitationMock cit = new CitationMock(title, null, null);
+ cit.identifiers = Arrays.asList(identifiers);
+ return cit;
}
/**
* Creates an identifier with a code space.
*/
- @SuppressWarnings("serial")
private static Identifier identifier(final String codeSpace, final String code) {
- return new SimpleIdentifier(null, code, false) {
- @Override public String getCodeSpace() {
- return codeSpace;
- }
- };
+ return new CitationMock(null, codeSpace, code);
}
/**
@@ -97,11 +87,11 @@ public final strictfp class CitationsTes
*/
@Test
public void testGetIdentifier() {
- SimpleCitation citation = new SimpleCitation(" Not an identifier ");
+ CitationMock citation = new CitationMock(" Not an identifier ", null, null);
assertEquals("Not an identifier", Citations.getIdentifier(citation, false));
assertNull(Citations.getIdentifier(citation, true));
- citation = new SimpleCitation(" ValidIdentifier ");
+ citation = new CitationMock(" ValidIdentifier ", null, null);
assertEquals("ValidIdentifier", Citations.getIdentifier(citation, false));
assertEquals("ValidIdentifier", Citations.getIdentifier(citation, true));
/*
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/LocalizedParseExceptionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/LocalizedParseExceptionTest.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/LocalizedParseExceptionTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/internal/util/LocalizedParseExceptionTest.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -22,7 +22,6 @@ import java.text.ParsePosition;
import org.apache.sis.measure.Angle;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.Exceptions;
-import org.apache.sis.test.DependsOn;
import org.apache.sis.test.TestCase;
import org.junit.Test;
@@ -37,7 +36,6 @@ import static org.junit.Assert.*;
* @since 0.3
* @module
*/
-@DependsOn(org.apache.sis.util.resources.IndexedResourceBundleTest.class)
public final strictfp class LocalizedParseExceptionTest extends TestCase {
/**
* Tests the {@link LocalizedParseException} constructor using the default string.
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -34,8 +34,6 @@ import java.io.ObjectOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.swing.tree.TreeNode;
-import javax.xml.parsers.ParserConfigurationException;
-import org.xml.sax.SAXException;
import org.apache.sis.util.Utilities;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.ComparisonMode;
@@ -48,7 +46,7 @@ import org.apache.sis.util.Classes;
*
* @author Martin Desruisseaux (Geomatys)
* @author Alexis Manin (Geomatys)
- * @version 0.8
+ * @version 1.0
* @since 0.3
* @module
*/
@@ -354,102 +352,6 @@ public strictfp class Assert extends org
}
/**
- * Parses two XML trees as DOM documents, and compares the nodes.
- * The inputs given to this method can be any of the following types:
- *
- * <ul>
- * <li>{@link org.w3c.dom.Node}: used directly without further processing.</li>
- * <li>{@link java.io.File}, {@link java.net.URL} or {@link java.net.URI}: the
- * stream is opened and parsed as a XML document.</li>
- * <li>{@link String}: The string content is parsed directly as a XML document.</li>
- * </ul>
- *
- * The comparison will ignore comments and the optional attributes given in arguments.
- *
- * <div class="section">Ignored attributes substitution</div>
- * For convenience, this method replaces some well known prefixes in the {@code ignoredAttributes}
- * array by their full namespace URLs. For example this method replaces{@code "xsi:schemaLocation"}
- * by {@code "http://www.w3.org/2001/XMLSchema-instance:schemaLocation"}.
- * If such substitution is not desired, consider using {@link XMLComparator} directly instead.
- *
- * <p>The current substitution map is as below (may be expanded in any future SIS version):</p>
- *
- * <table class="sis">
- * <caption>Predefined prefix mapping</caption>
- * <tr><th>Prefix</th> <th>URL</th></tr>
- * <tr><td>xmlns</td> <td>{@code "http://www.w3.org/2000/xmlns"}</td></tr>
- * <tr><td>xlink</td> <td>{@value org.apache.sis.xml.Namespaces#XLINK}</td></tr>
- * <tr><td>xsi</td> <td>{@value org.apache.sis.xml.Namespaces#XSI}</td></tr>
- * <tr><td>gml</td> <td>{@value org.apache.sis.xml.Namespaces#GML}</td></tr>
- * <tr><td>gmd</td> <td>{@value org.apache.sis.xml.Namespaces#GMD}</td></tr>
- * <tr><td>gmx</td> <td>{@value org.apache.sis.xml.Namespaces#GMX}</td></tr>
- * <tr><td>gmi</td> <td>{@value org.apache.sis.xml.Namespaces#GMI}</td></tr>
- * <tr><td>gco</td> <td>{@value org.apache.sis.xml.Namespaces#GCO}</td></tr>
- * </table>
- *
- * <p>For example in order to ignore the namespace, type and schema location declaration,
- * the following strings can be given to the {@code ignoredAttributes} argument:</p>
- *
- * {@preformat text
- * "xmlns:*", "xsi:schemaLocation", "xsi:type"
- * }
- *
- * @param expected the expected XML document.
- * @param actual the XML document to compare.
- * @param ignoredAttributes the fully-qualified names of attributes to ignore
- * (typically {@code "xmlns:*"} and {@code "xsi:schemaLocation"}).
- *
- * @see XMLComparator
- */
- public static void assertXmlEquals(final Object expected, final Object actual, final String... ignoredAttributes) {
- assertXmlEquals(expected, actual, TestCase.STRICT, null, ignoredAttributes);
- }
-
- /**
- * Parses two XML trees as DOM documents, and compares the nodes with the given tolerance
- * threshold for numerical values. The inputs given to this method can be any of the types
- * documented {@linkplain #assertXmlEquals(Object, Object, String[]) above}. This method
- * will ignore comments and the optional attributes given in arguments as documented in the
- * above method.
- *
- * @param expected the expected XML document.
- * @param actual the XML document to compare.
- * @param tolerance the tolerance threshold for comparison of numerical values.
- * @param ignoredNodes the fully-qualified names of the nodes to ignore, or {@code null} if none.
- * @param ignoredAttributes the fully-qualified names of attributes to ignore
- * (typically {@code "xmlns:*"} and {@code "xsi:schemaLocation"}).
- *
- * @see XMLComparator
- */
- public static void assertXmlEquals(final Object expected, final Object actual,
- final double tolerance, final String[] ignoredNodes, final String[] ignoredAttributes)
- {
- final XMLComparator comparator;
- try {
- comparator = new XMLComparator(expected, actual);
- } catch (IOException | ParserConfigurationException | SAXException e) {
- // We don't throw directly those exceptions since failing to parse the XML file can
- // be considered as part of test failures and the JUnit exception for such failures
- // is AssertionError. Having no checked exception in "assert" methods allow us to
- // declare the checked exceptions only for the library code being tested.
- throw new AssertionError(e);
- }
- comparator.tolerance = tolerance;
- comparator.ignoreComments = true;
- if (ignoredNodes != null) {
- for (final String node : ignoredNodes) {
- comparator.ignoredNodes.add(XMLComparator.substitutePrefix(node));
- }
- }
- if (ignoredAttributes != null) {
- for (final String attribute : ignoredAttributes) {
- comparator.ignoredAttributes.add(XMLComparator.substitutePrefix(attribute));
- }
- }
- comparator.compare();
- }
-
- /**
* Serializes the given object in memory, deserializes it and ensures that the deserialized
* object is equals to the original one. This method does not write anything to the disk.
*
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -33,7 +33,6 @@ import org.junit.BeforeClass;
// Following are testing the test tools.
org.apache.sis.internal.test.AssertTest.class,
org.apache.sis.internal.test.TestUtilitiesTest.class,
- org.apache.sis.internal.test.XMLComparatorTest.class,
// Most basic functions of SIS library.
org.apache.sis.internal.system.LoggersTest.class,
@@ -88,19 +87,9 @@ import org.junit.BeforeClass;
org.apache.sis.internal.util.DefinitionURITest.class,
org.apache.sis.internal.util.XPathsTest.class,
org.apache.sis.internal.util.CitationsTest.class,
- org.apache.sis.util.iso.TypesTest.class,
org.apache.sis.util.iso.SimpleInternationalStringTest.class,
org.apache.sis.util.iso.DefaultInternationalStringTest.class,
org.apache.sis.internal.util.LocalizedParseExceptionTest.class,
- org.apache.sis.util.iso.DefaultLocalNameTest.class,
- org.apache.sis.util.iso.DefaultScopedNameTest.class,
- org.apache.sis.util.iso.DefaultNameFactoryTest.class,
- org.apache.sis.util.iso.NamesTest.class,
- org.apache.sis.util.iso.TypeNamesTest.class,
- org.apache.sis.internal.simple.SimpleIdentifierTest.class,
- org.apache.sis.util.iso.DefaultRecordTypeTest.class,
- org.apache.sis.util.iso.DefaultRecordSchemaTest.class,
- org.apache.sis.util.iso.DefaultRecordTest.class,
// Measurements and formatting.
org.apache.sis.measure.SexagesimalConverterTest.class,
@@ -140,27 +129,7 @@ import org.junit.BeforeClass;
org.apache.sis.internal.converter.ArrayConverterTest.class,
org.apache.sis.internal.converter.ConverterRegistryTest.class,
org.apache.sis.internal.converter.SystemRegistryTest.class,
- org.apache.sis.internal.converter.NumberConverterTest.class, // Shall be after SystemRegistryTest.
-
- // XML most basic types.
- org.apache.sis.xml.NamespacesTest.class,
- org.apache.sis.xml.XLinkTest.class,
- org.apache.sis.xml.NilReasonTest.class,
- org.apache.sis.xml.LegacyCodesTest.class,
- org.apache.sis.xml.ValueConverterTest.class,
- org.apache.sis.xml.OGCNamespacePrefixMapperTest.class,
- org.apache.sis.xml.MarshallerPoolTest.class,
- org.apache.sis.xml.TransformingNamespacesTest.class,
- org.apache.sis.internal.jaxb.XmlUtilitiesTest.class,
- org.apache.sis.internal.jaxb.IdentifierMapAdapterTest.class,
- org.apache.sis.internal.jaxb.ModifiableIdentifierMapTest.class,
- org.apache.sis.internal.jaxb.gco.StringAdapterTest.class,
- org.apache.sis.internal.jaxb.gco.PropertyTypeTest.class,
- org.apache.sis.internal.jaxb.gmd.EnumAdapterTest.class,
- org.apache.sis.internal.jaxb.gmd.LanguageCodeTest.class,
- org.apache.sis.internal.jaxb.gml.TimePeriodTest.class,
- org.apache.sis.internal.jaxb.gml.MeasureTest.class,
- org.apache.sis.util.iso.NameMarshallingTest.class
+ org.apache.sis.internal.converter.NumberConverterTest.class // Shall be after SystemRegistryTest.
})
public final strictfp class UtilityTestSuite extends TestSuite {
/**
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/VersionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/VersionTest.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/VersionTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/VersionTest.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -16,7 +16,6 @@
*/
package org.apache.sis.util;
-import org.apache.sis.internal.jaxb.LegacyNamespaces;
import org.apache.sis.test.DependsOnMethod;
import org.apache.sis.test.TestCase;
import org.junit.Test;
@@ -76,14 +75,18 @@ public final strictfp class VersionTest
*/
@Test
public void testGML() {
- assertTrue(LegacyNamespaces.VERSION_3_2.compareTo(LegacyNamespaces.VERSION_3_2_1, 2) == 0);
- assertTrue(LegacyNamespaces.VERSION_3_2.compareTo(LegacyNamespaces.VERSION_3_2_1 ) < 0);
- assertTrue(LegacyNamespaces.VERSION_3_0.compareTo(LegacyNamespaces.VERSION_3_2_1 ) < 0);
- assertTrue(LegacyNamespaces.VERSION_3_0.compareTo(LegacyNamespaces.VERSION_3_2_1, 2) < 0);
- assertTrue(LegacyNamespaces.VERSION_3_0.compareTo(LegacyNamespaces.VERSION_3_2_1, 1) == 0);
- assertTrue(LegacyNamespaces.VERSION_3_0.compareTo(LegacyNamespaces.VERSION_3_2 ) < 0);
- assertTrue(LegacyNamespaces.VERSION_3_0.compareTo(LegacyNamespaces.VERSION_3_2, 2) < 0);
- assertTrue(LegacyNamespaces.VERSION_3_0.compareTo(LegacyNamespaces.VERSION_3_2, 1) == 0);
+ final Version V3_0 = new Version("3.0"),
+ V3_2 = new Version("3.2"),
+ V3_2_1 = new Version("3.2.1");
+
+ assertTrue(V3_2.compareTo(V3_2_1, 2) == 0);
+ assertTrue(V3_2.compareTo(V3_2_1 ) < 0);
+ assertTrue(V3_0.compareTo(V3_2_1 ) < 0);
+ assertTrue(V3_0.compareTo(V3_2_1, 2) < 0);
+ assertTrue(V3_0.compareTo(V3_2_1, 1) == 0);
+ assertTrue(V3_0.compareTo(V3_2 ) < 0);
+ assertTrue(V3_0.compareTo(V3_2, 2) < 0);
+ assertTrue(V3_0.compareTo(V3_2, 1) == 0);
}
/**
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/CodeListSetTest.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -26,7 +26,6 @@ import org.opengis.referencing.cs.AxisDi
import org.opengis.metadata.citation.OnLineFunction;
import org.apache.sis.test.TestCase;
import org.apache.sis.test.DependsOnMethod;
-import org.apache.sis.util.iso.LargeCodeList;
import org.junit.Test;
import static org.junit.Assert.*;
Copied: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/LargeCodeList.java (from r1825357, sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/LargeCodeList.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/LargeCodeList.java?p2=sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/LargeCodeList.java&p1=sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/LargeCodeList.java&r1=1825357&r2=1825465&rev=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/LargeCodeList.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/collection/LargeCodeList.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sis.util.iso;
+package org.apache.sis.util.collection;
import java.util.List;
import java.util.ArrayList;
Modified: sis/branches/JDK8/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/build.xml?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK8/ide-project/NetBeans/build.xml Tue Feb 27 15:48:05 2018
@@ -69,10 +69,10 @@
<!-- Other resources (properties files, SQL scripts, native libraries). -->
<fileset dir="${project.root}/core/sis-utility/src/main/resources">
<include name="**/*.properties"/>
- <include name="**/*.lst"/>
</fileset>
<fileset dir="${project.root}/core/sis-metadata/src/main/resources">
<include name="**/*.sql"/>
+ <include name="**/*.lst"/>
</fileset>
<fileset dir="${project.root}/core/sis-referencing/src/main/resources">
<include name="**/*.sql"/>
Modified: sis/branches/JDK8/storage/sis-xmlstore/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/pom.xml?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/pom.xml (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/pom.xml Tue Feb 27 15:48:05 2018
@@ -117,6 +117,15 @@ Read and write files in the GPX format.
<artifactId>esri-geometry-api</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.apache.sis.core</groupId>
+ <artifactId>sis-metadata</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java?rev=1825465&r1=1825464&r2=1825465&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java [UTF-8] Tue Feb 27 15:48:05 2018
@@ -36,7 +36,7 @@ import org.junit.BeforeClass;
import org.junit.AfterClass;
import org.junit.Test;
-import static org.apache.sis.test.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
// Branch-dependent imports
import org.opengis.feature.Feature;