slawekjaranowski commented on a change in pull request #104:
URL:
https://github.com/apache/maven-invoker-plugin/pull/104#discussion_r816106236
##########
File path: src/test/java/org/apache/maven/plugins/invoker/SelectorUtilsTest.java
##########
@@ -120,26 +124,45 @@ public void testIsMatchingToolchain() throws Exception
when( jdkMismatch.getType() ).thenReturn( "jdk" );
when( toolchainPrivateManager.getToolchainPrivates( "jdk" ) )
- .thenReturn( new ToolchainPrivate[] { jdkMatching } );
+ .thenReturn( new ToolchainPrivate[] {jdkMatching} );
assertTrue( SelectorUtils.isToolchain( toolchainPrivateManager,
Collections.singleton( openJdk9 ) ) );
when( toolchainPrivateManager.getToolchainPrivates( "jdk" ) )
- .thenReturn( new ToolchainPrivate[] { jdkMismatch } );
+ .thenReturn( new ToolchainPrivate[] {jdkMismatch} );
assertFalse( SelectorUtils.isToolchain( toolchainPrivateManager,
Collections.singleton( openJdk9 ) ) );
when( toolchainPrivateManager.getToolchainPrivates( "jdk" ) )
- .thenReturn( new ToolchainPrivate[] { jdkMatching,
jdkMismatch, jdkMatching } );
+ .thenReturn( new ToolchainPrivate[] {jdkMatching, jdkMismatch,
jdkMatching} );
assertTrue( SelectorUtils.isToolchain( toolchainPrivateManager,
Collections.singleton( openJdk9 ) ) );
when( toolchainPrivateManager.getToolchainPrivates( "jdk" ) )
- .thenReturn( new ToolchainPrivate[0] );
+ .thenReturn( new ToolchainPrivate[0] );
assertFalse( SelectorUtils.isToolchain( toolchainPrivateManager,
Collections.singleton( openJdk9 ) ) );
when( toolchainPrivateManager.getToolchainPrivates( "jdk" ) )
- .thenReturn( new ToolchainPrivate[] { jdkMatching } );
+ .thenReturn( new ToolchainPrivate[] {jdkMatching} );
when( toolchainPrivateManager.getToolchainPrivates( "maven" ) )
- .thenReturn( new ToolchainPrivate[0] );
+ .thenReturn( new ToolchainPrivate[0] );
assertFalse( SelectorUtils.isToolchain( toolchainPrivateManager,
Arrays.asList( openJdk9, maven360 ) ) );
}
+ @Test
+ public void mavenVersionForNotExistingMavenHomeThrowException()
+ {
+ File mavenHome = new File( "not-existing-path" );
+
+ assertThatCode( () -> SelectorUtils.getMavenVersion( mavenHome ) )
+ .isExactlyInstanceOf( IOException.class )
Review comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]