This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 263f7cfcf1d4382de93d9d92ed2dd535db6ded13 Author: Tran Tien Duc <[email protected]> AuthorDate: Thu Jun 6 12:09:28 2019 +0700 JAMES-2146 Move FileSystemFixture to file api module to be used in other places --- .../apache/james/filesystem/api}/FileSystemFixture.java | 17 +++++++---------- server/container/guice/mailet/pom.xml | 6 ++++++ .../org/apache/james/utils/GuiceMailetLoaderTest.java | 6 +++--- .../org/apache/james/utils/GuiceMatcherLoaderTest.java | 6 +++--- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/server/container/guice/mailet/src/test/java/org/apache/james/utils/FileSystemFixture.java b/server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/FileSystemFixture.java similarity index 86% rename from server/container/guice/mailet/src/test/java/org/apache/james/utils/FileSystemFixture.java rename to server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/FileSystemFixture.java index fa6c580..b9d4cc2 100644 --- a/server/container/guice/mailet/src/test/java/org/apache/james/utils/FileSystemFixture.java +++ b/server/container/filesystem-api/src/test/java/org/apache/james/filesystem/api/FileSystemFixture.java @@ -17,22 +17,19 @@ * under the License. * ****************************************************************/ -package org.apache.james.utils; +package org.apache.james.filesystem.api; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import org.apache.commons.lang.NotImplementedException; -import org.apache.james.filesystem.api.FileSystem; - public class FileSystemFixture { public static final FileSystem THROWING_FILE_SYSTEM = new FileSystem() { @Override public InputStream getResource(String url) throws IOException { - throw new NotImplementedException(); + throw new UnsupportedOperationException(); } @Override @@ -42,14 +39,14 @@ public class FileSystemFixture { @Override public File getBasedir() throws FileNotFoundException { - throw new NotImplementedException(); + throw new UnsupportedOperationException(); } }; public static final FileSystem CLASSPATH_FILE_SYSTEM = new FileSystem() { @Override public InputStream getResource(String url) throws IOException { - throw new NotImplementedException(); + return ClassLoader.getSystemResourceAsStream(url); } @Override @@ -59,14 +56,14 @@ public class FileSystemFixture { @Override public File getBasedir() throws FileNotFoundException { - throw new NotImplementedException(); + throw new UnsupportedOperationException(); } }; public static final FileSystem RECURSIVE_CLASSPATH_FILE_SYSTEM = new FileSystem() { @Override public InputStream getResource(String url) throws IOException { - throw new NotImplementedException(); + throw new UnsupportedOperationException(); } @Override @@ -76,7 +73,7 @@ public class FileSystemFixture { @Override public File getBasedir() throws FileNotFoundException { - throw new NotImplementedException(); + throw new UnsupportedOperationException(); } }; } diff --git a/server/container/guice/mailet/pom.xml b/server/container/guice/mailet/pom.xml index b2a260b..71f324f 100644 --- a/server/container/guice/mailet/pom.xml +++ b/server/container/guice/mailet/pom.xml @@ -43,6 +43,12 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> + <artifactId>james-server-filesystem-api</artifactId> + <scope>test</scope> + <type>test-jar</type> + </dependency> + <dependency> + <groupId>${james.groupId}</groupId> <artifactId>james-server-guice-configuration</artifactId> </dependency> <dependency> diff --git a/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMailetLoaderTest.java b/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMailetLoaderTest.java index b0cfae0..129f8e7 100644 --- a/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMailetLoaderTest.java +++ b/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMailetLoaderTest.java @@ -19,9 +19,9 @@ package org.apache.james.utils; -import static org.apache.james.utils.FileSystemFixture.CLASSPATH_FILE_SYSTEM; -import static org.apache.james.utils.FileSystemFixture.RECURSIVE_CLASSPATH_FILE_SYSTEM; -import static org.apache.james.utils.FileSystemFixture.THROWING_FILE_SYSTEM; +import static org.apache.james.filesystem.api.FileSystemFixture.CLASSPATH_FILE_SYSTEM; +import static org.apache.james.filesystem.api.FileSystemFixture.RECURSIVE_CLASSPATH_FILE_SYSTEM; +import static org.apache.james.filesystem.api.FileSystemFixture.THROWING_FILE_SYSTEM; import static org.assertj.core.api.Assertions.assertThat; import javax.mail.MessagingException; diff --git a/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMatcherLoaderTest.java b/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMatcherLoaderTest.java index 01e709b..319fb7a 100644 --- a/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMatcherLoaderTest.java +++ b/server/container/guice/mailet/src/test/java/org/apache/james/utils/GuiceMatcherLoaderTest.java @@ -19,9 +19,9 @@ package org.apache.james.utils; -import static org.apache.james.utils.FileSystemFixture.CLASSPATH_FILE_SYSTEM; -import static org.apache.james.utils.FileSystemFixture.RECURSIVE_CLASSPATH_FILE_SYSTEM; -import static org.apache.james.utils.FileSystemFixture.THROWING_FILE_SYSTEM; +import static org.apache.james.filesystem.api.FileSystemFixture.CLASSPATH_FILE_SYSTEM; +import static org.apache.james.filesystem.api.FileSystemFixture.RECURSIVE_CLASSPATH_FILE_SYSTEM; +import static org.apache.james.filesystem.api.FileSystemFixture.THROWING_FILE_SYSTEM; import static org.assertj.core.api.Assertions.assertThat; import javax.mail.MessagingException; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
