diff --git a/guava-collections-map/pom.xml b/guava-collections-map/pom.xml index ee8ceb10f3..06537d26bd 100644 --- a/guava-collections-map/pom.xml +++ b/guava-collections-map/pom.xml @@ -16,12 +16,39 @@ guava-collections-map + src/main/resources true + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + + + + + 5.6.2 + \ No newline at end of file diff --git a/guava-collections-set/pom.xml b/guava-collections-set/pom.xml index 8bb0b924f9..49d96965a7 100644 --- a/guava-collections-set/pom.xml +++ b/guava-collections-set/pom.xml @@ -13,8 +13,32 @@ ../parent-java + + guava-collections-set + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + org.assertj assertj-core @@ -23,13 +47,10 @@ - - guava-collections-set - - 3.6.1 + 5.6.2 diff --git a/guava-collections/pom.xml b/guava-collections/pom.xml index c6019362c5..744eba1a38 100644 --- a/guava-collections/pom.xml +++ b/guava-collections/pom.xml @@ -15,6 +15,25 @@ ../parent-java + + guava-collections + + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + @@ -27,7 +46,20 @@ commons-lang3 ${commons-lang3.version} + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + org.assertj assertj-core @@ -44,16 +76,6 @@ - - guava-collections - - - src/main/resources - true - - - - 4.1 @@ -61,6 +83,7 @@ 3.6.1 2.0.0.0 + 5.6.2 \ No newline at end of file diff --git a/guava-io/pom.xml b/guava-io/pom.xml index 7517d442b0..fd637f2474 100644 --- a/guava-io/pom.xml +++ b/guava-io/pom.xml @@ -4,6 +4,9 @@ 4.0.0 guava-io 0.1.0-SNAPSHOT + + 5.6.2 + guava-io @@ -15,12 +18,35 @@ guava-io + src/main/resources true + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + + \ No newline at end of file diff --git a/guava-io/src/main/test/java/com/baeldung/guava/GuavaCountingOutputStreamUnitTest.java b/guava-io/src/test/java/com/baeldung/guava/GuavaCountingOutputStreamUnitTest.java similarity index 100% rename from guava-io/src/main/test/java/com/baeldung/guava/GuavaCountingOutputStreamUnitTest.java rename to guava-io/src/test/java/com/baeldung/guava/GuavaCountingOutputStreamUnitTest.java diff --git a/guava-io/src/main/test/java/com/baeldung/guava/GuavaIOUnitTest.java b/guava-io/src/test/java/com/baeldung/guava/GuavaIOUnitTest.java similarity index 93% rename from guava-io/src/main/test/java/com/baeldung/guava/GuavaIOUnitTest.java rename to guava-io/src/test/java/com/baeldung/guava/GuavaIOUnitTest.java index 7d7b0ea04d..4d7c688f58 100644 --- a/guava-io/src/main/test/java/com/baeldung/guava/GuavaIOUnitTest.java +++ b/guava-io/src/test/java/com/baeldung/guava/GuavaIOUnitTest.java @@ -11,8 +11,11 @@ import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.List; +import org.junit.After; import org.junit.Test; import com.google.common.base.Charsets; @@ -31,6 +34,21 @@ import com.google.common.io.Resources; public class GuavaIOUnitTest { + @After + public void afterEach() throws Exception { + deleteProducedFiles(); + } + + private void deleteProducedFiles() throws IOException { + deleteIfExists("test.out"); + deleteIfExists("test_copy.in"); + deleteIfExists("test_le.txt"); + } + + private void deleteIfExists(String fileName) throws IOException { + java.nio.file.Files.deleteIfExists(Paths.get("src", "test", "resources", fileName)); + } + @Test public void whenWriteUsingFiles_thenWritten() throws IOException { final String expectedValue = "Hello world"; @@ -206,5 +224,4 @@ public class GuavaIOUnitTest { assertEquals(value, result); } - } diff --git a/guava-io/src/test/resources/test1.in b/guava-io/src/test/resources/test1.in new file mode 100644 index 0000000000..70c379b63f --- /dev/null +++ b/guava-io/src/test/resources/test1.in @@ -0,0 +1 @@ +Hello world \ No newline at end of file diff --git a/guava-io/src/test/resources/test1_1.in b/guava-io/src/test/resources/test1_1.in new file mode 100644 index 0000000000..8318c86b35 --- /dev/null +++ b/guava-io/src/test/resources/test1_1.in @@ -0,0 +1 @@ +Test \ No newline at end of file diff --git a/guava-io/src/test/resources/test2.in b/guava-io/src/test/resources/test2.in new file mode 100644 index 0000000000..622efea9e6 --- /dev/null +++ b/guava-io/src/test/resources/test2.in @@ -0,0 +1,4 @@ +John +Jane +Adam +Tom \ No newline at end of file diff --git a/guava-modules/guava-18/pom.xml b/guava-modules/guava-18/pom.xml index 30d9f953ac..d65fab1e57 100644 --- a/guava-modules/guava-18/pom.xml +++ b/guava-modules/guava-18/pom.xml @@ -8,9 +8,9 @@ com.baeldung - parent-java + guava-modules 0.0.1-SNAPSHOT - ../../parent-java + ../ diff --git a/guava-modules/guava-19/pom.xml b/guava-modules/guava-19/pom.xml index 0060afd426..20a405cff4 100644 --- a/guava-modules/guava-19/pom.xml +++ b/guava-modules/guava-19/pom.xml @@ -8,9 +8,9 @@ com.baeldung - parent-java + guava-modules 0.0.1-SNAPSHOT - ../../parent-java + ../ diff --git a/guava-modules/guava-21/pom.xml b/guava-modules/guava-21/pom.xml index 7932cfa6d8..b126df99cb 100644 --- a/guava-modules/guava-21/pom.xml +++ b/guava-modules/guava-21/pom.xml @@ -8,9 +8,9 @@ com.baeldung - parent-java + guava-modules 0.0.1-SNAPSHOT - ../../parent-java + ../ diff --git a/guava-modules/pom.xml b/guava-modules/pom.xml index 2b899df162..4e7282364d 100644 --- a/guava-modules/pom.xml +++ b/guava-modules/pom.xml @@ -4,13 +4,16 @@ 4.0.0 guava-modules guava-modules + + 5.6.2 + pom com.baeldung - parent-modules - 1.0.0-SNAPSHOT - .. + parent-java + 0.0.1-SNAPSHOT + ../parent-java @@ -19,4 +22,28 @@ guava-21 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + + diff --git a/guava/pom.xml b/guava/pom.xml index df6d57bd09..881390ae73 100644 --- a/guava/pom.xml +++ b/guava/pom.xml @@ -15,13 +15,45 @@ ../parent-java + + guava + + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + org.apache.commons commons-lang3 ${commons-lang3.version} + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + org.assertj assertj-core @@ -30,18 +62,9 @@ - - guava - - - src/main/resources - true - - - - + 5.6.2 3.6.1