sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1545773 - in /sis/branches/JDK7/core/sis-referencing/src: main/java/org/apache/sis/referencing/ main/java/org/apache/sis/referencing/cs/ main/java/org/apache/sis/referencing/datum/ test/java/org/apache/sis/referencing/ test/java/org/apache...
Date Tue, 26 Nov 2013 18:39:14 GMT
Author: desruisseaux
Date: Tue Nov 26 18:39:14 2013
New Revision: 1545773

URL: http://svn.apache.org/r1545773
Log:
Renamed 'nameMatches' as 'isHeuristicMatchForName'.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -519,12 +519,12 @@ public class AbstractIdentifiedObject ex
      * {@section Overriding by subclasses}
      * Some subclasses add more flexibility to the comparisons:
      * <ul>
-     *   <li>{@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#nameMatches(String)
Comparisons of
-     *       coordinate system axis names} consider {@code "Lat"}, {@code "Latitude"} and
{@code "Geodetic latitude"}
-     *       as synonymous, and likewise for longitude.</li>
-     *   <li>{@linkplain org.apache.sis.referencing.datum.DefaultGeodeticDatum#nameMatches(String)
Comparisons
-     *       of geodetic datum} ignore the {@code "D_"} prefix, if any. This prefix appears
in ESRI datum name
-     *       (e.g. {@code "D_WGS_1984"}).</li>
+     *   <li>{@linkplain org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#isHeuristicMatchForName(String)
+     *       Comparisons of coordinate system axis names} consider {@code "Lat"}, {@code
"Latitude"} and
+     *       {@code "Geodetic latitude"} as synonymous, and likewise for longitude.</li>
+     *   <li>{@linkplain org.apache.sis.referencing.datum.DefaultGeodeticDatum#isHeuristicMatchForName(String)
+     *       Comparisons of geodetic datum} ignore the {@code "D_"} prefix, if any.
+     *       This prefix appears in ESRI datum name (e.g. {@code "D_WGS_1984"}).</li>
      * </ul>
      *
      * {@section Future evolutions}
@@ -535,10 +535,10 @@ public class AbstractIdentifiedObject ex
      * @param  name The name to compare with the object name or aliases.
      * @return {@code true} if the primary name of at least one alias matches the specified
{@code name}.
      *
-     * @see IdentifiedObjects#nameMatches(IdentifiedObject, String)
+     * @see IdentifiedObjects#isHeuristicMatchForName(IdentifiedObject, String)
      */
