You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2022/12/23 20:06:13 UTC
[maven-surefire] branch master updated: [NO-JIRA] Refactor integration tests module (#576)
This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new 781592743 [NO-JIRA] Refactor integration tests module (#576)
781592743 is described below
commit 78159274330eb99279a77e9a5fb4e7c6d4bf8b06
Author: Simon <84...@users.noreply.github.com>
AuthorDate: Fri Dec 23 21:06:07 2022 +0100
[NO-JIRA] Refactor integration tests module (#576)
* Remove test configuration that has been commented since 2015
* Remove unnecessary throws declarations
* Remove some unused declarations
* Remove commented code blocks that have not been touched for a long time
* Optimize imports
* Use proper junit assertions
---
.../its/AbstractTestMultipleMethodPatterns.java | 22 ----------------
.../its/CheckTestNgCustomTestRunnerFactoryIT.java | 3 ++-
.../maven/surefire/its/CheckTestNgJdk14IT.java | 1 -
.../surefire/its/CheckTestNgReportTestIT.java | 1 -
.../maven/surefire/its/CheckTestNgVersionsIT.java | 30 ----------------------
.../maven/surefire/its/ClasspathFilteringIT.java | 1 -
.../apache/maven/surefire/its/FailFastJUnitIT.java | 4 ---
.../maven/surefire/its/FailFastTestNgIT.java | 2 --
.../org/apache/maven/surefire/its/ForkCountIT.java | 17 ++++++------
.../surefire/its/JUnit47RedirectOutputIT.java | 5 ----
.../its/JUnit47RerunFailingTestWithCucumberIT.java | 7 ++---
.../surefire/its/JUnit4RerunFailingTestsIT.java | 5 ----
.../maven/surefire/its/JUnit4RunListenerIT.java | 2 --
.../org/apache/maven/surefire/its/JUnitDepIT.java | 8 +++---
.../maven/surefire/its/Junit5ModulePathIT.java | 4 ---
.../maven/surefire/its/LongWindowsPathIT.java | 9 ++-----
.../apache/maven/surefire/its/ModulePathIT.java | 4 ---
.../surefire/its/MultiModuleProjectWithJPMSIT.java | 3 ++-
.../apache/maven/surefire/its/ReporterTime.java | 27 -------------------
.../maven/surefire/its/ResultCountingIT.java | 7 -----
.../org/apache/maven/surefire/its/RunOrderIT.java | 16 ++++++------
.../maven/surefire/its/SmartStackTraceIT.java | 1 -
.../apache/maven/surefire/its/Surefire1602IT.java | 3 ++-
.../maven/surefire/its/TestMethodPatternIT.java | 6 ++---
.../maven/surefire/its/TestMultipleMethodsIT.java | 4 ---
.../maven/surefire/its/TestSingleMethodIT.java | 22 +++++-----------
.../maven/surefire/its/TimeoutForkedTestIT.java | 3 +--
.../apache/maven/surefire/its/TwoTestCasesIT.java | 4 ---
.../its/WorkingDirectoryIsInvalidPropertyIT.java | 3 +--
.../maven/surefire/its/XmlReporterRunTimeIT.java | 1 -
.../surefire/its/fixture/AbstractJava9PlusIT.java | 4 +--
.../maven/surefire/its/fixture/TestFile.java | 3 ++-
...36NonFilterableJUnitRunnerWithCategoriesIT.java | 5 ++--
.../its/jiras/Surefire1144XmlRunTimeIT.java | 1 -
.../its/jiras/Surefire1158RemoveInfoLinesIT.java | 4 +--
.../its/jiras/Surefire1202RerunAndSkipIT.java | 3 ---
.../surefire/its/jiras/Surefire1265Java9IT.java | 4 +--
...urefire1534ReuseForksFalseWithJavaModuleIT.java | 5 ----
.../maven/surefire/its/jiras/Surefire1881IT.java | 2 +-
.../its/jiras/Surefire257NotRerunningTestsIT.java | 2 +-
.../Surefire570MultipleReportDirectoriesIT.java | 1 -
.../its/jiras/Surefire772BothReportsIT.java | 3 ---
.../its/jiras/Surefire772NoFailsafeReportsIT.java | 3 +--
.../its/jiras/Surefire817SystemExitIT.java | 4 +--
.../its/jiras/Surefire943ReportContentIT.java | 8 +++---
.../its/jiras/Surefire975DefaultVMEncodingIT.java | 1 -
.../its/jiras/Surefire979WrongClassLoaderIT.java | 1 -
.../jiras/Surefire995CategoryInheritanceIT.java | 2 +-
48 files changed, 60 insertions(+), 221 deletions(-)
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java
index 055c40711..f1a643e29 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractTestMultipleMethodPatterns.java
@@ -101,7 +101,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void simpleNameTest()
- throws Exception
{
prepare( "TestTwo" )
.executeTest()
@@ -113,7 +112,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void simpleNameTestAsParallel()
- throws Exception
{
assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
prepare( "TestTwo" )
@@ -128,7 +126,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void simpleNameTestWithJavaExt()
- throws Exception
{
prepare( "TestTwo.java" )
.executeTest()
@@ -140,7 +137,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void simpleNameTestWithWildcardPkg()
- throws Exception
{
prepare( "**/TestTwo" )
.executeTest()
@@ -152,7 +148,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void simpleNameTestWithJavaExtWildcardPkg()
- throws Exception
{
prepare( "**/TestTwo.java" )
.executeTest()
@@ -164,7 +159,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void fullyQualifiedTest()
- throws Exception
{
prepare( "jiras/surefire745/TestTwo.java" )
.executeTest()
@@ -176,7 +170,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchSimpleClassNameAndMethod()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "BasicTest#testSuccessTwo" )
@@ -230,7 +223,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchWildcardPackageAndClassAndMethod()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "jiras/**/BasicTest#testSuccessTwo" )
@@ -242,7 +234,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void regexClass()
- throws Exception
{
prepare( "%regex[.*.TestTwo.*]" )
.executeTest()
@@ -254,7 +245,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void testSuccessTwo()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "#testSuccessTwo" )
@@ -266,7 +256,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void testRegexSuccessTwo()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "%regex[#testSuccessTwo]" )
@@ -277,7 +266,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void regexClassAndMethod()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "%regex[.*.BasicTest.*#testSuccessTwo]" )
@@ -289,7 +277,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchExactClassAndMethodWildcard()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "BasicTest#test*One" )
@@ -301,7 +288,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchExactClassAndMethodsWildcard()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "BasicTest#testSuccess*" )
@@ -314,7 +300,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchExactClassAndMethodCharacters()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "BasicTest#test???????One" )
@@ -326,7 +311,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchExactClassAndMethodsPostfix()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "TestFive#testSuccess???" )
@@ -339,7 +323,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchExactClassAndMethodPostfix()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "TestFive#testSuccess?????" )
@@ -351,7 +334,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchExactClassAndMultipleMethods()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
prepare( "TestFive#testSuccessOne+testSuccessThree" )
@@ -364,7 +346,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchMultiplePatterns()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo" //2
@@ -381,7 +362,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchMultiplePatternsAsParallel()
- throws Exception
{
assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
assumeThat( getSettings().getConfiguration(), is( TEST ) );
@@ -401,7 +381,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchMultiplePatternsComplex()
- throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
String test = "**/BasicTest#testSuccessOne+testSuccessTwo" //2
@@ -418,7 +397,6 @@ public abstract class AbstractTestMultipleMethodPatterns
@Test
public void shouldMatchMultiplePatternsComplexAsParallel()
- throws Exception
{
assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
assumeThat( getSettings().getConfiguration(), is( TEST ) );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java
index 58de8fb9a..856f146a5 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java
@@ -24,6 +24,7 @@ import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
import java.io.File;
+import java.io.IOException;
import static org.assertj.core.api.Assertions.assertThat;
@@ -37,7 +38,7 @@ public class CheckTestNgCustomTestRunnerFactoryIT
{
@Test
public void testTestNgListenerReporter()
- throws Exception
+ throws IOException
{
File baseDir = unpack()
.executeTest()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgJdk14IT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgJdk14IT.java
index fe060eca6..63a970e31 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgJdk14IT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgJdk14IT.java
@@ -33,7 +33,6 @@ public class CheckTestNgJdk14IT
@Test
public void testNgJdk14()
- throws Exception
{
unpack( "/testng-jdk14" ).executeTest().verifyErrorFree( 1 );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgReportTestIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgReportTestIT.java
index a358172f7..f5efb122e 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgReportTestIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgReportTestIT.java
@@ -35,7 +35,6 @@ public class CheckTestNgReportTestIT
{
@Test
public void testNgReport()
- throws Exception
{
unpack( "/testng-simple" )
.sysProp( "testNgVersion", "5.7" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
index 9a0c1f7ed..48ac297cc 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgVersionsIT.java
@@ -45,7 +45,6 @@ public class CheckTestNgVersionsIT
{
@Test public void test47()
- throws Exception
{
runTestNgTest( "4.7", "jdk15" );
}
@@ -53,7 +52,6 @@ public class CheckTestNgVersionsIT
@Test
@Ignore( "5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024" )
public void xXXtest50()
- throws Exception
{
runTestNgTest( "5.0", "jdk15" );
}
@@ -61,139 +59,111 @@ public class CheckTestNgVersionsIT
@Test
@Ignore( "5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024" )
public void xXXtest501()
- throws Exception
{
runTestNgTest( "5.0.1", "jdk15" );
}
@Test public void test502()
- throws Exception
{
runTestNgTest( "5.0.2", "jdk15" );
}
@Test public void test51()
- throws Exception
{
runTestNgTest( "5.1", "jdk15" );
}
@Test public void test55()
- throws Exception
{
runTestNgTest( "5.5", "jdk15" );
}
@Test public void test56()
- throws Exception
{
runTestNgTest( "5.6", "jdk15" );
}
@Test public void test57()
- throws Exception
{
runTestNgTest( "5.7", "jdk15" );
}
@Test public void test58()
- throws Exception
{
runTestNgTest( "5.8", "jdk15" );
}
@Test public void test59()
- throws Exception
{
runTestNgTest( "5.9", "jdk15" );
}
@Test public void test510()
- throws Exception
{
runTestNgTest( "5.10", "jdk15" );
}
@Test public void test511()
- throws Exception
{
runTestNgTest( "5.11", "jdk15" );
}
@Test public void test512()
- throws Exception
{
runTestNgTest( "5.12.1" );
}
@Test public void test513()
- throws Exception
{
runTestNgTest( "5.13" );
}
@Test public void test5131()
- throws Exception
{
runTestNgTest( "5.13.1" );
}
@Test public void test514()
- throws Exception
{
runTestNgTest( "5.14" );
}
@Test public void test5141()
- throws Exception
{
runTestNgTest( "5.14.1" );
}
@Test public void test5142()
- throws Exception
{
runTestNgTest( "5.14.2" );
}
@Test public void test60()
- throws Exception
{
runTestNgTest( "6.0" );
}
@Test public void test685()
- throws Exception
{
runTestNgTestWithRunOrder( "6.8.5" );
}
private void runTestNgTestWithRunOrder( String version )
- throws Exception
{
runTestNgTest( version, null, true );
}
private void runTestNgTest( String version )
- throws Exception
{
runTestNgTest( version, null, false );
}
- private void runTestNgTest( String version, boolean validateRunOrder )
- throws Exception
- {
- runTestNgTest( version, null, validateRunOrder );
- }
-
private void runTestNgTest( String version, String classifier )
- throws Exception
{
runTestNgTest( version, classifier, false );
}
private void runTestNgTest( String version, String classifier, boolean validateRunOrder )
- throws Exception
{
final SurefireLauncher launcher = unpack( "testng-simple" )
.sysProp( "testNgVersion", version );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ClasspathFilteringIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ClasspathFilteringIT.java
index 89aada7b6..48a18e1e7 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ClasspathFilteringIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ClasspathFilteringIT.java
@@ -32,7 +32,6 @@ public class ClasspathFilteringIT
{
@Test
public void additionalClasspath()
- throws Exception
{
unpack( "classpath-filtering" ).debugLogging().executeTest().verifyErrorFree( 1 );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastJUnitIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastJUnitIT.java
index b3be032a0..8f18ec195 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastJUnitIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastJUnitIT.java
@@ -65,10 +65,6 @@ public class FailFastJUnitIT
args.add( new Object[] { "junit4-twoForks-ff3", "junit4", props( 2, 3, true ), 5, 0, 2, 0, true } );
args.add( new Object[] { "junit47-twoForks-ff3", "junit47", props( 2, 3, true ), 5, 0, 2, 0, true } );
args.add( new Object[] { "junit47-twoForks-ff3-tcp", "junit47", props( 2, 3, true ), 5, 0, 2, 0, false } );
- /*args.add( new Object[] { "junit4-twoForks-ff1x","junit4", props( 2, 1, false ), 5, 0, 2, 3 } );
- args.add( new Object[] { "junit47-twoForks-ff1x","junit47",props( 2, 1, false ), 5, 0, 2, 3 } );
- args.add( new Object[] { "junit4-twoForks-ff2x","junit4", props( 2, 2, false ), 5, 0, 2, 2 } );
- args.add( new Object[] { "junit47-twoForks-ff2x","junit47",props( 2, 2, false ), 5, 0, 2, 2 } );*/
return args;
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastTestNgIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastTestNgIT.java
index e282a2146..d8df1d4fa 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastTestNgIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/FailFastTestNgIT.java
@@ -60,8 +60,6 @@ public class FailFastTestNgIT
args.add( new Object[] { "testng-oneFork-ff3", null, props( 1, 3, true ), 5, 2, 0, 0, true } );
args.add( new Object[] { "testng-twoForks-ff3", null, props( 2, 3, true ), 5, 2, 0, 0, true } );
args.add( new Object[] { "testng-twoForks-ff3-tcp", null, props( 2, 3, true ), 5, 2, 0, 0, false } );
- /*args.add( new Object[] { "testng-twoForks-ff1x", null, props( 2, 1, false ), 5, 2, 0, 3 } );
- args.add( new Object[] { "testng-twoForks-ff2x", null, props( 2, 2, false ), 5, 2, 0, 2 } );*/
return args;
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkCountIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkCountIT.java
index ea0fab8c6..0eebb83e1 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkCountIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkCountIT.java
@@ -20,7 +20,7 @@ package org.apache.maven.surefire.its;
*/
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.fail;
import java.util.Arrays;
@@ -47,7 +47,6 @@ public class ForkCountIT
@BeforeClass
public static void installDumpPidPlugin()
- throws Exception
{
unpack( ForkCountIT.class, "test-helper-dump-pid-plugin", "plugin" ).executeInstall();
}
@@ -71,7 +70,7 @@ public class ForkCountIT
.threadCount( threadCount ) );
assertSamePids( pids );
assertEndWith( pids, "_1_1", 3 );
- assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) );
+ assertNotEquals( "pid 1 is not the same as the main process' pid", pids[0], getMainPID() );
}
@Test
@@ -83,7 +82,7 @@ public class ForkCountIT
.threadCount( threadCount )
.addGoal( "-DsleepLength=7200" ) );
assertDifferentPids( pids, 2 );
- assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) );
+ assertNotEquals( "pid 1 is not the same as the main process' pid", pids[0], getMainPID() );
}
@Test
@@ -92,7 +91,7 @@ public class ForkCountIT
String[] pids = doTest( unpack( getProject() ).setForkJvm().forkCount( 1 ).reuseForks( false ) );
assertDifferentPids( pids );
assertEndWith( pids, "_1_1", 3 );
- assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) );
+ assertNotEquals( "pid 1 is not the same as the main process' pid", pids[0], getMainPID() );
}
@Test
@@ -101,7 +100,7 @@ public class ForkCountIT
String[] pids = doTest( unpack( getProject() ).setForkJvm().forkCount( 1 ).reuseForks( true ) );
assertSamePids( pids );
assertEndWith( pids, "_1_1", 3 );
- assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) );
+ assertNotEquals( "pid 1 is not the same as the main process' pid", pids[0], getMainPID() );
}
@Test
@@ -110,7 +109,7 @@ public class ForkCountIT
String[] pids = doTest( unpack( getProject() ).setForkJvm().forkCount( 2 ).reuseForks( false )
.addGoal( "-DsleepLength=7200" ) );
assertDifferentPids( pids );
- assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) );
+ assertNotEquals( "pid 1 is not the same as the main process' pid", pids[0], getMainPID() );
}
@Test
@@ -119,7 +118,7 @@ public class ForkCountIT
String[] pids =
doTest( unpack( getProject() ).forkCount( 2 ).reuseForks( true ).addGoal( "-DsleepLength=7200" ) );
assertDifferentPids( pids, 2 );
- assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) );
+ assertNotEquals( "pid 1 is not the same as the main process' pid", pids[0], getMainPID() );
}
private void assertEndWith( String[] pids, String suffix, int expectedMatches )
@@ -147,7 +146,7 @@ public class ForkCountIT
{
String[] pids = doTest( unpack( getProject() ).forkOnce() );
assertSamePids( pids );
- assertFalse( "pid 1 is not the same as the main process' pid", pids[0].equals( getMainPID() ) );
+ assertNotEquals( "pid 1 is not the same as the main process' pid", pids[0], getMainPID() );
}
private String getMainPID()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java
index 437d24a2f..758fae084 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RedirectOutputIT.java
@@ -25,8 +25,6 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
-import java.io.IOException;
-
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@@ -38,7 +36,6 @@ public class JUnit47RedirectOutputIT
{
@Test
public void testPrintSummaryTrueWithRedirect()
- throws Exception
{
final OutputValidator clean = unpack().redirectToFile( true ).addGoal( "clean" ).executeTest();
checkReports( clean );
@@ -46,7 +43,6 @@ public class JUnit47RedirectOutputIT
@Test
public void testClassesParallel()
- throws Exception
{
final OutputValidator clean =
unpack().redirectToFile( true ).parallelClasses().addGoal( "clean" ).executeTest();
@@ -54,7 +50,6 @@ public class JUnit47RedirectOutputIT
}
private void checkReports( OutputValidator validator )
- throws IOException
{
String report = StringUtils.trimToNull(
validator.getSurefireReportsFile( "junit47ConsoleOutput.Test1-output.txt" ).readFileToString() );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java
index c20ec1ec3..13c48d6b9 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47RerunFailingTestWithCucumberIT.java
@@ -21,6 +21,7 @@ package org.apache.maven.surefire.its;
import java.util.ArrayList;
+import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
@@ -77,7 +78,7 @@ public class JUnit47RerunFailingTestWithCucumberIT extends SurefireJUnit4Integra
@Test
public void testRerunFailingErrorTestsFalse()
- throws Exception
+ throws VerificationException
{
String cls = profileId == null ? LEGACY_FORK_NODE : SUREFIRE_FORK_NODE;
unpack()
@@ -94,7 +95,7 @@ public class JUnit47RerunFailingTestWithCucumberIT extends SurefireJUnit4Integra
@Test
public void testRerunFailingErrorTestsWithOneRetry()
- throws Exception
+ throws VerificationException
{
String cls = profileId == null ? LEGACY_FORK_NODE : SUREFIRE_FORK_NODE;
unpack()
@@ -111,7 +112,7 @@ public class JUnit47RerunFailingTestWithCucumberIT extends SurefireJUnit4Integra
@Test
public void testRerunFailingErrorTestsTwoRetry()
- throws Exception
+ throws VerificationException
{
String cls = profileId == null ? LEGACY_FORK_NODE : SUREFIRE_FORK_NODE;
unpack()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RerunFailingTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RerunFailingTestsIT.java
index c5c4a21c0..aff6c176a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RerunFailingTestsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RerunFailingTestsIT.java
@@ -39,7 +39,6 @@ public class JUnit4RerunFailingTestsIT
@Test
public void testRerunFailingErrorTestsWithOneRetry()
- throws Exception
{
OutputValidator outputValidator =
unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.13" ).maven().addGoal(
@@ -65,7 +64,6 @@ public class JUnit4RerunFailingTestsIT
@Test
public void testRerunFailingErrorTestsTwoRetry()
- throws Exception
{
// Four flakes, both tests have been re-run twice
OutputValidator outputValidator =
@@ -95,7 +93,6 @@ public class JUnit4RerunFailingTestsIT
@Test
public void testRerunFailingErrorTestsFalse()
- throws Exception
{
OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion(
"4.13" ).maven().withFailure().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 );
@@ -122,7 +119,6 @@ public class JUnit4RerunFailingTestsIT
@Test
public void testRerunOneTestClass()
- throws Exception
{
OutputValidator outputValidator =
unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.13" ).maven().addGoal(
@@ -154,7 +150,6 @@ public class JUnit4RerunFailingTestsIT
@Test
public void testRerunOneTestMethod()
- throws Exception
{
OutputValidator outputValidator =
unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion( "4.13" ).maven().addGoal(
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java
index 433863e64..adf96e62b 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4RunListenerIT.java
@@ -39,7 +39,6 @@ public class JUnit4RunListenerIT
@Test
public void testJUnit4RunListener()
- throws Exception
{
final OutputValidator outputValidator = unpack().addGoal( "-Dprovider=surefire-junit4" ).setJUnitVersion(
"4.4" ).executeTest().verifyErrorFreeLog();
@@ -51,7 +50,6 @@ public class JUnit4RunListenerIT
@Test
public void testRunlistenerJunitCoreProvider()
- throws Exception
{
final OutputValidator outputValidator =
unpack().addGoal( "-Dprovider=surefire-junit47" ).setJUnitVersion( "4.8.1" ).addGoal(
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitDepIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitDepIT.java
index 045473aac..11590fbb2 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitDepIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitDepIT.java
@@ -36,28 +36,28 @@ public class JUnitDepIT extends SurefireJUnit4IntegrationTestCase
}
@Test
- public void testJUnit44Dep() throws Exception
+ public void testJUnit44Dep()
{
unpack().debugLogging().sysProp( "junit-dep.version", "4.4" ).executeTest().verifyErrorFree(
1 ).verifyTextInLog( "surefire-junit4" ); // Ahem. Will match on the 4.7 provider too
}
@Test
- public void testJUnit44DepWithSneaky381() throws Exception
+ public void testJUnit44DepWithSneaky381()
{
unpack().debugLogging().sysProp( "junit-dep.version", "4.4" ).activateProfile(
"provided381" ).executeTest().verifyErrorFree( 1 );
}
@Test
- public void testJUnit47Dep() throws Exception
+ public void testJUnit47Dep()
{
unpack().debugLogging().sysProp( "junit-dep.version", "4.7" ).executeTest().verifyErrorFree(
1 ).verifyTextInLog( "surefire-junit47" );
}
@Test
- public void testJUnit48Dep() throws Exception
+ public void testJUnit48Dep()
{
unpack().debugLogging().sysProp( "junit-dep.version", "4.8" ).executeTest().verifyErrorFree(
1 ).verifyTextInLog( "surefire-junit47" );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/Junit5ModulePathIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/Junit5ModulePathIT.java
index aafb230ab..08991326c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/Junit5ModulePathIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/Junit5ModulePathIT.java
@@ -19,8 +19,6 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import java.io.IOException;
-
import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
@@ -34,7 +32,6 @@ public class Junit5ModulePathIT
@Test
public void testModulePath()
- throws IOException
{
assumeJava9()
.debugLogging()
@@ -45,7 +42,6 @@ public class Junit5ModulePathIT
@Test
public void testModulePathWithSpaces()
- throws IOException
{
suffix = " with spaces";
assumeJava9()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java
index 7b4cddd20..362128740 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java
@@ -25,7 +25,6 @@ import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
import java.io.File;
-import java.io.IOException;
import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
import static org.assertj.core.api.Assertions.assertThat;
@@ -45,10 +44,6 @@ public class LongWindowsPathIT
extends SurefireJUnit4IntegrationTestCase
{
private static final String PROJECT_DIR = "long-windows-path";
- private static final String LONG_PATH = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
-
- // the IT engine crashes using long path
- private static final String LONG_DIR = LONG_PATH + LONG_PATH + LONG_PATH;
@Test
public void shouldRunInSystemTmp() throws Exception
@@ -81,8 +76,8 @@ public class LongWindowsPathIT
}
}
- private SurefireLauncher unpack() throws IOException
+ private SurefireLauncher unpack()
{
- return unpack( PROJECT_DIR/*, "_" + LONG_DIR*/ );
+ return unpack( PROJECT_DIR );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java
index c04a1eaee..92d643149 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ModulePathIT.java
@@ -22,8 +22,6 @@ package org.apache.maven.surefire.its;
import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
-import java.io.IOException;
-
/**
*
*/
@@ -34,7 +32,6 @@ public class ModulePathIT
@Test
public void testModulePath()
- throws IOException
{
assumeJava9()
.debugLogging()
@@ -45,7 +42,6 @@ public class ModulePathIT
@Test
public void testModulePathWithSpaces()
- throws IOException
{
suffix = " with spaces";
assumeJava9()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java
index 30703ba95..b5d780603 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.its;
* under the License.
*/
+import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.junit.Test;
@@ -35,7 +36,7 @@ import static org.hamcrest.Matchers.is;
public class MultiModuleProjectWithJPMSIT extends AbstractJava9PlusIT
{
@Test
- public void test() throws Exception
+ public void test() throws VerificationException
{
OutputValidator validator = assumeJava9()
.debugLogging()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ReporterTime.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ReporterTime.java
deleted file mode 100644
index d6a69d03a..000000000
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ReporterTime.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.apache.maven.surefire.its;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * @author Kristian Rosenvold
- */
-public class ReporterTime
-{
-}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java
index 6c0bb6da9..7f4a53fdd 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ResultCountingIT.java
@@ -19,13 +19,10 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
-import java.io.IOException;
-
/**
* Verifies that the providers get the result summary at the bottom of the run correctly, in different forkmodes
* SUREFIRE-613 Asserts proper test counts when running in parallel
@@ -38,27 +35,23 @@ public class ResultCountingIT
{
@Test
public void testCountingWithJunit481ForkNever()
- throws Exception
{
assertForkCount( 0, true );
}
@Test
public void testCountingWithJunit481ForkOnce()
- throws Exception
{
assertForkCount( 1, true );
}
@Test
public void testCountingWithJunit481ForkAlways()
- throws Exception
{
assertForkCount( 1, false );
}
private void assertForkCount( int forkCount, boolean reuseForks )
- throws IOException, VerificationException
{
OutputValidator outputValidator = unpack( "result-counting" ).failNever().forkCount( forkCount )
.reuseForks( reuseForks ).executeTest();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
index 906eafffa..acb5096f8 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderIT.java
@@ -44,7 +44,7 @@ public class RunOrderIT
@Test
public void testAlphabeticalJUnit4()
- throws Exception
+ throws VerificationException
{
OutputValidator validator = executeWithRunOrder( "alphabetical", "junit4" );
assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_ALPHABETICAL_ORDER );
@@ -52,7 +52,7 @@ public class RunOrderIT
@Test
public void testAlphabeticalJUnit5()
- throws Exception
+ throws VerificationException
{
OutputValidator validator = executeWithRunOrder( "alphabetical", "junit5" );
assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_ALPHABETICAL_ORDER );
@@ -60,7 +60,7 @@ public class RunOrderIT
@Test
public void testRandomJUnit4DifferentSeed()
- throws Exception
+ throws VerificationException
{
long seed = 0L;
OutputValidator validator = executeWithRandomOrder( "junit4", seed );
@@ -79,7 +79,7 @@ public class RunOrderIT
@Test
public void testRandomJUnit4SameSeed()
- throws Exception
+ throws VerificationException
{
long seed = 0L;
OutputValidator validator = executeWithRandomOrder( "junit4", seed );
@@ -111,7 +111,7 @@ public class RunOrderIT
@Test
public void testReverseAlphabeticalJUnit4()
- throws Exception
+ throws VerificationException
{
OutputValidator validator = executeWithRunOrder( "reversealphabetical", "junit4" );
assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_REVERSE_ALPHABETICAL_ORDER );
@@ -119,7 +119,7 @@ public class RunOrderIT
@Test
public void testReverseAlphabeticalJUnit5()
- throws Exception
+ throws VerificationException
{
OutputValidator validator = executeWithRunOrder( "reversealphabetical", "junit5" );
assertTestnamesAppearInSpecificOrder( validator, TESTS_IN_REVERSE_ALPHABETICAL_ORDER );
@@ -127,7 +127,7 @@ public class RunOrderIT
@Test
public void testHourlyJUnit4()
- throws Exception
+ throws VerificationException
{
int startHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY );
OutputValidator validator = executeWithRunOrder( "hourly", "junit4" );
@@ -144,7 +144,7 @@ public class RunOrderIT
@Test
public void testHourlyJUnit5()
- throws Exception
+ throws VerificationException
{
int startHour = Calendar.getInstance().get( Calendar.HOUR_OF_DAY );
OutputValidator validator = executeWithRunOrder( "hourly", "junit5" );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/SmartStackTraceIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/SmartStackTraceIT.java
index 2c29bc1ec..ee9da9a66 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/SmartStackTraceIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/SmartStackTraceIT.java
@@ -34,7 +34,6 @@ public class SmartStackTraceIT
@Test
public void misg()
- throws Exception
{
OutputValidator outputValidator = unpack( "/junit48-smartStackTrace" ).maven().withFailure().executeTest();
outputValidator.verifyTextInLog(
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/Surefire1602IT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/Surefire1602IT.java
index 8ce773273..5438d2311 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/Surefire1602IT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/Surefire1602IT.java
@@ -19,6 +19,7 @@ package org.apache.maven.surefire.its;
* under the License.
*/
+import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
@@ -32,7 +33,7 @@ public class Surefire1602IT
extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void nonCanonicalPath() throws Exception
+ public void nonCanonicalPath() throws VerificationException
{
SurefireLauncher launcher = unpack( "/surefire-1602" );
launcher.executeInstall();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
index be3beeb1c..124422f8e 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMethodPatternIT.java
@@ -98,21 +98,21 @@ public class TestMethodPatternIT
public void testJUnit44()
throws Exception
{
- runMethodPattern( "junit44-method-pattern", Collections.<String, String>emptyMap() );
+ runMethodPattern( "junit44-method-pattern", Collections.emptyMap() );
}
@Test
public void testJUnit48Provider4()
throws Exception
{
- runMethodPattern( "junit48-method-pattern", Collections.<String, String>emptyMap(), "-P surefire-junit4" );
+ runMethodPattern( "junit48-method-pattern", Collections.emptyMap(), "-P surefire-junit4" );
}
@Test
public void testJUnit48Provider47()
throws Exception
{
- runMethodPattern( "junit48-method-pattern", Collections.<String, String>emptyMap(), "-P surefire-junit47" )
+ runMethodPattern( "junit48-method-pattern", Collections.emptyMap(), "-P surefire-junit47" )
.verifyTextInLog( RUNNING_WITH_PROVIDER47 );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
index cb773cd0e..65dc604fb 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestMultipleMethodsIT.java
@@ -37,7 +37,6 @@ public class TestMultipleMethodsIT
private static final String RUNNING_WITH_PROVIDER47 = "parallel='none', perCoreThreadCount=true, threadCount=0";
public OutputValidator multipleMethod( String projectName, String... goals )
- throws Exception
{
SurefireLauncher launcher = unpack( projectName );
for ( String goal : goals )
@@ -51,21 +50,18 @@ public class TestMultipleMethodsIT
@Test
public void testJunit44()
- throws Exception
{
multipleMethod( "junit44-multiple-methods" );
}
@Test
public void testJunit48Provider4()
- throws Exception
{
multipleMethod( "junit48-multiple-methods", "-P surefire-junit4" );
}
@Test
public void testJunit48Provider47()
- throws Exception
{
multipleMethod( "junit48-multiple-methods", "-P surefire-junit47" )
.verifyTextInLog( RUNNING_WITH_PROVIDER47 );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
index 3b20ea263..a5d08cf6e 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestSingleMethodIT.java
@@ -40,7 +40,6 @@ public class TestSingleMethodIT
public OutputValidator singleMethod( String projectName, Map<String, String> props, String testToRun,
String... goals )
- throws Exception
{
SurefireLauncher launcher = unpack( projectName );
for ( Map.Entry<String, String> entry : props.entrySet() )
@@ -63,29 +62,25 @@ public class TestSingleMethodIT
@Test
public void testJunit44()
- throws Exception
{
- singleMethod( "junit44-single-method", Collections.<String, String>emptyMap(), null );
+ singleMethod( "junit44-single-method", Collections.emptyMap(), null );
}
@Test
public void testJunit48Provider4()
- throws Exception
{
- singleMethod( "junit48-single-method", Collections.<String, String>emptyMap(), null, "-P surefire-junit4" );
+ singleMethod( "junit48-single-method", Collections.emptyMap(), null, "-P surefire-junit4" );
}
@Test
public void testJunit48Provider47()
- throws Exception
{
- singleMethod( "junit48-single-method", Collections.<String, String>emptyMap(), null, "-P surefire-junit47" )
+ singleMethod( "junit48-single-method", Collections.emptyMap(), null, "-P surefire-junit47" )
.verifyTextInLog( RUNNING_WITH_PROVIDER47 );
}
@Test
public void testJunit48parallel()
- throws Exception
{
unpack( "junit48-single-method" )
.parallel( "all" )
@@ -97,7 +92,6 @@ public class TestSingleMethodIT
@Test
public void testTestNg()
- throws Exception
{
Map<String, String> props = new HashMap<>();
props.put( "testNgVersion", "5.7" );
@@ -107,30 +101,26 @@ public class TestSingleMethodIT
@Test
public void testTestNg5149()
- throws Exception
{
- singleMethod( "/testng-single-method-5-14-9", Collections.<String, String>emptyMap(), null );
+ singleMethod( "/testng-single-method-5-14-9", Collections.emptyMap(), null );
}
@Test
public void fullyQualifiedJunit48Provider4()
- throws Exception
{
- singleMethod( "junit48-single-method", Collections.<String, String>emptyMap(),
+ singleMethod( "junit48-single-method", Collections.emptyMap(),
"junit4.BasicTest#testSuccessOne", "-P surefire-junit4" );
}
@Test
public void fullyQualifiedJunit48Provider47()
- throws Exception
{
- singleMethod( "junit48-single-method", Collections.<String, String>emptyMap(),
+ singleMethod( "junit48-single-method", Collections.emptyMap(),
"junit4.BasicTest#testSuccessOne", "-P surefire-junit47" );
}
@Test
public void fullyQualifiedTestNg()
- throws Exception
{
Map<String, String> props = new HashMap<>();
props.put( "testNgVersion", "5.7" );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
index fdcea20d0..f185960aa 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/TimeoutForkedTestIT.java
@@ -32,12 +32,11 @@ public class TimeoutForkedTestIT
{
@Test
public void testTimeoutForked()
- throws Exception
{
unpack( "/timeout-forked" ).addGoal( "-DsleepLength=10000" ).addGoal(
"-DforkTimeout=1" ).maven().withFailure().executeTest();
// SUREFIRE-468 test that had to be reverted due to SUREFIRE-705
- //assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() );
+ // assertFalse( getSurefireReportsFile( "TEST-timeoutForked.BasicTest.xml" ).exists() );
// assertFalse( getSurefireReportsFile( "timeoutForked.BasicTest.txt" ).exists() );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java
index 02458ed2e..03d9ee4ca 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/TwoTestCasesIT.java
@@ -42,7 +42,6 @@ public class TwoTestCasesIT
{
@Test
public void testTwoTestCases()
- throws Exception
{
unpack( "junit-twoTestCases" )
.sysProp( "testNgVersion", "5.7" )
@@ -57,7 +56,6 @@ public class TwoTestCasesIT
*/
@Test
public void testTwoTestCaseSuite()
- throws Exception
{
final OutputValidator outputValidator = unpack( "junit-twoTestCaseSuite" )
.sysProp( "testNgVersion", "5.7" )
@@ -94,7 +92,6 @@ public class TwoTestCasesIT
@Test
public void testJunit4Suite()
- throws Exception
{
final OutputValidator outputValidator = unpack( "junit4-twoTestCaseSuite" )
.sysProp( "testNgVersion", "5.7" )
@@ -114,7 +111,6 @@ public class TwoTestCasesIT
@Test
public void testTestNGSuite()
- throws Exception
{
final OutputValidator outputValidator = unpack( "testng-twoTestCaseSuite" )
.sysProp( "testNgVersion", "5.7" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java
index 8f0e0096f..0785f5a4f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIsInvalidPropertyIT.java
@@ -32,9 +32,8 @@ public class WorkingDirectoryIsInvalidPropertyIT
{
@Test
public void testWorkingDirectory()
- throws Exception
{
unpack( "working-directory-is-invalid-property" ).maven().withFailure().executeTest().verifyTextInLog(
"workingDirectory cannot be null" );
}
-}
\ No newline at end of file
+}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/XmlReporterRunTimeIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/XmlReporterRunTimeIT.java
index 07e4843c9..f4e55be77 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/XmlReporterRunTimeIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/XmlReporterRunTimeIT.java
@@ -41,7 +41,6 @@ public class XmlReporterRunTimeIT
{
@Test
public void testForkAlways()
- throws Exception
{
// just generate .surefire-<hash> in order to apply runOrder
unpack( "/runorder-parallel" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/AbstractJava9PlusIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/AbstractJava9PlusIT.java
index c9c622572..42f10a00b 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/AbstractJava9PlusIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/AbstractJava9PlusIT.java
@@ -19,8 +19,6 @@ package org.apache.maven.surefire.its.fixture;
* under the License.
*/
-import java.io.IOException;
-
import static org.junit.Assume.assumeTrue;
/**
@@ -34,7 +32,7 @@ public abstract class AbstractJava9PlusIT
{
protected abstract String getProjectDirectoryName();
- protected SurefireLauncher assumeJava9() throws IOException
+ protected SurefireLauncher assumeJava9()
{
assumeTrue( "There's no JDK 9 provided.", IS_JAVA9_PLUS );
return unpack();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java
index d6aefa3d2..88f300208 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/TestFile.java
@@ -34,6 +34,7 @@ import junit.framework.Assert;
import org.hamcrest.Matcher;
import static java.nio.charset.Charset.defaultCharset;
+import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.hamcrest.Matchers.containsString;
@@ -75,7 +76,7 @@ public class TestFile
public OutputValidator assertFileNotExists()
{
- assertTrue( "File doesn't exist: " + file.getAbsolutePath(), !file.exists() );
+ assertFalse( "File doesn't exist: " + file.getAbsolutePath(), file.exists() );
return surefireVerifier;
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1036NonFilterableJUnitRunnerWithCategoriesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1036NonFilterableJUnitRunnerWithCategoriesIT.java
index d4e7328be..ef6388ed7 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1036NonFilterableJUnitRunnerWithCategoriesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1036NonFilterableJUnitRunnerWithCategoriesIT.java
@@ -19,7 +19,6 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.it.VerificationException;
import org.apache.maven.shared.utils.xml.Xpp3Dom;
import org.apache.maven.shared.utils.xml.Xpp3DomBuilder;
import org.apache.maven.surefire.its.fixture.OutputValidator;
@@ -45,7 +44,7 @@ public class Surefire1036NonFilterableJUnitRunnerWithCategoriesIT
@Test
public void test()
- throws VerificationException, FileNotFoundException
+ throws FileNotFoundException
{
OutputValidator validator = unpack().maven().executeTest();
validator.assertTestSuiteResults( 1, 0, 0, 0 );
@@ -70,4 +69,4 @@ public class Surefire1036NonFilterableJUnitRunnerWithCategoriesIT
Xpp3Dom[] children = testResult.getChildren( "testcase" );
assertEquals( tests, children.length );
}
-}
\ No newline at end of file
+}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1144XmlRunTimeIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1144XmlRunTimeIT.java
index 08197ad32..890229187 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1144XmlRunTimeIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1144XmlRunTimeIT.java
@@ -43,7 +43,6 @@ public class Surefire1144XmlRunTimeIT
{
@Test
public void testXmlRunTime()
- throws Exception
{
OutputValidator outputValidator = unpack( "/surefire-1144-xml-runtime" ).forkOnce().executeTest();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java
index 2401f7660..e8e20cccc 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1158RemoveInfoLinesIT.java
@@ -79,7 +79,7 @@ public class Surefire1158RemoveInfoLinesIT extends SurefireJUnit4IntegrationTest
public boolean isJUnit;
@Test
- public void shouldRunWithCliOption() throws Exception
+ public void shouldRunWithCliOption()
{
OutputValidator validator = assertTest();
if ( isJUnit )
@@ -92,7 +92,7 @@ public class Surefire1158RemoveInfoLinesIT extends SurefireJUnit4IntegrationTest
}
}
- private OutputValidator assertTest() throws Exception
+ private OutputValidator assertTest()
{
final String[] cli = {"--batch-mode"};
return unpack( "/surefire-1158-remove-info-lines", "_" + description, cli )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1202RerunAndSkipIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1202RerunAndSkipIT.java
index f88644603..1d40b561b 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1202RerunAndSkipIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1202RerunAndSkipIT.java
@@ -19,7 +19,6 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
@@ -36,7 +35,6 @@ public class Surefire1202RerunAndSkipIT
{
@Test
public void junit47()
- throws VerificationException
{
unpack().executeTest()
.assertTestSuiteResults( 5, 0, 0, 3, 4 );
@@ -44,7 +42,6 @@ public class Surefire1202RerunAndSkipIT
@Test
public void junit4()
- throws VerificationException
{
unpack().addGoal( "-Pjunit4" )
.executeTest()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java
index 9a1a446d0..38b7af8d4 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1265Java9IT.java
@@ -22,8 +22,6 @@ package org.apache.maven.surefire.its.jiras;
import org.apache.maven.surefire.its.fixture.AbstractJava9PlusIT;
import org.junit.Test;
-import java.io.IOException;
-
@SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } )
/**
* IsolatedClassLoader should take platform ClassLoader as a parent ClassLoader if running on the top of JDK9.
@@ -42,7 +40,7 @@ public class Surefire1265Java9IT
extends AbstractJava9PlusIT
{
@Test
- public void shouldRunInPluginJava9() throws IOException
+ public void shouldRunInPluginJava9()
{
assumeJava9()
.executeTest()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java
index 523f22ff8..0cc03e96a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1534ReuseForksFalseWithJavaModuleIT.java
@@ -24,8 +24,6 @@ import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
-import java.io.IOException;
-
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertTrue;
@@ -38,7 +36,6 @@ public class Surefire1534ReuseForksFalseWithJavaModuleIT
@Test
public void testExecuteWithReuseForksFalseWithJavaModule()
- throws IOException
{
OutputValidator validator = assumeJava9()
.reuseForks( false )
@@ -58,7 +55,6 @@ public class Surefire1534ReuseForksFalseWithJavaModuleIT
@Test
public void testExecuteWithReuseForksFalseWithJavaModuleWithFilter()
- throws IOException
{
OutputValidator validator = assumeJava9()
.reuseForks( false )
@@ -79,7 +75,6 @@ public class Surefire1534ReuseForksFalseWithJavaModuleIT
@Test
public void testExecuteWithZeroForkCountWithJavaModule()
- throws IOException
{
OutputValidator validator = assumeJava9()
.forkCount( 0 )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1881IT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1881IT.java
index 2b5ab80d0..8289b98a1 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1881IT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1881IT.java
@@ -30,7 +30,7 @@ public class Surefire1881IT extends SurefireJUnit4IntegrationTestCase
{
@Test( timeout = 60_000L )
- public void test() throws Exception
+ public void test()
{
unpack( "/surefire-1881" )
.executeVerify()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire257NotRerunningTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire257NotRerunningTestsIT.java
index 3fd4fb35a..7c5f941b9 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire257NotRerunningTestsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire257NotRerunningTestsIT.java
@@ -30,7 +30,7 @@ import org.junit.Test;
public class Surefire257NotRerunningTestsIT extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void shouldNotRerun() throws Exception
+ public void shouldNotRerun()
{
unpack( "/surefire-257-rerunningTests" )
.addSurefireReportGoal().addSurefireReportGoal().executeCurrentGoals().verifyTextInLog(
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire570MultipleReportDirectoriesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire570MultipleReportDirectoriesIT.java
index e188c8a20..20abced0e 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire570MultipleReportDirectoriesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire570MultipleReportDirectoriesIT.java
@@ -36,7 +36,6 @@ public class Surefire570MultipleReportDirectoriesIT
@Test
public void testReportWithAggregate()
- throws Exception
{
SurefireLauncher surefireLauncher = unpack().failNever();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java
index 67329d74a..8bd0564aa 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772BothReportsIT.java
@@ -46,7 +46,6 @@ public class Surefire772BothReportsIT
@Test
public void testReportGeneration()
- throws Exception
{
OutputValidator outputValidator =
unpack().addFailsafeReportOnlyGoal().addSurefireReportOnlyGoal().executeCurrentGoals();
@@ -60,7 +59,6 @@ public class Surefire772BothReportsIT
@Test
public void testSkippedFailsafeReportGeneration()
- throws Exception
{
OutputValidator validator = unpack().
activateProfile(
@@ -75,7 +73,6 @@ public class Surefire772BothReportsIT
@Test
public void testSkippedSurefireReportGeneration()
- throws Exception
{
OutputValidator validator = unpack().failNever().
activateProfile(
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java
index 9ae8f4aa7..c8de0aedb 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772NoFailsafeReportsIT.java
@@ -19,7 +19,6 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import java.io.IOException;
import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
@@ -101,7 +100,7 @@ public class Surefire772NoFailsafeReportsIT
}
private SurefireLauncher unpack()
- throws VerificationException, IOException
+ throws VerificationException
{
final SurefireLauncher unpack = unpack( "surefire-772-no-failsafe-reports" );
unpack.maven().deleteSiteDir().skipClean().failNever().verifyFileNotPresent( "site" );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java
index 215bd5d7e..5031f870b 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire817SystemExitIT.java
@@ -19,7 +19,6 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
@@ -35,7 +34,6 @@ public class Surefire817SystemExitIT
@Test
public void systemExit1()
- throws VerificationException
{
unpack().maven().withFailure().executeTest().verifyTextInLog( "class jiras.surefire817.Test main" );
}
@@ -44,4 +42,4 @@ public class Surefire817SystemExitIT
{
return unpack( "surefire-817-system-exit" );
}
-}
\ No newline at end of file
+}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java
index 2e37775ca..7ec189332 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire943ReportContentIT.java
@@ -106,8 +106,8 @@ public class Surefire943ReportContentIT
Assert.assertEquals( "Expected skipped tag for ignored method for " + className, 1,
child.getChildren( "skipped" ).length );
- Assert.assertTrue( "time for ignored test is expected to be zero",
- Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) == 0 );
+ Assert.assertEquals( "time for ignored test is expected to be zero", 0,
+ Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) );
}
private void validate( OutputValidator validator, String className, int ignored )
@@ -134,8 +134,8 @@ public class Surefire943ReportContentIT
Assert.assertEquals( "Expected skipped-tag for ignored method for " + className, 1,
child.getChildren( "skipped" ).length );
- Assert.assertTrue( "time for ignored test is expected to be zero",
- Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) == 0 );
+ Assert.assertEquals( "time for ignored test is expected to be zero", 0,
+ Double.compare( Double.parseDouble( child.getAttribute( "time" ) ), 0.0d ) );
}
else
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire975DefaultVMEncodingIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire975DefaultVMEncodingIT.java
index 99fee3d42..4af055bd2 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire975DefaultVMEncodingIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire975DefaultVMEncodingIT.java
@@ -34,7 +34,6 @@ public class Surefire975DefaultVMEncodingIT
@Test
public void runWithRussian1251()
- throws Exception
{
OutputValidator outputValidator =
unpack( "surefire-975-wrong-encoding" ).setMavenOpts( "-Dfile.encoding=windows-1251" ).executeTest();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire979WrongClassLoaderIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire979WrongClassLoaderIT.java
index 617213088..d099184db 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire979WrongClassLoaderIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire979WrongClassLoaderIT.java
@@ -31,7 +31,6 @@ public class Surefire979WrongClassLoaderIT
{
@Test
public void wrongClassloaderUSedInSmartStacktraceparser()
- throws Exception
{
OutputValidator outputValidator =
unpack( "surefire-979-smartStackTrace-wrongClassloader" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire995CategoryInheritanceIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire995CategoryInheritanceIT.java
index c57155643..9e526729f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire995CategoryInheritanceIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire995CategoryInheritanceIT.java
@@ -121,7 +121,7 @@ public class Surefire995CategoryInheritanceIT extends SurefireJUnit4IntegrationT
}
@Test
- public void junit412ShouldExecuteInheritedCategories() throws VerificationException
+ public void junit412ShouldExecuteInheritedCategories()
{
// GIVEN a project using junit 4.12
final OutputValidator outputValidator = unpack()