[JAVA-1660] Upgrade JUnit and Maven Surefire Plugin in guava modules (#9477)
* [JAVA-1660] Upgrade JUnit and Maven Surefire Plugin versions in guava-modules * Set guava-modules parent pom's parent to parent-java and submodules' parent to guava-modules parent * Upgraded Maven Surefire Plugin version to 2.22.2 * Upgraded JUnit version to 5.6.2 * [JAVA-1660] Upgrade JUnit and Maven Surefire Plugin versions in guava * Upgraded Maven Surefire Plugin version to 2.22.2 * Upgraded JUnit version to 5.6.2 * [JAVA-1660] Upgrade JUnit and Maven Surefire Plugin versions in guava-collections * Upgraded Maven Surefire Plugin version to 2.22.2 * Upgraded JUnit version to 5.6.2 * [JAVA-1660] Upgrade JUnit and Maven Surefire Plugin versions in guava-collections-map * Upgraded Maven Surefire Plugin version to 2.22.2 * Upgraded JUnit version to 5.6.2 * [JAVA-1660] Upgrade JUnit and Maven Surefire Plugin versions in guava-collections-set * Upgraded Maven Surefire Plugin version to 2.22.2 * Upgraded JUnit version to 5.6.2 * [JAVA-1660] Upgraded JUnit and Maven Surefire Plugin in guava-io module * Fixed project structure and added missing resources to make tests work * Upgraded Maven Surefire Plugin to version 2.22.2 * Upgraded JUnit version to 5.6.2
This commit is contained in:
		
							parent
							
								
									ca9ab77e7c
								
							
						
					
					
						commit
						3e6f576265
					
				| @ -16,12 +16,39 @@ | |||||||
| 
 | 
 | ||||||
|     <build> |     <build> | ||||||
|         <finalName>guava-collections-map</finalName> |         <finalName>guava-collections-map</finalName> | ||||||
|  | 
 | ||||||
|         <resources> |         <resources> | ||||||
|             <resource> |             <resource> | ||||||
|                 <directory>src/main/resources</directory> |                 <directory>src/main/resources</directory> | ||||||
|                 <filtering>true</filtering> |                 <filtering>true</filtering> | ||||||
|             </resource> |             </resource> | ||||||
|         </resources> |         </resources> | ||||||
|  | 
 | ||||||
|  |         <plugins> | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                 <version>2.22.2</version> | ||||||
|  |             </plugin> | ||||||
|  |         </plugins> | ||||||
|     </build> |     </build> | ||||||
| 
 | 
 | ||||||
|  |     <dependencies> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.jupiter</groupId> | ||||||
|  |             <artifactId>junit-jupiter</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.vintage</groupId> | ||||||
|  |             <artifactId>junit-vintage-engine</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |     </dependencies> | ||||||
|  | 
 | ||||||
|  |     <properties> | ||||||
|  |         <junit-jupiter.version>5.6.2</junit-jupiter.version> | ||||||
|  |     </properties> | ||||||
| </project> | </project> | ||||||
| @ -13,8 +13,32 @@ | |||||||
|         <relativePath>../parent-java</relativePath> |         <relativePath>../parent-java</relativePath> | ||||||
|     </parent> |     </parent> | ||||||
| 
 | 
 | ||||||
|  |     <build> | ||||||
|  |         <finalName>guava-collections-set</finalName> | ||||||
|  | 
 | ||||||
|  |         <plugins> | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                 <version>2.22.2</version> | ||||||
|  |             </plugin> | ||||||
|  |         </plugins> | ||||||
|  |     </build> | ||||||
|  | 
 | ||||||
|     <dependencies> |     <dependencies> | ||||||
|         <!-- test scoped --> |         <!-- test scoped --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.jupiter</groupId> | ||||||
|  |             <artifactId>junit-jupiter</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.vintage</groupId> | ||||||
|  |             <artifactId>junit-vintage-engine</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.assertj</groupId> |             <groupId>org.assertj</groupId> | ||||||
|             <artifactId>assertj-core</artifactId> |             <artifactId>assertj-core</artifactId> | ||||||
| @ -23,13 +47,10 @@ | |||||||
|         </dependency> |         </dependency> | ||||||
|     </dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
|     <build> |  | ||||||
|         <finalName>guava-collections-set</finalName> |  | ||||||
|     </build> |  | ||||||
| 
 |  | ||||||
|     <properties> |     <properties> | ||||||
|         <!-- testing --> |         <!-- testing --> | ||||||
|         <assertj.version>3.6.1</assertj.version> |         <assertj.version>3.6.1</assertj.version> | ||||||
|  |         <junit-jupiter.version>5.6.2</junit-jupiter.version> | ||||||
|     </properties> |     </properties> | ||||||
| 
 | 
 | ||||||
| </project> | </project> | ||||||
|  | |||||||
| @ -15,6 +15,25 @@ | |||||||
|         <relativePath>../parent-java</relativePath> |         <relativePath>../parent-java</relativePath> | ||||||
|     </parent> |     </parent> | ||||||
| 
 | 
 | ||||||
|  |     <build> | ||||||
|  |         <finalName>guava-collections</finalName> | ||||||
|  | 
 | ||||||
|  |         <resources> | ||||||
|  |             <resource> | ||||||
|  |                 <directory>src/main/resources</directory> | ||||||
|  |                 <filtering>true</filtering> | ||||||
|  |             </resource> | ||||||
|  |         </resources> | ||||||
|  | 
 | ||||||
|  |         <plugins> | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                 <version>2.22.2</version> | ||||||
|  |             </plugin> | ||||||
|  |         </plugins> | ||||||
|  |     </build> | ||||||
|  | 
 | ||||||
|     <dependencies> |     <dependencies> | ||||||
|         <!-- utils --> |         <!-- utils --> | ||||||
|         <dependency> |         <dependency> | ||||||
| @ -27,7 +46,20 @@ | |||||||
|             <artifactId>commons-lang3</artifactId> |             <artifactId>commons-lang3</artifactId> | ||||||
|             <version>${commons-lang3.version}</version> |             <version>${commons-lang3.version}</version> | ||||||
|         </dependency> |         </dependency> | ||||||
|  | 
 | ||||||
|         <!-- test scoped --> |         <!-- test scoped --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.jupiter</groupId> | ||||||
|  |             <artifactId>junit-jupiter</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.vintage</groupId> | ||||||
|  |             <artifactId>junit-vintage-engine</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.assertj</groupId> |             <groupId>org.assertj</groupId> | ||||||
|             <artifactId>assertj-core</artifactId> |             <artifactId>assertj-core</artifactId> | ||||||
| @ -44,16 +76,6 @@ | |||||||
|         </dependency> |         </dependency> | ||||||
|     </dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
|     <build> |  | ||||||
|         <finalName>guava-collections</finalName> |  | ||||||
|         <resources> |  | ||||||
|             <resource> |  | ||||||
|                 <directory>src/main/resources</directory> |  | ||||||
|                 <filtering>true</filtering> |  | ||||||
|             </resource> |  | ||||||
|         </resources> |  | ||||||
|     </build> |  | ||||||
| 
 |  | ||||||
|     <properties> |     <properties> | ||||||
|         <!-- util --> |         <!-- util --> | ||||||
|         <commons-collections4.version>4.1</commons-collections4.version> |         <commons-collections4.version>4.1</commons-collections4.version> | ||||||
| @ -61,6 +83,7 @@ | |||||||
|         <!-- testing --> |         <!-- testing --> | ||||||
|         <assertj.version>3.6.1</assertj.version> |         <assertj.version>3.6.1</assertj.version> | ||||||
|         <java-hamcrest.version>2.0.0.0</java-hamcrest.version> |         <java-hamcrest.version>2.0.0.0</java-hamcrest.version> | ||||||
|  |         <junit-jupiter.version>5.6.2</junit-jupiter.version> | ||||||
|     </properties> |     </properties> | ||||||
| 
 | 
 | ||||||
| </project> | </project> | ||||||
| @ -4,6 +4,9 @@ | |||||||
|     <modelVersion>4.0.0</modelVersion> |     <modelVersion>4.0.0</modelVersion> | ||||||
|     <artifactId>guava-io</artifactId> |     <artifactId>guava-io</artifactId> | ||||||
|     <version>0.1.0-SNAPSHOT</version> |     <version>0.1.0-SNAPSHOT</version> | ||||||
|  |     <properties> | ||||||
|  |         <junit-jupiter.version>5.6.2</junit-jupiter.version> | ||||||
|  |     </properties> | ||||||
|     <name>guava-io</name> |     <name>guava-io</name> | ||||||
| 
 | 
 | ||||||
|     <parent> |     <parent> | ||||||
| @ -15,12 +18,35 @@ | |||||||
| 
 | 
 | ||||||
|     <build> |     <build> | ||||||
|         <finalName>guava-io</finalName> |         <finalName>guava-io</finalName> | ||||||
|  | 
 | ||||||
|         <resources> |         <resources> | ||||||
|             <resource> |             <resource> | ||||||
|                 <directory>src/main/resources</directory> |                 <directory>src/main/resources</directory> | ||||||
|                 <filtering>true</filtering> |                 <filtering>true</filtering> | ||||||
|             </resource> |             </resource> | ||||||
|         </resources> |         </resources> | ||||||
|  | 
 | ||||||
|  |         <plugins> | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                 <version>2.22.2</version> | ||||||
|  |             </plugin> | ||||||
|  |         </plugins> | ||||||
|     </build> |     </build> | ||||||
| 
 | 
 | ||||||
|  |     <dependencies> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.jupiter</groupId> | ||||||
|  |             <artifactId>junit-jupiter</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.vintage</groupId> | ||||||
|  |             <artifactId>junit-vintage-engine</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |     </dependencies> | ||||||
| </project> | </project> | ||||||
| @ -11,8 +11,11 @@ import java.io.FileOutputStream; | |||||||
| import java.io.FileReader; | import java.io.FileReader; | ||||||
| import java.io.IOException; | import java.io.IOException; | ||||||
| import java.net.URL; | import java.net.URL; | ||||||
|  | import java.nio.file.Path; | ||||||
|  | import java.nio.file.Paths; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
|  | import org.junit.After; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| 
 | 
 | ||||||
| import com.google.common.base.Charsets; | import com.google.common.base.Charsets; | ||||||
| @ -31,6 +34,21 @@ import com.google.common.io.Resources; | |||||||
| 
 | 
 | ||||||
| public class GuavaIOUnitTest { | 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 |     @Test | ||||||
|     public void whenWriteUsingFiles_thenWritten() throws IOException { |     public void whenWriteUsingFiles_thenWritten() throws IOException { | ||||||
|         final String expectedValue = "Hello world"; |         final String expectedValue = "Hello world"; | ||||||
| @ -206,5 +224,4 @@ public class GuavaIOUnitTest { | |||||||
| 
 | 
 | ||||||
|         assertEquals(value, result); |         assertEquals(value, result); | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
| } | } | ||||||
							
								
								
									
										1
									
								
								guava-io/src/test/resources/test1.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								guava-io/src/test/resources/test1.in
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | |||||||
|  | Hello world | ||||||
							
								
								
									
										1
									
								
								guava-io/src/test/resources/test1_1.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								guava-io/src/test/resources/test1_1.in
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | |||||||
|  | Test | ||||||
							
								
								
									
										4
									
								
								guava-io/src/test/resources/test2.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								guava-io/src/test/resources/test2.in
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | |||||||
|  | John | ||||||
|  | Jane | ||||||
|  | Adam | ||||||
|  | Tom | ||||||
| @ -8,9 +8,9 @@ | |||||||
| 
 | 
 | ||||||
|     <parent> |     <parent> | ||||||
|         <groupId>com.baeldung</groupId> |         <groupId>com.baeldung</groupId> | ||||||
|         <artifactId>parent-java</artifactId> |         <artifactId>guava-modules</artifactId> | ||||||
|         <version>0.0.1-SNAPSHOT</version> |         <version>0.0.1-SNAPSHOT</version> | ||||||
|         <relativePath>../../parent-java</relativePath> |         <relativePath>../</relativePath> | ||||||
|     </parent> |     </parent> | ||||||
| 
 | 
 | ||||||
|     <properties> |     <properties> | ||||||
|  | |||||||
| @ -8,9 +8,9 @@ | |||||||
| 
 | 
 | ||||||
|     <parent> |     <parent> | ||||||
|         <groupId>com.baeldung</groupId> |         <groupId>com.baeldung</groupId> | ||||||
|         <artifactId>parent-java</artifactId> |         <artifactId>guava-modules</artifactId> | ||||||
|         <version>0.0.1-SNAPSHOT</version> |         <version>0.0.1-SNAPSHOT</version> | ||||||
|         <relativePath>../../parent-java</relativePath> |         <relativePath>../</relativePath> | ||||||
|     </parent> |     </parent> | ||||||
| 
 | 
 | ||||||
|     <properties> |     <properties> | ||||||
|  | |||||||
| @ -8,9 +8,9 @@ | |||||||
| 
 | 
 | ||||||
|     <parent> |     <parent> | ||||||
|         <groupId>com.baeldung</groupId> |         <groupId>com.baeldung</groupId> | ||||||
|         <artifactId>parent-java</artifactId> |         <artifactId>guava-modules</artifactId> | ||||||
|         <version>0.0.1-SNAPSHOT</version> |         <version>0.0.1-SNAPSHOT</version> | ||||||
|         <relativePath>../../parent-java</relativePath> |         <relativePath>../</relativePath> | ||||||
|     </parent> |     </parent> | ||||||
| 
 | 
 | ||||||
|     <dependencies> |     <dependencies> | ||||||
|  | |||||||
| @ -4,13 +4,16 @@ | |||||||
|     <modelVersion>4.0.0</modelVersion> |     <modelVersion>4.0.0</modelVersion> | ||||||
|     <artifactId>guava-modules</artifactId> |     <artifactId>guava-modules</artifactId> | ||||||
|     <name>guava-modules</name> |     <name>guava-modules</name> | ||||||
|  |     <properties> | ||||||
|  |         <junit-jupiter.version>5.6.2</junit-jupiter.version> | ||||||
|  |     </properties> | ||||||
|     <packaging>pom</packaging> |     <packaging>pom</packaging> | ||||||
| 
 | 
 | ||||||
|     <parent> |     <parent> | ||||||
|         <groupId>com.baeldung</groupId> |         <groupId>com.baeldung</groupId> | ||||||
|         <artifactId>parent-modules</artifactId> |         <artifactId>parent-java</artifactId> | ||||||
|         <version>1.0.0-SNAPSHOT</version> |         <version>0.0.1-SNAPSHOT</version> | ||||||
|         <relativePath>..</relativePath> |         <relativePath>../parent-java</relativePath> | ||||||
|     </parent> |     </parent> | ||||||
| 
 | 
 | ||||||
|     <modules> |     <modules> | ||||||
| @ -19,4 +22,28 @@ | |||||||
|         <module>guava-21</module> |         <module>guava-21</module> | ||||||
|     </modules> |     </modules> | ||||||
| 
 | 
 | ||||||
|  |     <build> | ||||||
|  |         <plugins> | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                 <version>2.22.2</version> | ||||||
|  |             </plugin> | ||||||
|  |         </plugins> | ||||||
|  |     </build> | ||||||
|  | 
 | ||||||
|  |     <dependencies> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.jupiter</groupId> | ||||||
|  |             <artifactId>junit-jupiter</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.vintage</groupId> | ||||||
|  |             <artifactId>junit-vintage-engine</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |     </dependencies> | ||||||
| </project> | </project> | ||||||
|  | |||||||
| @ -15,13 +15,45 @@ | |||||||
|         <relativePath>../parent-java</relativePath> |         <relativePath>../parent-java</relativePath> | ||||||
|     </parent> |     </parent> | ||||||
| 
 | 
 | ||||||
|  |     <build> | ||||||
|  |         <finalName>guava</finalName> | ||||||
|  | 
 | ||||||
|  |         <resources> | ||||||
|  |             <resource> | ||||||
|  |                 <directory>src/main/resources</directory> | ||||||
|  |                 <filtering>true</filtering> | ||||||
|  |             </resource> | ||||||
|  |         </resources> | ||||||
|  | 
 | ||||||
|  |         <plugins> | ||||||
|  |             <plugin> | ||||||
|  |                 <groupId>org.apache.maven.plugins</groupId> | ||||||
|  |                 <artifactId>maven-surefire-plugin</artifactId> | ||||||
|  |                 <version>2.22.2</version> | ||||||
|  |             </plugin> | ||||||
|  |         </plugins> | ||||||
|  |     </build> | ||||||
|  | 
 | ||||||
|     <dependencies> |     <dependencies> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.apache.commons</groupId> |             <groupId>org.apache.commons</groupId> | ||||||
|             <artifactId>commons-lang3</artifactId> |             <artifactId>commons-lang3</artifactId> | ||||||
|             <version>${commons-lang3.version}</version> |             <version>${commons-lang3.version}</version> | ||||||
|         </dependency> |         </dependency> | ||||||
|  | 
 | ||||||
|         <!-- test scoped --> |         <!-- test scoped --> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.jupiter</groupId> | ||||||
|  |             <artifactId>junit-jupiter</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.junit.vintage</groupId> | ||||||
|  |             <artifactId>junit-vintage-engine</artifactId> | ||||||
|  |             <version>${junit-jupiter.version}</version> | ||||||
|  |             <scope>test</scope> | ||||||
|  |         </dependency> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.assertj</groupId> |             <groupId>org.assertj</groupId> | ||||||
|             <artifactId>assertj-core</artifactId> |             <artifactId>assertj-core</artifactId> | ||||||
| @ -30,18 +62,9 @@ | |||||||
|         </dependency> |         </dependency> | ||||||
|     </dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
|     <build> |  | ||||||
|         <finalName>guava</finalName> |  | ||||||
|         <resources> |  | ||||||
|             <resource> |  | ||||||
|                 <directory>src/main/resources</directory> |  | ||||||
|                 <filtering>true</filtering> |  | ||||||
|             </resource> |  | ||||||
|         </resources> |  | ||||||
|     </build> |  | ||||||
| 
 |  | ||||||
|     <properties> |     <properties> | ||||||
|         <!-- testing --> |         <!-- testing --> | ||||||
|  |         <junit-jupiter.version>5.6.2</junit-jupiter.version> | ||||||
|         <assertj.version>3.6.1</assertj.version> |         <assertj.version>3.6.1</assertj.version> | ||||||
|     </properties> |     </properties> | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user