-    public boolean nameMatches(final String name) {
-        return IdentifiedObjects.nameMatches(this, alias, name);
+    public boolean isHeuristicMatchForName(final String name) {
+        return IdentifiedObjects.isHeuristicMatchForName(this, alias, name);
     }
 
     /**
@@ -565,7 +565,7 @@ public class AbstractIdentifiedObject ex
      * because objects of those types with different names have completely different meaning.
      * For example nothing differentiate the {@code "semi_major"} and {@code "semi_minor"}
parameters except the name.
      * The name comparison may be lenient however, i.e. the rules may accept a name matching
an alias.
-     * See {@link #nameMatches(String)} for more information.
+     * See {@link #isHeuristicMatchForName(String)} for more information.
      *
      * @param  object The object to compare to {@code this}.
      * @param  mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison,
or

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -291,9 +291,10 @@ public final class IdentifiedObjects ext
      * Returns {@code true} if either the {@linkplain AbstractIdentifiedObject#getName()
primary name} or at least
      * one {@linkplain AbstractIdentifiedObject#getAlias() alias} matches the given string
according heuristic rules.
      * If the given object is an instance of {@link AbstractIdentifiedObject}, then this
method delegates to its
-     * {@link AbstractIdentifiedObject#nameMatches(String) nameMatches(String)} method in
order to leverage the
-     * additional rules implemented by sub-classes. Otherwise the fallback implementation
returns {@code true}
-     * if the given {@code name} is equal, ignoring aspects documented below, to one of the
following names:
+     * {@link AbstractIdentifiedObject#isHeuristicMatchForName(String) isHeuristicMatchForName(String)}
method
+     * in order to leverage the additional rules implemented by sub-classes.
+     * Otherwise the fallback implementation returns {@code true} if the given {@code name}
is equal,
+     * ignoring aspects documented below, to one of the following names:
      *
      * <ul>
      *   <li>The {@linkplain AbstractIdentifiedObject#getName() primary name}'s {@linkplain
NamedIdentifier#getCode() code}
@@ -314,16 +315,16 @@ public final class IdentifiedObjects ext
      * @param  name The name to compare with the object name or aliases.
      * @return {@code true} if the primary name of at least one alias matches the specified
{@code name}.
      *
-     * @see AbstractIdentifiedObject#nameMatches(String)
+     * @see AbstractIdentifiedObject#isHeuristicMatchForName(String)
      */
-    public static boolean nameMatches(final IdentifiedObject object, final String name) {
+    public static boolean isHeuristicMatchForName(final IdentifiedObject object, final String
name) {
         if (object instanceof AbstractIdentifiedObject) {
             // DefaultCoordinateSystemAxis overrides this method.
             // We really need to delegate to the overridden method.
-            return ((AbstractIdentifiedObject) object).nameMatches(name);
+            return ((AbstractIdentifiedObject) object).isHeuristicMatchForName(name);
         } else {
             ensureNonNull("object", object);
-            return nameMatches(object, object.getAlias(), name);
+            return isHeuristicMatchForName(object, object.getAlias(), name);
         }
     }
 
@@ -339,7 +340,9 @@ public final class IdentifiedObjects ext
      * @param  name    The name for which to check for equality.
      * @return {@code true} if the primary name or at least one alias matches the given {@code
name}.
      */
-    static boolean nameMatches(final IdentifiedObject object, final Collection<GenericName>
aliases, CharSequence name) {
+    static boolean isHeuristicMatchForName(final IdentifiedObject object, final Collection<GenericName>
aliases,
+            CharSequence name)
+    {
         name = CharSequences.toASCII(name);
         final ReferenceIdentifier id = object.getName();
         if (id != null) { // Paranoiac check.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -85,7 +85,7 @@ public class DefaultCoordinateSystemAxis
      * <p>Keys in this map are names <strong>in lower cases</strong>.
      * Values are any object that allow us to differentiate latitude from longitude.</p>
      *
-     * @see #nameMatches(String)
+     * @see #isHeuristicMatchForName(String)
      */
     private static final Map<String,Object> ALIASES = new HashMap<>(12);
     static {
@@ -109,11 +109,11 @@ public class DefaultCoordinateSystemAxis
      * map, because experience has shown that doing so cause a lot of undesirable side effects.
The "x" abbreviation
      * is used for too many things ("Easting", "Westing", "Geocentric X", "Display right",
"Display left") and likewise
      * for "y". Declaring them as aliases introduces confusion in many places. Instead, the
"x" and "y" cases are
-     * handled in a special way by the {@code nameMatchesXY(…)} method.
+     * handled in a special way by the {@code isHeuristicMatchForNameXY(…)} method.
      *
      * <p>Names at even index are for "x" and names at odd index are for "y".</p>
      *
-     * @see #nameMatchesXY(String, String)
+     * @see #isHeuristicMatchForNameXY(String, String)
      */
     private static final String[] ALIASES_XY = {
         "Easting", "Northing",
@@ -381,7 +381,7 @@ public class DefaultCoordinateSystemAxis
      * Returns {@code true} if either the {@linkplain #getName() primary name} or at least
      * one {@linkplain #getAlias() alias} matches the given string according heuristic rules.
      * This method performs the comparison documented in the
-     * {@linkplain AbstractIdentifiedObject#nameMatches(String) super-class},
+     * {@link AbstractIdentifiedObject#isHeuristicMatchForName(String) super-class},
      * with an additional flexibility for latitudes and longitudes:
      *
      * <ul>
@@ -404,14 +404,14 @@ public class DefaultCoordinateSystemAxis
      * @return {@code true} if the primary name of at least one alias matches the specified
{@code name}.
      */
     @Override
-    public boolean nameMatches(final String name) {
-        if (super.nameMatches(name)) {
+    public boolean isHeuristicMatchForName(final String name) {
+        if (super.isHeuristicMatchForName(name)) {
             return true;
         }
         /*
-         * The standard comparisons didn't worked. Check for the aliases. Note: we don't
-         * test for 'nameMatchesXY(...)' here because the "x" and "y" axis names are too
-         * generic. We test them only in the 'equals' method, which has the extra-safety
+         * The standard comparisons didn't worked. Check for the aliases. Note: we don't
test
+         * for  'isHeuristicMatchForNameXY(...)'  here because the "x" and "y" axis names
are
+         * too generic.  We test them only in the 'equals' method, which has the extra-safety
          * of units comparison (so less risk to treat incompatible axes as equivalent).
          */
         final Object type = ALIASES.get(trimWhitespaces(name).toLowerCase(Locale.US)); //
Our ALIASES are in English.
@@ -428,7 +428,7 @@ public class DefaultCoordinateSystemAxis
      * @return {@code true} if the second name is equivalent to "x" or "y"
      *         (depending on the {@code xy} value), or {@code false} otherwise.
      */
-    private static boolean nameMatchesXY(String xy, String name) {
+    private static boolean isHeuristicMatchForNameXY(String xy, String name) {
         xy = trimWhitespaces(xy);
         if (xy.length() == 1) {
             int i = Character.toLowerCase(xy.charAt(0)) - 'x';
@@ -504,25 +504,28 @@ public class DefaultCoordinateSystemAxis
              *       the 'equals' method in the superclass.
              */
             final String thatName = that.getName().getCode();
-            if (!nameMatches(thatName)) {
+            if (!isHeuristicMatchForName(thatName)) {
                 /*
                  * The above test checked for special cases ("Lat" / "Lon" aliases, etc.).
                  * The next line may repeat the same check, so we may have a partial waste
                  * of CPU.   But we do it anyway for checking the 'that' aliases, and also
-                 * because the user may have overridden the 'that.nameMatches(...)' method.
+                 * because the user may have overridden 'that.isHeuristicMatchForName(…)'.
                  */
                 final String thisName = getName().getCode();
-                if (!IdentifiedObjects.nameMatches(that, thisName)) {
+                if (!IdentifiedObjects.isHeuristicMatchForName(that, thisName)) {
                     /*
                      * For the needs of CoordinateSystems.axisColinearWith(...), we must
stop here.
-                     * In addition it may be safer to not test 'nameMatchesXY' when we don't
have
-                     * the extra-safety of units comparison, because "x" and "y" names are
too generic.
+                     * In addition it may be safer to not test 'isHeuristicMatchForNameXY'
when we
+                     * do not have the extra-safety of units comparison, because "x" and
"y" names
+                     * are too generic.
                      */
                     if (!compareUnit) {
                         return false;
                     }
                     // Last chance: check for the special case of "x" and "y" axis names.
-                    if (!nameMatchesXY(thatName, thisName) && !nameMatchesXY(thisName,
thatName)) {
+                    if (!isHeuristicMatchForNameXY(thatName, thisName) &&
+                        !isHeuristicMatchForNameXY(thisName, thatName))
+                    {
                         return false;
                     }
                 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/AbstractDatum.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -295,7 +295,7 @@ public class AbstractDatum extends Abstr
      * Returns {@code true} if either the {@linkplain #getName() primary name} or at least
      * one {@linkplain #getAlias() alias} matches the given string according heuristic rules.
      * This method performs the comparison documented in the
-     * {@linkplain AbstractIdentifiedObject#nameMatches(String) super-class},
+     * {@link AbstractIdentifiedObject#isHeuristicMatchForName(String) super-class},
      * with the following additional flexibility:
      *
      * <ul>
@@ -313,17 +313,17 @@ public class AbstractDatum extends Abstr
      * @return {@code true} if the primary name of at least one alias matches the specified
{@code name}.
      */
     @Override
-    public boolean nameMatches(final String name) {
+    public boolean isHeuristicMatchForName(final String name) {
         if (name.startsWith((ESRI_PREFIX))) {
-            if (super.nameMatches(name.substring(ESRI_PREFIX.length()))) {
+            if (super.isHeuristicMatchForName(name.substring(ESRI_PREFIX.length()))) {
                 return true;
             }
         } else if (getName().getCode().startsWith(ESRI_PREFIX)) {
-            if (super.nameMatches(ESRI_PREFIX.concat(name))) {
+            if (super.isHeuristicMatchForName(ESRI_PREFIX.concat(name))) {
                 return true;
             }
         }
-        return super.nameMatches(name);
+        return super.isHeuristicMatchForName(name);
     }
 
     /**
@@ -367,8 +367,8 @@ public class AbstractDatum extends Abstr
                  * have already been compared by the subclass.
                  */
                 final Datum that = (Datum) object;
-                return nameMatches(that. getName().getCode()) ||
-                       IdentifiedObjects.nameMatches(that, getName().getCode());
+                return isHeuristicMatchForName(that. getName().getCode()) ||
+                       IdentifiedObjects.isHeuristicMatchForName(that, getName().getCode());
             }
         }
     }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -298,8 +298,8 @@ public class BursaWolfParameters extends
      * @return {@code true} if the given datum is equal to WGS84 for computational purpose.
      */
     final boolean isToWGS84() {
-        return IdentifiedObjects.nameMatches(targetDatum, "WGS 84") ||
-               IdentifiedObjects.nameMatches(targetDatum, "WGS84");
+        return IdentifiedObjects.isHeuristicMatchForName(targetDatum, "WGS 84") ||
+               IdentifiedObjects.isHeuristicMatchForName(targetDatum, "WGS84");
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -24,6 +24,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
+import static org.apache.sis.referencing.IdentifiedObjects.*;
 
 
 /**
@@ -36,38 +37,38 @@ import static org.junit.Assert.*;
  */
 public final strictfp class IdentifiedObjectsTest extends TestCase {
     /**
-     * Tests {@link IdentifiedObjects#nameMatches(IdentifiedObject, IdentifiedObject)}.
+     * Tests {@link IdentifiedObjects#isHeuristicMatchForName(IdentifiedObject, String)}.
      */
     @Test
-    public void testNameMatches() {
+    public void testIsHeuristicMatchForName() {
         final GenericName name = DefaultFactories.SIS_NAMES.createGenericName(null, "myScope",
"myName");
         IdentifiedObjectMock object = new IdentifiedObjectMock("myCode ", name); // Intentional
trailing space.
 
         // Test the code.
-        assertFalse(IdentifiedObjects.nameMatches(object, "other"));
-        assertTrue (IdentifiedObjects.nameMatches(object, "myCode"));
-        assertTrue (IdentifiedObjects.nameMatches(object, " my_code "));
-        assertFalse(IdentifiedObjects.nameMatches(object, "testmyCode"));
-        assertFalse(IdentifiedObjects.nameMatches(object, "other:myCode"));
-        assertFalse(IdentifiedObjects.nameMatches(object, "test"));
+        assertFalse(isHeuristicMatchForName(object, "other"));
+        assertTrue (isHeuristicMatchForName(object, "myCode"));
+        assertTrue (isHeuristicMatchForName(object, " my_code "));
+        assertFalse(isHeuristicMatchForName(object, "testmyCode"));
+        assertFalse(isHeuristicMatchForName(object, "other:myCode"));
+        assertFalse(isHeuristicMatchForName(object, "test"));
 
         // Test the alias.
-        assertTrue (IdentifiedObjects.nameMatches(object, "myName"));
-        assertTrue (IdentifiedObjects.nameMatches(object, " My_name "));
-        assertFalse(IdentifiedObjects.nameMatches(object, "myScope"));
-        assertFalse(IdentifiedObjects.nameMatches(object, "other:myName"));
-        assertFalse(IdentifiedObjects.nameMatches(object, "myScope:other"));
-        assertFalse(IdentifiedObjects.nameMatches(object, "other:myScope:myName"));
+        assertTrue (isHeuristicMatchForName(object, "myName"));
+        assertTrue (isHeuristicMatchForName(object, " My_name "));
+        assertFalse(isHeuristicMatchForName(object, "myScope"));
+        assertFalse(isHeuristicMatchForName(object, "other:myName"));
+        assertFalse(isHeuristicMatchForName(object, "myScope:other"));
+        assertFalse(isHeuristicMatchForName(object, "other:myScope:myName"));
 
         // Test non-letter and non-digits characters.
         object = new IdentifiedObjectMock("Mercator (1SP)", name);
-        assertTrue (IdentifiedObjects.nameMatches(object, "Mercator (1SP)"));
-        assertTrue (IdentifiedObjects.nameMatches(object, "Mercator_1SP"));
-        assertFalse(IdentifiedObjects.nameMatches(object, "Mercator_2SP"));
+        assertTrue (isHeuristicMatchForName(object, "Mercator (1SP)"));
+        assertTrue (isHeuristicMatchForName(object, "Mercator_1SP"));
+        assertFalse(isHeuristicMatchForName(object, "Mercator_2SP"));
 
         // Test diacritical signs
         object = new IdentifiedObjectMock("Réunion", name);
-        assertTrue (IdentifiedObjects.nameMatches(object, "Réunion"));
-        assertTrue (IdentifiedObjects.nameMatches(object, "Reunion"));
+        assertTrue (isHeuristicMatchForName(object, "Réunion"));
+        assertTrue (isHeuristicMatchForName(object, "Reunion"));
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -92,23 +92,23 @@ public final strictfp class DefaultCoord
     }
 
     /**
-     * Tests the {@link DefaultCoordinateSystemAxis#nameMatches(String)} method.
+     * Tests the {@link DefaultCoordinateSystemAxis#isHeuristicMatchForName(String)} method.
      */
     @Test
-    public void testNameMatches() {
-        assertTrue (LONGITUDE.nameMatches(GEODETIC_LONGITUDE.getName().getCode()));
-        assertFalse(LONGITUDE.nameMatches(GEODETIC_LATITUDE .getName().getCode()));
-        assertFalse(LONGITUDE.nameMatches(ALTITUDE          .getName().getCode()));
-        assertFalse(X        .nameMatches(LONGITUDE         .getName().getCode()));
-        assertFalse(X        .nameMatches(EASTING           .getName().getCode()));
-        assertFalse(X        .nameMatches(NORTHING          .getName().getCode()));
+    public void testIsHeuristicMatchForName() {
+        assertTrue (LONGITUDE.isHeuristicMatchForName(GEODETIC_LONGITUDE.getName().getCode()));
+        assertFalse(LONGITUDE.isHeuristicMatchForName(GEODETIC_LATITUDE .getName().getCode()));
+        assertFalse(LONGITUDE.isHeuristicMatchForName(ALTITUDE          .getName().getCode()));
+        assertFalse(X        .isHeuristicMatchForName(LONGITUDE         .getName().getCode()));
+        assertFalse(X        .isHeuristicMatchForName(EASTING           .getName().getCode()));
+        assertFalse(X        .isHeuristicMatchForName(NORTHING          .getName().getCode()));
     }
 
     /**
      * Tests the comparison of some axis, ignoring metadata.
      */
     @Test
-    @DependsOnMethod("testNameMatches")
+    @DependsOnMethod("testIsHeuristicMatchForName")
     public void testEqualsIgnoreMetadata() {
         assertFalse("X",         X        .equals(GEOCENTRIC_X,        ComparisonMode.IGNORE_METADATA));
         assertFalse("Longitude", LONGITUDE.equals(GEODETIC_LONGITUDE,  ComparisonMode.STRICT));

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java?rev=1545773&r1=1545772&r2=1545773&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
[UTF-8] Tue Nov 26 18:39:14 2013
@@ -91,17 +91,17 @@ public final strictfp class DefaultGeode
     }
 
     /**
-     * Tests {@link DefaultGeodeticDatum#nameMatches(String)}.
+     * Tests {@link DefaultGeodeticDatum#isHeuristicMatchForName(String)}.
      */
     @Test
-    public void testNameMatches() {
+    public void testIsHeuristicMatchForName() {
         final DefaultGeodeticDatum datum = new DefaultGeodeticDatum(WGS84);
-        assertFalse(datum.nameMatches("WGS72"));
-        assertTrue (datum.nameMatches("WGS84"));
-        assertTrue (datum.nameMatches("WGS 84"));
-        assertTrue (datum.nameMatches("WGS_84"));
-        assertTrue (datum.nameMatches("D_WGS_84"));
-        assertFalse(datum.nameMatches("E_WGS_84"));
+        assertFalse(datum.isHeuristicMatchForName("WGS72"));
+        assertTrue (datum.isHeuristicMatchForName("WGS84"));
+        assertTrue (datum.isHeuristicMatchForName("WGS 84"));
+        assertTrue (datum.isHeuristicMatchForName("WGS_84"));
+        assertTrue (datum.isHeuristicMatchForName("D_WGS_84"));
+        assertFalse(datum.isHeuristicMatchForName("E_WGS_84"));
     }
 
     /**



Mime
View raw message