sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1626344 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/ sis-metadata/src/test/java/org/apache/sis/metadata/ sis-referencing/src/main/j...
Date Fri, 19 Sep 2014 21:44:50 GMT
Author: desruisseaux
Date: Fri Sep 19 21:44:50 2014
New Revision: 1626344

URL: http://svn.apache.org/r1626344
Log:
Port from trunk some changes which were necessary for the merge.
Those changes are mostly for helping the trunk to deal with the changes in GeoAPI,
which are not yet known to the trunk since the later is nailed down on GeoAPI 3.0.0.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -303,7 +303,14 @@ public class MetadataStandard implements
             if (SpecialCases.isSpecialCase(type)) {
                 accessor = new SpecialCases(citation, type, implementation);
             } else {
-                accessor = new PropertyAccessor(citation, type, implementation);
+                /*
+                 * If "multi-value returns" was allowed in the Java language, the 'onlyUML'
boolean would
+                 * be returned by 'findInterface(Class)' method when it falls in the special
case for the
+                 * UML annotation on implementation class. But since we do not have multi-values,
we have
+                 * to infer it from our knownledge of how 'findInterface(Class)' is implemented.
+                 */
+                final boolean onlyUML = (type == implementation && !type.isInterface());
+                accessor = new PropertyAccessor(citation, type, implementation, onlyUML);
             }
             accessors.put(implementation, accessor);
             return accessor;
@@ -325,9 +332,9 @@ public class MetadataStandard implements
                 if (accessors.containsKey(type)) {
                     return true;
                 }
-                final Class<?> standard = findInterface(type);
-                if (standard != null) {
-                    accessors.put(type, standard);
+                final Class<?> standardType = findInterface(type);
+                if (standardType != null) {
+                    accessors.put(type, standardType);
                     return true;
                 }
             }
@@ -336,6 +343,18 @@ public class MetadataStandard implements
     }
 
     /**
+     * Returns {@code true} if the given implementation class, normally rejected by {@link
#findInterface(Class)},
+     * should be accepted as a pseudo-interface. We use this undocumented feature when Apache
SIS experiments a new
+     * API which is not yet published in GeoAPI. This happen for example when upgrading Apache
SIS public API from
+     * the ISO 19115:2003 standard to the ISO 19115:2014 version, but GeoAPI interfaces are
still the old version.
+     * In such case, API that would normally be present in GeoAPI interfaces are temporarily
available only in
+     * Apache SIS implementation classes.
+     */
+    boolean isPendingAPI(final Class<?> type) {
+        return false;
+    }
+
+    /**
      * Returns the metadata interface implemented by the specified implementation.
      * Only one metadata interface can be implemented. If the given type is already
      * an interface from the standard, then it is returned directly.
@@ -343,7 +362,7 @@ public class MetadataStandard implements
      * @param  type The standard interface or the implementation class.
      * @return The single interface, or {@code null} if none where found.
      */
