From 4dc5e97d9947e5a926d971bbe8ca5ececf9007df Mon Sep 17 00:00:00 2001 From: ribeaudc <ribeaudc> Date: Tue, 26 Feb 2008 05:42:53 +0000 Subject: [PATCH] change: - Trying to put some structure in 'ch.systemsx.cisd.common.utilities'. SVN: 4486 --- common/resource/dependency-structure.ddf | 15 +++++++++------ .../{utilities => collections}/CollectionIO.java | 3 ++- .../CollectionStyle.java | 2 +- .../CollectionUtils.java | 3 ++- .../FromStringIdentityConverter.java | 2 +- .../IFromStringConverter.java | 2 +- .../IToStringConverter.java | 2 +- .../ToStringDefaultConverter.java | 2 +- .../parser/MandatoryPropertyMissingException.java | 4 ++-- .../utilities/DirectoryScanningTimerTask.java | 1 + .../CollectionIOTest.java | 5 ++++- .../CollectionUtilsTest.java | 4 +++- .../process/ProcessExecutionHelperTest.java | 2 +- .../utilities/DirectoryScanningTimerTaskTest.java | 1 + .../utilities/RecursiveHardLinkMakerTest.java | 2 +- 15 files changed, 31 insertions(+), 19 deletions(-) rename common/source/java/ch/systemsx/cisd/common/{utilities => collections}/CollectionIO.java (99%) rename common/source/java/ch/systemsx/cisd/common/{utilities => collections}/CollectionStyle.java (96%) rename common/source/java/ch/systemsx/cisd/common/{utilities => collections}/CollectionUtils.java (99%) rename common/source/java/ch/systemsx/cisd/common/{utilities => collections}/FromStringIdentityConverter.java (96%) rename common/source/java/ch/systemsx/cisd/common/{utilities => collections}/IFromStringConverter.java (95%) rename common/source/java/ch/systemsx/cisd/common/{utilities => collections}/IToStringConverter.java (95%) rename common/source/java/ch/systemsx/cisd/common/{utilities => collections}/ToStringDefaultConverter.java (96%) rename common/sourceTest/java/ch/systemsx/cisd/common/{utilities => collections}/CollectionIOTest.java (97%) rename common/sourceTest/java/ch/systemsx/cisd/common/{utilities => collections}/CollectionUtilsTest.java (97%) diff --git a/common/resource/dependency-structure.ddf b/common/resource/dependency-structure.ddf index b4b257b8c81..8cc3a4ac6a8 100644 --- a/common/resource/dependency-structure.ddf +++ b/common/resource/dependency-structure.ddf @@ -12,6 +12,9 @@ check sets [db] [exceptions] = ${package}.exceptions.* check sets [exceptions] +[collections] = ${package}.collections.* +check sets [collections] + [logging] = ${package}.logging.* check sets [logging] @@ -24,14 +27,14 @@ check sets [process] [test] = ${package}.test.* check sets [test] -[utilities] = ${package}.utilities.* excluding ${package}.utilities.RecursiveHardLinkMaker -check sets [utilities] +# TODO 2008-02-26, Christian Ribeaud: include 'utilities' set into layering. +# [utilities] = ${package}.utilities.* +# check sets [utilities] layer layer0 = [annotation] [exceptions] [logging] [test] -layer layer1 = [utilities] -layer layer2 = [process] -layer layer3 = [db] [parser] +layer layer1 = [process] [collections] +layer layer2 = [db] [parser] -check layeringOf layer0 layer1 layer2 layer3 +check layeringOf layer0 layer1 layer2 check [parser] independentOf ${package}.exceptions.UserFailureException \ No newline at end of file diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/CollectionIO.java b/common/source/java/ch/systemsx/cisd/common/collections/CollectionIO.java similarity index 99% rename from common/source/java/ch/systemsx/cisd/common/utilities/CollectionIO.java rename to common/source/java/ch/systemsx/cisd/common/collections/CollectionIO.java index 99350c6e3ea..7bd8d4a76d3 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/CollectionIO.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/CollectionIO.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; import java.io.BufferedReader; import java.io.File; @@ -38,6 +38,7 @@ import org.apache.log4j.Logger; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; +import ch.systemsx.cisd.common.utilities.FileUtilities; /** * I/O operations for collections. Allows to read and write collections of {@link String}s and other objects from and diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/CollectionStyle.java b/common/source/java/ch/systemsx/cisd/common/collections/CollectionStyle.java similarity index 96% rename from common/source/java/ch/systemsx/cisd/common/utilities/CollectionStyle.java rename to common/source/java/ch/systemsx/cisd/common/collections/CollectionStyle.java index adb8f5cdd7e..ea072da2f65 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/CollectionStyle.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/CollectionStyle.java @@ -1,4 +1,4 @@ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; /** * Controls <code>Collection</code> string representation for {@link CollectionUtils}. diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/CollectionUtils.java b/common/source/java/ch/systemsx/cisd/common/collections/CollectionUtils.java similarity index 99% rename from common/source/java/ch/systemsx/cisd/common/utilities/CollectionUtils.java rename to common/source/java/ch/systemsx/cisd/common/collections/CollectionUtils.java index d3eb36873fe..99c1bea7b8c 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/CollectionUtils.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/CollectionUtils.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; + /** * Some convenience methods/utilities around {@link Collection}. * diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/FromStringIdentityConverter.java b/common/source/java/ch/systemsx/cisd/common/collections/FromStringIdentityConverter.java similarity index 96% rename from common/source/java/ch/systemsx/cisd/common/utilities/FromStringIdentityConverter.java rename to common/source/java/ch/systemsx/cisd/common/collections/FromStringIdentityConverter.java index 773e1648ed9..0292bbba288 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/FromStringIdentityConverter.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/FromStringIdentityConverter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; /** * The identity {@link IFromStringConverter} for {@link String}s, which returns the value itself as the converted diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/IFromStringConverter.java b/common/source/java/ch/systemsx/cisd/common/collections/IFromStringConverter.java similarity index 95% rename from common/source/java/ch/systemsx/cisd/common/utilities/IFromStringConverter.java rename to common/source/java/ch/systemsx/cisd/common/collections/IFromStringConverter.java index f8d47cfca7f..d20a79fa332 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/IFromStringConverter.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/IFromStringConverter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; /** * This converter represents a role that can convert a <var>String</var> to some other <var>Object</var>. diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/IToStringConverter.java b/common/source/java/ch/systemsx/cisd/common/collections/IToStringConverter.java similarity index 95% rename from common/source/java/ch/systemsx/cisd/common/utilities/IToStringConverter.java rename to common/source/java/ch/systemsx/cisd/common/collections/IToStringConverter.java index 1c6fe5a01d5..74ae81a19c5 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/IToStringConverter.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/IToStringConverter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; /** * This converter represents a role that can convert a <var>String</var> to some other <var>Object</var>. diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/ToStringDefaultConverter.java b/common/source/java/ch/systemsx/cisd/common/collections/ToStringDefaultConverter.java similarity index 96% rename from common/source/java/ch/systemsx/cisd/common/utilities/ToStringDefaultConverter.java rename to common/source/java/ch/systemsx/cisd/common/collections/ToStringDefaultConverter.java index 1aecc8f9deb..f4d8c64dcaa 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/ToStringDefaultConverter.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/ToStringDefaultConverter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; /** * The default converter: uses {@link Object#toString()} for conversion. diff --git a/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java b/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java index d03615f4da1..0b132316592 100644 --- a/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java +++ b/common/source/java/ch/systemsx/cisd/common/parser/MandatoryPropertyMissingException.java @@ -19,8 +19,8 @@ package ch.systemsx.cisd.common.parser; import java.util.Collections; import java.util.Set; -import ch.systemsx.cisd.common.utilities.CollectionStyle; -import ch.systemsx.cisd.common.utilities.CollectionUtils; +import ch.systemsx.cisd.common.collections.CollectionStyle; +import ch.systemsx.cisd.common.collections.CollectionUtils; /** * A <code>ParserException</code> extension which signalizes missing of a mandatory property. diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java b/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java index c58fa5b3989..4479526ac02 100644 --- a/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java +++ b/common/source/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTask.java @@ -24,6 +24,7 @@ import java.util.TimerTask; import org.apache.log4j.Logger; +import ch.systemsx.cisd.common.collections.CollectionIO; import ch.systemsx.cisd.common.logging.ISimpleLogger; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/CollectionIOTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionIOTest.java similarity index 97% rename from common/sourceTest/java/ch/systemsx/cisd/common/utilities/CollectionIOTest.java rename to common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionIOTest.java index 15853c77347..0dbbad3203d 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/CollectionIOTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionIOTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; import static org.testng.AssertJUnit.assertEquals; @@ -34,6 +34,9 @@ import java.util.Set; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; +import ch.systemsx.cisd.common.collections.CollectionIO; +import ch.systemsx.cisd.common.collections.IFromStringConverter; +import ch.systemsx.cisd.common.collections.IToStringConverter; import ch.systemsx.cisd.common.logging.LogInitializer; /** diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/CollectionUtilsTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionUtilsTest.java similarity index 97% rename from common/sourceTest/java/ch/systemsx/cisd/common/utilities/CollectionUtilsTest.java rename to common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionUtilsTest.java index e9e5f9cf8e3..c99f4634f1d 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/CollectionUtilsTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/collections/CollectionUtilsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.common.utilities; +package ch.systemsx.cisd.common.collections; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.fail; @@ -24,6 +24,8 @@ import java.util.Collection; import org.apache.commons.lang.StringUtils; import org.testng.annotations.Test; +import ch.systemsx.cisd.common.utilities.StringUtilities; + /** * Test cases for the {@link CollectionUtils} class. * diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/process/ProcessExecutionHelperTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/process/ProcessExecutionHelperTest.java index f400362e6ae..d539bf06e0d 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/process/ProcessExecutionHelperTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/process/ProcessExecutionHelperTest.java @@ -29,10 +29,10 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import ch.systemsx.cisd.common.collections.CollectionIO; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.common.logging.LogInitializer; -import ch.systemsx.cisd.common.utilities.CollectionIO; /** * Test cases for the {@link ProcessExecutionHelper}. diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTaskTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTaskTest.java index 3d225c22348..e987e4851d2 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTaskTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/utilities/DirectoryScanningTimerTaskTest.java @@ -30,6 +30,7 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import ch.systemsx.cisd.common.collections.CollectionIO; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogInitializer; import ch.systemsx.cisd.common.logging.LogMonitoringAppender; diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/RecursiveHardLinkMakerTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/utilities/RecursiveHardLinkMakerTest.java index 9b3932dd2cb..066d59af09b 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/RecursiveHardLinkMakerTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/utilities/RecursiveHardLinkMakerTest.java @@ -28,8 +28,8 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import ch.systemsx.cisd.common.collections.CollectionIO; import ch.systemsx.cisd.common.logging.LogInitializer; -import ch.systemsx.cisd.common.utilities.CollectionIO; import ch.systemsx.cisd.common.utilities.FileUtilities; import ch.systemsx.cisd.common.utilities.IPathImmutableCopier; import ch.systemsx.cisd.common.utilities.RecursiveHardLinkMaker; -- GitLab