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 2016/02/22 18:12:03 UTC
svn commit: r1731689 [4/4] - in /sis/trunk: ./ core/
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/
core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis...
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/LongConsumer.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/LongConsumer.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/LongConsumer.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/LongConsumer.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -18,7 +18,7 @@ package org.apache.sis.internal.jdk8;
/**
- * Placeholder for the {@link ava.util.function.LongConsumer} interface.
+ * Placeholder for the {@link java.util.function.LongConsumer} interface.
*/
public interface LongConsumer {
/**
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/package-info.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/package-info.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -25,7 +25,7 @@
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.3
+ * @version 0.7
* @module
*/
package org.apache.sis.internal.jdk8;
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -24,7 +24,7 @@ package org.apache.sis.internal.system;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.6
+ * @version 0.7
* @module
*/
public final class Semaphores {
@@ -53,6 +53,16 @@ public final class Semaphores {
public static final byte NULL_COLLECTION = 4;
/**
+ * A flag to indicate that a parameter value outside its domain of validity should not cause an exception
+ * to be thrown. This flag is set only when creating a deprecated operation from the EPSG database.
+ * Typically the operation is deprecated precisely because it used invalid parameter values,
+ * but SIS should still be able to create those deprecated objects if a user request them.
+ *
+ * <p><b>Example:</b> EPSG:3752 was a Mercator (variant A) projection but set the latitude of origin to 41°S.</p>
+ */
+ public static final byte SUSPEND_PARAMETER_CHECK = 8;
+
+ /**
* The flags per running thread.
*/
private static final ThreadLocal<Semaphores> FLAGS = new ThreadLocal<Semaphores>();
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -83,9 +83,9 @@ public final class Supervisor extends St
*/
public static synchronized void register() {
if (name == null) {
- name = ObjectName.WILDCARD; // In case of failure.
- final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
+ name = ObjectName.WILDCARD; // In case of failure.
try {
+ final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
final ObjectName n = new ObjectName(NAME);
server.registerMBean(new Supervisor(), n);
name = n; // Store only on success.
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -76,7 +76,7 @@ public final class CollectionsExt extend
public static <T> T first(final Iterable<T> collection) {
if (collection != null) {
final Iterator<T> it = collection.iterator();
- if (it != null && it.hasNext()) { // This check for null is paranoiac.
+ if (it != null && it.hasNext()) { // This check for null is paranoiac.
return it.next();
}
}
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -149,7 +149,7 @@ public abstract class SetOfUnknownSize<E
* iterate over the elements of this Set. The reason is that this Set may compute the values dynamically and
* it is sometime difficult to ensure that this Set's iterator is fully consistent with the values recognized
* by the contains(Object) method. For example the iterator may return "EPSG:4326" while the contains(Object)
- * method may accept both "EPSG:4326" and "EPSG::4326". For this equals(Object) method, we consider the
+ * method may accept both "EPSG:4326" and "EPSG:4326". For this equals(Object) method, we consider the
* contains(Object) method of the other Set as more reliable.
*/
if (object == this) {
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/UnmodifiableArrayList.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/UnmodifiableArrayList.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/UnmodifiableArrayList.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/UnmodifiableArrayList.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -91,7 +91,7 @@ public class UnmodifiableArrayList<E> ex
*
* @param array The array to wrap.
*/
- protected UnmodifiableArrayList(final E[] array) { // NOT "E..." - see javadoc.
+ protected UnmodifiableArrayList(final E[] array) { // NOT "E..." - see javadoc.
this.array = Objects.requireNonNull(array);
}
@@ -115,7 +115,7 @@ public class UnmodifiableArrayList<E> ex
* @return The given array wrapped in an unmodifiable list, or {@code null} if the given
* array was null.
*/
- public static <E> UnmodifiableArrayList<E> wrap(final E[] array) { // NOT "E..." - see javadoc.
+ public static <E> UnmodifiableArrayList<E> wrap(final E[] array) { // NOT "E..." - see javadoc.
return (array != null) ? new UnmodifiableArrayList<E>(array) : null;
}
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/DecimalFunctions.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/DecimalFunctions.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/DecimalFunctions.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/math/DecimalFunctions.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -441,8 +441,10 @@ public final class DecimalFunctions exte
* <li>Otherwise this method returns {@code fractionDigits}.</li>
* </ul>
*
- * Examples:
+ * <div class="note"><b>Note:</b>
+ * The threshold of 4 trailing fraction digits is arbitrary and may change in any future SIS version.</div>
*
+ * <div class="note"><b>Examples:</b>
* <ul>
* <li>{@code fractionDigitsForValue(179.12499999999824)} returns 14,
* the amount of digits after the decimal separator.</li>
@@ -455,9 +457,7 @@ public final class DecimalFunctions exte
* <li>{@code fractionDigitsForValue(179.12499997999999, 3)} returns 14 because rounding the 3 last digits
* results in 179.12499997000. The condition for 4 trailing zero fraction digits is not meet.</li>
* </ul>
- *
- * <div class="note"><b>Note:</b>
- * The threshold of 4 trailing fraction digits is arbitrary and may change in any future SIS version.</div>
+ * </div>
*
* @param value The value for which to get the number of significant fraction fraction digits minus rounding error.
* @param uncertainDigits Number of trailing fraction digits which may be rounding error artefacts.
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -22,6 +22,7 @@ import java.util.FormattableFlags;
import java.io.Serializable;
import javax.measure.unit.Unit;
import org.apache.sis.internal.util.Utilities;
+import org.apache.sis.internal.util.PatchedUnitFormat;
import org.apache.sis.util.collection.CheckedContainer;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.Emptiable;
@@ -676,9 +677,13 @@ public class Range<E extends Comparable<
}
final Unit<?> unit = unit();
if (unit != null) {
- // No need to check if we should omit the space because Unit.toString()
- // uses UCUM format, so we will never have symbol like the ° one.
- buffer.append(' ').append(unit);
+ final String symbol = PatchedUnitFormat.toString(unit);
+ if (!symbol.isEmpty()) {
+ if (Character.isLetterOrDigit(symbol.codePointAt(0))) {
+ buffer.append(' ');
+ }
+ buffer.append(symbol);
+ }
}
return buffer.toString();
}
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/SexagesimalConverter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/SexagesimalConverter.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/SexagesimalConverter.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/SexagesimalConverter.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -277,8 +277,9 @@ class SexagesimalConverter extends UnitC
* @param unit The vocabulary key for the field (minutes or seconds).
* @return The exception to throw.
*/
- private static IllegalArgumentException illegalField(final double value, final double field, final int unit) {
- return new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentField_4, "angle", value, unit, field));
+ private static IllegalArgumentException illegalField(final double value, final double field, final short unit) {
+ return new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentField_4,
+ "angle", value, Vocabulary.format(unit), field));
}
}
}
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -70,7 +70,7 @@ public final class Units extends Static
public static final Unit<Duration> MILLISECOND = SI.MetricPrefix.MILLI(SI.SECOND);
/**
- * The EPSG::1029 definition of year.
+ * The EPSG:1029 definition of year.
*/
private static final Unit<Duration> YEAR = SI.SECOND.divide(31556925.445);
@@ -593,8 +593,8 @@ public final class Units extends Static
*
* <p>The same unit may be represented by different EPSG codes depending on the context:</p>
* <ul>
- * <li>EPSG::9102 – <cite>degree</cite> – is used for prime meridian and coordinate operation parameters.</li>
- * <li>EPSG::9122 – <cite>degree (supplier to define representation)</cite> – is used for coordinate system axes.</li>
+ * <li>EPSG:9102 – <cite>degree</cite> – is used for prime meridian and coordinate operation parameters.</li>
+ * <li>EPSG:9122 – <cite>degree (supplier to define representation)</cite> – is used for coordinate system axes.</li>
* </ul>
*
* When such choice exists, the code to return is determined by the {@code inAxis} argument,
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -41,8 +41,7 @@ import static java.lang.Character.*;
*/
public final class StringBuilders extends Static {
/**
- * Letters in the range 00C0 (192) to 00FF (255) inclusive with their accent removed,
- * when possible.
+ * Letters in the range 00C0 (192) to 00FF (255) inclusive with their accent removed, when possible.
*/
private static final String ASCII = "AAAAAAÆCEEEEIIIIDNOOOOO*OUUUUYÞsaaaaaaæceeeeiiiionooooo/ouuuuyþy";
// Original letters (with accent) = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
Modified: sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -30,6 +30,7 @@ import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.lang.reflect.Modifier;
+import javax.measure.unit.Unit;
import org.opengis.util.CodeList;
import org.opengis.util.InternationalString;
import org.apache.sis.util.Debug;
@@ -40,6 +41,7 @@ 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.PatchedUnitFormat;
// Related to JDK7
import org.apache.sis.internal.jdk7.JDK7;
@@ -72,7 +74,7 @@ import org.apache.sis.internal.jdk7.JDK7
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.3
- * @version 0.6
+ * @version 0.7
* @module
*/
public class IndexedResourceBundle extends ResourceBundle implements Localized {
@@ -414,12 +416,14 @@ public class IndexedResourceBundle exten
replacement = Classes.getShortName(getPublicType((Class<?>) element));
} else if (element instanceof CodeList<?>) {
replacement = Types.getCodeTitle((CodeList<?>) element).toString(getLocale());
+ } else if (element instanceof Unit<?>) {
+ replacement = PatchedUnitFormat.toString((Unit<?>) element);
}
// No need to check for Numbers or Dates instances, since they are
// properly formatted in the ResourceBundle locale by MessageFormat.
if (replacement != element) {
if (array == arguments) {
- array = array.clone(); // Protect the user-provided array from change.
+ array = array.clone(); // Protect the user-provided array from change.
}
array[i] = replacement;
}
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/measure/MeasurementRangeTest.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -84,7 +84,7 @@ public final strictfp class MeasurementR
MeasurementRange<Float> range = MeasurementRange.create(10f, true, 20f, true, SI.KILOMETRE);
assertEquals("[10.0 … 20.0] km", range.toString());
range = MeasurementRange.create(10f, true, 20f, true, NonSI.DEGREE_ANGLE);
- assertEquals("[10.0 … 20.0] deg", range.toString());
+ assertEquals("[10.0 … 20.0]°", range.toString());
}
/**
Modified: sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java [UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java [UTF-8] Mon Feb 22 17:12:02 2016
@@ -16,6 +16,9 @@
*/
package org.apache.sis.test;
+import java.util.Queue;
+import java.util.LinkedList;
+import java.util.ConcurrentModificationException;
import java.util.logging.Filter;
import java.util.logging.Logger;
import java.util.logging.LogRecord;
@@ -29,44 +32,41 @@ import org.junit.runners.model.Framework
/**
- * Watches the logs sent to the given logger. Logs will be allowed only if the test was
- * expected to cause some logging events to occur, otherwise a test failure will occurs.
- *
- * <div class="note">Usage example</div>
- * Create a rule in the JUnit test class like below:
+ * Watches the logs sent to the given logger.
+ * For using, create a rule in the JUnit test class like below:
*
* {@preformat java
* @Rule
- * public final LoggingWatcher listener = new LoggingWatcher(Logging.getLogger(Loggers.XML)) {
- * @Override protected void verifyMessage(final String message) {
- * assertTrue(message.contains("An expected word in the logging message"));
- * }
- * };
+ * public final LoggingWatcher loggings = new LoggingWatcher(Logging.getLogger(Loggers.XML));
* }
*
- * Then, <em>only</em> in the test which are expected to emit a warning, add the following line
- * (replace 1 by a higher value if more than one logging is expected):
+ * Recommended but not mandatory, ensure that there is no unexpected logging in any tests:
*
* {@preformat java
- * listener.maximumLogCount = 1;
+ * @After
+ * public void assertNoUnexpectedLog() {
+ * loggings.assertNoUnexpectedLog();
+ * }
+ * }
+ *
+ * In tests that are expected to emit warnings, add the following lines:
+ *
+ * {@preformat java
+ * // Do the test here.
+ * loggings.assertNextLogContains("Some keywords", "that are expected", "to be found in the message");
+ * loggings.assertNoUnexpectedLog();
* }
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.7
* @module
*/
-public strictfp class LoggingWatcher extends TestWatchman implements Filter {
+public final strictfp class LoggingWatcher extends TestWatchman implements Filter {
/**
- * The maximal number of logs expected by the test. If this value is positive, then it is
- * decremented when {@link #isLoggable(LogRecord)} is invoked until the value reach zero.
- * If the value is zero and {@code isLoggable(LogRecord)} is invoked, then a test failure
- * occurs.
- *
- * <p>The initial value of this field is 0. Test cases shall set this field to a non-zero
- * value in order to allow log events.</p>
+ * The logged messages.
*/
- public int maximumLogCount;
+ private final Queue<String> messages = new LinkedList<String>();
/**
* The logger to watch.
@@ -89,6 +89,15 @@ public strictfp class LoggingWatcher ext
}
/**
+ * Creates a new watcher for the given logger.
+ *
+ * @param logger The name of logger to watch.
+ */
+ public LoggingWatcher(final String logger) {
+ this.logger = Logger.getLogger(logger);
+ }
+
+ /**
* Invoked when a test is about to start. This method installs this {@link Filter}
* for the log messages before the tests are run. This installation will cause the
* {@link #isLoggable(LogRecord)} method to be invoked when a message is logged.
@@ -101,7 +110,6 @@ public strictfp class LoggingWatcher ext
public final void starting(final FrameworkMethod description) {
assertNull(logger.getFilter());
logger.setFilter(this);
- maximumLogCount = 0;
}
/**
@@ -116,26 +124,69 @@ public strictfp class LoggingWatcher ext
}
/**
- * Invoked (indirectly) when a tested method has emitted a log message. This method verifies
- * if we were expecting a log message, then decrements the {@link #maximumLogCount} value.
+ * Invoked (indirectly) when a tested method has emitted a log message.
+ * This method adds the logging message to the {@link #messages} list.
*/
@Override
public final boolean isLoggable(final LogRecord record) {
- if (maximumLogCount <= 0) {
- fail("Unexpected logging:\n" + formatter.format(record));
- }
- maximumLogCount--;
- verifyMessage(formatter.formatMessage(record));
+ messages.add(formatter.formatMessage(record));
return TestCase.VERBOSE;
}
/**
- * Invoked by {@link #isLoggable(LogRecord)} when a tested method has emitted a log message.
- * The default implementation does nothing. Subclasses can override this method in order to
- * perform additional check.
+ * Skips the next log messages if it contains all the given keywords.
+ * This method is used instead of {@link #assertNextLogContains(String...)} when a log message may or
+ * may not be emitted during a test, depending on circumstances that the test method does not control.
+ *
+ * @param keywords The keywords that are expected to exist in the next log message
+ * if that log message has been emitted.
+ */
+ public void skipNextLogIfContains(final String... keywords) {
+ final String message = messages.peek();
+ if (message != null) {
+ for (final String word : keywords) {
+ if (!message.contains(word)) {
+ return;
+ }
+ }
+ if (messages.remove() != message) {
+ throw new ConcurrentModificationException();
+ }
+ }
+ }
+
+ /**
+ * Verifies that the next logging message contains the given keywords.
+ * Each call of this method advances to the next log message.
*
- * @param message The logging message.
+ * @param keywords The keywords that are expected to exist in the next log message.
+ */
+ public void assertNextLogContains(final String... keywords) {
+ if (messages.isEmpty()) {
+ fail("Expected a logging messages but got no more.");
+ }
+ final String message = messages.remove();
+ for (final String word : keywords) {
+ if (!message.contains(word)) {
+ fail("Expected the logging message to contains the “"+ word + "” word but got:\n" + message);
+ }
+ }
+ }
+
+ /**
+ * Verifies that there is no more log message.
+ */
+ public void assertNoUnexpectedLog() {
+ final String message = messages.peek();
+ if (message != null) {
+ fail("Unexpected logging message: " + message);
+ }
+ }
+
+ /**
+ * Discards all logging messages.
*/
- protected void verifyMessage(final String message) {
+ public void clear() {
+ messages.clear();
}
}
Modified: sis/trunk/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/build.xml?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/build.xml (original)
+++ sis/trunk/ide-project/NetBeans/build.xml Mon Feb 22 17:12:02 2016
@@ -50,11 +50,14 @@
</copy>
-->
- <!-- Following are classical properties resources files. -->
+ <!-- Resources (properties files, SQL scripts). -->
<copy todir="${build.classes.dir}">
<fileset dir="${project.root}/core/sis-utility/src/main/resources">
<include name="**/*.properties"/>
</fileset>
+ <fileset dir="${project.root}/core/sis-referencing/src/main/resources">
+ <include name="**/*.sql"/>
+ </fileset>
<fileset dir="${project.root}/application/sis-console/src/main/resources">
<include name="**/*.properties"/>
</fileset>
Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1731689&r1=1731688&r2=1731689&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Mon Feb 22 17:12:02 2016
@@ -209,6 +209,17 @@ Apache SIS is a free software, Java lang
<role>committer</role>
</roles>
</developer>
+ <developer>
+ <name>Rémi Maréchal</name>
+ <id>rmarechal</id>
+ <email>remi.marechal@geomatys.com</email>
+ <organization>Geomatys</organization>
+ <organizationUrl>http://www.geomatys.com/</organizationUrl>
+ <timezone>+1</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
</developers>
<contributors>