-    private Class<?> findInterface(Class<?> type) {
+    private Class<?> findInterface(final Class<?> type) {
         if (type != null) {
             if (type.isInterface()) {
                 if (type.getName().startsWith(interfacePackage)) {
@@ -355,10 +374,9 @@ public class MetadataStandard implements
                  * including the ones declared in the super-class.
                  */
                 final Set<Class<?>> interfaces = new LinkedHashSet<>();
-                do {
-                    getInterfaces(type, interfaces);
-                    type = type.getSuperclass();
-                } while (type != null);
+                for (Class<?> t=type; t!=null; t=t.getSuperclass()) {
+                    getInterfaces(t, interfaces);
+                }
                 /*
                  * If we found more than one interface, removes the
                  * ones that are sub-interfaces of the other.
@@ -380,6 +398,17 @@ public class MetadataStandard implements
                     }
                     // Found more than one interface; we don't know which one to pick.
                     // Returns 'null' for now; the caller will thrown an exception.
+                } else if (isPendingAPI(type)) {
+                    /*
+                     * Found no interface. According to our method contract we should return
null.
+                     * However we make an exception if the implementation class has a UML
annotation.
+                     * The reason is that when upgrading  API  from ISO 19115:2003 to ISO
19115:2014,
+                     * implementations are provided in Apache SIS before the corresponding
interfaces
+                     * are published on GeoAPI. The reason why GeoAPI is slower to upgrade
is that we
+                     * have to go through a voting process inside the Open Geospatial Consortium
(OGC).
+                     * So we use those implementation classes as a temporary substitute for
the interfaces.
+                     */
+                    return type;
                 }
             }
         }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -255,13 +255,14 @@ class PropertyAccessor {
      * @param  type The interface implemented by the metadata, which must be
      *         the value returned by {@link #getStandardType(Class, String)}.
      * @param  implementation The class of metadata implementations, or {@code type} if none.
+     * @param  onlyUML {@code true} for taking only the getter methods having a {@link UML}
annotation.
      */
-    PropertyAccessor(final Citation standard, final Class<?> type, final Class<?>
implementation) {
+    PropertyAccessor(final Citation standard, final Class<?> type, final Class<?>
implementation, final boolean onlyUML) {
         assert type.isAssignableFrom(implementation) : implementation;
         this.standard       = standard;
         this.type           = type;
         this.implementation = implementation;
-        this.getters        = getGetters(type, implementation);
+        this.getters        = getGetters(type, implementation, onlyUML);
         int allCount = getters.length;
         int standardCount = allCount;
         if (allCount != 0 && getters[allCount-1] == EXTRA_GETTER) {
@@ -417,9 +418,10 @@ class PropertyAccessor {
      *
      * @param  type The metadata interface.
      * @param  implementation The class of metadata implementations.
+     * @param  onlyUML {@code true} for taking only the getter methods having a {@link UML}
annotation.
      * @return The getters declared in the given interface (never {@code null}).
      */
-    private static Method[] getGetters(final Class<?> type, final Class<?> implementation)
{
+    private static Method[] getGetters(final Class<?> type, final Class<?> implementation,
final boolean onlyUML) {
         synchronized (SHARED_GETTERS) {
             Method[] getters = SHARED_GETTERS.get(type);
             if (getters == null) {
@@ -430,7 +432,7 @@ class PropertyAccessor {
                 boolean hasExtraGetter = false;
                 int count = 0;
                 for (final Method candidate : getters) {
-                    if (Classes.isPossibleGetter(candidate)) {
+                    if (Classes.isPossibleGetter(candidate) && (!onlyUML || candidate.isAnnotationPresent(UML.class)))
{
                         final String name = candidate.getName();
                         if (name.startsWith(SET)) { // Paranoiac check.
                             continue;

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyComparator.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -162,13 +162,31 @@ final class PropertyComparator implement
      * If positive, the index returned by this method correspond to a sorting in descending
order.
      */
     private int indexOf(final Method method) {
+        /*
+         * Check the cached value computed by previous call to 'indexOf(…)'.
+         * Example: "getExtents"
+         */
         Integer index = order.get(method);
         if (index == null) {
+            /*
+             * Check the value computed from @XmlType.propOrder() value.
+             * Inferred from the method name, so name is often plural.
+             * Example: "extents"
+             */
             String name = method.getName();
             name = toPropertyName(name, prefix(name).length());
             index = order.get(name);
             if (index == null) {
-                index = -1;
+                /*
+                 * Do not happen, except when we have private methods or deprecated public
methods
+                 * used as bridge between legacy and more recent standards (e.g. ISO 19115:2003
to
+                 * ISO 19115:2014), especially when cardinality changed between the two standards.
+                 * Example: "extent"
+                 */
+                final UML uml = method.getAnnotation(UML.class);
+                if (uml == null || (index = order.get(uml.identifier())) == null) {
+                    index = -1;
+                }
             }
             order.put(method, index);
         }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -49,7 +49,7 @@ final class SpecialCases extends Propert
      * @param  implementation The class of metadata implementations, or {@code type} if none.
      */
     SpecialCases(final Citation standard, final Class<?> type, final Class<?>
implementation) {
-        super(standard, type, implementation);
+        super(standard, type, implementation, false);
         assert isSpecialCase(type) : type;
         westBoundLongitude = indexOf("westBoundLongitude", true);
         eastBoundLongitude = indexOf("eastBoundLongitude", true);

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -18,6 +18,7 @@ package org.apache.sis.metadata;
 
 import java.util.Map;
 import java.util.IdentityHashMap;
+import org.opengis.annotation.UML;
 import org.opengis.annotation.Classifier;
 import org.opengis.annotation.Stereotype;
 import org.apache.sis.util.CharSequences;
@@ -95,6 +96,16 @@ final class StandardImplementation exten
     }
 
     /**
+     * Accepts Apache SIS implementation classes as "pseudo-interfaces" if they are annotated
with {@link UML}.
+     * We use this feature for example in the transition from ISO 19115:2003 to ISO 19115:2014,
when new API is
+     * defined in Apache SIS but not yet available in GeoAPI interfaces.
+     */
+    @Override
+    boolean isPendingAPI(final Class<?> type) {
+        return type.getName().startsWith(implementationPackage) && type.isAnnotationPresent(UML.class);
+    }
+
+    /**
      * Returns the implementation class for the given interface, or {@code null} if none.
      * This class uses heuristic rules based on naming conventions.
      *

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -250,6 +250,17 @@ public class DefaultRepresentativeFracti
         return (int) denominator;
     }
 
+    /**
+     * Returns a string representation of this scale, or {@code NaN} if undefined.
+     * If defined, the string representation uses the colon as in "1:20000".
+     *
+     * @return A string representation of this scale.
+     */
+    @Override
+    public String toString() {
+        return (denominator != 0) ? "1:" + denominator : "NaN";
+    }
+
 
 
 

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -185,7 +185,7 @@ public abstract strictfp class MetadataT
                 final Class<?> impl = getImplementation(type);
                 if (impl != null) {
                     assertTrue(type.isAssignableFrom(impl));
-                    testPropertyValues(new PropertyAccessor(standard.getCitation(), type,
impl));
+                    testPropertyValues(new PropertyAccessor(standard.getCitation(), type,
impl, false));
                 }
             }
         }

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -92,7 +92,7 @@ public final strictfp class PropertyAcce
      * Creates a new property accessor for the {@link DefaultCitation} class.
      */
     private static PropertyAccessor createPropertyAccessor() {
-        return new PropertyAccessor(HardCodedCitations.ISO_19115, Citation.class, DefaultCitation.class);
+        return new PropertyAccessor(HardCodedCitations.ISO_19115, Citation.class, DefaultCitation.class,
false);
     }
 
     /**
@@ -125,11 +125,11 @@ public final strictfp class PropertyAcce
             final String   propertyName  = (String)   expected[i++];
             final String   umlIdentifier = (String)   expected[i++];
             final String   sentence      = (String)   expected[i++];
-            assertEquals("declaringType", declaringType, accessor.type(index, TypeValuePolicy.DECLARING_INTERFACE));
             assertEquals("methodName",    methodName,    accessor.name(index, KeyNamePolicy.METHOD_NAME));
             assertEquals("propertyName",  propertyName,  accessor.name(index, KeyNamePolicy.JAVABEANS_PROPERTY));
             assertEquals("umlIdentifier", umlIdentifier, accessor.name(index, KeyNamePolicy.UML_IDENTIFIER));
             assertEquals("sentence",      sentence,      accessor.name(index, KeyNamePolicy.SENTENCE));
+            assertEquals("declaringType", declaringType, accessor.type(index, TypeValuePolicy.DECLARING_INTERFACE));
             assertEquals(methodName,      index,         accessor.indexOf(methodName,   
false));
             assertEquals(propertyName,    index,         accessor.indexOf(propertyName, 
false));
             assertEquals(umlIdentifier,   index,         accessor.indexOf(umlIdentifier,
false));
@@ -200,7 +200,7 @@ public final strictfp class PropertyAcce
     @Test
     @DependsOnMethod("testConstructor")
     public void testConstructorWithInheritance() {
-        assertMappingEquals(new PropertyAccessor(HardCodedCitations.ISO_19115, DataIdentification.class,
DefaultDataIdentification.class),
+        assertMappingEquals(new PropertyAccessor(HardCodedCitations.ISO_19115, DataIdentification.class,
DefaultDataIdentification.class, false),
         //……Declaring type………………………Method………………………………………………………………………JavaBeans………………………………………………………UML
identifier………………………………………Sentence……………………………………………………………Type………………………………………………………………
             Identification.class, "getCitation",                   "citation",          
        "citation",                  "Citation",                     Citation.class,
             Identification.class, "getAbstract",                   "abstract",          
        "abstract",                  "Abstract",                     InternationalString.class,
@@ -218,10 +218,10 @@ public final strictfp class PropertyAcce
             Identification.class, "getSpatialResolutions",         "spatialResolutions",
        "spatialResolution",         "Spatial resolutions",          Resolution[].class,
         DataIdentification.class, "getLanguages",                  "languages",         
        "language",                  "Languages",                    Locale[].class,
         DataIdentification.class, "getCharacterSets",              "characterSets",     
        "characterSet",              "Character sets",               Charset[].class,
+            Identification.class, "getTopicCategories",            "topicCategories",   
        "topicCategory",             "Topic categories",             TopicCategory[].class,
         DataIdentification.class, "getEnvironmentDescription",     "environmentDescription",
    "environmentDescription",    "Environment description",      InternationalString.class,
-        DataIdentification.class, "getSupplementalInformation",    "supplementalInformation",
   "supplementalInformation",   "Supplemental information",     InternationalString.class,
             Identification.class, "getExtents",                    "extents",           
        "extent",                    "Extents",                      Extent[].class,
-            Identification.class, "getTopicCategories",            "topicCategories",   
        "topicCategory",             "Topic categories",             TopicCategory[].class,
+        DataIdentification.class, "getSupplementalInformation",    "supplementalInformation",
   "supplementalInformation",   "Supplemental information",     InternationalString.class,
             Identification.class, "getAdditionalDocumentations",   "additionalDocumentations",
  "additionalDocumentation",   "Additional documentations",    Citation[].class,
             Identification.class, "getAssociatedResources",        "associatedResources",
       "associatedResource",        "Associated resources",         AssociatedResource[].class,
             Identification.class, "getProcessingLevel",            "processingLevel",   
        "processingLevel",           "Processing level",             Identifier.class,
@@ -239,7 +239,7 @@ public final strictfp class PropertyAcce
     @DependsOnMethod("testConstructorWithInheritance")
     public void testConstructorWithCovariantReturnType() {
         final Class<?> type = GeographicCRS.class;
-        assertMappingEquals(new PropertyAccessor(HardCodedCitations.ISO, type, type),
+        assertMappingEquals(new PropertyAccessor(HardCodedCitations.ISO, type, type, false),
         //……Declaring type……………………………Method……………………………………………JavaBeans……………………………UML
identifier………………Sentence…………………………………Type…………………………………………………………
             GeographicCRS.class,    "getCoordinateSystem", "coordinateSystem", "coordinateSystem",
"Coordinate system",  EllipsoidalCS.class,       // Covariant return type
             GeodeticCRS.class,      "getDatum",            "datum",            "datum", 
          "Datum",              GeodeticDatum.class,       // Covariant return type
@@ -369,7 +369,7 @@ public final strictfp class PropertyAcce
     @DependsOnMethod("testSet")
     public void testSetDeprecated() {
         final PropertyAccessor accessor = new PropertyAccessor(HardCodedCitations.ISO_19115,
-                CoverageDescription.class, DefaultCoverageDescription.class);
+                CoverageDescription.class, DefaultCoverageDescription.class, false);
         final int indexOfDeprecated  = accessor.indexOf("contentType", true);
         final int indexOfReplacement = accessor.indexOf("attributeGroup", true);
         assertTrue("Deprecated elements shall be sorted after non-deprecated ones.",

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -708,7 +708,7 @@ public class DefaultParameterValue<T> ex
             } else if (object instanceof ParameterValue<?>) {
                 final ParameterValue<?> that = (ParameterValue<?>) object;
                 return deepEquals(getDescriptor(), that.getDescriptor(), mode) &&
-                       Objects.equals(getValue(),  that.getValue()) &&
+                       deepEquals(getValue(),      that.getValue(), mode) &&
                        Objects.equals(getUnit(),   that.getUnit());
             }
         }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
[UTF-8] Fri Sep 19 21:44:50 2014
@@ -176,7 +176,7 @@ public strictfp class DefaultMetadataTes
             {
                 final DefaultKeywords keyword = new DefaultKeywords(
                         new Anchor(URI.create("SDN:P021:35:ATTN"), "Transmittance and attenuance
of the water column"));
-                keyword.setType(KeywordType.FEATURE_TYPE);
+                keyword.setType(KeywordType.THEME);
                 final DefaultCitation thesaurus = new DefaultCitation("BODC Parameter Discovery
Vocabulary");
                 thesaurus.setAlternateTitles(singleton(new SimpleInternationalString("P021")));
                 thesaurus.setDates(singleton(new DefaultCitationDate(TestUtilities.date("2008-11-25
23:00:00"), DateType.REVISION)));

Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml
(original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml
Fri Sep 19 21:44:50 2014
@@ -318,7 +318,7 @@
             <gmx:Anchor xlink:href="SDN:P021:35:ATTN">Transmittance and attenuance
of the water column</gmx:Anchor>
           </gmd:keyword>
           <gmd:type>
-            <gmd:MD_KeywordTypeCode codeListValue="featureType" codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode">Feature
type</gmd:MD_KeywordTypeCode>
+            <gmd:MD_KeywordTypeCode codeListValue="theme" codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode">Theme</gmd:MD_KeywordTypeCode>
           </gmd:type>
           <gmd:thesaurusName>
             <gmd:CI_Citation>

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1626344&r1=1626343&r2=1626344&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8]
Fri Sep 19 21:44:50 2014
@@ -56,11 +56,16 @@ import static org.apache.sis.util.collec
  * @author  Stephen Connolly
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from <a href="http://github.com/junit-team/junit.contrib/tree/master/assumes">junit-team</a>)
- * @version 0.4
+ * @version 0.5
  * @module
  */
 public final class TestRunner extends BlockJUnit4ClassRunner {
     /**
+     * {@code true} if ignoring a test should cause its dependencies to be skipped as well.
+     */
+    static final boolean TRANSITIVE_IGNORE = false;
+
+    /**
      * The test methods to be executed, sorted according their dependencies.
      * This array is created by {@link #getFilteredChildren()} when first needed.
      */
@@ -152,7 +157,9 @@ public final class TestRunner extends Bl
          */
         @Override
         public void testAssumptionFailure(final Failure failure) {
-            addDependencyFailure(failure.getDescription().getMethodName());
+            if (TRANSITIVE_IGNORE) {
+                addDependencyFailure(failure.getDescription().getMethodName());
+            }
         }
 
         /**
@@ -160,7 +167,9 @@ public final class TestRunner extends Bl
          */
         @Override
         public void testIgnored(final Description description) {
-            addDependencyFailure(description.getMethodName());
+            if (TRANSITIVE_IGNORE) {
+                addDependencyFailure(description.getMethodName());
+            }
         }
     };
 



Mime
View raw message