You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2019/11/02 19:04:36 UTC
[maven-surefire] 01/01: [SUREFIRE-1706] Use the checkstyle in tests
and se includeTestSourceDirectory=true
This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch checkstyle
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit 68b81cf7217bc57d77b68fc05045971907a030d6
Author: tibordigana <ti...@apache.org>
AuthorDate: Sat Nov 2 20:03:38 2019 +0100
[SUREFIRE-1706] Use the checkstyle in tests and se includeTestSourceDirectory=true
---
.../failsafe/MarshallerUnmarshallerTest.java | 3 +
.../maven/plugin/failsafe/RunResultTest.java | 1 +
.../AbstractSurefireMojoJava7PlusTest.java | 13 +-
.../plugin/surefire/AbstractSurefireMojoTest.java | 38 +-
.../maven/plugin/surefire/CommonReflectorTest.java | 5 +-
.../org/apache/maven/plugin/surefire/DataZT1A.java | 7 +-
.../org/apache/maven/plugin/surefire/DataZT2A.java | 8 +-
.../org/apache/maven/plugin/surefire/DataZT3A.java | 8 +-
.../maven/plugin/surefire/MojoMocklessTest.java | 9 +-
.../surefire/SurefireDependencyResolverTest.java | 27 +-
.../maven/plugin/surefire/SurefireHelperTest.java | 5 +-
.../plugin/surefire/SurefirePropertiesTest.java | 4 +-
...ooterDeserializerProviderConfigurationTest.java | 47 ++-
...BooterDeserializerStartupConfigurationTest.java | 20 +-
.../booterclient/DefaultForkConfigurationTest.java | 7 +-
.../booterclient/ForkConfigurationTest.java | 5 +
.../booterclient/ForkingRunListenerTest.java | 1 +
.../JarManifestForkConfigurationTest.java | 3 +-
.../booterclient/MockNotifiableTestStream.java | 2 +-
.../plugin/surefire/booterclient/MockReporter.java | 3 +-
.../OutputStreamFlushableCommandlineTest.java | 3 +
.../TestProvidingInputStreamTest.java | 3 +-
.../booterclient/output/ForkClientTest.java | 84 ++--
.../output/ForkedChannelDecoderTest.java | 27 +-
.../report/DefaultReporterFactoryTest.java | 19 +-
.../surefire/report/StatelessXmlReporterTest.java | 11 +-
.../surefire/report/WrappedReportEntryTest.java | 16 +-
.../runorder/RunEntryStatisticsMapTest.java | 5 +-
.../surefire/util/DependenciesScannerTest.java | 49 ++-
.../plugin/surefire/util/DirectoryScannerTest.java | 28 +-
.../report/ConsoleOutputFileReporterTest.java | 6 +-
.../maven/surefire/report/FileReporterTest.java | 13 +-
.../maven/surefire/report/RunStatisticsTest.java | 33 +-
.../maven/plugin/surefire/SurefirePluginTest.java | 6 +-
.../plugins/surefire/report/JUnit4SuiteTest.java | 2 +-
.../plugins/surefire/report/Surefire1183Test.java | 4 +-
.../plugins/surefire/report/Surefire597Test.java | 6 +-
.../surefire/report/SurefireReportMojoTest.java | 4 +-
.../report/SurefireSchemaValidationTest.java | 5 +-
.../maven/plugins/surefire/report/Utils.java | 3 +
.../runorder/ThreadedExecutionSchedulerTest.java | 1 +
.../surefire/SpecificTestClassFilterTest.java | 25 +-
.../maven/surefire/booter/CommandReaderTest.java | 45 +-
.../surefire/booter/ForkedChannelEncoderTest.java | 38 +-
.../surefire/booter/ForkingRunListenerTest.java | 38 +-
.../surefire/booter/MasterProcessCommandTest.java | 32 +-
.../surefire/booter/NewClassLoaderRunner.java | 2 +-
.../surefire/booter/SurefireReflectorTest.java | 38 +-
.../report/LegacyPojoStackTraceWriterTest.java | 164 ++++---
.../apache/maven/surefire/suite/RunResultTest.java | 1 +
.../surefire/testset/FundamentalFilterTest.java | 3 +-
.../maven/surefire/testset/ResolvedTestTest.java | 14 +-
.../surefire/testset/TestListResolverTest.java | 15 +-
.../maven/surefire/util/ReflectionUtilsTest.java | 6 +-
.../surefire/util/RunOrderCalculatorTest.java | 9 +-
.../apache/maven/surefire/util/RunOrderTest.java | 3 +
.../apache/maven/surefire/util/TestsToRunTest.java | 7 +-
.../util/internal/ConcurrencyUtilsTest.java | 4 +-
.../maven/surefire/util/testdata/DataZT1A.java | 7 +-
.../maven/surefire/util/testdata/DataZT2A.java | 8 +-
.../maven/surefire/util/testdata/DataZT3A.java | 8 +-
.../testdata/java/javascript/DataJavaZT4A.java | 4 +-
.../maven/surefire/booter/ClasspathTest.java | 12 +-
.../maven/surefire/booter/ForkedBooterTest.java | 1 +
.../maven/surefire/booter/PpidCheckerTest.java | 1 +
.../surefire/booter/PropertiesWrapperTest.java | 11 +-
.../maven/surefire/booter/SystemUtilsTest.java | 7 +
.../surefire/group/match/AndGroupMatcherTest.java | 4 +
.../group/match/InverseGroupMatcherTest.java | 4 +
.../surefire/group/match/OrGroupMatcherTest.java | 4 +
.../group/match/SingleGroupMatcherTest.java | 4 +
.../group/parse/GroupMatcherParserTest.java | 4 +
.../maven/surefire/its/AbstractFailFastIT.java | 7 +
.../its/AbstractTestMultipleMethodPatterns.java | 52 ++-
.../surefire/its/AssumptionFailureReportIT.java | 5 +
.../maven/surefire/its/CheckSingleTestIT.java | 5 +-
.../surefire/its/CheckTestFailIfNoTestsIT.java | 5 +-
.../its/CheckTestNgBeforeMethodFailureIT.java | 3 +-
.../surefire/its/CheckTestNgBeforeMethodIT.java | 3 +-
.../its/CheckTestNgCustomObjectFactoryIT.java | 1 +
.../its/CheckTestNgCustomTestRunnerFactoryIT.java | 1 +
.../surefire/its/CheckTestNgExecuteErrorIT.java | 5 +-
.../its/CheckTestNgGroupThreadParallelIT.java | 2 +-
.../maven/surefire/its/CheckTestNgJdk14IT.java | 2 +-
.../its/CheckTestNgListenerReporterIT.java | 9 +-
.../maven/surefire/its/CheckTestNgListenersIT.java | 2 +-
.../surefire/its/CheckTestNgPathWithSpacesIT.java | 2 +-
.../surefire/its/CheckTestNgSuiteXmlSingleIT.java | 2 +-
.../maven/surefire/its/CheckTestNgVersionsIT.java | 19 +-
.../apache/maven/surefire/its/FailFastJUnitIT.java | 10 +-
.../maven/surefire/its/FailFastTestNgIT.java | 2 +-
.../org/apache/maven/surefire/its/ForkModeIT.java | 4 +-
.../maven/surefire/its/ForkModeMultiModuleIT.java | 36 +-
.../surefire/its/IncludesExcludesFromFileIT.java | 2 +-
.../maven/surefire/its/JUnit47ConcurrencyIT.java | 8 +-
.../maven/surefire/its/JUnit47ParallelIT.java | 177 ++++----
.../surefire/its/JUnit47RedirectOutputIT.java | 3 +
.../its/JUnit47RerunFailingTestWithCucumberIT.java | 51 +--
.../its/JUnit47StaticInnerClassTestsIT.java | 3 +
.../maven/surefire/its/JUnit4VersionsIT.java | 3 +-
.../org/apache/maven/surefire/its/JUnitDepIT.java | 29 +-
.../maven/surefire/its/JUnitPlatformEnginesIT.java | 49 ++-
.../apache/maven/surefire/its/JUnitPlatformIT.java | 6 +
.../its/JUnitPlatformRerunFailingTestsIT.java | 70 +--
.../its/JUnitPlatformStreamCorruptionIT.java | 4 +
.../apache/maven/surefire/its/JUnitVersion.java | 3 +-
.../apache/maven/surefire/its/Java9FullApiIT.java | 4 +-
.../apache/maven/surefire/its/ModulePathIT.java | 3 +
.../maven/surefire/its/PlexusConflictIT.java | 2 +-
.../apache/maven/surefire/its/ReporterTime.java | 1 +
.../maven/surefire/its/ResultCountingIT.java | 1 +
.../org/apache/maven/surefire/its/RunOrderIT.java | 10 +-
.../surefire/its/RunOrderParallelForksIT.java | 3 +
.../maven/surefire/its/SmartStackTraceIT.java | 6 +-
.../apache/maven/surefire/its/Surefire1602IT.java | 1 -
.../surefire/its/TestNgSuccessPercentageIT.java | 7 +-
.../maven/surefire/its/TestSingleMethodIT.java | 4 +-
.../apache/maven/surefire/its/TwoTestCasesIT.java | 5 +-
.../maven/surefire/its/UnicodeTestNamesIT.java | 2 +-
.../maven/surefire/its/WorkingDirectoryIT.java | 5 +-
.../its/WorkingDirectoryIsInvalidPropertyIT.java | 1 +
.../maven/surefire/its/XmlReporterRunTimeIT.java | 1 +
.../its/fixture/FailsafeOutputValidator.java | 3 +
.../surefire/its/fixture/HelperAssertions.java | 11 +-
.../its/fixture/IntegrationTestSuiteResults.java | 6 +-
.../apache/maven/surefire/its/fixture/IsRegex.java | 1 -
.../maven/surefire/its/fixture/MavenLauncher.java | 39 +-
.../surefire/its/fixture/SurefireLauncher.java | 2 +-
.../maven/surefire/its/fixture/TestFile.java | 2 +-
...nTestFromDependencyJarsTypeAndClassifierIT.java | 19 +-
.../Surefire1024VerifyFailsafeIfTestedIT.java | 3 +-
...36NonFilterableJUnitRunnerWithCategoriesIT.java | 4 +-
.../jiras/Surefire1041FailingJUnitRunnerIT.java | 5 +-
.../Surefire1055CorrectConcurrentTestCountIT.java | 1 +
.../its/jiras/Surefire1095NpeInRunListener.java | 2 +-
.../its/jiras/Surefire1098BalancedRunOrderIT.java | 41 +-
...urefire1135ImproveIgnoreMessageForTestNGIT.java | 67 ++-
.../its/jiras/Surefire1144XmlRunTimeIT.java | 3 +-
.../Surefire1146RerunFailedAndParameterized.java | 3 +-
.../Surefire1152RerunFailingTestsInSuiteIT.java | 13 +-
.../Surefire1153IncludesAndSpecifiedTestIT.java | 4 +
.../its/jiras/Surefire1158RemoveInfoLinesIT.java | 59 +--
.../its/jiras/Surefire1209RerunAndForkCountIT.java | 16 +-
.../its/jiras/Surefire1260NewTestsPattern.java | 3 +-
.../Surefire1295AttributeJvmCrashesToTestsIT.java | 9 +-
.../its/jiras/Surefire1367AssumptionLogsIT.java | 99 ++---
.../Surefire1396CustomProviderClassPathIT.java | 4 +-
.../its/jiras/Surefire141PluggableProvidersIT.java | 2 +-
...urefire1534ReuseForksFalseWithJavaModuleIT.java | 3 +
.../jiras/Surefire1535TestNGParallelSuitesIT.java | 11 +-
.../maven/surefire/its/jiras/Surefire1585IT.java | 4 +
.../its/jiras/Surefire162CharsetProviderIT.java | 5 +-
.../jiras/Surefire224WellFormedXmlFailuresIT.java | 2 +-
.../its/jiras/Surefire257NotRerunningTestsIT.java | 12 +-
.../jiras/Surefire260TestWithIdenticalNamesIT.java | 5 +-
.../Surefire569RunTestFromDependencyJarsIT.java | 21 +-
.../Surefire570MultipleReportDirectoriesIT.java | 5 +-
.../jiras/Surefire613TestCountInParallelIT.java | 1 +
.../Surefire649EmptyStringSystemPropertiesIT.java | 13 +-
.../jiras/Surefire705ParallelForkTimeoutIT.java | 8 +-
.../Surefire747MethodParallelWithSuiteCountIT.java | 1 +
.../its/jiras/Surefire772BothReportsIT.java | 5 +-
.../its/jiras/Surefire772NoFailsafeReportsIT.java | 5 +-
.../its/jiras/Surefire772SpecifiedReportsIT.java | 5 +-
.../its/jiras/Surefire803MultiFailsafeExecsIT.java | 11 +-
.../jiras/Surefire806SpecifiedTestControlsIT.java | 4 +
.../its/jiras/Surefire809GroupExpressionsIT.java | 4 +
.../its/jiras/Surefire818NpeIgnoresTestsIT.java | 7 +-
.../its/jiras/Surefire828EmptyGroupExprIT.java | 4 +
.../its/jiras/Surefire832ProviderSelectionIT.java | 4 +
.../jiras/Surefire839TestWithoutCategoriesIT.java | 4 +
.../its/jiras/Surefire847AdditionalFailureIT.java | 4 +
.../Surefire907PerThreadWithoutThreadCountIT.java | 4 +
.../Surefire920TestFailureIgnoreWithTimeoutIT.java | 4 +
.../its/jiras/Surefire930TestNgSuiteXmlIT.java | 4 +
.../its/jiras/Surefire943ReportContentIT.java | 14 +-
...Surefire946KillMainProcessInReusableForkIT.java | 8 +-
.../its/jiras/Surefire972BizarreNoClassDefIT.java | 10 +-
.../its/jiras/Surefire975DefaultVMEncodingIT.java | 3 +
.../its/jiras/Surefire979WrongClassLoaderIT.java | 13 +-
...efire985ParameterizedRunnerAndCategoriesIT.java | 6 +-
.../apache/maven/surefire/report/ABaseClass.java | 4 +-
.../apache/maven/surefire/report/ASubClass.java | 3 +
.../apache/maven/surefire/report/ATestClass.java | 5 +-
.../maven/surefire/report/OutermostClass.java | 3 +-
.../surefire/report/PojoStackTraceWriterTest.java | 8 +-
.../maven/surefire/report/RunnableTestClass1.java | 37 +-
.../maven/surefire/report/RunnableTestClass2.java | 39 +-
.../surefire/report/SmartStackTraceParserTest.java | 27 +-
.../surefire/report/StackTraceFocusedOnClass.java | 2 +-
.../apache/maven/surefire/report/TestClass1.java | 1 +
.../apache/maven/surefire/report/TestClass2.java | 1 +
.../common/junit3/JUnit3TestCheckerTest.java | 28 +-
.../common/junit4/JUnit4ProviderUtilTest.java | 12 +-
.../common/junit4/JUnit4Reflector40Test.java | 8 +-
.../common/junit4/JUnit4RunListenerTest.java | 8 +-
.../surefire/junit4/JUnit4TestCheckerTest.java | 36 +-
.../surefire/common/junit48/FilterFactoryTest.java | 121 ++++--
.../common/junit48/JUnit48TestCheckerTest.java | 31 +-
.../maven/surefire/common/junit48/tests/ATest.java | 4 +
.../surefire/common/junit48/tests/a/ATest.java | 4 +
.../maven/surefire/common/junit48/tests/pt/PT.java | 3 +
.../junitplatform/RunListenerAdapterTest.java | 23 +-
.../junitplatform/TestMethodFilterTest.java | 5 +-
.../maven/surefire/junit/JUnitTestSetTest.java | 12 +
.../maven/surefire/junit4/JUnit4ProviderTest.java | 14 +-
.../junitcore/ConcurrentRunListenerTest.java | 26 +-
.../ConfigurableParallelComputerTest.java | 19 +-
.../surefire/junitcore/DiagnosticRunListener.java | 44 +-
.../surefire/junitcore/JUnit4Reflector481Test.java | 41 +-
.../junitcore/JUnitCoreParametersTest.java | 35 +-
.../junitcore/JUnitCoreRunListenerTest.java | 50 ++-
.../junitcore/MavenSurefireJUnit47RunnerTest.java | 22 +-
.../junitcore/MavenSurefireJUnit48RunnerTest.java | 22 +-
.../maven/surefire/junitcore/Surefire746Test.java | 66 ++-
.../junitcore/Surefire813IncorrectResultTest.java | 9 +-
.../maven/surefire/junitcore/TestMethodTest.java | 5 +-
.../pc/OptimizedParallelComputerTest.java | 104 +++--
.../junitcore/pc/ParallelComputerBuilderTest.java | 229 ++++++----
.../junitcore/pc/ParallelComputerUtilTest.java | 437 +++++++++----------
.../junitcore/pc/SchedulingStrategiesTest.java | 2 +-
.../test/java/testng/utils/BaseClassSample.java | 3 +
.../test/java/testng/utils/ChildClassSample.java | 3 +
.../test/java/testng/utils/MethodSelectorTest.java | 3 +
.../testng/conf/TestNG513ConfiguratorTest.java | 3 +
.../testng/conf/TestNG5141ConfiguratorTest.java | 36 +-
.../testng/conf/TestNG5143ConfiguratorTest.java | 38 +-
.../testng/conf/TestNGMapConfiguratorTest.java | 39 +-
.../surefire/report/ReportTestCaseTest.java | 1 +
.../surefire/report/ReportTestSuiteTest.java | 1 +
.../surefire/report/SurefireReportParserTest.java | 1 +
.../surefire/report/TestSuiteXmlParserTest.java | 469 ++++++++++-----------
232 files changed, 2600 insertions(+), 1890 deletions(-)
diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java
index 96708a8..94e65c8 100644
--- a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java
+++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java
@@ -27,6 +27,9 @@ import java.io.File;
import static org.fest.assertions.Assertions.assertThat;
+/**
+ *
+ */
public class MarshallerUnmarshallerTest
{
@Test
diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java
index 210e019..3ef140c 100644
--- a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java
+++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java
@@ -31,6 +31,7 @@ import static org.fest.assertions.Assertions.assertThat;
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class RunResultTest
{
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
index 8dbab23..0850e2a 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java
@@ -44,7 +44,11 @@ import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.io.File;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
import static java.util.Arrays.asList;
import static java.util.Collections.singleton;
@@ -79,6 +83,7 @@ public class AbstractSurefireMojoJava7PlusTest
private LocationManager locationManager;
@Test
+ @SuppressWarnings( "checkstyle:linelength" )
public void shouldHaveStartupConfigForModularClasspath()
throws Exception
{
@@ -240,6 +245,9 @@ public class AbstractSurefireMojoJava7PlusTest
return f;
}
+ /**
+ *
+ */
public static class Mojo
extends AbstractSurefireMojo
{
@@ -545,7 +553,8 @@ public class AbstractSurefireMojoJava7PlusTest
}
@Override
- protected String[] getExcludedEnvironmentVariables() {
+ protected String[] getExcludedEnvironmentVariables()
+ {
return new String[0];
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
index 50d24cc..4e71b02 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
@@ -69,14 +69,18 @@ import java.util.Set;
import static java.io.File.separatorChar;
import static java.util.Arrays.asList;
-import static java.util.Collections.*;
+import static java.util.Collections.emptySet;
+import static java.util.Collections.singleton;
+import static java.util.Collections.singletonMap;
import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS;
import static org.apache.maven.artifact.versioning.VersionRange.createFromVersion;
import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec;
import static org.fest.assertions.Assertions.assertThat;
import static org.fest.assertions.MapAssert.entry;
import static org.junit.Assert.fail;
-import static org.mockito.ArgumentMatchers.*;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.verify;
@@ -86,7 +90,6 @@ import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.spy;
import static org.powermock.api.mockito.PowerMockito.verifyPrivate;
import static org.powermock.reflect.Whitebox.invokeMethod;
-import static org.powermock.reflect.Whitebox.setInternalState;
/**
* Test for {@link AbstractSurefireMojo}.
@@ -273,6 +276,7 @@ public class AbstractSurefireMojoTest
}
@Test
+ @SuppressWarnings( "checkstyle:linelength" )
public void shouldHaveStartupConfigForNonModularClasspath()
throws Exception
{
@@ -380,25 +384,28 @@ public class AbstractSurefireMojoTest
}
@Test
- public void providerClasspathCachingIsNotSharedAcrossMojoInstances() throws Exception {
+ public void providerClasspathCachingIsNotSharedAcrossMojoInstances() throws Exception
+ {
ProviderInfo providerInfo = mock( ProviderInfo.class );
when( providerInfo.getProviderName() ).thenReturn( "test-provider" );
- Artifact provider = new DefaultArtifact( "com.example", "provider", createFromVersion( "1" ), "runtime", "jar", "", handler );
+ Artifact provider = new DefaultArtifact( "com.example", "provider", createFromVersion( "1" ), "runtime",
+ "jar", "", handler );
provider.setFile( mockFile( "original-test-provider.jar" ) );
- HashSet<Artifact> providerClasspath = new HashSet<Artifact>( asList( provider ) );
- when( providerInfo.getProviderClasspath()).thenReturn( providerClasspath );
+ HashSet<Artifact> providerClasspath = new HashSet<>( asList( provider ) );
+ when( providerInfo.getProviderClasspath() ).thenReturn( providerClasspath );
- StartupConfiguration startupConfiguration = startupConfigurationForProvider(providerInfo);
+ StartupConfiguration startupConfiguration = startupConfigurationForProvider( providerInfo );
assertThat( startupConfiguration.getClasspathConfiguration().getProviderClasspath().getClassPath() )
.containsExactly( "original-test-provider.jar" );
provider.setFile( mockFile( "modified-test-provider.jar" ) );
- startupConfiguration = startupConfigurationForProvider(providerInfo);
+ startupConfiguration = startupConfigurationForProvider( providerInfo );
assertThat( startupConfiguration.getClasspathConfiguration().getProviderClasspath().getClassPath() )
.containsExactly( "modified-test-provider.jar" );
}
- private StartupConfiguration startupConfigurationForProvider(ProviderInfo providerInfo) throws Exception {
+ private StartupConfiguration startupConfigurationForProvider( ProviderInfo providerInfo ) throws Exception
+ {
AbstractSurefireMojo mojo = spy( new Mojo() );
Logger logger = mock( Logger.class );
@@ -408,7 +415,8 @@ public class AbstractSurefireMojoTest
File classesDir = mockFile( "classes" );
File testClassesDir = mockFile( "test-classes" );
- TestClassPath testClassPath = new TestClassPath( new ArrayList<Artifact>(), classesDir, testClassesDir, new String[0] );
+ TestClassPath testClassPath =
+ new TestClassPath( new ArrayList<Artifact>(), classesDir, testClassesDir, new String[0] );
Artifact common = new DefaultArtifact( "org.apache.maven.surefire", "maven-surefire-common",
createFromVersion( "1" ), "runtime", "jar", "", handler );
@@ -436,8 +444,7 @@ public class AbstractSurefireMojoTest
doReturn( 1 ).when( mojo, "getEffectiveForkCount" );
- StartupConfiguration startupConfiguration = invokeMethod( mojo, "createStartupConfiguration", providerInfo, false, null, null, null, testClassPath);
- return startupConfiguration;
+ return invokeMethod( mojo, "createStartupConfiguration", providerInfo, false, null, null, null, testClassPath );
}
@Test
@@ -1682,6 +1689,9 @@ public class AbstractSurefireMojoTest
return surefirePlatformResolutionResult;
}
+ /**
+ *
+ */
public static class Mojo
extends AbstractSurefireMojo implements SurefireReportParameters
{
@@ -2105,7 +2115,7 @@ public class AbstractSurefireMojoTest
List<Dependency> dependencies = new ArrayList<>();
for ( Artifact artifact : artifacts )
{
- dependencies.add( toDependency( artifact) );
+ dependencies.add( toDependency( artifact ) );
}
return dependencies;
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java
index b00d131..1f94a75 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java
@@ -34,6 +34,9 @@ import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.powermock.reflect.Whitebox.getInternalState;
+/**
+ *
+ */
public class CommonReflectorTest
{
private StartupReportConfiguration startupReportConfiguration;
@@ -55,7 +58,7 @@ public class CommonReflectorTest
startupReportConfiguration = new StartupReportConfiguration( true, true, "PLAIN", false, reportsDirectory,
false, null, statistics, false, 1, null, null, false,
- xmlReporter, consoleOutputReporter, infoReporter);
+ xmlReporter, consoleOutputReporter, infoReporter );
consoleLogger = mock( ConsoleLogger.class );
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT1A.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT1A.java
index e413c05..7cbd568 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT1A.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT1A.java
@@ -1,3 +1,5 @@
+package org.apache.maven.plugin.surefire;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,9 @@
* under the License.
*/
-package org.apache.maven.plugin.surefire;
-
+/**
+ *
+ */
public class DataZT1A
{
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT2A.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT2A.java
index eaaa48d..3779ca1 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT2A.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT2A.java
@@ -1,3 +1,5 @@
+package org.apache.maven.plugin.surefire;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,9 +19,9 @@
* under the License.
*/
-package org.apache.maven.plugin.surefire;
-
-
+/**
+ *
+ */
public class DataZT2A
{
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT3A.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT3A.java
index e64ff37..c44752b 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT3A.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/DataZT3A.java
@@ -1,3 +1,5 @@
+package org.apache.maven.plugin.surefire;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,9 +19,9 @@
* under the License.
*/
-package org.apache.maven.plugin.surefire;
-
-
+/**
+ *
+ */
public class DataZT3A
{
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java
index f9f598d..7651cc2 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java
@@ -46,6 +46,9 @@ import static org.junit.Assert.fail;
import static org.powermock.reflect.Whitebox.invokeMethod;
import static org.powermock.reflect.Whitebox.setInternalState;
+/**
+ *
+ */
public class MojoMocklessTest
{
@Test
@@ -104,6 +107,7 @@ public class MojoMocklessTest
}
@Test
+ @SuppressWarnings( "checkstyle:magicnumber" )
public void testForkCountComputation()
{
AbstractSurefireMojo surefirePlugin = new Mojo( null, null );
@@ -362,7 +366,7 @@ public class MojoMocklessTest
.contains( "pkg.MyTest" );
}
- private final static class Mojo
+ private static final class Mojo
extends AbstractSurefireMojo
{
private final List<Artifact> projectTestArtifacts;
@@ -675,7 +679,8 @@ public class MojoMocklessTest
}
@Override
- protected String[] getExcludedEnvironmentVariables() {
+ protected String[] getExcludedEnvironmentVariables()
+ {
return new String[0];
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java
index c7e982d..1ea7002 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java
@@ -49,9 +49,16 @@ import static org.apache.maven.artifact.versioning.VersionRange.createFromVersio
import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec;
import static org.apache.maven.plugin.surefire.SurefireDependencyResolver.PROVIDER_GROUP_ID;
import static org.fest.assertions.Assertions.assertThat;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.isNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import static org.powermock.reflect.Whitebox.invokeMethod;
+/**
+ *
+ */
public class SurefireDependencyResolverTest
{
@Rule
@@ -107,8 +114,9 @@ public class SurefireDependencyResolverTest
final Artifact provider = createArtifact( "surefire-junit-platform" );
RepositorySystem repositorySystem = mock( RepositorySystem.class );
final ArtifactResolutionResult expectedResult = mock( ArtifactResolutionResult.class );
- when( repositorySystem.resolve( any( ArtifactResolutionRequest.class) ) )
- .then( new Answer<ArtifactResolutionResult>() {
+ when( repositorySystem.resolve( any( ArtifactResolutionRequest.class ) ) )
+ .then( new Answer<ArtifactResolutionResult>()
+ {
@Override
public ArtifactResolutionResult answer( InvocationOnMock invocation )
{
@@ -182,7 +190,8 @@ public class SurefireDependencyResolverTest
RepositorySystem repositorySystem = mock( RepositorySystem.class );
when( repositorySystem.resolve( any( ArtifactResolutionRequest.class ) ) )
- .then( new Answer<ArtifactResolutionResult>() {
+ .then( new Answer<ArtifactResolutionResult>()
+ {
@Override
public ArtifactResolutionResult answer( InvocationOnMock invocation )
{
@@ -218,7 +227,8 @@ public class SurefireDependencyResolverTest
}
} );
when( repositorySystem.createDependencyArtifact( any( Dependency.class ) ) )
- .then( new Answer<Artifact>() {
+ .then( new Answer<Artifact>()
+ {
@Override
public Artifact answer( InvocationOnMock invocation )
{
@@ -315,8 +325,9 @@ public class SurefireDependencyResolverTest
.thenReturn( new HashSet<>( asList( provider, api, logger, ext ) ) );
RepositorySystem repositorySystem = mock( RepositorySystem.class );
- when( repositorySystem.resolve( any( ArtifactResolutionRequest.class) ) )
- .then( new Answer<ArtifactResolutionResult>() {
+ when( repositorySystem.resolve( any( ArtifactResolutionRequest.class ) ) )
+ .then( new Answer<ArtifactResolutionResult>()
+ {
@Override
public ArtifactResolutionResult answer( InvocationOnMock invocation )
{
@@ -417,7 +428,7 @@ public class SurefireDependencyResolverTest
private static Artifact createArtifact( String groupId, String artifactId )
throws InvalidVersionSpecificationException
{
- return createArtifact(groupId, artifactId, "1");
+ return createArtifact( groupId, artifactId, "1" );
}
private static Artifact createArtifact( String groupId, String artifactId, String version )
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
index 9541d3a..5b15054 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java
@@ -89,7 +89,7 @@ public class SurefireHelperTest
assertThat( SurefireHelper.DUMPSTREAM_FILENAME_FORMATTER )
.isEqualTo( SurefireHelper.DUMP_FILE_PREFIX + "%d.dumpstream" );
- assertThat( String.format( SurefireHelper.DUMPSTREAM_FILENAME_FORMATTER, 5) )
+ assertThat( String.format( SurefireHelper.DUMPSTREAM_FILENAME_FORMATTER, 5 ) )
.endsWith( "-jvmRun5.dumpstream" );
}
@@ -99,6 +99,7 @@ public class SurefireHelperTest
assumeTrue( IS_OS_WINDOWS );
String root = "X:\\path\\to\\project\\";
String pathToJar = "target\\surefire\\surefirebooter4942721306300108667.jar";
+ @SuppressWarnings( "checkstyle:magicnumber" )
int projectNameLength = 247 - root.length() - pathToJar.length();
StringBuilder projectFolder = new StringBuilder();
for ( int i = 0; i < projectNameLength; i++ )
@@ -153,6 +154,6 @@ public class SurefireHelperTest
fail( "Expected MojoFailureException with message "
+ "'There are test failures.\n\nPlease refer to null "
+ "for the individual test results.\nPlease refer to dump files (if any exist) "
- + "[date].dump, [date]-jvmRun[N].dump and [date].dumpstream.'");
+ + "[date].dump, [date]-jvmRun[N].dump and [date].dumpstream.'" );
}
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
index 03aa136..69c5fbf 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.plugin.surefire;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -123,7 +124,8 @@ public class SurefirePropertiesTest
private static int size( Iterator<?> iterator )
{
int count = 0;
- while ( iterator.hasNext() ) {
+ while ( iterator.hasNext() )
+ {
iterator.next();
count++;
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
index 4cdff1b..dc7376b 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerProviderConfigurationTest.java
@@ -22,10 +22,22 @@ package org.apache.maven.plugin.surefire.booterclient;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.commons.io.FileUtils;
-import org.apache.maven.surefire.booter.*;
+import org.apache.maven.surefire.booter.BooterDeserializer;
+import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
+import org.apache.maven.surefire.booter.ClasspathConfiguration;
+import org.apache.maven.surefire.booter.PropertiesWrapper;
+import org.apache.maven.surefire.booter.ProviderConfiguration;
+import org.apache.maven.surefire.booter.Shutdown;
+import org.apache.maven.surefire.booter.StartupConfiguration;
+import org.apache.maven.surefire.booter.TypeEncodedValue;
import org.apache.maven.surefire.cli.CommandLineOption;
import org.apache.maven.surefire.report.ReporterConfiguration;
-import org.apache.maven.surefire.testset.*;
+import org.apache.maven.surefire.testset.DirectoryScannerParameters;
+import org.apache.maven.surefire.testset.ResolvedTest;
+import org.apache.maven.surefire.testset.RunOrderParameters;
+import org.apache.maven.surefire.testset.TestArtifactInfo;
+import org.apache.maven.surefire.testset.TestListResolver;
+import org.apache.maven.surefire.testset.TestRequest;
import org.apache.maven.surefire.util.RunOrder;
import org.junit.After;
import org.junit.Before;
@@ -33,7 +45,11 @@ import org.junit.Before;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.util.*;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
import static org.apache.maven.surefire.cli.CommandLineOption.LOGGING_LEVEL_DEBUG;
import static org.apache.maven.surefire.cli.CommandLineOption.REACTOR_FAIL_FAST;
@@ -48,13 +64,13 @@ public class BooterDeserializerProviderConfigurationTest
extends TestCase
{
- static final TypeEncodedValue aTestTyped = new TypeEncodedValue( String.class.getName(), "aTest" );
+ static final TypeEncodedValue TEST_TYPED = new TypeEncodedValue( String.class.getName(), "aTest" );
- private static final String aUserRequestedTest = "aUserRequestedTest";
+ private static final String USER_REQUESTED_TEST = "aUserRequestedTest";
- private static final String aUserRequestedTestMethod = "aUserRequestedTestMethod";
+ private static final String USER_REQUESTED_TEST_METHOD = "aUserRequestedTestMethod";
- private static final int rerunFailingTestsCount = 3;
+ private static final int RERUN_FAILING_TEST_COUNT = 3;
private static int idx = 0;
@@ -149,15 +165,16 @@ public class BooterDeserializerProviderConfigurationTest
TestListResolver resolver = testSuiteDefinition.getTestListResolver();
Assert.assertNotNull( resolver );
Assert.assertFalse( resolver.isEmpty() );
- Assert.assertEquals( aUserRequestedTest + "#" + aUserRequestedTestMethod, resolver.getPluginParameterTest() );
+ Assert.assertEquals( USER_REQUESTED_TEST + "#" + USER_REQUESTED_TEST_METHOD,
+ resolver.getPluginParameterTest() );
Assert.assertFalse( resolver.getIncludedPatterns().isEmpty() );
Assert.assertTrue( resolver.getExcludedPatterns().isEmpty() );
Assert.assertEquals( 1, resolver.getIncludedPatterns().size() );
ResolvedTest filter = resolver.getIncludedPatterns().iterator().next();
Assert.assertNotNull( filter );
- Assert.assertEquals( "**/" + aUserRequestedTest, filter.getTestClassPattern() );
- Assert.assertEquals( aUserRequestedTestMethod, filter.getTestMethodPattern() );
- Assert.assertEquals( rerunFailingTestsCount, testSuiteDefinition.getRerunFailingTestsCount() );
+ Assert.assertEquals( "**/" + USER_REQUESTED_TEST, filter.getTestClassPattern() );
+ Assert.assertEquals( USER_REQUESTED_TEST_METHOD, filter.getTestMethodPattern() );
+ Assert.assertEquals( RERUN_FAILING_TEST_COUNT, testSuiteDefinition.getRerunFailingTestsCount() );
assertEquals( cli, reloaded.getMainCliOptions() );
}
@@ -165,7 +182,7 @@ public class BooterDeserializerProviderConfigurationTest
throws IOException
{
final ProviderConfiguration reloaded = getReloadedProviderConfiguration();
- Assert.assertEquals( aTestTyped, reloaded.getTestForFork() );
+ Assert.assertEquals( TEST_TYPED, reloaded.getTestForFork() );
assertEquals( cli, reloaded.getMainCliOptions() );
}
@@ -255,11 +272,11 @@ public class BooterDeserializerProviderConfigurationTest
ReporterConfiguration reporterConfiguration = new ReporterConfiguration( cwd, true );
TestRequest testSuiteDefinition =
new TestRequest( getSuiteXmlFileStrings(), getTestSourceDirectory(),
- new TestListResolver( aUserRequestedTest + "#aUserRequestedTestMethod" ),
- rerunFailingTestsCount );
+ new TestListResolver( USER_REQUESTED_TEST + "#aUserRequestedTestMethod" ),
+ RERUN_FAILING_TEST_COUNT );
RunOrderParameters runOrderParameters = new RunOrderParameters( RunOrder.DEFAULT, null );
return new ProviderConfiguration( directoryScannerParameters, runOrderParameters, true, reporterConfiguration,
- new TestArtifactInfo( "5.0", "ABC" ), testSuiteDefinition, new HashMap<String, String>(), aTestTyped,
+ new TestArtifactInfo( "5.0", "ABC" ), testSuiteDefinition, new HashMap<String, String>(), TEST_TYPED,
readTestsFromInStream, cli, 0, Shutdown.DEFAULT, 0 );
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
index e170a45..c70b4a5 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/BooterDeserializerStartupConfigurationTest.java
@@ -21,10 +21,22 @@ package org.apache.maven.plugin.surefire.booterclient;
import junit.framework.TestCase;
import org.apache.commons.io.FileUtils;
-import org.apache.maven.surefire.booter.*;
+import org.apache.maven.surefire.booter.AbstractPathConfiguration;
+import org.apache.maven.surefire.booter.BooterDeserializer;
+import org.apache.maven.surefire.booter.Classpath;
+import org.apache.maven.surefire.booter.ClasspathConfiguration;
+import org.apache.maven.surefire.booter.ClassLoaderConfiguration;
+import org.apache.maven.surefire.booter.PropertiesWrapper;
+import org.apache.maven.surefire.booter.ProviderConfiguration;
+import org.apache.maven.surefire.booter.StartupConfiguration;
+import org.apache.maven.surefire.booter.Shutdown;
import org.apache.maven.surefire.cli.CommandLineOption;
import org.apache.maven.surefire.report.ReporterConfiguration;
-import org.apache.maven.surefire.testset.*;
+import org.apache.maven.surefire.testset.DirectoryScannerParameters;
+import org.apache.maven.surefire.testset.RunOrderParameters;
+import org.apache.maven.surefire.testset.TestArtifactInfo;
+import org.apache.maven.surefire.testset.TestRequest;
+import org.apache.maven.surefire.testset.TestListResolver;
import org.apache.maven.surefire.util.RunOrder;
import org.junit.After;
import org.junit.Before;
@@ -165,12 +177,12 @@ public class BooterDeserializerStartupConfigurationTest
ReporterConfiguration reporterConfiguration = new ReporterConfiguration( cwd, true );
TestRequest testSuiteDefinition =
new TestRequest( Arrays.asList( getSuiteXmlFileStrings() ), getTestSourceDirectory(),
- new TestListResolver( "aUserRequestedTest#aUserRequestedTestMethod" ));
+ new TestListResolver( "aUserRequestedTest#aUserRequestedTestMethod" ) );
RunOrderParameters runOrderParameters = new RunOrderParameters( RunOrder.DEFAULT, null );
return new ProviderConfiguration( directoryScannerParameters, runOrderParameters, true, reporterConfiguration,
new TestArtifactInfo( "5.0", "ABC" ), testSuiteDefinition, new HashMap<String, String>(),
- BooterDeserializerProviderConfigurationTest.aTestTyped, true, cli, 0, Shutdown.DEFAULT, 0 );
+ BooterDeserializerProviderConfigurationTest.TEST_TYPED, true, cli, 0, Shutdown.DEFAULT, 0 );
}
private StartupConfiguration getTestStartupConfiguration( ClassLoaderConfiguration classLoaderConfiguration )
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java
index 0d9c3b6..23d2674 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java
@@ -48,7 +48,12 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.powermock.api.mockito.PowerMockito.*;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.mockStatic;
+import static org.powermock.api.mockito.PowerMockito.spy;
+import static org.powermock.api.mockito.PowerMockito.verifyPrivate;
+import static org.powermock.api.mockito.PowerMockito.verifyStatic;
+import static org.powermock.api.mockito.PowerMockito.when;
import static org.powermock.reflect.Whitebox.invokeMethod;
/**
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
index f29c62e..988aa60 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java
@@ -47,6 +47,9 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+/**
+ *
+ */
public class ForkConfigurationTest
{
private static final StartupConfiguration STARTUP_CONFIG = new StartupConfiguration( "",
@@ -75,6 +78,7 @@ public class ForkConfigurationTest
}
@Test
+ @SuppressWarnings( { "checkstyle:methodname", "checkstyle:magicnumber" } )
public void testCreateCommandLine_UseSystemClassLoaderForkOnce_ShouldConstructManifestOnlyJar()
throws IOException, SurefireBooterForkException
{
@@ -223,6 +227,7 @@ public class ForkConfigurationTest
}
// based on http://stackoverflow.com/questions/2591083/getting-version-of-java-in-runtime
+ @SuppressWarnings( "checkstyle:magicnumber" )
private static boolean isJavaVersionAtLeast7u60()
{
String[] javaVersionElements = System.getProperty( "java.runtime.version" ).split( "\\.|_|-b" );
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java
index ab84690..79c6f0e 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java
@@ -51,6 +51,7 @@ import static org.hamcrest.Matchers.is;
/**
* @author Kristian Rosenvold
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class ForkingRunListenerTest
extends TestCase
{
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java
index 8f8cd8f..e44c10b 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java
@@ -149,7 +149,7 @@ public class JarManifestForkConfigurationTest
when( parent.toString() ).thenReturn( "C:\\Windows\\Temp\\surefire" );
Path classPathElement = mock( Path.class );
when( classPathElement.toString() )
- .thenReturn("C:\\Test User\\me\\.m2\\repository\\grp\\art\\1.0\\art-1.0.jar");
+ .thenReturn( "C:\\Test User\\me\\.m2\\repository\\grp\\art\\1.0\\art-1.0.jar" );
when( relativize( parent, classPathElement ) )
.thenReturn( "..\\..\\..\\Test User\\me\\.m2\\repository\\grp\\art\\1.0\\art-1.0.jar" );
when( toClasspathElementUri( same( parent ), same( classPathElement ), same( dumpDirectory ), anyBoolean() ) )
@@ -194,6 +194,7 @@ public class JarManifestForkConfigurationTest
}
@Test
+ @SuppressWarnings( "checkstyle:magicnumber" )
public void shouldEscapeUri()
throws Exception
{
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java
index b98aca7..c44b82d 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockNotifiableTestStream.java
@@ -20,7 +20,7 @@ package org.apache.maven.plugin.surefire.booterclient;
*/
import org.apache.maven.plugin.surefire.booterclient.lazytestprovider.NotifiableTestStream;
-import org.apache.maven.surefire.booter.*;
+import org.apache.maven.surefire.booter.Shutdown;
/**
* Mock of {@link NotifiableTestStream} for testing purposes.
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java
index 1a84a63..fdd9110 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/MockReporter.java
@@ -133,7 +133,8 @@ public class MockReporter
}
@Override
- public RunMode markAs(RunMode currentRunMode) {
+ public RunMode markAs( RunMode currentRunMode )
+ {
return null;
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java
index 78251a6..3cd0fb8 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java
@@ -33,6 +33,9 @@ import static org.mockito.Mockito.verify;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.verifyZeroInteractions;
+/**
+ *
+ */
public class OutputStreamFlushableCommandlineTest
{
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java
index d120638..21bc663 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/TestProvidingInputStreamTest.java
@@ -35,7 +35,8 @@ import java.util.concurrent.TimeUnit;
import static org.apache.maven.surefire.booter.MasterProcessCommand.BYE_ACK;
import static org.apache.maven.surefire.booter.MasterProcessCommand.decode;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
/**
* Asserts that this stream properly reads bytes from queue.
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java
index a2405c5..09230bb 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java
@@ -37,10 +37,32 @@ import java.util.concurrent.atomic.AtomicBoolean;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Arrays.copyOfRange;
import static org.apache.commons.codec.binary.Base64.encodeBase64String;
-import static org.apache.maven.plugin.surefire.booterclient.MockReporter.*;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.CONSOLE_DEBUG;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.CONSOLE_ERR;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.CONSOLE_WARN;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.CONSOLE_INFO;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.SET_COMPLETED;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.SET_STARTING;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.STDOUT;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.STDERR;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.TEST_ASSUMPTION_FAIL;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.TEST_ERROR;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.TEST_FAILED;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.TEST_STARTING;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.TEST_SKIPPED;
+import static org.apache.maven.plugin.surefire.booterclient.MockReporter.TEST_SUCCEEDED;
import static org.fest.assertions.Assertions.assertThat;
import static org.fest.assertions.MapAssert.entry;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.startsWith;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
/**
* Test for {@link ForkClient}.
@@ -50,6 +72,8 @@ import static org.mockito.Mockito.*;
*/
public class ForkClientTest
{
+ private static final int ELAPSED_TIME = 102;
+
@Test
public void shouldNotFailOnEmptyInput1()
{
@@ -890,7 +914,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -917,7 +941,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -950,7 +974,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getNameText() )
.isNull();
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getGroup() )
@@ -1021,7 +1045,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -1052,7 +1076,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -1083,7 +1107,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getNameText() )
.isEqualTo( "dn2" );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getGroup() )
@@ -1156,7 +1180,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -1183,7 +1207,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -1212,7 +1236,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getNameText() )
.isNull();
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getGroup() )
@@ -1285,7 +1309,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -1312,7 +1336,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -1346,7 +1370,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getNameText() )
.isNull();
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 0 ) ).getGroup() )
@@ -1415,7 +1439,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -1451,7 +1475,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -1484,7 +1508,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getName() )
.isEqualTo( "my test" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getGroup() )
@@ -1557,7 +1581,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -1593,7 +1617,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -1630,7 +1654,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getNameText() )
.isNull();
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getGroup() )
@@ -1703,7 +1727,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -1739,7 +1763,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -1776,7 +1800,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getNameText() )
.isNull();
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getGroup() )
@@ -1849,7 +1873,7 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -1889,7 +1913,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -1922,7 +1946,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getName() )
.isEqualTo( "my test" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getGroup() )
@@ -1995,11 +2019,11 @@ public class ForkClientTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "some test" );
when( reportEntry.getName() ).thenReturn( "my test" );
- when( reportEntry.getNameText() ).thenReturn("display name");
+ when( reportEntry.getNameText() ).thenReturn( "display name" );
when( reportEntry.getNameWithGroup() ).thenReturn( "name with group" );
when( reportEntry.getSourceName() ).thenReturn( "pkg.MyTest" );
when( reportEntry.getStackTraceWriter() ).thenReturn( stackTraceWriter );
@@ -2033,7 +2057,7 @@ public class ForkClientTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -2066,7 +2090,7 @@ public class ForkClientTest
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getNameText() )
.isEqualTo( "display name" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getElapsed() )
- .isEqualTo( 102 );
+ .isEqualTo( ELAPSED_TIME );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getMessage() )
.isEqualTo( "some test" );
assertThat( ( (ReportEntry) receiver.getData().get( 1 ) ).getGroup() )
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkedChannelDecoderTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkedChannelDecoderTest.java
index 53c3562..42dd636 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkedChannelDecoderTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkedChannelDecoderTest.java
@@ -71,6 +71,9 @@ import static org.mockito.Mockito.when;
@RunWith( Enclosed.class )
public class ForkedChannelDecoderTest
{
+ /**
+ *
+ */
public static class DecoderOperationsTest
{
@Rule
@@ -86,6 +89,7 @@ public class ForkedChannelDecoderTest
}
@Test
+ @SuppressWarnings( "checkstyle:innerassignment" )
public void shouldHaveSystemProperty() throws IOException
{
Stream out = Stream.newStream();
@@ -129,6 +133,7 @@ public class ForkedChannelDecoderTest
}
@Test
+ @SuppressWarnings( "checkstyle:magicnumber" )
public void testCreatingReportEntry()
{
final String exceptionMessage = "msg";
@@ -175,7 +180,7 @@ public class ForkedChannelDecoderTest
assertThat( decodedReportEntry.getSourceName() ).isEqualTo( reportEntry.getSourceName() );
assertThat( decodedReportEntry.getSourceText() ).isEqualTo( reportEntry.getSourceText() );
assertThat( decodedReportEntry.getName() ).isEqualTo( reportEntry.getName() );
- assertThat( decodedReportEntry.getNameText() ).isEqualTo(reportEntry.getNameText());
+ assertThat( decodedReportEntry.getNameText() ).isEqualTo( reportEntry.getNameText() );
assertThat( decodedReportEntry.getGroup() ).isEqualTo( reportEntry.getGroup() );
assertThat( decodedReportEntry.getMessage() ).isEqualTo( reportEntry.getMessage() );
assertThat( decodedReportEntry.getStackTraceWriter() ).isNull();
@@ -187,7 +192,7 @@ public class ForkedChannelDecoderTest
assertThat( decodedReportEntry.getSourceName() ).isEqualTo( reportEntry.getSourceName() );
assertThat( decodedReportEntry.getSourceText() ).isEqualTo( reportEntry.getSourceText() );
assertThat( decodedReportEntry.getName() ).isEqualTo( reportEntry.getName() );
- assertThat( decodedReportEntry.getNameText() ).isEqualTo(reportEntry.getNameText());
+ assertThat( decodedReportEntry.getNameText() ).isEqualTo( reportEntry.getNameText() );
assertThat( decodedReportEntry.getGroup() ).isEqualTo( reportEntry.getGroup() );
assertThat( decodedReportEntry.getMessage() ).isEqualTo( reportEntry.getMessage() );
assertThat( decodedReportEntry.getElapsed() ).isNull();
@@ -200,7 +205,7 @@ public class ForkedChannelDecoderTest
assertThat( decodedReportEntry.getSourceName() ).isEqualTo( reportEntry.getSourceName() );
assertThat( decodedReportEntry.getSourceText() ).isEqualTo( reportEntry.getSourceText() );
assertThat( decodedReportEntry.getName() ).isEqualTo( reportEntry.getName() );
- assertThat( decodedReportEntry.getNameText() ).isEqualTo(reportEntry.getNameText());
+ assertThat( decodedReportEntry.getNameText() ).isEqualTo( reportEntry.getNameText() );
assertThat( decodedReportEntry.getGroup() ).isEqualTo( reportEntry.getGroup() );
assertThat( decodedReportEntry.getMessage() ).isEqualTo( reportEntry.getMessage() );
assertThat( decodedReportEntry.getElapsed() ).isEqualTo( 1003 );
@@ -214,7 +219,7 @@ public class ForkedChannelDecoderTest
assertThat( decodedReportEntry.getSourceName() ).isEqualTo( reportEntry.getSourceName() );
assertThat( decodedReportEntry.getSourceText() ).isEqualTo( reportEntry.getSourceText() );
assertThat( decodedReportEntry.getName() ).isEqualTo( reportEntry.getName() );
- assertThat( decodedReportEntry.getNameText() ).isEqualTo(reportEntry.getNameText());
+ assertThat( decodedReportEntry.getNameText() ).isEqualTo( reportEntry.getNameText() );
assertThat( decodedReportEntry.getGroup() ).isEqualTo( reportEntry.getGroup() );
assertThat( decodedReportEntry.getMessage() ).isEqualTo( reportEntry.getMessage() );
assertThat( decodedReportEntry.getElapsed() ).isEqualTo( 1003 );
@@ -235,7 +240,7 @@ public class ForkedChannelDecoderTest
assertThat( decodedReportEntry.getSourceName() ).isEqualTo( reportEntry.getSourceName() );
assertThat( decodedReportEntry.getSourceText() ).isEqualTo( reportEntry.getSourceText() );
assertThat( decodedReportEntry.getName() ).isEqualTo( reportEntry.getName() );
- assertThat( decodedReportEntry.getNameText() ).isEqualTo(reportEntry.getNameText());
+ assertThat( decodedReportEntry.getNameText() ).isEqualTo( reportEntry.getNameText() );
assertThat( decodedReportEntry.getGroup() ).isEqualTo( reportEntry.getGroup() );
assertThat( decodedReportEntry.getMessage() ).isEqualTo( reportEntry.getMessage() );
assertThat( decodedReportEntry.getElapsed() ).isEqualTo( 1003 );
@@ -590,10 +595,14 @@ public class ForkedChannelDecoderTest
}
}
+ /**
+ *
+ */
@RunWith( Theories.class )
public static class ReportEntryTest
{
@DataPoints( value = "operation" )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public static String[][] operations = { { "testSetStarting", "setTestSetStartingListener" },
{ "testSetCompleted", "setTestSetCompletedListener" },
{ "testStarting", "setTestStartingListener" },
@@ -605,21 +614,27 @@ public class ForkedChannelDecoderTest
};
@DataPoints( value = "reportedMessage" )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public static String[] reportedMessage = { null, "skipped test" };
@DataPoints( value = "elapsed" )
+ @SuppressWarnings( { "checkstyle:visibilitymodifier", "checkstyle:magicnumber" } )
public static Integer[] elapsed = { null, 102 };
@DataPoints( value = "trim" )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public static boolean[] trim = { false, true };
@DataPoints( value = "msg" )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public static boolean[] msg = { false, true };
@DataPoints( value = "smart" )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public static boolean[] smart = { false, true };
@DataPoints( value = "trace" )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public static boolean[] trace = { false, true };
@Theory
@@ -657,7 +672,7 @@ public class ForkedChannelDecoderTest
when( reportEntry.getName() ).thenReturn( "display name of test" );
when( reportEntry.getNameWithGroup() ).thenReturn( "name with group" );
when( reportEntry.getSourceName() ).thenReturn( "pkg.MyTest" );
- when( reportEntry.getSourceText() ).thenReturn("test class display name");
+ when( reportEntry.getSourceText() ).thenReturn( "test class display name" );
when( reportEntry.getStackTraceWriter() ).thenReturn( stackTraceWriter );
Stream out = Stream.newStream();
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
index a9c5bee..0dfe1b8 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java
@@ -54,22 +54,25 @@ import static org.mockito.Mockito.when;
import static org.powermock.reflect.Whitebox.getInternalState;
import static org.powermock.reflect.Whitebox.invokeMethod;
+/**
+ *
+ */
public class DefaultReporterFactoryTest
extends TestCase
{
- private final static String TEST_ONE = "testOne";
+ private static final String TEST_ONE = "testOne";
- private final static String TEST_TWO = "testTwo";
+ private static final String TEST_TWO = "testTwo";
- private final static String TEST_THREE = "testThree";
+ private static final String TEST_THREE = "testThree";
- private final static String TEST_FOUR = "testFour";
+ private static final String TEST_FOUR = "testFour";
- private final static String TEST_FIVE = "testFive";
+ private static final String TEST_FIVE = "testFive";
- private final static String ASSERTION_FAIL = "assertionFail";
+ private static final String ASSERTION_FAIL = "assertionFail";
- private final static String ERROR = "error";
+ private static final String ERROR = "error";
public void testMergeTestHistoryResult()
throws Exception
@@ -395,7 +398,7 @@ public class DefaultReporterFactoryTest
private final String stackTrace;
- public DummyStackTraceWriter( String stackTrace )
+ DummyStackTraceWriter( String stackTrace )
{
this.stackTrace = stackTrace;
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
index 5faf8e3..0914051 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java
@@ -40,15 +40,18 @@ import java.util.concurrent.atomic.AtomicInteger;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.maven.surefire.util.internal.ObjectUtils.systemProps;
+/**
+ *
+ */
@SuppressWarnings( "ResultOfMethodCallIgnored" )
public class StatelessXmlReporterTest
extends TestCase
{
private static final String XSD =
"https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd";
- private final static String TEST_ONE = "aTestMethod";
- private final static String TEST_TWO = "bTestMethod";
- private final static String TEST_THREE = "cTestMethod";
+ private static final String TEST_ONE = "aTestMethod";
+ private static final String TEST_TWO = "bTestMethod";
+ private static final String TEST_THREE = "cTestMethod";
private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger();
private TestSetStats stats;
@@ -140,7 +143,7 @@ public class StatelessXmlReporterTest
FileInputStream fileInputStream = new FileInputStream( expectedReportFile );
- Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, UTF_8) );
+ Xpp3Dom testSuite = Xpp3DomBuilder.build( new InputStreamReader( fileInputStream, UTF_8 ) );
assertEquals( "testsuite", testSuite.getName() );
Xpp3Dom properties = testSuite.getChild( "properties" );
assertEquals( System.getProperties().size(), properties.getChildCount() );
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/WrappedReportEntryTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/WrappedReportEntryTest.java
index abbc093..36d1696 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/WrappedReportEntryTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/WrappedReportEntryTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.plugin.surefire.report;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,7 +24,10 @@ import org.apache.maven.surefire.report.SimpleReportEntry;
import junit.framework.TestCase;
-import static org.apache.maven.plugin.surefire.report.ReportEntryType.*;
+import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR;
+import static org.apache.maven.plugin.surefire.report.ReportEntryType.FAILURE;
+import static org.apache.maven.plugin.surefire.report.ReportEntryType.SKIPPED;
+import static org.apache.maven.plugin.surefire.report.ReportEntryType.SUCCESS;
/**
* @author Kristian Rosenvold
@@ -55,7 +59,7 @@ public class WrappedReportEntryTest
assertEquals( "surefire.testcase.JunitParamsTest", wr.getSourceName( "" ) );
assertEquals( "surefire.testcase.JunitParamsTest(BDD)", wr.getSourceName( "BDD" ) );
assertEquals( "testSum", wr.getReportName() );
- assertFalse(wr.isSucceeded());
+ assertFalse( wr.isSucceeded() );
assertFalse( wr.isErrorOrFailure() );
assertFalse( wr.isSkipped() );
assertTrue( wr.getSystemProperties().isEmpty() );
@@ -73,8 +77,8 @@ public class WrappedReportEntryTest
assertEquals( "dn1(BDD)", wr.getReportSourceName( "BDD" ) );
assertEquals( "surefire.testcase.JunitParamsTest(BDD)", wr.getSourceName( "BDD" ) );
assertEquals( "dn2", wr.getReportName() );
- assertFalse(wr.isSucceeded());
- assertTrue(wr.isErrorOrFailure());
+ assertFalse( wr.isSucceeded() );
+ assertTrue( wr.isErrorOrFailure() );
assertFalse( wr.isSkipped() );
assertNull( wr.getStackTraceWriter() );
assertEquals( "surefire.testcase.JunitParamsTest.testSum Time elapsed: 0.012 s",
@@ -92,7 +96,7 @@ public class WrappedReportEntryTest
assertEquals( "surefire.testcase.JunitParamsTest", wr.getReportSourceName() );
assertEquals( "surefire.testcase.JunitParamsTest(BDD)", wr.getReportSourceName( "BDD" ) );
assertEquals( "testSum", wr.getReportName() );
- assertFalse(wr.isSucceeded());
+ assertFalse( wr.isSucceeded() );
assertTrue( wr.isErrorOrFailure() );
assertFalse( wr.isSkipped() );
}
@@ -105,7 +109,7 @@ public class WrappedReportEntryTest
final String reportName = wr.getReportSourceName();
assertEquals( "[0] 1, 2, 3 (testSum)", reportName );
assertFalse( wr.isSucceeded() );
- assertFalse (wr.isErrorOrFailure() );
+ assertFalse ( wr.isErrorOrFailure() );
assertTrue( wr.isSkipped() );
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java
index 7f97a6d..1a15fbe 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java
@@ -74,6 +74,7 @@ public class RunEntryStatisticsMapTest
return new ByteArrayInputStream( content.getBytes( UTF_8 ) );
}
+ @SuppressWarnings( "checkstyle:magicnumber" )
public void testSerialize()
throws Exception
{
@@ -90,7 +91,7 @@ public class RunEntryStatisticsMapTest
newResults.add( existingEntries.createNextGeneration( reportEntry3 ) );
newResults.serialize( data );
- try ( InputStream io = new FileInputStream( data) )
+ try ( InputStream io = new FileInputStream( data ) )
{
List<String> lines = readLines( io, UTF_8 );
@@ -125,6 +126,7 @@ public class RunEntryStatisticsMapTest
}
}
+ @SuppressWarnings( "checkstyle:magicnumber" )
public void testMultiLineTestMethodName() throws IOException
{
File data = File.createTempFile( "surefire-unit", "test" );
@@ -159,6 +161,7 @@ public class RunEntryStatisticsMapTest
}
}
+ @SuppressWarnings( "checkstyle:magicnumber" )
public void testCombinedMethodNames() throws IOException
{
File data = File.createTempFile( "surefire-unit", "test" );
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DependenciesScannerTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DependenciesScannerTest.java
index e0a3e49..48f5e1e 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DependenciesScannerTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DependenciesScannerTest.java
@@ -19,7 +19,9 @@ package org.apache.maven.plugin.surefire.util;
* under the License.
*/
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
@@ -33,7 +35,12 @@ import org.junit.rules.TemporaryFolder;
import java.io.File;
import java.io.FileOutputStream;
-import java.util.*;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@@ -50,7 +57,8 @@ public class DependenciesScannerTest
public void testLocateTestClasses()
throws Exception
{
- File testFile = writeTestFile( "DependenciesScannerTest-tests.jar", "org/test/TestA.class", "org/test/TestB.class" );
+ File testFile = writeTestFile( "DependenciesScannerTest-tests.jar",
+ "org/test/TestA.class", "org/test/TestB.class" );
// use target as people can configure ide to compile in an other place than maven
Artifact artifact =
@@ -65,7 +73,8 @@ public class DependenciesScannerTest
include.add( "**/*A.java" );
List<String> exclude = new ArrayList<>();
- List<File> dependenciesToScan = filterArtifactsAsFiles(scanDependencies, Collections.singletonList(artifact));
+ List<File> dependenciesToScan =
+ filterArtifactsAsFiles( scanDependencies, Collections.singletonList( artifact ) );
DependencyScanner scanner =
new DependencyScanner( dependenciesToScan, new TestListResolver( include, exclude ) );
@@ -93,15 +102,15 @@ public class DependenciesScannerTest
VersionRange.createFromVersion( "1.0" ), "test", "jar", "tests-jdk15", null );
testArtifact.setFile( testJarFile );
- List<String> scanDependencies = new ArrayList<String>();
+ List<String> scanDependencies = new ArrayList<>();
scanDependencies.add( "org.surefire.dependency:dependent-artifact2:*:*:tests-jdk15" );
- List<String> include = new ArrayList<String>();
+ List<String> include = new ArrayList<>();
include.add( "**/*A.java" );
- List<String> exclude = new ArrayList<String>();
+ List<String> exclude = new ArrayList<>();
- List<File> filesToScan = filterArtifactsAsFiles(scanDependencies, Collections.singletonList(testArtifact));
+ List<File> filesToScan = filterArtifactsAsFiles( scanDependencies, Collections.singletonList( testArtifact ) );
DependencyScanner scanner =
new DependencyScanner( filesToScan, new TestListResolver( include, exclude ) );
@@ -110,7 +119,7 @@ public class DependenciesScannerTest
assertNotNull( classNames );
assertEquals( 2, classNames.size() );
- Map<String, String> props = new HashMap<String, String>();
+ Map<String, String> props = new HashMap<>();
classNames.writeTo( props );
assertEquals( 2, props.size() );
}
@@ -136,7 +145,7 @@ public class DependenciesScannerTest
new DefaultArtifactHandler() );
testArtifact.setFile( testJarFile );
- List<String> scanDependencies = new ArrayList<String>();
+ List<String> scanDependencies = new ArrayList<>();
scanDependencies.add( "org.surefire.dependency:dependent-artifact3:test-jar" );
List<String> include = new ArrayList<String>();
@@ -145,7 +154,7 @@ public class DependenciesScannerTest
List<Artifact> artifacts = Arrays.asList( mainArtifact, testArtifact );
- List<File> filesToScan = filterArtifactsAsFiles(scanDependencies, artifacts);
+ List<File> filesToScan = filterArtifactsAsFiles( scanDependencies, artifacts );
DependencyScanner scanner = new DependencyScanner( filesToScan, new TestListResolver( include, exclude ) );
@@ -154,7 +163,7 @@ public class DependenciesScannerTest
assertEquals( 1, classNames.size() );
assertEquals( "org.test.TestA", classNames.getClassName( 0 ) );
- Map<String, String> props = new HashMap<String, String>();
+ Map<String, String> props = new HashMap<>();
classNames.writeTo( props );
assertEquals( 1, props.size() );
}
@@ -180,16 +189,16 @@ public class DependenciesScannerTest
new DefaultArtifactHandler() );
artifact20.setFile( jarFile20 );
- List<String> scanDependencies = new ArrayList<String>();
+ List<String> scanDependencies = new ArrayList<>();
scanDependencies.add( "org.surefire.dependency:dependent-artifact4:*:2.0" );
- List<String> include = new ArrayList<String>();
+ List<String> include = new ArrayList<>();
include.add( "**/*A.java" );
- List<String> exclude = new ArrayList<String>();
+ List<String> exclude = new ArrayList<>();
List<Artifact> artifacts = Arrays.asList( artifact10, artifact20 );
- List<File> filesToScan = filterArtifactsAsFiles(scanDependencies, artifacts);
+ List<File> filesToScan = filterArtifactsAsFiles( scanDependencies, artifacts );
DependencyScanner scanner = new DependencyScanner( filesToScan, new TestListResolver( include, exclude ) );
ScanResult classNames = scanner.scan();
@@ -203,10 +212,12 @@ public class DependenciesScannerTest
assertFalse( props.values().contains( "org.test.ClassA" ) );
}
- private static List<File> filterArtifactsAsFiles(List<String> scanDependencies, List<Artifact> artifacts) {
+ private static List<File> filterArtifactsAsFiles( List<String> scanDependencies, List<Artifact> artifacts )
+ {
List<File> filesToScan = new ArrayList<>();
- for (Artifact a : DependencyScanner.filter(artifacts, scanDependencies)) {
- filesToScan.add(a.getFile());
+ for ( Artifact a : DependencyScanner.filter( artifacts, scanDependencies ) )
+ {
+ filesToScan.add( a.getFile() );
}
return filesToScan;
}
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DirectoryScannerTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DirectoryScannerTest.java
index 02a462b..f19b2a9 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DirectoryScannerTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/DirectoryScannerTest.java
@@ -32,8 +32,12 @@ import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-import static org.junit.runners.Parameterized.*;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.runners.Parameterized.Parameter;
+import static org.junit.runners.Parameterized.Parameters;
/**
* @author Kristian Rosenvold
@@ -42,20 +46,24 @@ import static org.junit.runners.Parameterized.*;
public class DirectoryScannerTest
{
@Parameters( name = "\"{0}\" should count {1} classes" )
- public static Iterable<Object[]> data() {
- return Arrays.asList( new Object[][] {
- { "**/*ZT*A.java", is( 3 ) },
- { "**/*ZT*A.java#testMethod", is( 3 ) },
- { "**/*ZT?A.java#testMethod, !*ZT2A", is( 2 ) },
- { "**/*ZT?A.java#testMethod, !*ZT2A#testMethod", is( 3 ) },
- { "#testMethod", is( greaterThanOrEqualTo( 3 ) ) },
- } );
+ public static Iterable<Object[]> data()
+ {
+ return Arrays.asList( new Object[][]
+ {
+ { "**/*ZT*A.java", is( 3 ) },
+ { "**/*ZT*A.java#testMethod", is( 3 ) },
+ { "**/*ZT?A.java#testMethod, !*ZT2A", is( 2 ) },
+ { "**/*ZT?A.java#testMethod, !*ZT2A#testMethod", is( 3 ) },
+ { "#testMethod", is( greaterThanOrEqualTo( 3 ) ) }
+ } );
}
@Parameter( 0 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String filter;
@Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public Matcher<? super Integer> expectedClassesCount;
@Test
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
index c74e5b7..e8922cf 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java
@@ -34,6 +34,9 @@ import org.apache.maven.shared.utils.io.FileUtils;
import static java.nio.charset.StandardCharsets.US_ASCII;
import static org.fest.assertions.Assertions.assertThat;
+/**
+ *
+ */
public class ConsoleOutputFileReporterTest
extends TestCase
{
@@ -127,7 +130,8 @@ public class ConsoleOutputFileReporterTest
final ArrayList<Callable<Void>> jobs = new ArrayList<>();
for ( int i = 0; i < 10; i++ )
{
- jobs.add( new Callable<Void>() {
+ jobs.add( new Callable<Void>()
+ {
@Override
public Void call()
{
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/FileReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/FileReporterTest.java
index 0b9d84b..cbb85cc 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/FileReporterTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/FileReporterTest.java
@@ -29,6 +29,9 @@ import org.apache.maven.plugin.surefire.report.WrappedReportEntry;
import junit.framework.TestCase;
+/**
+ *
+ */
public class FileReporterTest
extends TestCase
{
@@ -37,18 +40,18 @@ public class FileReporterTest
private ReportEntry reportEntry;
- private static final String testName = "org.apache.maven.surefire.report.FileReporterTest";
+ private static final String TEST_NAME = "org.apache.maven.surefire.report.FileReporterTest";
public void testFileNameWithoutSuffix()
{
File reportDir = new File( "target" );
- reportEntry = new SimpleReportEntry( getClass().getName(), null, testName, null );
+ reportEntry = new SimpleReportEntry( getClass().getName(), null, TEST_NAME, null );
WrappedReportEntry wrappedReportEntry =
new WrappedReportEntry( reportEntry, ReportEntryType.SUCCESS, 12, null, null );
reporter = new FileReporter( reportDir, null, Charset.defaultCharset(), false, false, false );
reporter.testSetCompleted( wrappedReportEntry, createTestSetStats(), new ArrayList<String>() );
- File expectedReportFile = new File( reportDir, testName + ".txt" );
+ File expectedReportFile = new File( reportDir, TEST_NAME + ".txt" );
assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist",
expectedReportFile.exists() );
//noinspection ResultOfMethodCallIgnored
@@ -64,13 +67,13 @@ public class FileReporterTest
{
File reportDir = new File( "target" );
String suffixText = "sampleSuffixText";
- reportEntry = new SimpleReportEntry( getClass().getName(), null, testName, null );
+ reportEntry = new SimpleReportEntry( getClass().getName(), null, TEST_NAME, null );
WrappedReportEntry wrappedReportEntry =
new WrappedReportEntry( reportEntry, ReportEntryType.SUCCESS, 12, null, null );
reporter = new FileReporter( reportDir, suffixText, Charset.defaultCharset(), false, false, false );
reporter.testSetCompleted( wrappedReportEntry, createTestSetStats(), new ArrayList<String>() );
- File expectedReportFile = new File( reportDir, testName + "-" + suffixText + ".txt" );
+ File expectedReportFile = new File( reportDir, TEST_NAME + "-" + suffixText + ".txt" );
assertTrue( "Report file (" + expectedReportFile.getAbsolutePath() + ") doesn't exist",
expectedReportFile.exists() );
//noinspection ResultOfMethodCallIgnored
diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/RunStatisticsTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/RunStatisticsTest.java
index acb17cc..b05561a 100644
--- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/RunStatisticsTest.java
+++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/RunStatisticsTest.java
@@ -1,24 +1,29 @@
package org.apache.maven.surefire.report;
-import junit.framework.TestCase;
-
/*
- * Copyright 2002-2009 the original author or authors.
- *
- * Licensed 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
+ * 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
*
- * 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.
+ * 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.
*/
+import junit.framework.TestCase;
+
+/**
+ *
+ */
public class RunStatisticsTest
extends TestCase
{
diff --git a/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java b/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java
index 0be3d89..3c759b1 100644
--- a/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java
+++ b/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.plugin.surefire;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,6 +25,9 @@ import org.apache.maven.surefire.suite.RunResult;
import static org.fest.assertions.Assertions.assertThat;
+/**
+ *
+ */
public class SurefirePluginTest extends TestCase
{
public void testDefaultIncludes()
@@ -76,7 +80,7 @@ public class SurefirePluginTest extends TestCase
fail( "Expected MojoFailureException with message "
+ "'There are test failures.\n\nPlease refer to null "
+ "for the individual test results.\nPlease refer to dump files (if any exist) "
- + "[date].dump, [date]-jvmRun[N].dump and [date].dumpstream.'");
+ + "[date].dump, [date]-jvmRun[N].dump and [date].dumpstream.'" );
}
public void testPluginName()
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/JUnit4SuiteTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/JUnit4SuiteTest.java
index 5ab3ee1..bcf63cb 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/JUnit4SuiteTest.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/JUnit4SuiteTest.java
@@ -38,7 +38,7 @@ public class JUnit4SuiteTest extends TestCase
suite.addTest( new JUnit4TestAdapter( Surefire597Test.class ) );
suite.addTest( new JUnit4TestAdapter( SurefireSchemaValidationTest.class ) );
suite.addTestSuite( Surefire1183Test.class );
- suite.addTestSuite( SurefireReportMojoTest.class);
+ suite.addTestSuite( SurefireReportMojoTest.class );
return suite;
}
}
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java
index 20e20f2..2ce686d 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire1183Test.java
@@ -1,3 +1,5 @@
+package org.apache.maven.plugins.surefire.report;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.plugins.surefire.report;
-
import org.apache.maven.doxia.site.decoration.DecorationModel;
import org.apache.maven.doxia.siterenderer.Renderer;
import org.apache.maven.doxia.siterenderer.RendererException;
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire597Test.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire597Test.java
index b179e3c..2f40a9f 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire597Test.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Surefire597Test.java
@@ -21,6 +21,7 @@ package org.apache.maven.plugins.surefire.report;
import junit.framework.TestCase;
import org.apache.maven.doxia.module.xhtml5.Xhtml5Sink;
+import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger;
@@ -39,6 +40,7 @@ import static org.apache.maven.plugins.surefire.report.Utils.toSystemNewLine;
public class Surefire597Test
extends TestCase
{
+ @SuppressWarnings( "checkstyle:linelength" )
public void testCorruptedTestCaseFailureWithMissingErrorTypeAndMessage()
throws Exception
{
@@ -47,7 +49,9 @@ public class Surefire597Test
ConsoleLogger log = new NullConsoleLogger();
SurefireReportGenerator gen = new SurefireReportGenerator( singletonList( report ), ENGLISH, true, null, log );
StringWriter writer = new StringWriter();
- gen.doGenerateReport( new SurefireReportMojo().getBundle( ENGLISH ), new Xhtml5Sink( writer ) {} );
+ Sink sink = new Xhtml5Sink( writer )
+ { };
+ gen.doGenerateReport( new SurefireReportMojo().getBundle( ENGLISH ), sink );
String xml = writer.toString();
assertThat( xml, containsString( toSystemNewLine(
"<table border=\"1\" class=\"bodyTable\">\n"
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
index e62c168..d4dedd1 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireReportMojoTest.java
@@ -44,6 +44,7 @@ import static org.apache.maven.plugins.surefire.report.Utils.toSystemNewLine;
/**
* @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>
*/
+@SuppressWarnings( "checkstyle:linelength" )
public class SurefireReportMojoTest
extends AbstractMojoTestCase
{
@@ -198,7 +199,8 @@ public class SurefireReportMojoTest
assertTrue( idx < 0 );
}
-
+
+ @SuppressWarnings( "checkstyle:methodname" )
public void testBasicSurefireReport_AnchorTestCases()
throws Exception
{
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java
index 9292fcf..c8fe52f 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java
@@ -37,10 +37,13 @@ import org.xmlunit.validation.ValidationProblem;
import org.xmlunit.validation.ValidationResult;
import org.xmlunit.validation.Validator;
+/**
+ *
+ */
public class SurefireSchemaValidationTest
extends TestCase
{
-
+ @SuppressWarnings( "checkstyle:methodname" )
public void testValidate_XMLs_against_schema()
throws Exception
{
diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Utils.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Utils.java
index d2cb04e..0c689de 100644
--- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Utils.java
+++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/Utils.java
@@ -19,6 +19,9 @@ package org.apache.maven.plugins.surefire.report;
* under the License.
*/
+/**
+ *
+ */
public final class Utils
{
private Utils()
diff --git a/surefire-api/src/test/java/org/apache/maven/plugin/surefire/runorder/ThreadedExecutionSchedulerTest.java b/surefire-api/src/test/java/org/apache/maven/plugin/surefire/runorder/ThreadedExecutionSchedulerTest.java
index 6647504..5c607ef 100644
--- a/surefire-api/src/test/java/org/apache/maven/plugin/surefire/runorder/ThreadedExecutionSchedulerTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/plugin/surefire/runorder/ThreadedExecutionSchedulerTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.plugin.surefire.runorder;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/SpecificTestClassFilterTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/SpecificTestClassFilterTest.java
index 905c7fe..0cb8da0 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/SpecificTestClassFilterTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/SpecificTestClassFilterTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,40 +21,40 @@ package org.apache.maven.surefire;
import junit.framework.TestCase;
-public class SpecificTestClassFilterTest
- extends TestCase
+/**
+ *
+ */
+public class SpecificTestClassFilterTest extends TestCase
{
-
public void testMatchSingleCharacterWildcard()
{
- SpecificTestClassFilter filter =
- new SpecificTestClassFilter( new String[]{ "org/apache/maven/surefire/?pecificTestClassFilter.class" } );
+ SpecificTestClassFilter filter = new SpecificTestClassFilter(
+ new String[] {"org/apache/maven/surefire/?pecificTestClassFilter.class"} );
assertTrue( filter.accept( SpecificTestClassFilter.class ) );
}
public void testMatchSingleSegmentWordWildcard()
{
- SpecificTestClassFilter filter =
- new SpecificTestClassFilter( new String[]{ "org/apache/maven/surefire/*TestClassFilter.class" } );
+ SpecificTestClassFilter filter = new SpecificTestClassFilter(
+ new String[] {"org/apache/maven/surefire/*TestClassFilter.class"} );
assertTrue( filter.accept( SpecificTestClassFilter.class ) );
}
public void testMatchMultiSegmentWildcard()
{
- SpecificTestClassFilter filter =
- new SpecificTestClassFilter( new String[]{ "org/**/SpecificTestClassFilter.class" } );
+ SpecificTestClassFilter filter = new SpecificTestClassFilter(
+ new String[] {"org/**/SpecificTestClassFilter.class"} );
assertTrue( filter.accept( SpecificTestClassFilter.class ) );
}
public void testMatchSingleSegmentWildcard()
{
- SpecificTestClassFilter filter =
- new SpecificTestClassFilter( new String[]{ "org/*/maven/surefire/SpecificTestClassFilter.class" } );
+ SpecificTestClassFilter filter = new SpecificTestClassFilter(
+ new String[] {"org/*/maven/surefire/SpecificTestClassFilter.class"} );
assertTrue( filter.accept( SpecificTestClassFilter.class ) );
}
-
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java
index 5168d2b..40c0243 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java
@@ -57,20 +57,27 @@ import static org.fest.assertions.Assertions.assertThat;
@RunWith( NewClassLoaderRunner.class )
public class CommandReaderTest
{
+ private static final long DELAY = 200L;
+ private static final long TEST_TIMEOUT = 15_000L;
+
private final BlockingQueue<Byte> blockingStream = new LinkedBlockingQueue<>();
private InputStream realInputStream;
private CommandReader reader;
- static class A {
+ static class A
+ {
}
- static class B {
+ static class B
+ {
}
- static class C {
+ static class C
+ {
}
- static class D {
+ static class D
+ {
}
@Before
@@ -135,7 +142,7 @@ public class CommandReaderTest
assertThat( it1.next(), is( A.class.getName() ) );
addTestToPipeline( B.class.getName() );
- TimeUnit.MILLISECONDS.sleep( 200 ); // give the test chance to fail
+ TimeUnit.MILLISECONDS.sleep( DELAY ); // give the test chance to fail
Iterator<String> it2 = reader.iterated();
@@ -154,8 +161,7 @@ public class CommandReaderTest
}
@Test( expected = NoSuchElementException.class )
- public void stopBeforeReadInThread()
- throws Throwable
+ public void stopBeforeReadInThread() throws Throwable
{
Runnable runnable = new Runnable()
{
@@ -181,8 +187,7 @@ public class CommandReaderTest
}
@Test
- public void readTwoClassesInThread()
- throws Throwable
+ public void readTwoClassesInThread() throws Throwable
{
final CountDownLatch counter = new CountDownLatch( 1 );
Runnable runnable = new Runnable()
@@ -211,21 +216,18 @@ public class CommandReaderTest
}
}
- @Test( timeout = 15000 )
- public void shouldAwaitReaderUp()
- throws TestSetFailedException
+ @Test( timeout = TEST_TIMEOUT )
+ public void shouldAwaitReaderUp() throws TestSetFailedException
{
assertTrue( reader.awaitStarted() );
reader.stop();
assertFalse( reader.awaitStarted() );
}
- private class SystemInputStream
- extends InputStream
+ private class SystemInputStream extends InputStream
{
@Override
- public int read()
- throws IOException
+ public int read() throws IOException
{
try
{
@@ -241,10 +243,8 @@ public class CommandReaderTest
private void addTestToPipeline( String cls )
{
byte[] clazz = cls.getBytes( ISO_8859_1 );
- ByteBuffer buffer = ByteBuffer.allocate( 8 + clazz.length )
- .putInt( MasterProcessCommand.RUN_CLASS.getId() )
- .putInt( clazz.length )
- .put( clazz );
+ ByteBuffer buffer = ByteBuffer.allocate( 8 + clazz.length ).putInt(
+ MasterProcessCommand.RUN_CLASS.getId() ).putInt( clazz.length ).put( clazz );
buffer.rewind();
for ( ; buffer.hasRemaining(); )
{
@@ -254,9 +254,8 @@ public class CommandReaderTest
private void addEndOfPipeline()
{
- ByteBuffer buffer = ByteBuffer.allocate( 8 )
- .putInt( MasterProcessCommand.TEST_SET_FINISHED.getId() )
- .putInt( 0 );
+ ByteBuffer buffer = ByteBuffer.allocate( 8 ).putInt( MasterProcessCommand.TEST_SET_FINISHED.getId() ).putInt(
+ 0 );
buffer.rewind();
for ( ; buffer.hasRemaining(); )
{
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java
index 4429f79..efa89e0 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkedChannelEncoderTest.java
@@ -56,6 +56,7 @@ import static org.mockito.Mockito.when;
*/
public class ForkedChannelEncoderTest
{
+ private static final int ELAPSED_TIME = 102;
@Test
public void shouldBeFailSafe()
@@ -163,7 +164,7 @@ public class ForkedChannelEncoderTest
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "skipped test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -191,7 +192,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -216,7 +217,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -245,7 +246,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -275,7 +276,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -310,7 +311,7 @@ public class ForkedChannelEncoderTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "skipped test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -342,7 +343,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -377,7 +378,7 @@ public class ForkedChannelEncoderTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "skipped test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -409,7 +410,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -444,7 +445,7 @@ public class ForkedChannelEncoderTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "skipped test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -476,7 +477,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -511,7 +512,7 @@ public class ForkedChannelEncoderTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "skipped test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -543,7 +544,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -577,7 +578,7 @@ public class ForkedChannelEncoderTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "skipped test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -609,7 +610,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -642,7 +643,7 @@ public class ForkedChannelEncoderTest
when( stackTraceWriter.writeTraceToString() ).thenReturn( stackTrace );
ReportEntry reportEntry = mock( ReportEntry.class );
- when( reportEntry.getElapsed() ).thenReturn( 102 );
+ when( reportEntry.getElapsed() ).thenReturn( ELAPSED_TIME );
when( reportEntry.getGroup() ).thenReturn( "this group" );
when( reportEntry.getMessage() ).thenReturn( "skipped test" );
when( reportEntry.getName() ).thenReturn( "my test" );
@@ -674,7 +675,7 @@ public class ForkedChannelEncoderTest
+ ":"
+ encodedMessage
+ ":"
- + 102
+ + ELAPSED_TIME
+ ":"
+ encodedExceptionMsg
@@ -771,7 +772,7 @@ public class ForkedChannelEncoderTest
forkedChannelEncoder.stopOnNextTest();
LineNumberReader printedLines = out.newReader( UTF_8 );
assertThat( printedLines.readLine() )
- .isEqualTo( ":maven:surefire:std:out:stop-on-next-test");
+ .isEqualTo( ":maven:surefire:std:out:stop-on-next-test" );
assertThat( printedLines.readLine() ).isNull();
}
@@ -1000,6 +1001,7 @@ public class ForkedChannelEncoderTest
}
@Test
+ @SuppressWarnings( "checkstyle:innerassignment" )
public void shouldCountSameNumberOfSystemProperties() throws IOException
{
Stream out = Stream.newStream();
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkingRunListenerTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkingRunListenerTest.java
index b56b98b..549f3aa 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkingRunListenerTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/ForkingRunListenerTest.java
@@ -1,22 +1,23 @@
package org.apache.maven.surefire.booter;
+
/*
-* 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.
-*/
+ * 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.
+ */
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
@@ -34,8 +35,7 @@ public class ForkingRunListenerTest
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
PrintStream target = new PrintStream( byteArrayOutputStream );
ForkingRunListener forkingRunListener = new ForkingRunListener( new ForkedChannelEncoder( target ), true );
- forkingRunListener.info( new String( new byte[]{ 65 } ) );
+ forkingRunListener.info( new String( new byte[]{ (byte) 'A' } ) );
forkingRunListener.info( new String( new byte[]{ } ) );
-
}
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/MasterProcessCommandTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/MasterProcessCommandTest.java
index 19740fd..cfd4d5f 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/MasterProcessCommandTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/MasterProcessCommandTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.booter;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -26,9 +27,14 @@ import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
-import static org.apache.maven.surefire.booter.MasterProcessCommand.*;
+import static org.apache.maven.surefire.booter.MasterProcessCommand.decode;
+import static org.apache.maven.surefire.booter.MasterProcessCommand.resolve;
+import static org.apache.maven.surefire.booter.MasterProcessCommand.setCommandAndDataLength;
+import static org.apache.maven.surefire.booter.MasterProcessCommand.BYE_ACK;
+import static org.apache.maven.surefire.booter.MasterProcessCommand.NOOP;
+import static org.apache.maven.surefire.booter.MasterProcessCommand.RUN_CLASS;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.is;
/**
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
@@ -90,13 +96,9 @@ public class MasterProcessCommandTest
assertThat( decoded, is( dummyData ) );
break;
case TEST_SET_FINISHED:
- assertEquals( Void.class, command.getDataType() );
- encoded = command.fromDataType( dummyData );
- assertThat( encoded.length, is( 0 ) );
- decoded = command.toDataTypeAsString( encoded );
- assertNull( decoded );
- break;
case SKIP_SINCE_NEXT_TEST:
+ case NOOP:
+ case BYE_ACK:
assertEquals( Void.class, command.getDataType() );
encoded = command.fromDataType( dummyData );
assertThat( encoded.length, is( 0 ) );
@@ -110,20 +112,6 @@ public class MasterProcessCommandTest
decoded = command.toDataTypeAsString( encoded );
assertThat( decoded, is( Shutdown.EXIT.name() ) );
break;
- case NOOP:
- assertEquals( Void.class, command.getDataType() );
- encoded = command.fromDataType( dummyData );
- assertThat( encoded.length, is( 0 ) );
- decoded = command.toDataTypeAsString( encoded );
- assertNull( decoded );
- break;
- case BYE_ACK:
- assertEquals( Void.class, command.getDataType() );
- encoded = command.fromDataType( dummyData );
- assertThat( encoded.length, is( 0 ) );
- decoded = command.toDataTypeAsString( encoded );
- assertNull( decoded );
- break;
default:
fail();
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
index f137598..780f2f0 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/NewClassLoaderRunner.java
@@ -189,7 +189,7 @@ public class NewClassLoaderRunner
}
}
- public static class TestClassLoader
+ private static class TestClassLoader
extends URLClassLoader
{
TestClassLoader()
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
index cbd2d16..0a006bf 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
@@ -1,22 +1,23 @@
package org.apache.maven.surefire.booter;
+
/*
-* 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.
-*/
+ * 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.
+ */
import junit.framework.TestCase;
import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
@@ -44,6 +45,9 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+/**
+ *
+ */
public class SurefireReflectorTest
extends TestCase
{
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java
index d81e816..60bbc09 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/report/LegacyPojoStackTraceWriterTest.java
@@ -26,112 +26,106 @@ import junit.framework.TestCase;
/**
* @author Kristian Rosenvold
*/
-public class LegacyPojoStackTraceWriterTest
- extends TestCase
+public class LegacyPojoStackTraceWriterTest extends TestCase
{
+ @SuppressWarnings( "checkstyle:linelength" )
public void testWriteTrimmedTraceToString()
{
- String stackTrace = "junit.framework.AssertionFailedError: blah\n" +
- " at junit.framework.Assert.fail(Assert.java:47)\n" +
- " at TestSurefire3.testQuote(TestSurefire3.java:23)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
- " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
- " at java.lang.reflect.Method.invoke(Method.java:585)\n" +
- " at junit.framework.TestCase.runTest(TestCase.java:154)\n" +
- " at junit.framework.TestCase.runBare(TestCase.java:127)\n" +
- " at junit.framework.TestResult$1.protect(TestResult.java:106)\n" +
- " at junit.framework.TestResult.runProtected(TestResult.java:124)\n" +
- " at junit.framework.TestResult.run(TestResult.java:109)\n" +
- " at junit.framework.TestCase.run(TestCase.java:118)\n" +
- " at junit.framework.TestSuite.runTest(TestSuite.java:208)\n" +
- " at junit.framework.TestSuite.run(TestSuite.java:203)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
- " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
- " at java.lang.reflect.Method.invoke(Method.java:585)\n" +
- " at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)\n" +
- " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)\n"
- +
- " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)\n"
- +
- " at org.apache.maven.surefire.Surefire.run(Surefire.java:132)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
- " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
- " at java.lang.reflect.Method.invoke(Method.java:585)\n" +
- " at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:318)\n" +
- " at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:956)\n";
+ String stackTrace = "junit.framework.AssertionFailedError: blah\n"
+ + " at junit.framework.Assert.fail(Assert.java:47)\n"
+ + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n"
+ + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n"
+ + " at java.lang.reflect.Method.invoke(Method.java:585)\n"
+ + " at junit.framework.TestCase.runTest(TestCase.java:154)\n"
+ + " at junit.framework.TestCase.runBare(TestCase.java:127)\n"
+ + " at junit.framework.TestResult$1.protect(TestResult.java:106)\n"
+ + " at junit.framework.TestResult.runProtected(TestResult.java:124)\n"
+ + " at junit.framework.TestResult.run(TestResult.java:109)\n"
+ + " at junit.framework.TestCase.run(TestCase.java:118)\n"
+ + " at junit.framework.TestSuite.runTest(TestSuite.java:208)\n"
+ + " at junit.framework.TestSuite.run(TestSuite.java:203)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n"
+ + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n"
+ + " at java.lang.reflect.Method.invoke(Method.java:585)\n"
+ + " at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)\n"
+ + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)\n"
+ + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)\n"
+ + " at org.apache.maven.surefire.Surefire.run(Surefire.java:132)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n"
+ + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n"
+ + " at java.lang.reflect.Method.invoke(Method.java:585)\n"
+ + " at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:318)\n"
+ + " at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:956)\n";
MockThrowable t = new MockThrowable( stackTrace );
LegacyPojoStackTraceWriter w = new LegacyPojoStackTraceWriter( "TestSurefire3", "testQuote", t );
String out = w.writeTrimmedTraceToString();
- String expected = "junit.framework.AssertionFailedError: blah\n" +
- " at junit.framework.Assert.fail(Assert.java:47)\n" +
- " at TestSurefire3.testQuote(TestSurefire3.java:23)\n";
+ String expected = "junit.framework.AssertionFailedError: blah\n" + " at junit.framework.Assert.fail(Assert.java:47)\n" + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n";
assertEquals( expected, out );
}
+ @SuppressWarnings( "checkstyle:linelength" )
public void testCausedBy()
{
- String stackTrace = "java.lang.RuntimeException: blah\n" +
- " at TestSurefire3.testBlah(TestSurefire3.java:45)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
- " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
- " at java.lang.reflect.Method.invoke(Method.java:585)\n" +
- " at junit.framework.TestCase.runTest(TestCase.java:154)\n" +
- " at junit.framework.TestCase.runBare(TestCase.java:127)\n" +
- " at junit.framework.TestResult$1.protect(TestResult.java:106)\n" +
- " at junit.framework.TestResult.runProtected(TestResult.java:124)\n" +
- " at junit.framework.TestResult.run(TestResult.java:109)\n" +
- " at junit.framework.TestCase.run(TestCase.java:118)\n" +
- " at junit.framework.TestSuite.runTest(TestSuite.java:208)\n" +
- " at junit.framework.TestSuite.run(TestSuite.java:203)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
- " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
- " at java.lang.reflect.Method.invoke(Method.java:585)\n" +
- " at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)\n" +
- " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)\n"
- +
- " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)\n"
- +
- " at org.apache.maven.surefire.Surefire.run(Surefire.java:132)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" +
- " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n" +
- " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n" +
- " at java.lang.reflect.Method.invoke(Method.java:585)\n" +
- " at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:318)\n" +
- " at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:956)\n" +
- "Caused by: junit.framework.AssertionFailedError: \"\n" +
- " at junit.framework.Assert.fail(Assert.java:47)\n" +
- " at TestSurefire3.testQuote(TestSurefire3.java:23)\n" +
- " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" +
- " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" +
- " ... 26 more\n";
+ String stackTrace = "java.lang.RuntimeException: blah\n"
+ + " at TestSurefire3.testBlah(TestSurefire3.java:45)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n"
+ + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n"
+ + " at java.lang.reflect.Method.invoke(Method.java:585)\n"
+ + " at junit.framework.TestCase.runTest(TestCase.java:154)\n"
+ + " at junit.framework.TestCase.runBare(TestCase.java:127)\n"
+ + " at junit.framework.TestResult$1.protect(TestResult.java:106)\n"
+ + " at junit.framework.TestResult.runProtected(TestResult.java:124)\n"
+ + " at junit.framework.TestResult.run(TestResult.java:109)\n"
+ + " at junit.framework.TestCase.run(TestCase.java:118)\n"
+ + " at junit.framework.TestSuite.runTest(TestSuite.java:208)\n"
+ + " at junit.framework.TestSuite.run(TestSuite.java:203)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n"
+ + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n"
+ + " at java.lang.reflect.Method.invoke(Method.java:585)\n"
+ + " at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)\n"
+ + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)\n"
+ + " at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)\n"
+ + " at org.apache.maven.surefire.Surefire.run(Surefire.java:132)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n"
+ + " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n"
+ + " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n"
+ + " at java.lang.reflect.Method.invoke(Method.java:585)\n"
+ + " at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:318)\n"
+ + " at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:956)\n"
+ + "Caused by: junit.framework.AssertionFailedError: \"\n"
+ + " at junit.framework.Assert.fail(Assert.java:47)\n"
+ + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n"
+ + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n"
+ + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n"
+ + " ... 26 more\n";
MockThrowable t = new MockThrowable( stackTrace );
LegacyPojoStackTraceWriter w = new LegacyPojoStackTraceWriter( "TestSurefire3", "testBlah", t );
String out = w.writeTrimmedTraceToString();
- String expected = "java.lang.RuntimeException: blah\n" +
- " at TestSurefire3.testBlah(TestSurefire3.java:45)\n" +
- "Caused by: junit.framework.AssertionFailedError: \"\n" +
- " at junit.framework.Assert.fail(Assert.java:47)\n" +
- " at TestSurefire3.testQuote(TestSurefire3.java:23)\n" +
- " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" +
- " at TestSurefire3.testBlah(TestSurefire3.java:43)\n" +
- " ... 26 more\n";
+ String expected = "java.lang.RuntimeException: blah\n"
+ + " at TestSurefire3.testBlah(TestSurefire3.java:45)\n"
+ + "Caused by: junit.framework.AssertionFailedError: \"\n"
+ + " at junit.framework.Assert.fail(Assert.java:47)\n"
+ + " at TestSurefire3.testQuote(TestSurefire3.java:23)\n"
+ + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n"
+ + " at TestSurefire3.testBlah(TestSurefire3.java:43)\n"
+ + " ... 26 more\n";
assertEquals( expected, out );
}
- class MockThrowable
- extends Throwable
+ static class MockThrowable extends Throwable
{
private static final long serialVersionUID = 1L;
private final String stackTrace;
- public MockThrowable( String stackTrace )
+ MockThrowable( String stackTrace )
{
this.stackTrace = stackTrace;
}
@@ -145,8 +139,7 @@ public class LegacyPojoStackTraceWriterTest
public void testMultiLineMessage()
{
- String msg =
- "assert \"foo\" == \"bar\"\n"
+ String msg = "assert \"foo\" == \"bar\"\n"
+ " |\n"
+ " false";
try
@@ -160,5 +153,4 @@ public class LegacyPojoStackTraceWriterTest
assertTrue( stackTrace.startsWith( "java.lang.RuntimeException: \n" + msg ) );
}
}
-
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/suite/RunResultTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/suite/RunResultTest.java
index e888ca2..67fc171 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/suite/RunResultTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/suite/RunResultTest.java
@@ -34,6 +34,7 @@ public class RunResultTest
assertTrue( summary.isErrorFree() );
}
+ @SuppressWarnings( "checkstyle:magicnumber" )
public void testFailuresInFirstRun()
{
RunResult resultOne = new RunResult( 10, 1, 3, 2 );
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/testset/FundamentalFilterTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/testset/FundamentalFilterTest.java
index b99d4f9..63fb571 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/testset/FundamentalFilterTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/testset/FundamentalFilterTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.testset;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,7 +22,7 @@ package org.apache.maven.surefire.testset;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.is;
@SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } )
/**
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java
index f636c72..2a0d0d0 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/testset/ResolvedTestTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.testset;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,6 +25,9 @@ import static org.apache.maven.surefire.testset.ResolvedTest.Type.CLASS;
import static org.apache.maven.surefire.testset.ResolvedTest.Type.METHOD;
import static org.apache.maven.surefire.testset.ResolvedTest.fromFullyQualifiedClass;
+/**
+ *
+ */
public class ResolvedTestTest
extends TestCase
{
@@ -53,19 +57,19 @@ public class ResolvedTestTest
public void testFromFullyQualifiedClass()
{
- String classFileName = fromFullyQualifiedClass("my.package.MyTest");
+ String classFileName = fromFullyQualifiedClass( "my.package.MyTest" );
assertEquals( "my/package/MyTest", classFileName );
- classFileName = fromFullyQualifiedClass("my.package.MyTest.class");
+ classFileName = fromFullyQualifiedClass( "my.package.MyTest.class" );
assertEquals( "my/package/MyTest.class", classFileName );
- classFileName = fromFullyQualifiedClass("my/package/MyTest.class");
+ classFileName = fromFullyQualifiedClass( "my/package/MyTest.class" );
assertEquals( "my/package/MyTest.class", classFileName );
- classFileName = fromFullyQualifiedClass("my/package/MyTest.*");
+ classFileName = fromFullyQualifiedClass( "my/package/MyTest.*" );
assertEquals( "my/package/MyTest.*", classFileName );
- classFileName = fromFullyQualifiedClass("my.package.MyTest.*");
+ classFileName = fromFullyQualifiedClass( "my.package.MyTest.*" );
assertEquals( "my/package/MyTest.*", classFileName );
}
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java
index d7a53b6..00ce3d1 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/testset/TestListResolverTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.testset;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -35,8 +36,11 @@ import static java.util.Arrays.asList;
import static java.util.Collections.emptySet;
import static java.util.Collections.singleton;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.is;
+/**
+ *
+ */
public class TestListResolverTest
extends TestCase
{
@@ -235,7 +239,8 @@ public class TestListResolverTest
public void testShouldRunTestWithoutMethod()
{
- new TestListResolver("**/*Test.class, !%regex[.*.MyTest.class#myTest]").shouldRun( "pkg/MyTest.class", null );
+ new TestListResolver( "**/*Test.class, !%regex[.*.MyTest.class#myTest]" )
+ .shouldRun( "pkg/MyTest.class", null );
}
public void testShouldNotRunExcludedMethods()
@@ -328,7 +333,7 @@ public class TestListResolverTest
ResolvedTest inc2 = new ResolvedTest( "**/?Test", null, false );
ResolvedTest exc1 = new ResolvedTest( "AATest", null, false );
ResolvedTest exc2 = new ResolvedTest( "**/BTest.java", null, false );
- TestListResolver resolver = newTestListResolver( $( inc1, inc2 ), $( exc1, exc2 ) );
+ TestListResolver resolver = newTestListResolver( toSet( inc1, inc2 ), toSet( exc1, exc2 ) );
assertThat( resolver.getPluginParameterTest(), is( "A?Test.java, **/?Test, !AATest, !**/BTest.java" ) );
assertFalse( resolver.isEmpty() );
assertFalse( resolver.hasIncludedMethodPatterns() );
@@ -348,7 +353,7 @@ public class TestListResolverTest
ResolvedTest inc2 = new ResolvedTest( "*?Test", null, false );
ResolvedTest exc1 = new ResolvedTest( "AATest", null, false );
ResolvedTest exc2 = new ResolvedTest( "*BTest.java", "failedTest", false );
- TestListResolver resolver = newTestListResolver( $( inc1, inc2 ), $( exc1, exc2 ) );
+ TestListResolver resolver = newTestListResolver( toSet( inc1, inc2 ), toSet( exc1, exc2 ) );
assertThat( resolver.getPluginParameterTest(), is( "A?Test.java, *?Test, !AATest, !*BTest.java#failedTest" ) );
assertFalse( resolver.isEmpty() );
assertFalse( resolver.hasIncludedMethodPatterns() );
@@ -363,7 +368,7 @@ public class TestListResolverTest
assertFalse( TestListResolver.optionallyWildcardFilter( resolver ).isEmpty() );
}
- private static Set<ResolvedTest> $( ResolvedTest... patterns )
+ private static Set<ResolvedTest> toSet( ResolvedTest... patterns )
{
Set<ResolvedTest> set = new LinkedHashSet<>();
addAll( set, patterns );
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/ReflectionUtilsTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/ReflectionUtilsTest.java
index 34eafe3..9941626 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/ReflectionUtilsTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/ReflectionUtilsTest.java
@@ -39,7 +39,7 @@ public class ReflectionUtilsTest
.isEqualTo( B.class );
}
- @Test(expected = RuntimeException.class)
+ @Test( expected = RuntimeException.class )
public void shouldNotInvokeStaticMethod()
{
ReflectionUtils.invokeStaticMethod( ReflectionUtilsTest.class, "notCallable",
@@ -96,7 +96,7 @@ public class ReflectionUtilsTest
return 3L;
}
- public static class A
+ static class A
{
public static A current()
{
@@ -114,7 +114,7 @@ public class ReflectionUtilsTest
}
}
- public static class B
+ static class B
{
public long pid()
{
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderCalculatorTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderCalculatorTest.java
index 12a513c..2308d0c 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderCalculatorTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderCalculatorTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.util;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -33,14 +34,12 @@ public class RunOrderCalculatorTest
{
public void testOrderTestClasses()
- throws Exception
{
getClassesToRun();
TestsToRun testsToRun = new TestsToRun( getClassesToRun() );
RunOrderCalculator runOrderCalculator = new DefaultRunOrderCalculator( RunOrderParameters.alphabetical(), 1 );
final TestsToRun testsToRun1 = runOrderCalculator.orderTestClasses( testsToRun );
assertEquals( A.class, testsToRun1.iterator().next() );
-
}
private Set<Class<?>> getClassesToRun()
@@ -51,15 +50,13 @@ public class RunOrderCalculatorTest
return classesToRun;
}
- class A
+ static class A
{
}
- class B
+ static class B
{
}
-
-
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderTest.java
index 13e5a43..cf60eba 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/RunOrderTest.java
@@ -21,6 +21,9 @@ package org.apache.maven.surefire.util;
import junit.framework.TestCase;
+/**
+ *
+ */
public class RunOrderTest
extends TestCase
{
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/TestsToRunTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/TestsToRunTest.java
index 0c52c74..1acd420 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/TestsToRunTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/TestsToRunTest.java
@@ -25,10 +25,9 @@ import java.util.Set;
import junit.framework.TestCase;
-/*
+/**
* @author Kristian Rosenvold
*/
-
public class TestsToRunTest
extends TestCase
{
@@ -109,12 +108,12 @@ public class TestsToRunTest
assertFalse( it1.hasNext() );
}
- class T1
+ static class T1
{
}
- class T2
+ static class T2
{
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java
index 7e76fbf..30c4a04 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/internal/ConcurrencyUtilsTest.java
@@ -42,7 +42,7 @@ public class ConcurrencyUtilsTest
{
@Test
- public void countDownShouldBeUnchangedAsZero$NegativeTest()
+ public void countDownShouldBeUnchangedAsZeroNegativeTest()
{
AtomicInteger atomicCounter = new AtomicInteger( 0 );
assertFalse( countDownToZero( atomicCounter ) );
@@ -50,7 +50,7 @@ public class ConcurrencyUtilsTest
}
@Test
- public void countDownShouldBeUnchangedAsNegative$NegativeTest()
+ public void countDownShouldBeUnchangedAsNegativeNegativeTest()
{
AtomicInteger atomicCounter = new AtomicInteger( -1 );
assertFalse( countDownToZero( atomicCounter ) );
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT1A.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT1A.java
index 1d69e2d..2c3a725 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT1A.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT1A.java
@@ -1,3 +1,5 @@
+package org.apache.maven.surefire.util.testdata;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,9 @@
* under the License.
*/
-package org.apache.maven.surefire.util.testdata;
-
+/**
+ *
+ */
public class DataZT1A
{
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT2A.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT2A.java
index 682747e..e016215 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT2A.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT2A.java
@@ -1,3 +1,5 @@
+package org.apache.maven.surefire.util.testdata;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,9 +19,9 @@
* under the License.
*/
-package org.apache.maven.surefire.util.testdata;
-
-
+/**
+ *
+ */
public class DataZT2A
{
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT3A.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT3A.java
index 782286f..5abbf9f 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT3A.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/DataZT3A.java
@@ -1,3 +1,5 @@
+package org.apache.maven.surefire.util.testdata;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,9 +19,9 @@
* under the License.
*/
-package org.apache.maven.surefire.util.testdata;
-
-
+/**
+ *
+ */
public class DataZT3A
{
}
diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/java/javascript/DataJavaZT4A.java b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/java/javascript/DataJavaZT4A.java
index 8b869de..b497ace 100644
--- a/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/java/javascript/DataJavaZT4A.java
+++ b/surefire-api/src/test/java/org/apache/maven/surefire/util/testdata/java/javascript/DataJavaZT4A.java
@@ -1,3 +1,5 @@
+package org.apache.maven.surefire.util.testdata.java.javascript;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.surefire.util.testdata.java.javascript;
-
/**
* Test data class for SUREFIRE-638
* User: sslavic
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
index cb0679e..874010f 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
@@ -47,7 +47,9 @@ public class ClasspathTest
public void testShouldWriteSeparatedElementsAsSystemProperty()
{
- Classpath classpath = Classpath.emptyClasspath().addClassPathElementUrl( DUMMY_URL_1 ).addClassPathElementUrl( DUMMY_URL_2 );
+ Classpath classpath = Classpath.emptyClasspath()
+ .addClassPathElementUrl( DUMMY_URL_1 )
+ .addClassPathElementUrl( DUMMY_URL_2 );
classpath.writeToSystemProperty( DUMMY_PROPERTY_NAME );
assertEquals( DUMMY_URL_1 + File.pathSeparatorChar + DUMMY_URL_2 + File.pathSeparatorChar,
System.getProperty( DUMMY_PROPERTY_NAME ) );
@@ -55,8 +57,9 @@ public class ClasspathTest
public void testShouldAddNoDuplicateElements()
{
- Classpath classpath =
- emptyClasspath().addClassPathElementUrl( DUMMY_URL_1 ).addClassPathElementUrl( DUMMY_URL_1 );
+ Classpath classpath = emptyClasspath()
+ .addClassPathElementUrl( DUMMY_URL_1 )
+ .addClassPathElementUrl( DUMMY_URL_1 );
assertClasspathConsistsOfElements( classpath, new String[]{ DUMMY_URL_1 } );
}
@@ -69,7 +72,8 @@ public class ClasspathTest
public void testShouldHaveAllElementsAfterJoiningTwoDifferentClasspaths()
{
Classpath firstClasspath = Classpath.emptyClasspath();
- Classpath secondClasspath = firstClasspath.addClassPathElementUrl( DUMMY_URL_1 ).addClassPathElementUrl( DUMMY_URL_2 );
+ Classpath secondClasspath = firstClasspath.addClassPathElementUrl( DUMMY_URL_1 )
+ .addClassPathElementUrl( DUMMY_URL_2 );
Classpath joinedClasspath = Classpath.join( firstClasspath, secondClasspath );
assertClasspathConsistsOfElements( joinedClasspath, new String[]{ DUMMY_URL_1, DUMMY_URL_2 } );
}
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java
index 42feda6..9e53f05 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java
@@ -39,6 +39,7 @@ import static org.powermock.reflect.Whitebox.invokeMethod;
/**
* Tests for {@link ForkedBooter}.
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class ForkedBooterTest
{
@Test
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
index cbe1ce3..915f2bc 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
@@ -48,6 +48,7 @@ import static org.powermock.reflect.Whitebox.setInternalState;
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20.1
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class PpidCheckerTest
{
@Rule
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PropertiesWrapperTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PropertiesWrapperTest.java
index 9cbad17..06b08aa 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PropertiesWrapperTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PropertiesWrapperTest.java
@@ -19,7 +19,10 @@ package org.apache.maven.surefire.booter;
* under the License.
*/
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import junit.framework.TestCase;
@@ -30,7 +33,6 @@ public class PropertiesWrapperTest
extends TestCase
{
public void testAddList()
- throws Exception
{
PropertiesWrapper propertiesWrapper = new PropertiesWrapper( new HashMap<String, String>() );
List<String> items = new ArrayList<>();
@@ -45,7 +47,6 @@ public class PropertiesWrapperTest
assertEquals( "String5", test.get( 4 ) );
assertEquals( "String3", test.get( 2 ) );
assertEquals( "String2", test.get( 1 ) );
-
}
private static final String DUMMY_PREFIX = "dummyPrefix";
@@ -61,7 +62,6 @@ public class PropertiesWrapperTest
private final Classpath classpathWithTwoElements = createClasspathWithTwoElements();
public void testReadFromProperties()
- throws Exception
{
properties.put( DUMMY_PREFIX + "0", FIRST_ELEMENT );
properties.put( DUMMY_PREFIX + "1", SECOND_ELEMENT );
@@ -70,14 +70,12 @@ public class PropertiesWrapperTest
}
public void testReadFromPropertiesWithEmptyProperties()
- throws Exception
{
Classpath recreatedClasspath = readClasspathFromProperties();
assertTrue( recreatedClasspath.getClassPath().isEmpty() );
}
public void testWriteToProperties()
- throws Exception
{
mapper.setClasspath( DUMMY_PREFIX, classpathWithTwoElements );
assertEquals( FIRST_ELEMENT, mapper.getProperty( DUMMY_PREFIX + "0" ) );
@@ -85,7 +83,6 @@ public class PropertiesWrapperTest
}
public void testRoundtrip()
- throws Exception
{
mapper.setClasspath( DUMMY_PREFIX, classpathWithTwoElements );
Classpath recreatedClasspath = readClasspathFromProperties();
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
index 438cb00..34faff0 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java
@@ -54,9 +54,13 @@ import static org.powermock.reflect.Whitebox.invokeMethod;
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.20.1
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
@RunWith( Enclosed.class )
public class SystemUtilsTest
{
+ /**
+ *
+ */
public static class PlainUnitTests
{
@@ -295,6 +299,9 @@ public class SystemUtilsTest
}
+ /**
+ *
+ */
@RunWith( PowerMockRunner.class )
@PrepareForTest( SystemUtils.class )
@PowerMockIgnore( { "org.jacoco.agent.rt.*", "com.vladium.emma.rt.*" } )
diff --git a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/AndGroupMatcherTest.java b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/AndGroupMatcherTest.java
index f81cfd3..d9c8baf 100644
--- a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/AndGroupMatcherTest.java
+++ b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/AndGroupMatcherTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.group.match;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,6 +21,9 @@ package org.apache.maven.surefire.group.match;
import junit.framework.TestCase;
+/**
+ *
+ */
public class AndGroupMatcherTest
extends TestCase
{
diff --git a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/InverseGroupMatcherTest.java b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/InverseGroupMatcherTest.java
index 6be29c2..23ecc35 100644
--- a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/InverseGroupMatcherTest.java
+++ b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/InverseGroupMatcherTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.group.match;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,6 +21,9 @@ package org.apache.maven.surefire.group.match;
import junit.framework.TestCase;
+/**
+ *
+ */
public class InverseGroupMatcherTest
extends TestCase
{
diff --git a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/OrGroupMatcherTest.java b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/OrGroupMatcherTest.java
index 3c41609..48feb36 100644
--- a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/OrGroupMatcherTest.java
+++ b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/OrGroupMatcherTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.group.match;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,6 +21,9 @@ package org.apache.maven.surefire.group.match;
import junit.framework.TestCase;
+/**
+ *
+ */
public class OrGroupMatcherTest
extends TestCase
{
diff --git a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/SingleGroupMatcherTest.java b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/SingleGroupMatcherTest.java
index 31d959f..b75011f 100644
--- a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/SingleGroupMatcherTest.java
+++ b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/match/SingleGroupMatcherTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.group.match;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,6 +21,9 @@ package org.apache.maven.surefire.group.match;
import junit.framework.TestCase;
+/**
+ *
+ */
public class SingleGroupMatcherTest
extends TestCase
{
diff --git a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/parse/GroupMatcherParserTest.java b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/parse/GroupMatcherParserTest.java
index e92595a..070caa7 100644
--- a/surefire-grouper/src/test/java/org/apache/maven/surefire/group/parse/GroupMatcherParserTest.java
+++ b/surefire-grouper/src/test/java/org/apache/maven/surefire/group/parse/GroupMatcherParserTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.group.parse;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -26,6 +27,9 @@ import org.apache.maven.surefire.group.match.SingleGroupMatcher;
import junit.framework.TestCase;
+/**
+ *
+ */
public class GroupMatcherParserTest
extends TestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java
index 7ccf612..507a08a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/AbstractFailFastIT.java
@@ -42,24 +42,31 @@ public abstract class AbstractFailFastIT
extends SurefireJUnit4IntegrationTestCase
{
@Parameter( 0 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String description;
@Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String profile;
@Parameter( 2 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public Map<String, String> properties;
@Parameter( 3 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public int total;
@Parameter( 4 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public int failures;
@Parameter( 5 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public int errors;
@Parameter( 6 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public int skipped;
protected abstract String withProvider();
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 01932fa..6c458f5 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
@@ -24,8 +24,13 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
-import static org.apache.maven.surefire.its.fixture.TestFramework.*;
-import static org.apache.maven.surefire.its.fixture.Configuration.*;
+import static org.apache.maven.surefire.its.fixture.TestFramework.JUNIT47;
+import static org.apache.maven.surefire.its.fixture.TestFramework.TestNG;
+import static org.apache.maven.surefire.its.fixture.Configuration.INCLUDES;
+import static org.apache.maven.surefire.its.fixture.Configuration.INCLUDES_EXCLUDES;
+import static org.apache.maven.surefire.its.fixture.Configuration.INCLUDES_EXCLUDES_FILE;
+import static org.apache.maven.surefire.its.fixture.Configuration.INCLUDES_FILE;
+import static org.apache.maven.surefire.its.fixture.Configuration.TEST;
import static org.hamcrest.core.AnyOf.anyOf;
import static org.hamcrest.core.Is.is;
import static org.junit.Assume.assumeThat;
@@ -48,7 +53,8 @@ public abstract class AbstractTestMultipleMethodPatterns
{
SurefireLauncher launcher = unpack().addGoal( "-P " + getSettings().profile() );
String[] includedExcluded = splitIncludesExcludes( tests );
- switch ( getSettings().getConfiguration() ) {
+ switch ( getSettings().getConfiguration() )
+ {
case TEST:
launcher.setTestToRun( tests );
break;
@@ -361,11 +367,11 @@ public abstract class AbstractTestMultipleMethodPatterns
throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
- String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo"//2
- + ',' + "jiras/**/TestTwo"//2
- + ',' + "jiras/surefire745/TestThree#testSuccess*"//2
- + ',' + "TestFour#testSuccess???"//2
- + ',' + "jiras/surefire745/*Five#test*One";//1
+ String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo" //2
+ + ',' + "jiras/**/TestTwo" //2
+ + ',' + "jiras/surefire745/TestThree#testSuccess*" //2
+ + ',' + "TestFour#testSuccess???" //2
+ + ',' + "jiras/surefire745/*Five#test*One"; //1
prepare( test )
.executeTest()
@@ -379,11 +385,11 @@ public abstract class AbstractTestMultipleMethodPatterns
{
assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
assumeThat( getSettings().getConfiguration(), is( TEST ) );
- String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo"//2
- + ',' + "jiras/**/TestTwo"//2
- + ',' + "jiras/surefire745/TestThree#testSuccess*"//2
- + ',' + "TestFour#testSuccess???"//2
- + ',' + "jiras/surefire745/*Five#test*One";//1
+ String test = "jiras/surefire745/BasicTest#testSuccessOne+testSuccessTwo" //2
+ + ',' + "jiras/**/TestTwo" //2
+ + ',' + "jiras/surefire745/TestThree#testSuccess*" //2
+ + ',' + "TestFour#testSuccess???" //2
+ + ',' + "jiras/surefire745/*Five#test*One"; //1
prepare( test )
.parallel( "classes" )
@@ -398,11 +404,11 @@ public abstract class AbstractTestMultipleMethodPatterns
throws Exception
{
assumeThat( getSettings().getConfiguration(), is( TEST ) );
- String test = "**/BasicTest#testSuccessOne+testSuccessTwo"//2
- + ',' + "jiras/**/TestTwo"//2
- + ',' + "?????/surefire745/TestThree#testSuccess*"//2
- + ',' + "jiras/surefire745/TestFour.java#testSuccess???"//2
- + ',' + "jiras/surefire745/*Five#test*One";//1
+ String test = "**/BasicTest#testSuccessOne+testSuccessTwo" //2
+ + ',' + "jiras/**/TestTwo" //2
+ + ',' + "?????/surefire745/TestThree#testSuccess*" //2
+ + ',' + "jiras/surefire745/TestFour.java#testSuccess???" //2
+ + ',' + "jiras/surefire745/*Five#test*One"; //1
prepare( test )
.executeTest()
@@ -416,11 +422,11 @@ public abstract class AbstractTestMultipleMethodPatterns
{
assumeThat( getSettings().getFramework(), anyOf( is( JUNIT47 ), is( TestNG ) ) );
assumeThat( getSettings().getConfiguration(), is( TEST ) );
- String test = "**/BasicTest#testSuccessOne+testSuccessTwo"//2
- + ',' + "jiras/**/TestTwo"//2
- + ',' + "?????/surefire745/TestThree#testSuccess*"//2
- + ',' + "jiras/surefire745/TestFour.java#testSuccess???"//2
- + ',' + "jiras/surefire745/*Five#test*One";//1
+ String test = "**/BasicTest#testSuccessOne+testSuccessTwo" //2
+ + ',' + "jiras/**/TestTwo" //2
+ + ',' + "?????/surefire745/TestThree#testSuccess*" //2
+ + ',' + "jiras/surefire745/TestFour.java#testSuccess???" //2
+ + ',' + "jiras/surefire745/*Five#test*One"; //1
prepare( test )
.parallel( "classes" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java
index 856cd8c..f9da42c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/AssumptionFailureReportIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,11 +18,15 @@ package org.apache.maven.surefire.its;
* specific language governing permissions and limitations
* under the License.
*/
+
import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
+/**
+ *
+ */
public class AssumptionFailureReportIT extends SurefireJUnit4IntegrationTestCase
{
@Test
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
index 85d0f95..95bbc35 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckSingleTestIT.java
@@ -19,7 +19,10 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
index 787037c..02fad0c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestFailIfNoTestsIT.java
@@ -19,7 +19,10 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java
index 440955c..22d72a0 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodFailureIT.java
@@ -33,8 +33,7 @@ public class CheckTestNgBeforeMethodFailureIT
{
@Test
- public void TestNgBeforeMethodFailure()
- throws Exception
+ public void testNgBeforeMethodFailure()
{
unpack( "/testng-beforeMethodFailure" )
.maven()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java
index d96fefc..02fab32 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgBeforeMethodIT.java
@@ -32,8 +32,7 @@ public class CheckTestNgBeforeMethodIT
extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void TestNgBeforeMethod()
- throws Exception
+ public void testNgBeforeMethod()
{
unpack( "/testng-beforeMethod" )
.sysProp( "testNgVersion", "5.7" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java
index 2e2b646..1cb7f75 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
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 4cf5afa..f21014e 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
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java
index ff0d9da..8582753 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java
@@ -30,7 +30,8 @@ import static org.fest.assertions.Assertions.assertThat;
/**
- * Test for checking that the output from a forked suite is properly captured even if the suite encounters a severe error.
+ * Test for checking that the output from a forked suite is properly captured even if the suite encounters
+ * a severe error.
*
* @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
* @author <a href="mailto:krosenvold@apache.org">Kristian Rosenvold</a>
@@ -58,7 +59,7 @@ public class CheckTestNgExecuteErrorIT
{
return name.endsWith( "-jvmRun1.dump" );
}
- });
+ } );
assertThat( dumpFiles )
.isNotNull()
.isNotEmpty();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgGroupThreadParallelIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgGroupThreadParallelIT.java
index f56e2e4..5b200a6 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgGroupThreadParallelIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgGroupThreadParallelIT.java
@@ -32,7 +32,7 @@ public class CheckTestNgGroupThreadParallelIT
extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void TestNgGroupThreadParallel()
+ public void testNgGroupThreadParallel()
{
unpack( "testng-group-thread-parallel" )
.sysProp( "testNgVersion", "5.7" )
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 9cabd7e..fe060ec 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
@@ -32,7 +32,7 @@ public class CheckTestNgJdk14IT
{
@Test
- public void TestNgJdk14()
+ public void testNgJdk14()
throws Exception
{
unpack( "/testng-jdk14" ).executeTest().verifyErrorFree( 1 );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java
index 1764aee..af945b0 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenerReporterIT.java
@@ -39,13 +39,15 @@ import static org.junit.runners.Parameterized.Parameters;
* @author <a href="mailto:krosenvold@apache.org">Kristian Rosenvold</a>
*/
@RunWith( ParallelParameterized.class )
+@SuppressWarnings( { "checkstyle:magicnumber", "checkstyle:linelength" } )
public class CheckTestNgListenerReporterIT
extends SurefireJUnit4IntegrationTestCase
{
@Parameters( name = "{index}: TestNG {0}" )
public static Collection<Object[]> data()
{
- return Arrays.asList(new Object[][] {
+ return Arrays.asList( new Object[][]
+ {
{ "5.6", "jdk15", 1.5d }, // First TestNG version with reporter support
{ "5.7", "jdk15", 1.5d }, // default version from pom of the test case
{ "5.10", "jdk15", 1.5d },
@@ -73,16 +75,19 @@ public class CheckTestNgListenerReporterIT
{ "6.0", null, 1.5d },
{ "6.14.3", null, 1.7d },
{ "7.0.0", null, 1.8d } // Currently latest TestNG version
- });
+ } );
}
@Parameter
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String version;
@Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String classifier;
@Parameter( 2 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public double javaVersion;
@Test
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenersIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenersIT.java
index cc1bb74..beb3eb6 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenersIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgListenersIT.java
@@ -29,7 +29,7 @@ public class CheckTestNgListenersIT
extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void TestNgListenerReporter()
+ public void testNgListenerReporter()
{
unpack( "testng-listeners" ).mavenTestFailureIgnore( true ).executeTest().assertTestSuiteResults( 1, 0, 1, 0 );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgPathWithSpacesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgPathWithSpacesIT.java
index aa77d1b..654cfc2 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgPathWithSpacesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgPathWithSpacesIT.java
@@ -31,7 +31,7 @@ public class CheckTestNgPathWithSpacesIT
extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void TestWithSpaces()
+ public void testWithSpaces()
{
unpack( "testng-path with spaces" )
.sysProp( "testNgVersion", "5.7" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
index e2b63b6..bec8422 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgSuiteXmlSingleIT.java
@@ -31,7 +31,7 @@ public class CheckTestNgSuiteXmlSingleIT
extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void TestNgSuite()
+ public void testNgSuite()
{
unpack( "/testng-twoTestCaseSuite" )
.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 6d2bbfa..64235ee 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
@@ -50,13 +50,17 @@ public class CheckTestNgVersionsIT
runTestNgTest( "4.7", "jdk15" );
}
- @Test @Ignore( "5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024" ) public void XXXtest50()
+ @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" );
}
- @Test @Ignore( "5.0 and 5.0.1 jars on central are malformed SUREFIRE-375 + MAVENUPLOAD-1024" ) public void XXXtest501()
+ @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" );
@@ -210,9 +214,14 @@ public class CheckTestNgVersionsIT
assertEquals( 3, report.size() );
- assertTrue( "TestNGSuiteTestC was executed first", getTestClass( report, 0 ).endsWith( "TestNGSuiteTestC" ) );
- assertTrue( "TestNGSuiteTestB was executed second", getTestClass( report, 1 ).endsWith( "TestNGSuiteTestB" ) );
- assertTrue( "TestNGSuiteTestA was executed last", getTestClass( report, 2 ).endsWith( "TestNGSuiteTestA" ) );
+ assertTrue( "TestNGSuiteTestC was executed first",
+ getTestClass( report, 0 ).endsWith( "TestNGSuiteTestC" ) );
+
+ assertTrue( "TestNGSuiteTestB was executed second",
+ getTestClass( report, 1 ).endsWith( "TestNGSuiteTestB" ) );
+
+ assertTrue( "TestNGSuiteTestA was executed last",
+ getTestClass( report, 2 ).endsWith( "TestNGSuiteTestA" ) );
}
}
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 beb1e32..9077c02 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
@@ -32,8 +32,8 @@ import static org.junit.runners.Parameterized.Parameters;
public class FailFastJUnitIT
extends AbstractFailFastIT
{
-
- @Parameters(name = "{0}")
+ @Parameters( name = "{0}" )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public static Iterable<Object[]> data()
{
/**
@@ -55,13 +55,13 @@ public class FailFastJUnitIT
args.add( new Object[] { "junit4-oneFork-ff2", "junit4", props( 1, 2, true ), 5, 0, 2, 3 } );
args.add( new Object[] { "junit47-oneFork-ff2", "junit47", props( 1, 2, true ), 5, 0, 2, 3 } );
args.add( new Object[] { "junit4-twoForks-ff1", "junit4", props( 2, 1, true ), 5, 0, 2, 3 } );
- args.add( new Object[] { "junit47-twoForks-ff1", "junit47",props( 2, 1, true ), 5, 0, 2, 3 } );
+ args.add( new Object[] { "junit47-twoForks-ff1", "junit47", props( 2, 1, true ), 5, 0, 2, 3 } );
args.add( new Object[] { "junit4-twoForks-ff2", "junit4", props( 2, 2, true ), 5, 0, 2, 2 } );
- args.add( new Object[] { "junit47-twoForks-ff2", "junit47",props( 2, 2, true ), 5, 0, 2, 2 } );
+ args.add( new Object[] { "junit47-twoForks-ff2", "junit47", props( 2, 2, true ), 5, 0, 2, 2 } );
args.add( new Object[] { "junit4-oneFork-ff3", "junit4", props( 1, 3, true ), 5, 0, 2, 0 } );
args.add( new Object[] { "junit47-oneFork-ff3", "junit47", props( 1, 3, true ), 5, 0, 2, 0 } );
args.add( new Object[] { "junit4-twoForks-ff3", "junit4", props( 2, 3, true ), 5, 0, 2, 0 } );
- args.add( new Object[] { "junit47-twoForks-ff3", "junit47",props( 2, 3, true ), 5, 0, 2, 0 } );
+ args.add( new Object[] { "junit47-twoForks-ff3", "junit47", props( 2, 3, true ), 5, 0, 2, 0 } );
/*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 } );
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 f4aa2b7..0ee2606 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
@@ -33,7 +33,7 @@ public class FailFastTestNgIT
extends AbstractFailFastIT
{
- @Parameters(name = "{0}")
+ @Parameters( name = "{0}" )
public static Iterable<Object[]> data()
{
/**
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
index 6965b4d..22dc5fd 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeIT.java
@@ -143,8 +143,8 @@ public class ForkModeIT
@Test
public void testForkCountTwoNoReuse()
{
- String[] pids =
- doTest( unpack( getProject() ).setForkJvm().forkCount( 2 ).reuseForks( false ).addGoal( "-DsleepLength=7200" ) );
+ 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() ) );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeMultiModuleIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeMultiModuleIT.java
index 6a8d9df..b0ed712 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeMultiModuleIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/ForkModeMultiModuleIT.java
@@ -19,7 +19,11 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.HelperAssertions;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
import java.io.File;
@@ -33,22 +37,21 @@ import static org.junit.Assert.assertTrue;
/**
* Test forkMode in a multi module project with parallel maven builds
- *
+ *
* @author Andreas Gudian
*/
-public class ForkModeMultiModuleIT
- extends SurefireJUnit4IntegrationTestCase
+public class ForkModeMultiModuleIT extends SurefireJUnit4IntegrationTestCase
{
@Test
public void testForkCountOneNoReuse()
{
List<String> pids = doTest( unpack( getProject() ).forkCount( 1 ).reuseForks( false ) );
assertAllDifferentPids( pids );
- int matchesOne = countSuffixMatches( pids, "_1_1");
+ int matchesOne = countSuffixMatches( pids, "_1_1" );
int matchesTwo = countSuffixMatches( pids, "_2_2" );
assertTrue( "At least one fork had forkNumber 1", matchesOne >= 1 );
assertTrue( "At least one fork had forkNumber 2", matchesTwo >= 1 );
- assertEquals( "No other forkNumbers than 1 and 2 have been used", 6, matchesOne + matchesTwo);
+ assertEquals( "No other forkNumbers than 1 and 2 have been used", 6, matchesOne + matchesTwo );
}
@@ -66,33 +69,34 @@ public class ForkModeMultiModuleIT
{
List<String> pids = doTest( unpack( getProject() ).forkCount( 2 ).reuseForks( false ) );
assertAllDifferentPids( pids );
- int matchesOne = countSuffixMatches( pids, "_1_1");
+ int matchesOne = countSuffixMatches( pids, "_1_1" );
int matchesTwo = countSuffixMatches( pids, "_2_2" );
- int matchesThree = countSuffixMatches( pids, "_3_3");
+ int matchesThree = countSuffixMatches( pids, "_3_3" );
int matchesFour = countSuffixMatches( pids, "_4_4" );
assertTrue( "At least one fork had forkNumber 1", matchesOne >= 1 );
assertTrue( "At least one fork had forkNumber 2", matchesTwo >= 1 );
assertTrue( "At least one fork had forkNumber 3", matchesThree >= 1 );
assertTrue( "At least one fork had forkNumber 4", matchesFour >= 1 );
- assertEquals( "No other forkNumbers than 1, 2, 3, or 4 have been used", 6, matchesOne + matchesTwo + matchesThree + matchesFour );
+ assertEquals( "No other forkNumbers than 1, 2, 3, or 4 have been used", 6,
+ matchesOne + matchesTwo + matchesThree + matchesFour );
}
@Test
public void testForkCountTwoReuse()
{
- List<String> pids =
- doTest( unpack( getProject() ).forkCount( 2 ).reuseForks( true ) );
+ List<String> pids = doTest( unpack( getProject() ).forkCount( 2 ).reuseForks( true ) );
assertDifferentPids( pids, 4 );
-
- int matchesOne = countSuffixMatches( pids, "_1_1");
+
+ int matchesOne = countSuffixMatches( pids, "_1_1" );
int matchesTwo = countSuffixMatches( pids, "_2_2" );
- int matchesThree = countSuffixMatches( pids, "_3_3");
+ int matchesThree = countSuffixMatches( pids, "_3_3" );
int matchesFour = countSuffixMatches( pids, "_4_4" );
assertTrue( "At least one fork had forkNumber 1", matchesOne >= 1 );
assertTrue( "At least one fork had forkNumber 2", matchesTwo >= 1 );
assertTrue( "At least one fork had forkNumber 3", matchesThree >= 1 );
assertTrue( "At least one fork had forkNumber 4", matchesFour >= 1 );
- assertEquals( "No other forkNumbers than 1, 2, 3, or 4 have been used", 6, matchesOne + matchesTwo + matchesThree + matchesFour );
+ assertEquals( "No other forkNumbers than 1, 2, 3, or 4 have been used", 6,
+ matchesOne + matchesTwo + matchesThree + matchesFour );
}
private void assertEndWith( List<String> pids, String suffix, int expectedMatches )
@@ -149,7 +153,7 @@ public class ForkModeMultiModuleIT
String pid = targetFile.slurpFile();
pids.add( pid );
}
-
+
return pids;
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/IncludesExcludesFromFileIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/IncludesExcludesFromFileIT.java
index a6c539c..89e735f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/IncludesExcludesFromFileIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/IncludesExcludesFromFileIT.java
@@ -64,7 +64,7 @@ public class IncludesExcludesFromFileIT
@Test
public void testMissingExcludes()
{
- expectBuildFailure("missing-excludes-file", "Failed to load list from file", "no-such-excludes-file");
+ expectBuildFailure( "missing-excludes-file", "Failed to load list from file", "no-such-excludes-file" );
}
@Test
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ConcurrencyIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ConcurrencyIT.java
index 57007a7..c7ccdad 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ConcurrencyIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ConcurrencyIT.java
@@ -23,9 +23,11 @@ import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.*;
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.endsWith;
/**
* Basic suite test using all known versions of JUnit 4.x
@@ -51,7 +53,7 @@ public class JUnit47ConcurrencyIT
break;
}
}
- assertNotNull( result);
+ assertNotNull( result );
assertThat( result, anyOf( containsString( "Time elapsed: 1." ), containsString( "Time elapsed: 0.9" ) ) );
assertThat( result, endsWith( " s - in concurrentjunit47.src.test.java.junit47.BasicTest" ) );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java
index fdf75ef..e612196 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java
@@ -29,29 +29,29 @@ import org.junit.Test;
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @since 2.16
*/
-public class JUnit47ParallelIT
- extends SurefireJUnit4IntegrationTestCase
+@SuppressWarnings( "checkstyle:magicnumber" )
+public class JUnit47ParallelIT extends SurefireJUnit4IntegrationTestCase
{
@Test
public void unknownThreadCountSuites()
{
unpack().parallelSuites().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use threadCount or threadCountSuites > 0 or useUnlimitedThreads=true for parallel='suites'" );
+ "Use threadCount or threadCountSuites > 0 or useUnlimitedThreads=true for parallel='suites'" );
}
@Test
public void unknownThreadCountClasses()
{
unpack().parallelClasses().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use threadCount or threadCountClasses > 0 or useUnlimitedThreads=true for parallel='classes'" );
+ "Use threadCount or threadCountClasses > 0 or useUnlimitedThreads=true for parallel='classes'" );
}
@Test
public void unknownThreadCountMethods()
{
unpack().parallelMethods().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use threadCount or threadCountMethods > 0 or useUnlimitedThreads=true for parallel='methods'" );
+ "Use threadCount or threadCountMethods > 0 or useUnlimitedThreads=true for parallel='methods'" );
}
@@ -59,61 +59,52 @@ public class JUnit47ParallelIT
public void unknownThreadCountBoth()
{
unpack().parallelBoth().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use useUnlimitedThreads=true, " +
- "or only threadCount > 0, " +
- "or (threadCountClasses > 0 and threadCountMethods > 0), " +
- "or (threadCount > 0 and threadCountClasses > 0 and threadCountMethods > 0), " +
- "or (threadCount > 0 and threadCountClasses > 0 and threadCount > threadCountClasses) " +
- "for parallel='both' or parallel='classesAndMethods'" );
+ "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountClasses > 0 and "
+ + "threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and "
+ + "threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and "
+ + "threadCount > threadCountClasses) " + "for parallel='both' or "
+ + "parallel='classesAndMethods'" );
}
@Test
public void unknownThreadCountAll()
{
unpack().parallelAll().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use useUnlimitedThreads=true, " +
- "or only threadCount > 0, " +
- "or (threadCountSuites > 0 and threadCountClasses > 0 and threadCountMethods > 0), " +
- "or every thread-count is specified, " +
- "or (threadCount > 0 and threadCountSuites > 0 and threadCountClasses > 0 " +
- "and threadCount > threadCountSuites + threadCountClasses) " +
- "for parallel='all'" );
+ "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and "
+ + "threadCountClasses > 0 and threadCountMethods > 0), " + "or every thread-count is "
+ + "specified, " + "or (threadCount > 0 and threadCountSuites > 0 and threadCountClasses > 0 "
+ + "and threadCount > threadCountSuites + threadCountClasses) " + "for parallel='all'" );
}
@Test
public void unknownThreadCountSuitesAndClasses()
{
unpack().parallelSuitesAndClasses().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use useUnlimitedThreads=true, " +
- "or only threadCount > 0, " +
- "or (threadCountSuites > 0 and threadCountClasses > 0), " +
- "or (threadCount > 0 and threadCountSuites > 0 and threadCountClasses > 0) " +
- "or (threadCount > 0 and threadCountSuites > 0 and threadCount > threadCountSuites) " +
- "for parallel='suitesAndClasses' or 'both'" );
+ "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and "
+ + "threadCountClasses > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and "
+ + "threadCountClasses > 0) " + "or (threadCount > 0 and threadCountSuites > 0 and threadCount"
+ + " > threadCountSuites) " + "for parallel='suitesAndClasses' or 'both'" );
}
@Test
public void unknownThreadCountSuitesAndMethods()
{
unpack().parallelSuitesAndMethods().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use useUnlimitedThreads=true, " +
- "or only threadCount > 0, " +
- "or (threadCountSuites > 0 and threadCountMethods > 0), " +
- "or (threadCount > 0 and threadCountSuites > 0 and threadCountMethods > 0), " +
- "or (threadCount > 0 and threadCountSuites > 0 and threadCount > threadCountSuites) " +
- "for parallel='suitesAndMethods'" );
+ "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountSuites > 0 and "
+ + "threadCountMethods > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and "
+ + "threadCountMethods > 0), " + "or (threadCount > 0 and threadCountSuites > 0 and "
+ + "threadCount > threadCountSuites) " + "for parallel='suitesAndMethods'" );
}
@Test
public void unknownThreadCountClassesAndMethods()
{
unpack().parallelClassesAndMethods().setTestToRun( "TestClass" ).failNever().executeTest().verifyTextInLog(
- "Use useUnlimitedThreads=true, " +
- "or only threadCount > 0, " +
- "or (threadCountClasses > 0 and threadCountMethods > 0), " +
- "or (threadCount > 0 and threadCountClasses > 0 and threadCountMethods > 0), " +
- "or (threadCount > 0 and threadCountClasses > 0 and threadCount > threadCountClasses) " +
- "for parallel='both' or parallel='classesAndMethods'" );
+ "Use useUnlimitedThreads=true, " + "or only threadCount > 0, " + "or (threadCountClasses > 0 and "
+ + "threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and "
+ + "threadCountMethods > 0), " + "or (threadCount > 0 and threadCountClasses > 0 and "
+ + "threadCount > threadCountClasses) " + "for parallel='both' or "
+ + "parallel='classesAndMethods'" );
}
@Test
@@ -128,7 +119,7 @@ public class JUnit47ParallelIT
{
// takes 3.6 sec
unpack().parallelSuites().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
@@ -136,7 +127,7 @@ public class JUnit47ParallelIT
{
// takes 3.6 sec
unpack().parallelSuites().useUnlimitedThreads().threadCountSuites( 5 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -144,7 +135,7 @@ public class JUnit47ParallelIT
{
// takes 1.8 sec
unpack().parallelClasses().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
@@ -152,7 +143,7 @@ public class JUnit47ParallelIT
{
// takes 1.8 sec
unpack().parallelClasses().useUnlimitedThreads().threadCountClasses( 5 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -160,7 +151,7 @@ public class JUnit47ParallelIT
{
// takes 2.4 sec
unpack().parallelMethods().useUnlimitedThreads().setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
@@ -168,7 +159,7 @@ public class JUnit47ParallelIT
{
// takes 2.4 sec
unpack().parallelMethods().useUnlimitedThreads().threadCountMethods( 5 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -176,7 +167,7 @@ public class JUnit47ParallelIT
{
// takes 0.9 sec
unpack().parallelSuitesAndClasses().useUnlimitedThreads().setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -185,7 +176,7 @@ public class JUnit47ParallelIT
// takes 0.9 sec
// 1.8 sec with 4 parallel classes
unpack().parallelSuitesAndClasses().useUnlimitedThreads().threadCountSuites( 5 ).threadCountClasses(
- 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -193,7 +184,7 @@ public class JUnit47ParallelIT
{
// takes 1.2 sec
unpack().parallelSuitesAndMethods().useUnlimitedThreads().setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -201,7 +192,7 @@ public class JUnit47ParallelIT
{
// takes 1.2 sec
unpack().parallelSuitesAndMethods().useUnlimitedThreads().threadCountSuites( 5 ).threadCountMethods(
- 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -209,7 +200,7 @@ public class JUnit47ParallelIT
{
// takes 0.6 sec
unpack().parallelClassesAndMethods().useUnlimitedThreads().setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -217,7 +208,7 @@ public class JUnit47ParallelIT
{
// takes 0.6 sec
unpack().parallelClassesAndMethods().useUnlimitedThreads().threadCountClasses( 5 ).threadCountMethods(
- 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 15 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -232,7 +223,7 @@ public class JUnit47ParallelIT
{
// takes 0.3 sec
unpack().parallelAll().useUnlimitedThreads().threadCountSuites( 5 ).threadCountClasses( 15 ).threadCountMethods(
- 30 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 30 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -262,7 +253,7 @@ public class JUnit47ParallelIT
{
// takes 4.8 sec
unpack().disablePerCoreThreadCount().disableParallelOptimization().parallelClassesAndMethods().threadCount(
- 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -270,7 +261,7 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().disablePerCoreThreadCount().parallelClassesAndMethods().threadCount( 3 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -278,7 +269,7 @@ public class JUnit47ParallelIT
{
// takes 2.4 sec for double core CPU
unpack().disableParallelOptimization().parallelClassesAndMethods().threadCount( 3 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -286,7 +277,7 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().parallelClassesAndMethods().threadCount( 3 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -295,7 +286,7 @@ public class JUnit47ParallelIT
// usually 24 times 0.3 sec = 7.2 sec with one core CPU
// takes 1.8 sec for double core CPU
unpack().disableParallelOptimization().parallelSuitesAndMethods().threadCount( 3 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -303,14 +294,14 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().parallelSuitesAndMethods().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
public void threadCountSuitesAndClasses()
{
unpack().disableParallelOptimization().parallelSuitesAndClasses().threadCount( 3 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -318,14 +309,14 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().parallelSuitesAndClasses().threadCount( 3 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
public void threadCountAll()
{
unpack().disableParallelOptimization().parallelAll().threadCount( 3 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -340,7 +331,7 @@ public class JUnit47ParallelIT
{
// takes 1.8 sec for double core CPU
unpack().parallelSuitesAndClasses().threadCount( 3 ).threadCountSuites( 34 ).threadCountClasses(
- 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -348,7 +339,7 @@ public class JUnit47ParallelIT
{
// takes 1.8 sec for double core CPU
unpack().parallelSuitesAndMethods().threadCount( 3 ).threadCountSuites( 34 ).threadCountMethods(
- 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -356,7 +347,7 @@ public class JUnit47ParallelIT
{
// takes 1.8 sec for double core CPU
unpack().parallelClassesAndMethods().threadCount( 3 ).threadCountClasses( 34 ).threadCountMethods(
- 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 66 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -364,7 +355,7 @@ public class JUnit47ParallelIT
{
// takes 2.4 sec for double core CPU
unpack().parallelAll().threadCount( 3 ).threadCountSuites( 17 ).threadCountClasses( 34 ).threadCountMethods(
- 49 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 49 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -373,7 +364,7 @@ public class JUnit47ParallelIT
// 4 * cpu to 5 * cpu threads to run test classes
// takes cca 1.8 sec
unpack().disableParallelOptimization().parallelSuitesAndClasses().disablePerCoreThreadCount().threadCount(
- 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -381,7 +372,7 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().parallelSuitesAndClasses().disablePerCoreThreadCount().threadCount( 6 ).threadCountSuites(
- 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -390,7 +381,7 @@ public class JUnit47ParallelIT
// 4 * cpu to 5 * cpu threads to run test methods
// takes cca 1.8 sec
unpack().disableParallelOptimization().parallelSuitesAndMethods().disablePerCoreThreadCount().threadCount(
- 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 6 ).threadCountSuites( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -398,7 +389,7 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().parallelSuitesAndMethods().disablePerCoreThreadCount().threadCount( 6 ).threadCountSuites(
- 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -407,7 +398,7 @@ public class JUnit47ParallelIT
// 4 * cpu to 5 * cpu threads to run test methods
// takes cca 1.8 sec
unpack().disableParallelOptimization().parallelClassesAndMethods().disablePerCoreThreadCount().threadCount(
- 6 ).threadCountClasses( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 6 ).threadCountClasses( 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -415,7 +406,7 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().parallelClassesAndMethods().disablePerCoreThreadCount().threadCount( 6 ).threadCountClasses(
- 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 2 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -424,8 +415,8 @@ public class JUnit47ParallelIT
// 8 * cpu to 13 * cpu threads to run test methods
// takes 0.9 sec
unpack().disableParallelOptimization().parallelAll().disablePerCoreThreadCount().threadCount(
- 14 ).threadCountSuites( 2 ).threadCountClasses( 4 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 14 ).threadCountSuites( 2 ).threadCountClasses( 4 ).setTestToRun(
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -433,7 +424,7 @@ public class JUnit47ParallelIT
{
// the number of reused threads in leafs depends on the number of runners and CPU
unpack().parallelAll().disablePerCoreThreadCount().threadCount( 14 ).threadCountSuites( 2 ).threadCountClasses(
- 4 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ 4 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -441,7 +432,7 @@ public class JUnit47ParallelIT
{
// takes 3.6 sec
unpack().parallelSuites().threadCountSuites( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
@@ -449,7 +440,7 @@ public class JUnit47ParallelIT
{
// takes 1.8 sec on any CPU because the suites are running in a sequence
unpack().parallelClasses().threadCountClasses( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
@@ -458,7 +449,7 @@ public class JUnit47ParallelIT
// takes 2.4 sec on any CPU because every class has only three methods
// and the suites and classes are running in a sequence
unpack().parallelMethods().threadCountMethods( 5 ).setTestToRun( "Suite*Test" ).executeTest().verifyErrorFree(
- 24 );
+ 24 );
}
@Test
@@ -466,7 +457,7 @@ public class JUnit47ParallelIT
{
// takes 0.9 sec
unpack().parallelSuitesAndClasses().threadCountSuites( 5 ).threadCountClasses( 15 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -474,7 +465,7 @@ public class JUnit47ParallelIT
{
// takes 1.2 sec on any CPU
unpack().parallelSuitesAndMethods().threadCountSuites( 5 ).threadCountMethods( 15 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -482,7 +473,7 @@ public class JUnit47ParallelIT
{
// takes 0.6 sec on any CPU
unpack().parallelClassesAndMethods().threadCountClasses( 5 ).threadCountMethods( 15 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -490,7 +481,7 @@ public class JUnit47ParallelIT
{
// takes 0.3 sec on any CPU
unpack().parallelAll().threadCountSuites( 5 ).threadCountClasses( 15 ).threadCountMethods( 30 ).setTestToRun(
- "Suite*Test" ).executeTest().verifyErrorFree( 24 );
+ "Suite*Test" ).executeTest().verifyErrorFree( 24 );
}
@Test
@@ -498,8 +489,8 @@ public class JUnit47ParallelIT
{
// executes for 2.5 sec until timeout has elapsed
unpack().parallelMethods().threadCountMethods( 2 ).parallelTestsTimeoutInSeconds( 2.5d ).setTestToRun(
- "TestClass" ).failNever().executeTest().verifyTextInLog(
- "The test run has finished abruptly after timeout of 2.5 seconds." );
+ "TestClass" ).failNever().executeTest().verifyTextInLog(
+ "The test run has finished abruptly after timeout of 2.5 seconds." );
}
@Test
@@ -507,8 +498,8 @@ public class JUnit47ParallelIT
{
// executes for 2.5 sec until timeout has elapsed
unpack().parallelMethods().threadCountMethods( 2 ).parallelTestsTimeoutForcedInSeconds( 2.5d ).setTestToRun(
- "TestClass" ).failNever().executeTest().verifyTextInLog(
- "The test run has finished abruptly after timeout of 2.5 seconds." );
+ "TestClass" ).failNever().executeTest().verifyTextInLog(
+ "The test run has finished abruptly after timeout of 2.5 seconds." );
}
@Test
@@ -516,27 +507,25 @@ public class JUnit47ParallelIT
{
// executes for one sec until timeout has elapsed
unpack().parallelMethods().threadCountMethods( 2 ).parallelTestsTimeoutInSeconds(
- 1 ).parallelTestsTimeoutForcedInSeconds( 2.5d ).setTestToRun(
- "TestClass" ).failNever().executeTest().verifyTextInLog(
- "The test run has finished abruptly after timeout of 1.0 seconds." );
+ 1 ).parallelTestsTimeoutForcedInSeconds( 2.5d ).setTestToRun(
+ "TestClass" ).failNever().executeTest().verifyTextInLog(
+ "The test run has finished abruptly after timeout of 1.0 seconds." );
}
@Test
public void forcedShutdownVerifyingLogs()
{
// attempts to run for 2.4 sec until timeout has elapsed
- unpack().parallelMethods().threadCountMethods( 3 ).disablePerCoreThreadCount()
- .parallelTestsTimeoutForcedInSeconds( 1.05d ).setTestToRun( "Waiting*Test" ).failNever().executeTest()
- .verifyTextInLog( "The test run has finished abruptly after timeout of 1.05 seconds." )
- .verifyTextInLog( "These tests were executed in prior to the shutdown operation:" )
- .verifyTextInLog( "These tests are incomplete:" );
+ unpack().parallelMethods().threadCountMethods(
+ 3 ).disablePerCoreThreadCount().parallelTestsTimeoutForcedInSeconds( 1.05d ).setTestToRun(
+ "Waiting*Test" ).failNever().executeTest().verifyTextInLog(
+ "The test run has finished abruptly after timeout of 1.05 seconds." ).verifyTextInLog(
+ "These tests were executed in prior to the shutdown operation:" ).verifyTextInLog(
+ "These tests are incomplete:" );
}
private SurefireLauncher unpack()
{
- return unpack( "junit47-parallel" )
- .showErrorStackTraces()
- .forkOnce()
- .redirectToFile( false );
+ return unpack( "junit47-parallel" ).showErrorStackTraces().forkOnce().redirectToFile( false );
}
}
\ No newline at end of file
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 c3144e1..437d24a 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
@@ -30,6 +30,9 @@ import java.io.IOException;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+/**
+ *
+ */
public class JUnit47RedirectOutputIT
extends SurefireJUnit4IntegrationTestCase
{
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 628d63e..470cfe3 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
@@ -24,48 +24,41 @@ import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
/**
- * Tests using the JUnit 47 provider to rerun failing tests with the cucumber runner. The main
- * problem that the junit4 provider has with the cucumber runner is that the junit Description
- * instance created by the runner has a null test class attribute. This requires that tests are
- * rerun based on their description.
+ * Tests using the JUnit 47 provider to rerun failing tests with the cucumber runner. The main problem that the junit4
+ * provider has with the cucumber runner is that the junit Description instance created by the runner has a null test
+ * class attribute. This requires that tests are rerun based on their description.
*
* @author mpkorstanje
*/
-public class JUnit47RerunFailingTestWithCucumberIT
- extends SurefireJUnit4IntegrationTestCase {
+public class JUnit47RerunFailingTestWithCucumberIT extends SurefireJUnit4IntegrationTestCase
+{
- private SurefireLauncher unpack() {
- return unpack("junit47-rerun-failing-tests-with-cucumber")
- .setJUnitVersion("4.12");
+ private SurefireLauncher unpack()
+ {
+ return unpack( "junit47-rerun-failing-tests-with-cucumber" ).setJUnitVersion( "4.12" );
}
@Test
- public void testRerunFailingErrorTestsFalse() {
- unpack()
- .maven()
- .addGoal("-Dsurefire.rerunFailingTestsCount=" + 0)
- .withFailure()
- .executeTest()
- .assertTestSuiteResults(1, 0, 1, 0, 0);
+ public void testRerunFailingErrorTestsFalse()
+ {
+ unpack().maven().addGoal(
+ "-Dsurefire.rerunFailingTestsCount=" + 0 ).withFailure().executeTest().assertTestSuiteResults( 1, 0, 1,
+ 0, 0 );
}
@Test
- public void testRerunFailingErrorTestsWithOneRetry() {
- unpack()
- .maven()
- .addGoal("-Dsurefire.rerunFailingTestsCount=" + 1)
- .withFailure()
- .executeTest()
- .assertTestSuiteResults(1, 0, 1, 0, 0);
+ public void testRerunFailingErrorTestsWithOneRetry()
+ {
+ unpack().maven().addGoal(
+ "-Dsurefire.rerunFailingTestsCount=" + 1 ).withFailure().executeTest().assertTestSuiteResults( 1, 0, 1,
+ 0, 0 );
}
@Test
- public void testRerunFailingErrorTestsTwoRetry() {
- unpack()
- .maven()
- .addGoal("-Dsurefire.rerunFailingTestsCount=" + 2)
- .executeTest()
- .assertTestSuiteResults(1, 0, 0, 0, 2);
+ public void testRerunFailingErrorTestsTwoRetry()
+ {
+ unpack().maven().addGoal( "-Dsurefire.rerunFailingTestsCount=" + 2 ).executeTest().assertTestSuiteResults( 1, 0,
+ 0, 0, 2 );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47StaticInnerClassTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47StaticInnerClassTestsIT.java
index e50e6d7..c3e2e97 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47StaticInnerClassTestsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47StaticInnerClassTestsIT.java
@@ -22,6 +22,9 @@ package org.apache.maven.surefire.its;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class JUnit47StaticInnerClassTestsIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4VersionsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4VersionsIT.java
index b6cfad8..38ca8a5 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4VersionsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit4VersionsIT.java
@@ -36,7 +36,7 @@ import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_1;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_8_2;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_9;
-import static org.junit.runners.Parameterized.*;
+import static org.junit.runners.Parameterized.Parameters;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_0;
import static org.apache.maven.surefire.its.JUnitVersion.JUNIT_4_1;
@@ -82,6 +82,7 @@ public class JUnit4VersionsIT
}
@Parameter
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public JUnitVersion version;
@Test
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 0757a17..045473a 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
@@ -28,8 +28,7 @@ import org.junit.Test;
*
* @author <a href="mailto:dfabulich@apache.org">Dan Fabulich</a>
*/
-public class JUnitDepIT
- extends SurefireJUnit4IntegrationTestCase
+public class JUnitDepIT extends SurefireJUnit4IntegrationTestCase
{
public SurefireLauncher unpack()
{
@@ -37,34 +36,30 @@ public class JUnitDepIT
}
@Test
- public void testJUnit44Dep()
- throws Exception
+ public void testJUnit44Dep() throws Exception
{
- unpack().debugLogging().sysProp( "junit-dep.version", "4.4" ).executeTest().verifyErrorFree( 1 ).verifyTextInLog(
- "surefire-junit4" ); // Ahem. Will match on the 4.7 provider too
+ 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() throws Exception
{
unpack().debugLogging().sysProp( "junit-dep.version", "4.4" ).activateProfile(
- "provided381" ).executeTest().verifyErrorFree( 1 );
+ "provided381" ).executeTest().verifyErrorFree( 1 );
}
@Test
- public void testJUnit47Dep()
- throws Exception
+ public void testJUnit47Dep() throws Exception
{
- unpack().debugLogging().sysProp( "junit-dep.version", "4.7" ).executeTest().verifyErrorFree( 1 ).verifyTextInLog(
- "surefire-junit47" );
+ unpack().debugLogging().sysProp( "junit-dep.version", "4.7" ).executeTest().verifyErrorFree(
+ 1 ).verifyTextInLog( "surefire-junit47" );
}
@Test
- public void testJUnit48Dep()
- throws Exception
+ public void testJUnit48Dep() throws Exception
{
- unpack().debugLogging().sysProp( "junit-dep.version", "4.8" ).executeTest().verifyErrorFree( 1 ).verifyTextInLog(
- "surefire-junit47" );
+ 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/JUnitPlatformEnginesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
index 5c4d278..f0cf023 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java
@@ -40,33 +40,40 @@ import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;
+/**
+ *
+ */
@RunWith( ParallelParameterized.class )
-public class JUnitPlatformEnginesIT
- extends SurefireJUnit4IntegrationTestCase
+@SuppressWarnings( "checkstyle:magicnumber" )
+public class JUnitPlatformEnginesIT extends SurefireJUnit4IntegrationTestCase
{
@Parameter
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String platform;
@Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String jupiter;
@Parameter( 2 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String opentest;
@Parameter( 3 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String apiguardian;
- @Parameters(name = "{0}")
+ @Parameters( name = "{0}" )
public static Iterable<Object[]> artifactVersions()
{
ArrayList<Object[]> args = new ArrayList<>();
- args.add( new Object[] { "1.0.3", "5.0.3", "1.0.0", "1.0.0" } );
- args.add( new Object[] { "1.1.1", "5.1.1", "1.0.0", "1.0.0" } );
- args.add( new Object[] { "1.2.0", "5.2.0", "1.1.0", "1.0.0" } );
- args.add( new Object[] { "1.3.2", "5.3.2", "1.1.1", "1.0.0" } );
- args.add( new Object[] { "1.4.2", "5.4.2", "1.1.1", "1.0.0" } );
- args.add( new Object[] { "1.5.2", "5.5.2", "1.2.0", "1.1.0" } );
- args.add( new Object[] { "1.6.0-M1", "5.6.0-M1", "1.2.0", "1.1.0" } );
+ args.add( new Object[] {"1.0.3", "5.0.3", "1.0.0", "1.0.0"} );
+ args.add( new Object[] {"1.1.1", "5.1.1", "1.0.0", "1.0.0"} );
+ args.add( new Object[] {"1.2.0", "5.2.0", "1.1.0", "1.0.0"} );
+ args.add( new Object[] {"1.3.2", "5.3.2", "1.1.1", "1.0.0"} );
+ args.add( new Object[] {"1.4.2", "5.4.2", "1.1.1", "1.0.0"} );
+ args.add( new Object[] {"1.5.2", "5.5.2", "1.2.0", "1.1.0"} );
+ args.add( new Object[] {"1.6.0-M1", "5.6.0-M1", "1.2.0", "1.1.0"} );
//args.add( new Object[] { "1.6.0-SNAPSHOT", "5.6.0-SNAPSHOT", "1.2.0", "1.1.0" } );
return args;
}
@@ -81,8 +88,7 @@ public class JUnitPlatformEnginesIT
public void testToRegex()
{
String regex = toRegex( ".[]()*" );
- assertThat( regex )
- .isEqualTo( "\\.\\[\\]\\(\\).*" );
+ assertThat( regex ).isEqualTo( "\\.\\[\\]\\(\\).*" );
}
@Test
@@ -96,8 +102,7 @@ public class JUnitPlatformEnginesIT
List<String> lines = validator.loadLogLines( startsWith( "[DEBUG] test(compact) classpath" ) );
- assertThat( lines )
- .hasSize( 1 );
+ assertThat( lines ).hasSize( 1 );
String line = lines.get( 0 );
@@ -115,8 +120,7 @@ public class JUnitPlatformEnginesIT
lines = validator.loadLogLines( startsWith( "[DEBUG] provider(compact) classpath" ) );
- assertThat( lines )
- .hasSize( 1 );
+ assertThat( lines ).hasSize( 1 );
line = lines.get( 0 );
@@ -131,8 +135,7 @@ public class JUnitPlatformEnginesIT
lines = validator.loadLogLines( startsWith( "[DEBUG] boot(compact) classpath" ) );
- assertThat( lines )
- .hasSize( 1 );
+ assertThat( lines ).hasSize( 1 );
line = lines.get( 0 );
@@ -144,17 +147,17 @@ public class JUnitPlatformEnginesIT
regex( toRegex( "* test-classes*" ) ),
regex( toRegex( "* classes*" ) ),
regex( toRegex( "*junit-jupiter-engine-" + jupiter + ".jar*" ) ),
- regex( toRegex("*apiguardian-api-" + apiguardian + ".jar*" ) ),
+ regex( toRegex( "*apiguardian-api-" + apiguardian + ".jar*" ) ),
regex( toRegex( "*junit-platform-engine-" + platform + ".jar*" ) ),
- regex( toRegex( "*junit-platform-commons-" + platform + ".jar*" ) ),
+ regex( toRegex( "*junit-platform-commons-" + platform + ".jar*" ) ),
regex( toRegex( "*opentest4j-" + opentest + ".jar*" ) ),
regex( toRegex( "*junit-jupiter-api-" + jupiter + ".jar*" ) ),
regex( toRegex( "*surefire-junit-platform-*.jar*" ) ),
- regex( toRegex( "*junit-platform-launcher-" + platform + ".jar*" ) )
- ) );
+ regex( toRegex( "*junit-platform-launcher-" + platform + ".jar*" ) ) ) );
}
- private static String toRegex(String text) {
+ private static String toRegex( String text )
+ {
return text.replaceAll( "\\.", "\\\\." )
.replaceAll( "\\[", "\\\\[" )
.replaceAll( "]", "\\\\]" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java
index 87bb255..5a26e0f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformIT.java
@@ -33,7 +33,11 @@ import java.util.ArrayList;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion;
+/**
+ *
+ */
@RunWith( ParallelParameterized.class )
+@SuppressWarnings( "checkstyle:magicnumber" )
public class JUnitPlatformIT
extends SurefireJUnit4IntegrationTestCase
{
@@ -43,9 +47,11 @@ public class JUnitPlatformIT
+ "version=\"3.0\" name=\"<< ✨ >>\"";
@Parameter
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String junit5Version;
@Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String jqwikVersion;
@Parameters( name = "{0}" )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformRerunFailingTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformRerunFailingTestsIT.java
index 6d881d3..2a3bdca 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformRerunFailingTestsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformRerunFailingTestsIT.java
@@ -33,9 +33,10 @@ import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaV
* @author <a href="mailto:qingzhouluo@google.com">Qingzhou Luo</a>
* @author Matt Coley
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationTestCase
{
- private final static String VERSION = "5.5.1";
+ private static final String VERSION = "5.5.1";
private SurefireLauncher unpack()
{
@@ -49,10 +50,13 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
}
@Test
- public void testRerunFailingErrorTestsWithOneRetry() throws Exception
+ public void testRerunFailingErrorTestsWithOneRetry()
{
OutputValidator outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
- "-Dsurefire.rerunFailingTestsCount=1" ).withFailure().debugLogging().executeTest()
+ "-Dsurefire.rerunFailingTestsCount=1" )
+ .withFailure()
+ .debugLogging()
+ .executeTest()
.assertTestSuiteResults( 5, 1, 1, 0, 0 );
verifyFailuresOneRetryAllClasses( outputValidator );
@@ -73,11 +77,11 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
}
@Test
- public void testRerunFailingErrorTestsTwoRetry() throws Exception
+ public void testRerunFailingErrorTestsTwoRetry()
{
// Four flakes, both tests have been re-run twice
- OutputValidator outputValidator = unpack().setJUnitVersion( VERSION ).maven().debugLogging()
- .addGoal( "-Dsurefire.rerunFailingTestsCount=2" ).executeTest().assertTestSuiteResults( 5, 0, 0, 0, 4 );
+ OutputValidator outputValidator = unpack().setJUnitVersion( VERSION ).maven().debugLogging().addGoal(
+ "-Dsurefire.rerunFailingTestsCount=2" ).executeTest().assertTestSuiteResults( 5, 0, 0, 0, 4 );
verifyFailuresTwoRetryAllClasses( outputValidator );
@@ -101,7 +105,7 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
}
@Test
- public void testRerunFailingErrorTestsFalse() throws Exception
+ public void testRerunFailingErrorTestsFalse()
{
OutputValidator outputValidator = unpack().setJUnitVersion(
VERSION ).maven().withFailure().debugLogging().executeTest().assertTestSuiteResults( 5, 1, 1, 0, 0 );
@@ -113,23 +117,21 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
verifyFailuresNoRetryAllClasses( outputValidator );
- outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
- "-Dparallel=methods" ).addGoal(
- "-DuseUnlimitedThreads=true" ).withFailure().debugLogging().executeTest()
- .assertTestSuiteResults( 5, 1, 1, 0, 0 );
+ outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal( "-Dparallel=methods" ).addGoal(
+ "-DuseUnlimitedThreads=true" ).withFailure().debugLogging().executeTest().assertTestSuiteResults( 5, 1,
+ 1, 0, 0 );
verifyFailuresNoRetryAllClasses( outputValidator );
- outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
- "-Dparallel=classes" ).addGoal(
- "-DuseUnlimitedThreads=true" ).withFailure().debugLogging().executeTest()
- .assertTestSuiteResults( 5, 1, 1, 0, 0 );
+ outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal( "-Dparallel=classes" ).addGoal(
+ "-DuseUnlimitedThreads=true" ).withFailure().debugLogging().executeTest().assertTestSuiteResults( 5, 1,
+ 1, 0, 0 );
verifyFailuresNoRetryAllClasses( outputValidator );
}
@Test
- public void testRerunOneTestClass() throws Exception
+ public void testRerunOneTestClass()
{
OutputValidator outputValidator = unpack().setJUnitVersion( VERSION ).maven().debugLogging().addGoal(
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal(
@@ -139,30 +141,30 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-DforkCount=3" ).addGoal(
- "-Dtest=FlakyFirstTimeTest" ).withFailure().debugLogging().executeTest()
- .assertTestSuiteResults( 3, 1, 1, 0, 0 );
+ "-Dtest=FlakyFirstTimeTest" ).withFailure().debugLogging().executeTest().assertTestSuiteResults( 3, 1,
+ 1, 0, 0 );
verifyFailuresOneRetryOneClass( outputValidator );
outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=methods" ).addGoal(
"-DuseUnlimitedThreads=true" ).addGoal(
- "-Dtest=FlakyFirstTimeTest" ).withFailure().debugLogging().executeTest()
- .assertTestSuiteResults( 3, 1, 1, 0, 0 );
+ "-Dtest=FlakyFirstTimeTest" ).withFailure().debugLogging().executeTest().assertTestSuiteResults( 3, 1,
+ 1, 0, 0 );
verifyFailuresOneRetryOneClass( outputValidator );
outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=classes" ).addGoal(
"-DuseUnlimitedThreads=true" ).addGoal(
- "-Dtest=FlakyFirstTimeTest" ).withFailure().debugLogging().executeTest()
- .assertTestSuiteResults( 3, 1, 1, 0, 0 );
+ "-Dtest=FlakyFirstTimeTest" ).withFailure().debugLogging().executeTest().assertTestSuiteResults( 3, 1,
+ 1, 0, 0 );
verifyFailuresOneRetryOneClass( outputValidator );
}
@Test
- public void testRerunOneTestMethod() throws Exception
+ public void testRerunOneTestMethod()
{
OutputValidator outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal(
@@ -181,7 +183,10 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=methods" ).addGoal(
"-DuseUnlimitedThreads=true" ).addGoal(
- "-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure().debugLogging().executeTest()
+ "-Dtest=FlakyFirstTimeTest#testFailing*" )
+ .withFailure()
+ .debugLogging()
+ .executeTest()
.assertTestSuiteResults( 1, 0, 1, 0, 0 );
verifyFailuresOneRetryOneMethod( outputValidator );
@@ -189,7 +194,10 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
outputValidator = unpack().setJUnitVersion( VERSION ).maven().addGoal(
"-Dsurefire.rerunFailingTestsCount=1" ).addGoal( "-Dparallel=classes" ).addGoal(
"-DuseUnlimitedThreads=true" ).addGoal(
- "-Dtest=FlakyFirstTimeTest#testFailing*" ).withFailure().debugLogging().executeTest()
+ "-Dtest=FlakyFirstTimeTest#testFailing*" )
+ .withFailure()
+ .debugLogging()
+ .executeTest()
.assertTestSuiteResults( 1, 0, 1, 0, 0 );
verifyFailuresOneRetryOneMethod( outputValidator );
@@ -220,7 +228,8 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
verifyOnlyFailuresOneRetry( outputValidator, 1, 1, 0, 0 );
}
- private void verifyFailuresOneRetry( OutputValidator outputValidator, int run, int failures, int errors, int flakes )
+ private void verifyFailuresOneRetry( OutputValidator outputValidator, int run, int failures, int errors,
+ int flakes )
{
outputValidator.verifyTextInLog( "Failures:" );
outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testFailingTestOne" );
@@ -233,7 +242,8 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
verifyStatistics( outputValidator, run, failures, errors, flakes );
}
- private void verifyOnlyFailuresOneRetry( OutputValidator outputValidator, int run, int failures, int errors, int flakes )
+ private void verifyOnlyFailuresOneRetry( OutputValidator outputValidator, int run, int failures, int errors,
+ int flakes )
{
outputValidator.verifyTextInLog( "Failures:" );
outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testFailingTestOne" );
@@ -242,7 +252,8 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
verifyStatistics( outputValidator, run, failures, errors, flakes );
}
- private void verifyFailuresTwoRetry( OutputValidator outputValidator, int run, int failures, int errors, int flakes )
+ private void verifyFailuresTwoRetry( OutputValidator outputValidator, int run, int failures, int errors,
+ int flakes )
{
outputValidator.verifyTextInLog( "Flakes:" );
outputValidator.verifyTextInLog( "Run 1: FlakyFirstTimeTest.testFailingTestOne" );
@@ -270,7 +281,8 @@ public class JUnitPlatformRerunFailingTestsIT extends SurefireJUnit4IntegrationT
if ( flakes > 0 )
{
outputValidator.verifyTextInLog(
- "Tests run: " + run + ", Failures: " + failures + ", Errors: " + errors + ", Skipped: 0, Flakes: " + flakes );
+ "Tests run: " + run + ", Failures: " + failures + ", Errors: " + errors + ", Skipped: 0, Flakes: "
+ + flakes );
}
else
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java
index 00a556c..baa557d 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java
@@ -31,6 +31,10 @@ import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaV
import static org.fest.assertions.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.startsWith;
+/**
+ *
+ */
+@SuppressWarnings( "checkstyle:magicnumber" )
public class JUnitPlatformStreamCorruptionIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitVersion.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitVersion.java
index 9549016..522e062 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitVersion.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitVersion.java
@@ -24,7 +24,8 @@ import org.apache.maven.surefire.its.fixture.SurefireLauncher;
/**
* Enum listing all the JUnit version.
*/
-public enum JUnitVersion {
+public enum JUnitVersion
+{
JUNIT_4_0( "4.0" ),
JUNIT_4_1( "4.1" ),
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
index 0c7776d..37b784b 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/Java9FullApiIT.java
@@ -26,7 +26,6 @@ import java.io.File;
import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME;
import static org.apache.maven.surefire.its.fixture.SurefireLauncher.EXT_JDK_HOME_KEY;
-import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.is;
@@ -43,6 +42,7 @@ public class Java9FullApiIT
private static final String JVM_SPEC_VERSION = System.getProperty( "java.specification.version" );
@Test
+ @SuppressWarnings( "checkstyle:methodname" )
public void shouldLoadMultipleJavaModules_JavaHome() throws Exception
{
OutputValidator validator = assumeJava9()
@@ -61,6 +61,7 @@ public class Java9FullApiIT
}
@Test
+ @SuppressWarnings( "checkstyle:methodname" )
public void shouldLoadMultipleJavaModules_JvmParameter() throws Exception
{
OutputValidator validator = assumeJava9Property()
@@ -80,6 +81,7 @@ public class Java9FullApiIT
}
@Test
+ @SuppressWarnings( "checkstyle:methodname" )
public void shouldLoadMultipleJavaModules_ToolchainsXML() throws Exception
{
OutputValidator validator = assumeJava9Property()
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 a05ef72..5a716ca 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
@@ -23,6 +23,9 @@ import org.junit.Test;
import java.io.IOException;
+/**
+ *
+ */
public class ModulePathIT
extends AbstractJigsawIT
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java
index bec3e99..1df2e7e 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/PlexusConflictIT.java
@@ -40,7 +40,7 @@ public class PlexusConflictIT
@Test
public void testPlexusConflictIsolatedClassLoader()
{
- unpack().useSystemClassLoader(false).executeTest().verifyErrorFree( 1 );
+ unpack().useSystemClassLoader( false ).executeTest().verifyErrorFree( 1 );
}
private SurefireLauncher unpack()
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
index 154fb73..d6a69d0 100644
--- 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
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
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 714d0c4..034e114 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
@@ -32,6 +32,7 @@ import java.io.IOException;
*
* @author Kristian Rosenvold
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class ResultCountingIT
extends SurefireJUnit4IntegrationTestCase
{
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 099aa07..d2031fa 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
@@ -19,7 +19,6 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import java.io.IOException;
import java.util.Calendar;
import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.OutputValidator;
@@ -78,8 +77,13 @@ public class RunOrderIT
public void testNonExistingRunOrder()
throws Exception
{
- unpack().forkMode( getForkMode() ).runOrder( "nonExistingRunOrder" ).maven().withFailure().executeTest().verifyTextInLog(
- "There's no RunOrder with the name nonExistingRunOrder." );
+ unpack()
+ .forkMode( getForkMode() )
+ .runOrder( "nonExistingRunOrder" )
+ .maven()
+ .withFailure()
+ .executeTest()
+ .verifyTextInLog( "There's no RunOrder with the name nonExistingRunOrder." );
}
private OutputValidator executeWithRunOrder( String runOrder )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderParallelForksIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderParallelForksIT.java
index 72fc428..5694ae3 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderParallelForksIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/RunOrderParallelForksIT.java
@@ -19,6 +19,9 @@ package org.apache.maven.surefire.its;
* under the License.
*/
+/**
+ *
+ */
public class RunOrderParallelForksIT
extends RunOrderIT
{
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 b98155e..2c29bc1 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
@@ -37,8 +37,10 @@ public class SmartStackTraceIT
throws Exception
{
OutputValidator outputValidator = unpack( "/junit48-smartStackTrace" ).maven().withFailure().executeTest();
- outputValidator.verifyTextInLog( "SmartStackTraceTest.shouldFailInMethodButDoesnt Expected exception: java.lang.RuntimeException" );
- outputValidator.verifyTextInLog( "SmartStackTraceTest.shortName Expected exception: java.io.IOException" );
+ outputValidator.verifyTextInLog(
+ "SmartStackTraceTest.shouldFailInMethodButDoesnt Expected exception: java.lang.RuntimeException" );
+ outputValidator.verifyTextInLog(
+ "SmartStackTraceTest.shortName Expected exception: java.io.IOException" );
}
}
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 d26bd4a..8ce7732 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,7 +19,6 @@ package org.apache.maven.surefire.its;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestNgSuccessPercentageIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestNgSuccessPercentageIT.java
index 3b12e03..1be72f4 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/TestNgSuccessPercentageIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/TestNgSuccessPercentageIT.java
@@ -30,16 +30,17 @@ import org.junit.Test;
* @author Jon Todd
* @author Andreas Gudian
*/
-public class TestNgSuccessPercentageIT extends SurefireJUnit4IntegrationTestCase {
+public class TestNgSuccessPercentageIT extends SurefireJUnit4IntegrationTestCase
+{
@Test
public void testPassesWhenFailuresLessThanSuccessPercentage()
{
- OutputValidator validator = unpack("/testng-succes-percentage")
+ OutputValidator validator = unpack( "/testng-succes-percentage" )
.sysProp( "testNgVersion", "5.7" )
.sysProp( "testNgClassifier", "jdk15" )
.mavenTestFailureIgnore( true )
.executeTest();
- validator.assertTestSuiteResults(8, 0, 1, 0);
+ validator.assertTestSuiteResults( 8, 0, 1, 0 );
}
}
\ No newline at end of file
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 24dd8f4..3b20ea2 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
@@ -124,8 +124,8 @@ public class TestSingleMethodIT
public void fullyQualifiedJunit48Provider47()
throws Exception
{
- singleMethod("junit48-single-method", Collections.<String, String>emptyMap(),
- "junit4.BasicTest#testSuccessOne", "-P surefire-junit47");
+ singleMethod( "junit48-single-method", Collections.<String, String>emptyMap(),
+ "junit4.BasicTest#testSuccessOne", "-P surefire-junit47" );
}
@Test
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 61b5517..23e6dd0 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
@@ -23,7 +23,10 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.maven.plugins.surefire.report.ReportTestSuite;
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.HelperAssertions;
+import org.apache.maven.surefire.its.fixture.IntegrationTestSuiteResults;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
index 3ce7336..57bc602 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/UnicodeTestNamesIT.java
@@ -16,7 +16,7 @@ package org.apache.maven.surefire.its;
* "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 LicenseUni.
+ * under the License.
*/
import org.apache.maven.surefire.its.fixture.OutputValidator;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
index 174ed1a..f381950 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/WorkingDirectoryIT.java
@@ -24,7 +24,10 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import org.apache.maven.it.VerificationException;
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
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 1415b6e..8f0e009 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
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE 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 e8ee58b..539d6cf 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
@@ -35,6 +35,7 @@ import static org.hamcrest.Matchers.lessThan;
*
* @author Kristian Rosenvold
*/
+@SuppressWarnings( { "checkstyle:magicnumber", "checkstyle:linelength" } )
public class XmlReporterRunTimeIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java
index b96cf9b..19e1089 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/FailsafeOutputValidator.java
@@ -21,6 +21,9 @@ package org.apache.maven.surefire.its.fixture;
import org.apache.maven.it.VerificationException;
+/**
+ *
+ */
public class FailsafeOutputValidator
extends OutputValidator
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/HelperAssertions.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/HelperAssertions.java
index 324936d..e4b8e84 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/HelperAssertions.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/HelperAssertions.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.fixture;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -33,7 +34,10 @@ import static junit.framework.Assert.assertTrue;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assume.assumeTrue;
-@SuppressWarnings( { "JavaDoc" } )
+/**
+ *
+ */
+@SuppressWarnings( {"JavaDoc"} )
public class HelperAssertions
{
/**
@@ -45,7 +49,8 @@ public class HelperAssertions
assertTestSuiteResults( total, errors, failures, skipped, suite );
}
- public static void assertTestSuiteResults( int total, int errors, int failures, int skipped, int flakes, File testDir )
+ public static void assertTestSuiteResults( int total, int errors, int failures, int skipped, int flakes,
+ File testDir )
{
IntegrationTestSuiteResults suite = parseTestResults( testDir );
assertTestSuiteResults( total, errors, failures, skipped, flakes, suite );
@@ -90,7 +95,7 @@ public class HelperAssertions
public static void assertTestSuiteResults( int total, int errors, int failures, int skipped, int flakes,
IntegrationTestSuiteResults actualSuite )
{
- assertTestSuiteResults(total, errors, failures, skipped, actualSuite);
+ assertTestSuiteResults( total, errors, failures, skipped, actualSuite );
assertEquals( "wrong number of flaky tests", flakes, actualSuite.getFlakes() );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IntegrationTestSuiteResults.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IntegrationTestSuiteResults.java
index f147281..c2d7743 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IntegrationTestSuiteResults.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IntegrationTestSuiteResults.java
@@ -19,7 +19,9 @@ package org.apache.maven.surefire.its.fixture;
* under the License.
*/
-
+/**
+ *
+ */
public class IntegrationTestSuiteResults
{
private int total, errors, failures, skipped, flakes;
@@ -34,7 +36,7 @@ public class IntegrationTestSuiteResults
public IntegrationTestSuiteResults( int total, int errors, int failures, int skipped, int flakes )
{
- this(total, errors, failures, skipped);
+ this( total, errors, failures, skipped );
this.flakes = flakes;
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IsRegex.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IsRegex.java
index 09e8d0d..59d9070 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IsRegex.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/IsRegex.java
@@ -23,7 +23,6 @@ import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
-import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java
index de1d5f8..d444e35 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java
@@ -96,8 +96,7 @@ public final class MavenLauncher
return unpackedAt;
}
- public void moveUnpackTo( File dest )
- throws IOException
+ public void moveUnpackTo( File dest ) throws IOException
{
FileUtils.deleteDirectory( dest );
//noinspection ResultOfMethodCallIgnored
@@ -159,8 +158,7 @@ public final class MavenLauncher
return mavenLauncher;
}
- public OutputValidator getSubProjectValidator( String subProject )
- throws VerificationException
+ public OutputValidator getSubProjectValidator( String subProject ) throws VerificationException
{
String subProjectBasedir = getValidator().getSubFile( subProject ).getAbsolutePath();
String settingsXml = settingsXmlPath().getAbsolutePath();
@@ -235,18 +233,17 @@ public final class MavenLauncher
{
if ( newGoal != null && newGoal.startsWith( "-D" ) )
{
- final String sysPropKey =
- newGoal.contains( "=" ) ? newGoal.substring( 0, newGoal.indexOf( '=' ) ) : newGoal;
+ String sysPropKey = newGoal.contains( "=" ) ? newGoal.substring( 0, newGoal.indexOf( '=' ) ) : newGoal;
- final String sysPropStarter = sysPropKey + "=";
+ String sysPropStarter = sysPropKey + "=";
for ( ListIterator<String> it = goals.listIterator(); it.hasNext(); )
{
String goal = it.next();
if ( goal.equals( sysPropKey ) || goal.startsWith( sysPropStarter ) )
{
- System.out.printf( "[WARNING] System property already exists '%s'. Overriding to '%s'.\n",
- goal, newGoal );
+ System.out.printf( "[WARNING] System property already exists '%s'. Overriding to '%s'.\n", goal,
+ newGoal );
it.set( newGoal );
return;
}
@@ -255,7 +252,7 @@ public final class MavenLauncher
goals.add( newGoal );
}
- private OutputValidator conditionalExec(String goal)
+ private OutputValidator conditionalExec( String goal )
{
OutputValidator verify;
try
@@ -372,7 +369,8 @@ public final class MavenLauncher
return validator;
}
- public void setForkJvm( boolean forkJvm ) {
+ public void setForkJvm( boolean forkJvm )
+ {
getVerifier().setForkJvm( forkJvm );
}
@@ -403,7 +401,7 @@ public final class MavenLauncher
}
return verifier;
}
-
+
private File simpleExtractResources( Class<?> cl, String resourcePath )
{
if ( !resourcePath.startsWith( "/" ) )
@@ -415,7 +413,8 @@ public final class MavenLauncher
try
{
File parentPom = new File( tempDir.getParentFile(), "pom.xml" );
- if (!parentPom.exists()){
+ if ( !parentPom.exists() )
+ {
URL resource = cl.getResource( "/pom.xml" );
FileUtils.copyURLToFile( resource, parentPom );
}
@@ -433,8 +432,7 @@ public final class MavenLauncher
private File getUnpackDir()
{
String tempDirPath = System.getProperty( "maven.test.tmpdir", System.getProperty( "java.io.tmpdir" ) );
- return new File( tempDirPath,
- testCaseBeingRun.getSimpleName() + "_" + getTestMethodName() + suffix );
+ return new File( tempDirPath, testCaseBeingRun.getSimpleName() + "_" + getTestMethodName() + suffix );
}
public File getArtifactPath( String gid, String aid, String version, String ext )
@@ -463,12 +461,10 @@ public final class MavenLauncher
private static Verifier createVerifier( String basedir, String settingsFile, String[] defaultCliOptions )
throws VerificationException
{
- Verifier verifier = defaultCliOptions == null ?
- new Verifier( basedir, settingsFile, false )
- : new Verifier( basedir, settingsFile, false, defaultCliOptions );
+ Verifier verifier = defaultCliOptions == null ? new Verifier( basedir, settingsFile, false ) : new Verifier(
+ basedir, settingsFile, false, defaultCliOptions );
- verifier.getVerifierProperties()
- .setProperty( "use.mavenRepoLocal", "true" );
+ verifier.getVerifierProperties().setProperty( "use.mavenRepoLocal", "true" );
return verifier;
}
@@ -477,8 +473,7 @@ public final class MavenLauncher
{
try
{
- return new File( System.getProperty( "maven.settings.file" ) )
- .getCanonicalFile();
+ return new File( System.getProperty( "maven.settings.file" ) ).getCanonicalFile();
}
catch ( IOException e )
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
index bb19ea9..a507604 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/SurefireLauncher.java
@@ -131,7 +131,7 @@ public final class SurefireLauncher
return this;
}
- public SurefireLauncher setMavenOpts(String opts)
+ public SurefireLauncher setMavenOpts( String opts )
{
return addEnvVar( "MAVEN_OPTS", opts );
}
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 f7f05f7..d6aefa3 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
@@ -50,7 +50,7 @@ public class TestFile
public TestFile( File file, OutputValidator surefireVerifier )
{
- this( file, defaultCharset(), surefireVerifier);
+ this( file, defaultCharset(), surefireVerifier );
}
public TestFile( File file, Charset charset, OutputValidator surefireVerifier )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1004RunTestFromDependencyJarsTypeAndClassifierIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1004RunTestFromDependencyJarsTypeAndClassifierIT.java
index d0f7aa6..ffc05b2 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1004RunTestFromDependencyJarsTypeAndClassifierIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1004RunTestFromDependencyJarsTypeAndClassifierIT.java
@@ -19,7 +19,7 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
import java.util.Collection;
@@ -28,21 +28,22 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
-public class Surefire1004RunTestFromDependencyJarsTypeAndClassifierIT
- extends SurefireJUnit4IntegrationTestCase
+/**
+ *
+ */
+public class Surefire1004RunTestFromDependencyJarsTypeAndClassifierIT extends SurefireJUnit4IntegrationTestCase
{
-
+
@Test
- public void shouldScanAndRunTestsInDependencyJars()
- throws Exception
+ public void shouldScanAndRunTestsInDependencyJars() throws Exception
{
SurefireLauncher launcher = unpack( "surefire-1004-RunTestFromDependencyJarsTypeAndClassifier" );
- launcher.addGoal("test").addGoal("install");
+ launcher.addGoal( "test" ).addGoal( "install" );
OutputValidator wholeExecValidator = launcher.executeCurrentGoals();
wholeExecValidator.verifyErrorFreeLog();
- OutputValidator module1 = launcher.getSubProjectValidator("surefire-1004-module1");
- module1.assertTestSuiteResults(3, 0, 0, 0);
+ OutputValidator module1 = launcher.getSubProjectValidator( "surefire-1004-module1" );
+ module1.assertTestSuiteResults( 3, 0, 0, 0 );
// Tests from dependencies
wholeExecValidator.verifyTextInLog( "Running org.acme.tests.TestA" );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1024VerifyFailsafeIfTestedIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1024VerifyFailsafeIfTestedIT.java
index 886cd07..9db5da8 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1024VerifyFailsafeIfTestedIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1024VerifyFailsafeIfTestedIT.java
@@ -37,7 +37,8 @@ public class Surefire1024VerifyFailsafeIfTestedIT
{
@Test
- public void shouldScanAndRunTestsInDependencyJars() throws Exception {
+ public void shouldScanAndRunTestsInDependencyJars() throws Exception
+ {
SurefireLauncher launcher = unpack( "surefire-1024" );
launcher.executeVerify()
.verifyTextInLog( "class jiras.surefire1024.A1IT#test() dependency to scan" );
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 0d6d8b6..d4e7328 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
@@ -30,7 +30,9 @@ import org.junit.Test;
import java.io.FileNotFoundException;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
/**
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1041FailingJUnitRunnerIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1041FailingJUnitRunnerIT.java
index bb65682..8c23d75 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1041FailingJUnitRunnerIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1041FailingJUnitRunnerIT.java
@@ -33,6 +33,9 @@ public class Surefire1041FailingJUnitRunnerIT
@Test
public void reportErrorInJUnitRunnerAsTestError()
{
- unpack( "surefire-1041-exception-in-junit-runner" ).mavenTestFailureIgnore( true ).executeTest().assertTestSuiteResults( 1, 1, 0, 0 );
+ unpack( "surefire-1041-exception-in-junit-runner" )
+ .mavenTestFailureIgnore( true )
+ .executeTest()
+ .assertTestSuiteResults( 1, 1, 0, 0 );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1055CorrectConcurrentTestCountIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1055CorrectConcurrentTestCountIT.java
index 0293a75..9326b36 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1055CorrectConcurrentTestCountIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1055CorrectConcurrentTestCountIT.java
@@ -28,6 +28,7 @@ import org.junit.Test;
*
* @author Kristian Rosenvold
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire1055CorrectConcurrentTestCountIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1095NpeInRunListener.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1095NpeInRunListener.java
index f894265..d120d41 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1095NpeInRunListener.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1095NpeInRunListener.java
@@ -23,7 +23,7 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
-@SuppressWarnings( { "javadoc", "checkstyle:javadoctype" } )
+@SuppressWarnings( { "javadoc", "checkstyle:javadoctype", "checkstyle:linelength" } )
/**
*
* In the surefire plugin, it is possible to specify one or more RunListener when running tests with JUnit.
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1098BalancedRunOrderIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1098BalancedRunOrderIT.java
index 9a1fd11..f50bb8e 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1098BalancedRunOrderIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1098BalancedRunOrderIT.java
@@ -36,11 +36,8 @@ import static org.hamcrest.core.AnyOf.anyOf;
/**
* The purpose of this IT is to assert that the run order of test classes is according to the settings:<br>
- *
- * runOrder=balanced<br>
- * parallel=classes<br>
- * threadCount=2<br>
- * perCoreThreadCount=false<br>
+ * <p>
+ * runOrder=balanced<br> parallel=classes<br> threadCount=2<br> perCoreThreadCount=false<br>
* <br>
* The list of tests should be reordered to (DTest, CTest, BTest, ATest) in the second run.
*
@@ -48,28 +45,23 @@ import static org.hamcrest.core.AnyOf.anyOf;
* @see <a href="https://issues.apache.org/jira/browse/SUREFIRE-1098">SUREFIRE-1098</a>
* @since 2.18
*/
-public class Surefire1098BalancedRunOrderIT
- extends SurefireJUnit4IntegrationTestCase
+public class Surefire1098BalancedRunOrderIT extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void reorderedParallelClasses()
- throws VerificationException
+ public void reorderedParallelClasses() throws VerificationException
{
SurefireLauncher launcher = unpack();
launcher
- // .runOrder( "balanced" ) call it in 3.x and remove it in surefire-1098-balanced-runorder/pom.xml
- // as soon as there is prefix available "failsafe" and "surefire" in system property for this parameter.
- .parallelClasses().threadCount( 2 ).disablePerCoreThreadCount()
- .executeTest().verifyErrorFree( 4 );
+ // .runOrder( "balanced" ) call it in 3.x and remove it in surefire-1098-balanced-runorder/pom.xml
+ // as soon as there is prefix available "failsafe" and "surefire" in system property for this parameter.
+ .parallelClasses().threadCount( 2 ).disablePerCoreThreadCount().executeTest().verifyErrorFree( 4 );
- OutputValidator validator =
- launcher
+ OutputValidator validator = launcher
// .runOrder( "balanced" ) call it in 3.x and remove it in surefire-1098-balanced-runorder/pom.xml
// as soon as there is prefix available "failsafe" and "surefire" in system property for this parameter.
- .parallelClasses().threadCount( 2 ).disablePerCoreThreadCount()
- .executeTest().verifyErrorFree( 4 );
+ .parallelClasses().threadCount( 2 ).disablePerCoreThreadCount().executeTest().verifyErrorFree( 4 );
List<String> log = printOnlyTestLines( validator );
assertThat( log.size(), is( 4 ) );
@@ -91,28 +83,29 @@ public class Surefire1098BalancedRunOrderIT
return unpack( "surefire-1098-balanced-runorder" );
}
- private static List<String> printOnlyTestLines( OutputValidator validator )
- throws VerificationException
+ private static List<String> printOnlyTestLines( OutputValidator validator ) throws VerificationException
{
List<String> log = new ArrayList<>( validator.loadLogLines() );
- for ( Iterator<String> it = log.iterator(); it.hasNext(); ) {
+ for ( Iterator<String> it = log.iterator(); it.hasNext(); )
+ {
String line = it.next();
- if ( !line.startsWith( "class jiras.surefire1098." ) ) {
+ if ( !line.startsWith( "class jiras.surefire1098." ) )
+ {
it.remove();
}
}
return log;
}
- private static int[] extractThreadPoolIds(String logLine)
+ private static int[] extractThreadPoolIds( String logLine )
{
//Example to parse "class jiras.surefire1098.DTest pool-2-thread-1" into {2, 1}.
String t = logLine.split( " " )[2];
String[] ids = t.split( "-" );
- return new int[]{ Integer.parseInt( ids[1] ), Integer.parseInt( ids[3] )};
+ return new int[] {Integer.parseInt( ids[1] ), Integer.parseInt( ids[3] )};
}
- private String testLine(String test, int pool, int thread)
+ private String testLine( String test, int pool, int thread )
{
return String.format( "class jiras.surefire1098.%sTest pool-%d-thread-%d", test, pool, thread );
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1135ImproveIgnoreMessageForTestNGIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1135ImproveIgnoreMessageForTestNGIT.java
index f7324c9..fe1ec8f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1135ImproveIgnoreMessageForTestNGIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1135ImproveIgnoreMessageForTestNGIT.java
@@ -20,7 +20,11 @@ package org.apache.maven.surefire.its.jiras;
*/
import static org.apache.maven.shared.utils.xml.Xpp3DomBuilder.build;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.arrayWithSize;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.isEmptyOrNullString;
+import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import java.io.FileNotFoundException;
@@ -36,72 +40,72 @@ import org.junit.Test;
*
* @author <a href="mailto:michal.bocek@gmail.com">Michal Bocek</a>
*/
-public class Surefire1135ImproveIgnoreMessageForTestNGIT
- extends SurefireJUnit4IntegrationTestCase
+public class Surefire1135ImproveIgnoreMessageForTestNGIT extends SurefireJUnit4IntegrationTestCase
{
private enum ResultType
{
- SKIPPED( "skipped" ), FAILURE( "failure" );
+ SKIPPED( "skipped" ),
+ FAILURE( "failure" );
private final String type;
- ResultType(String type)
+ ResultType( String type )
{
this.type = type;
}
- public String getType() {
+ public String getType()
+ {
return type;
}
}
@Test
- public void testNgReport688() throws Exception {
- testNgReport( "6.8.8", null, ResultType.SKIPPED,
- "Skip test",
- /*"org.testng.SkipException"*/ null,
- /*"SkipExceptionReportTest.java:30"*/ null );
+ public void testNgReport688() throws Exception
+ {
+ testNgReport( "6.8.8", null, ResultType.SKIPPED, "Skip test",
+ /*"org.testng.SkipException"*/ null,
+ /*"SkipExceptionReportTest.java:30"*/ null );
}
@Test
- public void testNgReport57() throws Exception {
- testNgReport( "5.7", "jdk15", ResultType.SKIPPED,
- "Skip test",
- /*"org.testng.SkipException"*/ null,
- /*"SkipExceptionReportTest.java:30"*/ null );
+ public void testNgReport57() throws Exception
+ {
+ testNgReport( "5.7", "jdk15", ResultType.SKIPPED, "Skip test",
+ /*"org.testng.SkipException"*/ null,
+ /*"SkipExceptionReportTest.java:30"*/ null );
}
private void testNgReport( String version, String classifier, ResultType resultType, String message, String type,
- String stackTrace )
- throws Exception
+ String stackTrace ) throws Exception
{
- OutputValidator outputValidator =
- runTest( version, classifier, resultType, "/surefire-1135-improve-ignore-message-for-testng" );
+ OutputValidator outputValidator = runTest( version, classifier, resultType,
+ "/surefire-1135-improve-ignore-message-for-testng" );
Xpp3Dom[] children = readTests( outputValidator, "testng.SkipExceptionReportTest" );
assertThat( "Report should contains only one test case", children.length, is( 1 ) );
Xpp3Dom test = children[0];
assertThat( "Not expected classname", test.getAttribute( "classname" ),
- is( "testng.SkipExceptionReportTest" ) );
+ is( "testng.SkipExceptionReportTest" ) );
assertThat( "Not expected test name", test.getAttribute( "name" ), is( "testSkipException" ) );
children = test.getChildren( resultType.getType() );
assertThat( "Test should contains only one " + resultType.getType() + " element", children,
- is( arrayWithSize( 1 ) ) );
+ is( arrayWithSize( 1 ) ) );
Xpp3Dom result = children[0];
if ( message == null )
{
assertThat( "Subelement message attribute must be null", result.getAttribute( "message" ),
- is( nullValue() ) );
+ is( nullValue() ) );
}
else
{
assertThat( "Subelement should contains message attribute", result.getAttribute( "message" ),
- is( message ) );
+ is( message ) );
}
if ( type == null )
@@ -115,7 +119,7 @@ public class Surefire1135ImproveIgnoreMessageForTestNGIT
if ( stackTrace == null )
{
- assertThat( "Element body must be null", result.getValue() , isEmptyOrNullString() );
+ assertThat( "Element body must be null", result.getValue(), isEmptyOrNullString() );
}
else
{
@@ -135,18 +139,13 @@ public class Surefire1135ImproveIgnoreMessageForTestNGIT
launcher.sysProp( "testNgClassifier", classifier );
}
- return launcher.addSurefireReportGoal()
- .executeCurrentGoals()
- .assertTestSuiteResults( 1, 0, failure, skipped );
+ return launcher.addSurefireReportGoal().executeCurrentGoals().assertTestSuiteResults( 1, 0, failure, skipped );
}
- private static Xpp3Dom[] readTests( OutputValidator validator, String className )
- throws FileNotFoundException
+ private static Xpp3Dom[] readTests( OutputValidator validator, String className ) throws FileNotFoundException
{
- Xpp3Dom testResult =
- build( validator.getSurefireReportsXmlFile( "TEST-" + className + ".xml" ).getFileInputStream(),
- "UTF-8"
- );
+ Xpp3Dom testResult = build(
+ validator.getSurefireReportsXmlFile( "TEST-" + className + ".xml" ).getFileInputStream(), "UTF-8" );
return testResult.getChildren( "testcase" );
}
}
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 d81d7c2..08197ad 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
@@ -37,6 +37,7 @@ import static org.hamcrest.Matchers.is;
*
* @author <a href="mailto:eloussi2@illinois.edu">Lamyaa Eloussi</a>
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire1144XmlRunTimeIT
extends SurefireJUnit4IntegrationTestCase
{
@@ -52,7 +53,7 @@ public class Surefire1144XmlRunTimeIT
ReportTestSuite report = reports.get( 0 );
float xmlTime = report.getTimeElapsed();
- assertThat( xmlTime, is(greaterThanOrEqualTo( 1.6f ) ) ); //include beforeClass and afterClass
+ assertThat( xmlTime, is( greaterThanOrEqualTo( 1.6f ) ) ); //include beforeClass and afterClass
outputValidator.verifyTextInLog( Float.toString( xmlTime ) ); //same time in console
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1146RerunFailedAndParameterized.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1146RerunFailedAndParameterized.java
index f78c16a..3a5fa8c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1146RerunFailedAndParameterized.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1146RerunFailedAndParameterized.java
@@ -34,9 +34,10 @@ public class Surefire1146RerunFailedAndParameterized
public void testsAreRerun()
{
OutputValidator outputValidator = unpack( "surefire-1146-rerunFailingTests-with-Parameterized" ).executeTest();
- verify(outputValidator, 8, 0, 0, 0, 5);
+ verify( outputValidator, 8, 0, 0, 0, 5 );
}
+ @SuppressWarnings( "checkstyle:linelength" )
private void verify( OutputValidator outputValidator, int run, int failures, int errors, int skipped, int flakes )
{
outputValidator.verifyTextInLog( "Flakes:" );
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1152RerunFailingTestsInSuiteIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1152RerunFailingTestsInSuiteIT.java
index ded2361..b32129a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1152RerunFailingTestsInSuiteIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1152RerunFailingTestsInSuiteIT.java
@@ -29,15 +29,14 @@ import org.junit.Test;
*
* @author Sean Flanigan
*/
-public class Surefire1152RerunFailingTestsInSuiteIT
- extends SurefireJUnit4IntegrationTestCase
+public class Surefire1152RerunFailingTestsInSuiteIT extends SurefireJUnit4IntegrationTestCase
{
private static final String RUNNING_WITH_PROVIDER47 =
- "Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider";
+ "Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider";
private OutputValidator runMethodPattern( String... goals )
{
- SurefireLauncher launcher = unpack("surefire-1152-rerunFailingTestsCount-suite" );
+ SurefireLauncher launcher = unpack( "surefire-1152-rerunFailingTestsCount-suite" );
for ( String goal : goals )
{
launcher.addGoal( goal );
@@ -51,14 +50,12 @@ public class Surefire1152RerunFailingTestsInSuiteIT
@Test
public void testJUnit48Provider4()
{
- runMethodPattern("-P surefire-junit4" );
+ runMethodPattern( "-P surefire-junit4" );
}
@Test
public void testJUnit48Provider47()
{
- runMethodPattern("-P surefire-junit47" )
- .verifyTextInLog( RUNNING_WITH_PROVIDER47 );
+ runMethodPattern( "-P surefire-junit47" ).verifyTextInLog( RUNNING_WITH_PROVIDER47 );
}
-
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1153IncludesAndSpecifiedTestIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1153IncludesAndSpecifiedTestIT.java
index 3a2c826..f60a878 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1153IncludesAndSpecifiedTestIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1153IncludesAndSpecifiedTestIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -22,6 +23,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire1153IncludesAndSpecifiedTestIT
extends SurefireJUnit4IntegrationTestCase
{
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 36f4628..0b236e1 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
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -27,11 +28,11 @@ import org.junit.runner.RunWith;
import java.util.ArrayList;
import static org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase.unpack;
-import static org.junit.runners.Parameterized.*;
-import static org.junit.Assert.*;
+import static org.junit.runners.Parameterized.Parameter;
+import static org.junit.runners.Parameterized.Parameters;
+import static org.junit.Assert.fail;
/**
- *
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
* @see <a href="https://issues.apache.org/jira/browse/SUREFIRE-1158">SUREFIRE-1158</a>
* @since 2.19
@@ -40,40 +41,45 @@ import static org.junit.Assert.*;
public class Surefire1158RemoveInfoLinesIT
{
- @Parameters(name = "{0}")
+ @Parameters( name = "{0}" )
public static Iterable<Object[]> data()
{
ArrayList<Object[]> args = new ArrayList<>();
- args.add( new Object[] { "junit-option-ff", "JUnitTest", "-ff", "surefire-junit47", false, true } );
- args.add( new Object[] { "testng-option-ff", "TestNGSuiteTest", "-ff", "surefire-testng", false, false } );
- args.add( new Object[] { "junit-option-X", "JUnitTest", "-X", "surefire-junit47", true, true } );
- args.add( new Object[] { "testng-option-X", "TestNGSuiteTest", "-X", "surefire-testng", true, false } );
- args.add( new Object[] { "junit-option-e", "JUnitTest", "-e", "surefire-junit47", true, true } );
- args.add( new Object[] { "testng-option-e", "TestNGSuiteTest", "-e", "surefire-testng", true, false } );
+ args.add( new Object[] {"junit-option-ff", "JUnitTest", "-ff", "surefire-junit47", false, true} );
+ args.add( new Object[] {"testng-option-ff", "TestNGSuiteTest", "-ff", "surefire-testng", false, false} );
+ args.add( new Object[] {"junit-option-X", "JUnitTest", "-X", "surefire-junit47", true, true} );
+ args.add( new Object[] {"testng-option-X", "TestNGSuiteTest", "-X", "surefire-testng", true, false} );
+ args.add( new Object[] {"junit-option-e", "JUnitTest", "-e", "surefire-junit47", true, true} );
+ args.add( new Object[] {"testng-option-e", "TestNGSuiteTest", "-e", "surefire-testng", true, false} );
return args;
}
- @Parameter(0)
+ @Parameter( 0 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String description;
- @Parameter(1)
+ @Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String testToRun;
- @Parameter(2)
+ @Parameter( 2 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String cliOption;
- @Parameter(3)
+ @Parameter( 3 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String provider;
- @Parameter(4)
+ @Parameter( 4 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public boolean printsInfoLines;
- @Parameter(5)
+ @Parameter( 5 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public boolean isJUnit;
@Test
- public void shouldRunWithCliOption()
- throws Exception
+ public void shouldRunWithCliOption() throws Exception
{
OutputValidator validator = assertTest();
if ( isJUnit )
@@ -86,14 +92,12 @@ public class Surefire1158RemoveInfoLinesIT
}
}
- private OutputValidator assertTest()
- throws Exception
+ private OutputValidator assertTest() throws Exception
{
final String[] cli = {"--batch-mode"};
- return unpack( getClass(), "/surefire-1158-remove-info-lines", "_" + description, cli )
- .sysProp( "provider", provider ).addGoal( cliOption ).setTestToRun( testToRun )
- .executeTest()
- .verifyErrorFreeLog().assertTestSuiteResults( 1, 0, 0, 0 );
+ return unpack( getClass(), "/surefire-1158-remove-info-lines", "_" + description, cli ).sysProp( "provider",
+ provider ).addGoal( cliOption ).setTestToRun(
+ testToRun ).executeTest().verifyErrorFreeLog().assertTestSuiteResults( 1, 0, 0, 0 );
}
private void assertJUnitTestLogs( OutputValidator validator )
@@ -101,10 +105,11 @@ public class Surefire1158RemoveInfoLinesIT
try
{
validator.verifyTextInLog( "Surefire report directory:" );
- validator.verifyTextInLog( "Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider" );
+ validator.verifyTextInLog(
+ "Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider" );
validator.verifyTextInLog( "parallel='none', perCoreThreadCount=true, threadCount=0, "
- + "useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0, "
- + "threadCountMethods=0, parallelOptimized=true" );
+ + "useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0, "
+ + "threadCountMethods=0, parallelOptimized=true" );
if ( !printsInfoLines )
{
fail();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1209RerunAndForkCountIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1209RerunAndForkCountIT.java
index 1b5130f..696e0ac 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1209RerunAndForkCountIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1209RerunAndForkCountIT.java
@@ -22,10 +22,10 @@ package org.apache.maven.surefire.its.jiras;
import org.apache.maven.it.VerificationException;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
-import org.hamcrest.CoreMatchers;
import org.junit.Test;
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.containsString;
/**
* @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
@@ -38,14 +38,16 @@ public class Surefire1209RerunAndForkCountIT
private static final String SUMMARY_COUNTS = "Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Flakes: 2";
@Test
- public void reusableForksJUnit47() throws VerificationException {
+ public void reusableForksJUnit47() throws VerificationException
+ {
unpack().executeTest()
.assertTestSuiteResults( 5, 0, 0, 0, 4 )
.assertThatLogLine( containsString( SUMMARY_COUNTS ), is( 1 ) );
}
@Test
- public void notReusableForksJUnit47() throws VerificationException {
+ public void notReusableForksJUnit47() throws VerificationException
+ {
unpack().reuseForks( false )
.executeTest()
.assertTestSuiteResults( 5, 0, 0, 0, 4 )
@@ -53,7 +55,8 @@ public class Surefire1209RerunAndForkCountIT
}
@Test
- public void reusableForksJUnit4() throws VerificationException {
+ public void reusableForksJUnit4() throws VerificationException
+ {
unpack().activateProfile( "junit4" )
.executeTest()
.assertTestSuiteResults( 5, 0, 0, 0, 4 )
@@ -62,7 +65,8 @@ public class Surefire1209RerunAndForkCountIT
@Test
public void notReusableForksJUnit4()
- throws VerificationException {
+ throws VerificationException
+ {
unpack().activateProfile( "junit4" )
.reuseForks( false )
.executeTest()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java
index c4031c2..640c551 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1260NewTestsPattern.java
@@ -19,7 +19,8 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
/**
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
index 41a2964..9f6798c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java
@@ -55,6 +55,9 @@ import static org.junit.Assume.assumeTrue;
public class Surefire1295AttributeJvmCrashesToTestsIT
extends SurefireJUnit4IntegrationTestCase
{
+ /**
+ *
+ */
public enum ForkMode
{
DEFAULT,
@@ -65,7 +68,7 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
@Parameters
public static Iterable<Object[]> parameters()
{
- return asList(new Object[][] {
+ return asList( new Object[][] {
// exit() does not stop all Threads immediately,
// see https://github.com/michaeltandy/crashjvm/issues/1
{ "exit", DEFAULT },
@@ -77,13 +80,15 @@ public class Surefire1295AttributeJvmCrashesToTestsIT
{ "segfault", DEFAULT },
{ "segfault", ONE_FORK_NO_REUSE },
{ "segfault", ONE_FORK_REUSE }
- });
+ } );
}
@Parameter( 0 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String crashStyle;
@Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public ForkMode forkStyle;
@Test
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java
index 48564fb..5d05c12 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java
@@ -31,22 +31,16 @@ import static org.fest.assertions.Assertions.assertThat;
* @see <a href="https://issues.apache.org/jira/browse/SUREFIRE-1367">SUREFIRE-1367</a>
* @since 2.20.1
*/
-public class Surefire1367AssumptionLogsIT
- extends SurefireJUnit4IntegrationTestCase
+public class Surefire1367AssumptionLogsIT extends SurefireJUnit4IntegrationTestCase
{
private static final String NL = System.getProperty( "line.separator" );
@Test
public void shouldSeeLogsParallelForked()
{
- OutputValidator outputValidator = unpack().setForkJvm()
- .forkMode( "once" )
- .parallelClassesAndMethods()
- .disablePerCoreThreadCount()
- .threadCountClasses( 2 )
- .threadCountMethods( 2 )
- .executeTest()
- .assertTestSuiteResults( 2, 0, 0, 2 );
+ OutputValidator outputValidator = unpack().setForkJvm().forkMode(
+ "once" ).parallelClassesAndMethods().disablePerCoreThreadCount().threadCountClasses(
+ 2 ).threadCountMethods( 2 ).executeTest().assertTestSuiteResults( 2, 0, 0, 2 );
verifyReportA( outputValidator );
verifyReportB( outputValidator );
@@ -55,14 +49,9 @@ public class Surefire1367AssumptionLogsIT
@Test
public void shouldSeeLogsParallelInPlugin()
{
- OutputValidator outputValidator = unpack().setForkJvm()
- .forkMode( "never" )
- .parallelClassesAndMethods()
- .disablePerCoreThreadCount()
- .threadCountClasses( 2 )
- .threadCountMethods( 2 )
- .executeTest()
- .assertTestSuiteResults( 2, 0, 0, 2 );
+ OutputValidator outputValidator = unpack().setForkJvm().forkMode(
+ "never" ).parallelClassesAndMethods().disablePerCoreThreadCount().threadCountClasses(
+ 2 ).threadCountMethods( 2 ).executeTest().assertTestSuiteResults( 2, 0, 0, 2 );
verifyReportA( outputValidator );
verifyReportB( outputValidator );
@@ -71,10 +60,8 @@ public class Surefire1367AssumptionLogsIT
@Test
public void shouldSeeLogsForked()
{
- OutputValidator outputValidator = unpack().setForkJvm()
- .forkMode( "once" )
- .executeTest()
- .assertTestSuiteResults( 2, 0, 0, 2 );
+ OutputValidator outputValidator = unpack().setForkJvm().forkMode( "once" ).executeTest().assertTestSuiteResults(
+ 2, 0, 0, 2 );
verifyReportA( outputValidator );
verifyReportB( outputValidator );
@@ -83,10 +70,8 @@ public class Surefire1367AssumptionLogsIT
@Test
public void shouldSeeLogsInPlugin()
{
- OutputValidator outputValidator = unpack().setForkJvm()
- .forkMode( "never" )
- .executeTest()
- .assertTestSuiteResults( 2, 0, 0, 2 );
+ OutputValidator outputValidator = unpack().setForkJvm().forkMode(
+ "never" ).executeTest().assertTestSuiteResults( 2, 0, 0, 2 );
verifyReportA( outputValidator );
verifyReportB( outputValidator );
@@ -100,58 +85,34 @@ public class Surefire1367AssumptionLogsIT
private void verifyReportA( OutputValidator outputValidator )
{
- String xmlReport = outputValidator.getSurefireReportsXmlFile( "TEST-ATest.xml" )
- .readFileToString();
-
- String outputCData = "<system-out><![CDATA[Hi" + NL +
- NL +
- "There!" + NL +
- "]]></system-out>" + NL +
- " <system-err><![CDATA[Hello" + NL +
- NL +
- "What's up!" + NL +
- "]]></system-err>";
-
- assertThat( xmlReport )
- .contains( outputCData );
-
-
- String output = outputValidator.getSurefireReportsFile( "ATest-output.txt" )
- .readFileToString();
-
- String outputExpected = "Hi" + NL +
- NL +
- "There!" + NL +
- "Hello" + NL +
- NL +
- "What's up!" + NL;
-
- assertThat( output )
- .isEqualTo( outputExpected );
+ String xmlReport = outputValidator.getSurefireReportsXmlFile( "TEST-ATest.xml" ).readFileToString();
+
+ String outputCData = "<system-out><![CDATA[Hi" + NL + NL + "There!" + NL + "]]></system-out>" + NL + " "
+ + "<system-err><![CDATA[Hello" + NL + NL + "What's up!" + NL + "]]></system-err>";
+
+ assertThat( xmlReport ).contains( outputCData );
+
+
+ String output = outputValidator.getSurefireReportsFile( "ATest-output.txt" ).readFileToString();
+
+ String outputExpected = "Hi" + NL + NL + "There!" + NL + "Hello" + NL + NL + "What's up!" + NL;
+
+ assertThat( output ).isEqualTo( outputExpected );
}
private void verifyReportB( OutputValidator outputValidator )
{
- String xmlReport = outputValidator.getSurefireReportsXmlFile( "TEST-BTest.xml" )
- .readFileToString();
+ String xmlReport = outputValidator.getSurefireReportsXmlFile( "TEST-BTest.xml" ).readFileToString();
- String outputCData = "<system-out><![CDATA[Hey" + NL +
- NL +
- "you!" + NL +
- "]]></system-out>";
+ String outputCData = "<system-out><![CDATA[Hey" + NL + NL + "you!" + NL + "]]></system-out>";
- assertThat( xmlReport )
- .contains( outputCData );
+ assertThat( xmlReport ).contains( outputCData );
- String output = outputValidator.getSurefireReportsFile( "BTest-output.txt" )
- .readFileToString();
+ String output = outputValidator.getSurefireReportsFile( "BTest-output.txt" ).readFileToString();
- String outputExpected = "Hey" + NL +
- NL +
- "you!" + NL;
+ String outputExpected = "Hey" + NL + NL + "you!" + NL;
- assertThat( output )
- .isEqualTo( outputExpected );
+ assertThat( output ).isEqualTo( outputExpected );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java
index 60b372f..e0ed72a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1396CustomProviderClassPathIT.java
@@ -32,7 +32,9 @@ public class Surefire1396CustomProviderClassPathIT
@BeforeClass
public static void installProvider()
{
- unpack( Surefire1396CustomProviderClassPathIT.class, "surefire-1396-pluggableproviders-classpath-provider", "prov" ).executeInstall();
+ unpack( Surefire1396CustomProviderClassPathIT.class,
+ "surefire-1396-pluggableproviders-classpath-provider", "prov" )
+ .executeInstall();
}
@Test
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java
index 80c82b2..cce0000 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java
@@ -135,7 +135,7 @@ public class Surefire141PluggableProvidersIT
{
return name.endsWith( "-jvmRun1.dump" );
}
- });
+ } ) ;
assertThat( dumpFiles )
.isNotNull()
.isNotEmpty();
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 676785a..23df035 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
@@ -29,6 +29,9 @@ import java.io.IOException;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertTrue;
+/**
+ *
+ */
public class Surefire1534ReuseForksFalseWithJavaModuleIT
extends AbstractJigsawIT
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java
index 9a8025f..9d44fff 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java
@@ -32,11 +32,16 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.fest.assertions.Assertions.assertThat;
+/**
+ *
+ */
public class Surefire1535TestNGParallelSuitesIT
extends SurefireJUnit4IntegrationTestCase
{
- private static final String TEST_RESULT_1 = platformEncoding( "Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, " );
- private static final String TEST_RESULT_2 = platformEncoding( "Tests run: 2, Failures: 0, Errors: 0, Skipped: 0" );
+ private static final String TEST_RESULT_1 =
+ platformEncoding( "Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, " );
+ private static final String TEST_RESULT_2 =
+ platformEncoding( "Tests run: 2, Failures: 0, Errors: 0, Skipped: 0" );
private static final String SUITE1 = platformEncoding( "Suite1" );
private static final String SUITE2 = platformEncoding( "Suite2" );
private static final String TEST1 = platformEncoding( "test 1" );
@@ -190,7 +195,7 @@ public class Surefire1535TestNGParallelSuitesIT
private SurefireLauncher unpack()
{
- return unpack("/surefire-1535-parallel-testng");
+ return unpack( "/surefire-1535-parallel-testng" );
}
private static String platformEncoding( String text )
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1585IT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1585IT.java
index 12e175f..cad464c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1585IT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1585IT.java
@@ -25,6 +25,10 @@ import org.junit.Test;
import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion;
+/**
+ *
+ */
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire1585IT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire162CharsetProviderIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire162CharsetProviderIT.java
index e13483a..8d6a540 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire162CharsetProviderIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire162CharsetProviderIT.java
@@ -21,7 +21,10 @@ package org.apache.maven.surefire.its.jiras;
import java.io.File;
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.MavenLauncher;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.codehaus.plexus.util.FileUtils;
import org.junit.Test;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire224WellFormedXmlFailuresIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire224WellFormedXmlFailuresIT.java
index 1bdb3cb..b278c7a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire224WellFormedXmlFailuresIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire224WellFormedXmlFailuresIT.java
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertEquals;
public class Surefire224WellFormedXmlFailuresIT
extends SurefireJUnit4IntegrationTestCase
{
- @SuppressWarnings("ConstantConditions")
+ @SuppressWarnings( "ConstantConditions" )
@Test
public void testWellFormedXmlFailures()
{
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 2796b92..3fd4fb3 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
@@ -27,15 +27,13 @@ import org.junit.Test;
*
* @author Kristian Rosenvold
*/
-public class Surefire257NotRerunningTestsIT
- extends SurefireJUnit4IntegrationTestCase
+public class Surefire257NotRerunningTestsIT extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void shouldNotRerun()
- throws Exception
+ public void shouldNotRerun() throws Exception
{
- unpack(
- "/surefire-257-rerunningTests" ).addSurefireReportGoal().addSurefireReportGoal().executeCurrentGoals().verifyTextInLog(
- "Skipping execution of surefire because it has already been run for this configuration" );
+ unpack( "/surefire-257-rerunningTests" )
+ .addSurefireReportGoal().addSurefireReportGoal().executeCurrentGoals().verifyTextInLog(
+ "Skipping execution of surefire because it has already been run for this configuration" );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire260TestWithIdenticalNamesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire260TestWithIdenticalNamesIT.java
index b4c2678..85bafc5 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire260TestWithIdenticalNamesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire260TestWithIdenticalNamesIT.java
@@ -22,7 +22,9 @@ package org.apache.maven.surefire.its.jiras;
import java.io.IOException;
import java.net.URI;
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.TestFile;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
@@ -40,6 +42,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Kristian Rosenvold
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire260TestWithIdenticalNamesIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire569RunTestFromDependencyJarsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire569RunTestFromDependencyJarsIT.java
index 3e53cca..a46483c 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire569RunTestFromDependencyJarsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire569RunTestFromDependencyJarsIT.java
@@ -29,16 +29,17 @@ import org.junit.Test;
*
* @author Aslak Knutsen
*/
-public class Surefire569RunTestFromDependencyJarsIT
- extends SurefireJUnit4IntegrationTestCase {
+public class Surefire569RunTestFromDependencyJarsIT extends SurefireJUnit4IntegrationTestCase
+{
- @Test
- public void shouldScanAndRunTestsInDependencyJars() throws Exception {
- SurefireLauncher launcher = unpack( "surefire-569-RunTestFromDependencyJars" );
- launcher.addGoal("test").addGoal("install");
- launcher.executeCurrentGoals();
+ @Test
+ public void shouldScanAndRunTestsInDependencyJars() throws Exception
+ {
+ SurefireLauncher launcher = unpack( "surefire-569-RunTestFromDependencyJars" );
+ launcher.addGoal( "test" ).addGoal( "install" );
+ launcher.executeCurrentGoals();
- OutputValidator module1 = launcher.getSubProjectValidator("module1");
- module1.assertTestSuiteResults(1, 0, 0, 0);
- }
+ OutputValidator module1 = launcher.getSubProjectValidator( "module1" );
+ module1.assertTestSuiteResults( 1, 0, 0, 0 );
+ }
}
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 a9b437e..e188c8a 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
@@ -19,7 +19,10 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
/**
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire613TestCountInParallelIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire613TestCountInParallelIT.java
index 7b74409..9653693 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire613TestCountInParallelIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire613TestCountInParallelIT.java
@@ -28,6 +28,7 @@ import org.junit.Test;
*
* @author Kristian Rosenvold
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire613TestCountInParallelIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire649EmptyStringSystemPropertiesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire649EmptyStringSystemPropertiesIT.java
index d6f0a0e..7326244 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire649EmptyStringSystemPropertiesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire649EmptyStringSystemPropertiesIT.java
@@ -32,13 +32,11 @@ import static org.junit.Assert.fail;
* @see <a href="https://issues.apache.org/jira/browse/SUREFIRE-649">SUREFIRE-649</a>
* @since 2.18
*/
-public class Surefire649EmptyStringSystemPropertiesIT
- extends SurefireJUnit4IntegrationTestCase
+public class Surefire649EmptyStringSystemPropertiesIT extends SurefireJUnit4IntegrationTestCase
{
@Test
- public void systemProperties()
- throws VerificationException
+ public void systemProperties() throws VerificationException
{
SurefireLauncher launcher = unpack1();
@@ -51,12 +49,11 @@ public class Surefire649EmptyStringSystemPropertiesIT
return;
}
}
- fail("Could not find text in log: emptyProperty=''");
+ fail( "Could not find text in log: emptyProperty=''" );
}
@Test
- public void systemPropertyVariables()
- throws VerificationException
+ public void systemPropertyVariables() throws VerificationException
{
SurefireLauncher launcher = unpack2();
@@ -69,7 +66,7 @@ public class Surefire649EmptyStringSystemPropertiesIT
return;
}
}
- fail("Could not find text in log: emptyProperty=''");
+ fail( "Could not find text in log: emptyProperty=''" );
}
private SurefireLauncher unpack1()
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java
index e1a258a..b29bfd0 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire705ParallelForkTimeoutIT.java
@@ -27,14 +27,14 @@ import org.junit.Test;
*
* @author Kristian Rosenvold
*/
-public class Surefire705ParallelForkTimeoutIT
- extends SurefireJUnit4IntegrationTestCase
+public class Surefire705ParallelForkTimeoutIT extends SurefireJUnit4IntegrationTestCase
{
@Test
public void testTimeoutForked()
{
unpack( "/fork-timeout" ).setJUnitVersion( "4.8.1" ).addGoal( "-Djunit.version=4.8.1" ).addGoal(
- "-Djunit.parallel=classes" ).addGoal( "-DtimeOut=1" ).maven().withFailure().executeTest()
- .verifyTextInLog( "There was a timeout or other error in the fork" );
+ "-Djunit.parallel=classes" ).addGoal(
+ "-DtimeOut=1" ).maven().withFailure().executeTest().verifyTextInLog(
+ "There was a timeout or other error in the fork" );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java
index 1eab676..77751fe 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire747MethodParallelWithSuiteCountIT.java
@@ -45,6 +45,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Kristian Rosenvold
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire747MethodParallelWithSuiteCountIT
extends SurefireJUnit4IntegrationTestCase
{
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 96d31c1..67329d7 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
@@ -19,7 +19,10 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
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 af18336..98dd512 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
@@ -21,7 +21,10 @@ package org.apache.maven.surefire.its.jiras;
import java.io.IOException;
import org.apache.maven.it.VerificationException;
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java
index a709f7d..e494352 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire772SpecifiedReportsIT.java
@@ -19,7 +19,10 @@ package org.apache.maven.surefire.its.jiras;
* under the License.
*/
-import org.apache.maven.surefire.its.fixture.*;
+import org.apache.maven.surefire.its.fixture.OutputValidator;
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.apache.maven.surefire.its.fixture.SurefireLauncher;
+import org.apache.maven.surefire.its.fixture.TestFile;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java
index 658befd..c05c52a 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire803MultiFailsafeExecsIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -22,6 +23,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire803MultiFailsafeExecsIT
extends SurefireJUnit4IntegrationTestCase
{
@@ -30,8 +34,11 @@ public class Surefire803MultiFailsafeExecsIT
public void testSecondExecutionRunsAfterFirstExecutionFails()
{
unpack(
- "/surefire-803-multiFailsafeExec-failureInFirst" ).maven().withFailure().executeVerify().assertIntegrationTestSuiteResults(
- 4, 0, 2, 0 );
+ "/surefire-803-multiFailsafeExec-failureInFirst" )
+ .maven()
+ .withFailure()
+ .executeVerify()
+ .assertIntegrationTestSuiteResults( 4, 0, 2, 0 );
}
@Test
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java
index aedb82b..0b75c00 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire806SpecifiedTestControlsIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,6 +24,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Ignore;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire806SpecifiedTestControlsIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java
index 5ab103b..3773817 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire809GroupExpressionsIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,6 +25,9 @@ import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire809GroupExpressionsIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java
index 1bf4c8d..c747541 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire818NpeIgnoresTestsIT.java
@@ -33,7 +33,10 @@ public class Surefire818NpeIgnoresTestsIT
@Test
public void testBuildFailingWhenErrors()
{
- unpack( "surefire-818-ignored-tests-on-npe" ).maven().withFailure().executeTest().assertTestSuiteResults( 2, 0,
- 1, 0 );
+ unpack( "surefire-818-ignored-tests-on-npe" )
+ .maven()
+ .withFailure()
+ .executeTest()
+ .assertTestSuiteResults( 2, 0, 1, 0 );
}
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java
index b59bc6a..71cb02f 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire828EmptyGroupExprIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,6 +24,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire828EmptyGroupExprIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java
index c694a3d..6e02ed2 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire832ProviderSelectionIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,6 +24,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.apache.maven.surefire.its.fixture.SurefireLauncher;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire832ProviderSelectionIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
index 0babe66..ca46340 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire839TestWithoutCategoriesIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -22,6 +23,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire839TestWithoutCategoriesIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
index eaecc90..040dd5f 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire847AdditionalFailureIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,6 +22,9 @@ package org.apache.maven.surefire.its.jiras;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire847AdditionalFailureIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
index 8317c52..eb7a711 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire907PerThreadWithoutThreadCountIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,6 +24,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire907PerThreadWithoutThreadCountIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java
index 4f60895..b6a25eb 100755
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire920TestFailureIgnoreWithTimeoutIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,6 +24,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire920TestFailureIgnoreWithTimeoutIT
extends SurefireJUnit4IntegrationTestCase
{
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java
index 5963662..80b2c91 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire930TestNgSuiteXmlIT.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.its.jiras;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -22,6 +23,9 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire930TestNgSuiteXmlIT
extends SurefireJUnit4IntegrationTestCase
{
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 0d3c4a3..2e37775 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
@@ -28,11 +28,15 @@ import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Assert;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire943ReportContentIT
extends SurefireJUnit4IntegrationTestCase
{
@Test
+ @SuppressWarnings( "checkstyle:methodname" )
public void test_noParallel()
throws Exception
{
@@ -40,6 +44,7 @@ public class Surefire943ReportContentIT
}
@Test
+ @SuppressWarnings( "checkstyle:methodname" )
public void test_parallelBoth()
throws Exception
{
@@ -149,10 +154,9 @@ public class Surefire943ReportContentIT
throws FileNotFoundException
{
Xpp3Dom testResult =
- Xpp3DomBuilder.build( validator.getSurefireReportsXmlFile( "TEST-" + className + ".xml" ).getFileInputStream(),
- "UTF-8" );
- Xpp3Dom[] children = testResult.getChildren( "testcase" );
- return children;
+ Xpp3DomBuilder.build(
+ validator.getSurefireReportsXmlFile( "TEST-" + className + ".xml" )
+ .getFileInputStream(), "UTF-8" );
+ return testResult.getChildren( "testcase" );
}
-
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
index 7fab6d0..4be28e7 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java
@@ -37,7 +37,11 @@ import java.util.ArrayList;
import static org.fest.assertions.Assertions.assertThat;
+/**
+ *
+ */
@RunWith( ParallelParameterized.class )
+@SuppressWarnings( "checkstyle:magicnumber" )
public class Surefire946KillMainProcessInReusableForkIT
extends SurefireJUnit4IntegrationTestCase
{
@@ -50,12 +54,14 @@ public class Surefire946KillMainProcessInReusableForkIT
private String classifierOfDummyDependency;
@Parameter
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String shutdownMavenMethod;
@Parameter( 1 )
+ @SuppressWarnings( "checkstyle:visibilitymodifier" )
public String shutdownSurefireMethod;
- @Parameters( name = "{0}-{1}")
+ @Parameters( name = "{0}-{1}" )
public static Iterable<Object[]> data()
{
ArrayList<Object[]> args = new ArrayList<>();
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire972BizarreNoClassDefIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire972BizarreNoClassDefIT.java
index 94db9f8..9f93443 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire972BizarreNoClassDefIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire972BizarreNoClassDefIT.java
@@ -1,8 +1,5 @@
package org.apache.maven.surefire.its.jiras;
-import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
-import org.junit.Test;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,6 +18,13 @@ import org.junit.Test;
* specific language governing permissions and limitations
* under the License.
*/
+
+import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
+import org.junit.Test;
+
+/**
+ *
+ */
public class Surefire972BizarreNoClassDefIT
extends SurefireJUnit4IntegrationTestCase
{
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 a53c647..99fee3d 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
@@ -25,6 +25,9 @@ import org.junit.Test;
import static org.apache.maven.surefire.its.fixture.HelperAssertions.convertUnicodeToUTF8;
+/**
+ *
+ */
public class Surefire975DefaultVMEncodingIT
extends SurefireJUnit4IntegrationTestCase
{
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 d648576..6172130 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
@@ -23,17 +23,22 @@ import org.apache.maven.surefire.its.fixture.OutputValidator;
import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
import org.junit.Test;
+/**
+ *
+ */
public class Surefire979WrongClassLoaderIT
extends SurefireJUnit4IntegrationTestCase
{
-
@Test
public void wrongClassloaderUSedInSmartStacktraceparser()
throws Exception
{
OutputValidator outputValidator =
- unpack( "surefire-979-smartStackTrace-wrongClassloader" ).failNever().executeTest();
- outputValidator.verifyTextInLog( "java.lang.NoClassDefFoundError: org/apache/commons/io/input/AutoCloseInputStream" );
- }
+ unpack( "surefire-979-smartStackTrace-wrongClassloader" )
+ .failNever()
+ .executeTest();
+ outputValidator.verifyTextInLog(
+ "java.lang.NoClassDefFoundError: org/apache/commons/io/input/AutoCloseInputStream" );
+ }
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire985ParameterizedRunnerAndCategoriesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire985ParameterizedRunnerAndCategoriesIT.java
index b86b291..8d59cbe 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire985ParameterizedRunnerAndCategoriesIT.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire985ParameterizedRunnerAndCategoriesIT.java
@@ -32,6 +32,9 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+/**
+ *
+ */
public class Surefire985ParameterizedRunnerAndCategoriesIT
extends SurefireJUnit4IntegrationTestCase
{
@@ -43,7 +46,8 @@ public class Surefire985ParameterizedRunnerAndCategoriesIT
OutputValidator validator = unpack( "surefire-985-parameterized-and-categories" ).maven().executeTest();
validator.assertTestSuiteResults( 12, 0, 0, 0 );
- assertFalse( validator.getSurefireReportsXmlFile( "TEST-sample.parameterized.Parameterized01Test.xml" ).exists() );
+ assertFalse( validator.getSurefireReportsXmlFile( "TEST-sample.parameterized.Parameterized01Test.xml" )
+ .exists() );
TestFile reportFile2 =
validator.getSurefireReportsXmlFile( "TEST-sample.parameterized.Parameterized02Test.xml" );
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ABaseClass.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ABaseClass.java
index c4387d2..3f8692d 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ABaseClass.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ABaseClass.java
@@ -19,7 +19,9 @@ package org.apache.maven.surefire.report;
* under the License.
*/
-
+/**
+ *
+ */
public class ABaseClass
{
public void npe()
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ASubClass.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ASubClass.java
index 985447e..77e6d8e 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ASubClass.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ASubClass.java
@@ -19,6 +19,9 @@ package org.apache.maven.surefire.report;
* under the License.
*/
+/**
+ *
+ */
public class ASubClass extends ABaseClass
{
}
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ATestClass.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ATestClass.java
index baff162..d7ac6b8 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ATestClass.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/ATestClass.java
@@ -21,6 +21,9 @@ package org.apache.maven.surefire.report;
import java.io.File;
+/**
+ *
+ */
@SuppressWarnings( "UnusedDeclaration" )
public class ATestClass
{
@@ -58,6 +61,6 @@ public class ATestClass
public void aLongTestErrorMessage()
{
throw new RuntimeException( "This message will be truncated, somewhere over the rainbow. "
- + "Gangnam style, Gangnam style, Gangnam style, , Gangnam style, Gangnam style" );
+ + "Gangnam style, Gangnam style, Gangnam style, , Gangnam style, Gangnam style" );
}
}
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/OutermostClass.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/OutermostClass.java
index be9525e..91e723f 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/OutermostClass.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/OutermostClass.java
@@ -19,7 +19,8 @@ package org.apache.maven.surefire.report;
* under the License.
*/
-class OutermostClass {
+class OutermostClass
+{
void junit()
{
new ATestClass().failInAssert();
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/PojoStackTraceWriterTest.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/PojoStackTraceWriterTest.java
index 4bb667e..69a3db0 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/PojoStackTraceWriterTest.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/PojoStackTraceWriterTest.java
@@ -21,6 +21,9 @@ package org.apache.maven.surefire.report;
import junit.framework.TestCase;
+/**
+ *
+ */
public class PojoStackTraceWriterTest
extends TestCase
{
@@ -30,10 +33,9 @@ public class PojoStackTraceWriterTest
PojoStackTraceWriter w =
new PojoStackTraceWriter( ATestClass.AnotherTestClass.class.getName(), "testQuote", getAThrowAble() );
String out = w.writeTrimmedTraceToString();
- String expected =
- "org.apache.maven.surefire.report.PojoStackTraceWriterTest$ATestClass$AnotherTestClass.getAThrowable(PojoStackTraceWriterTest.java";
+ String expected = "org.apache.maven.surefire.report.PojoStackTraceWriterTest$ATestClass$AnotherTestClass"
+ + ".getAThrowable(PojoStackTraceWriterTest.java";
assertTrue( out.contains( expected ) );
-
}
public void testMultiLineMessage()
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java
index 521c873..2d236d6 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass1.java
@@ -1,29 +1,30 @@
package org.apache.maven.surefire.report;
+/*
+ * 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.
+ */
+
import org.apache.maven.surefire.util.internal.DaemonThreadFactory;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
-/*
-* 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.
-*/
class RunnableTestClass1
implements Callable<Object>
{
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java
index b782df8..77da1c7 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/RunnableTestClass2.java
@@ -1,25 +1,26 @@
package org.apache.maven.surefire.report;
+/*
+ * 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.
+ */
+
import java.util.concurrent.Callable;
-/*
-* 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.
-*/
class RunnableTestClass2
implements Callable<Object>
@@ -30,7 +31,7 @@ class RunnableTestClass2
throws Exception
{
InnerRunnableTestClass.cThrows();
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
static class InnerRunnableTestClass
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/SmartStackTraceParserTest.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/SmartStackTraceParserTest.java
index f057ce5..593a8c2 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/SmartStackTraceParserTest.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/SmartStackTraceParserTest.java
@@ -29,8 +29,13 @@ import junit.framework.ComparisonFailure;
import junit.framework.TestCase;
import org.apache.maven.surefire.util.internal.DaemonThreadFactory;
-import static org.apache.maven.surefire.report.SmartStackTraceParser.*;
+import static org.apache.maven.surefire.report.SmartStackTraceParser.findTopmostWithClass;
+import static org.apache.maven.surefire.report.SmartStackTraceParser.focusInsideClass;
+import static org.apache.maven.surefire.report.SmartStackTraceParser.stackTraceWithFocusOnClassAsString;
+/**
+ *
+ */
@SuppressWarnings( "ThrowableResultOfMethodCallIgnored" )
public class SmartStackTraceParserTest
extends TestCase
@@ -44,9 +49,10 @@ public class SmartStackTraceParserTest
}
catch ( AssertionError e )
{
- SmartStackTraceParser smartStackTraceParser = new SmartStackTraceParser( ATestClass.class.getName(), e, null );
+ SmartStackTraceParser smartStackTraceParser =
+ new SmartStackTraceParser( ATestClass.class.getName(), e, null );
String res = smartStackTraceParser.getString();
- assertEquals( "ATestClass.failInAssert:30 X is not Z", res );
+ assertEquals( "ATestClass.failInAssert:33 X is not Z", res );
}
}
@@ -62,7 +68,7 @@ public class SmartStackTraceParserTest
SmartStackTraceParser smartStackTraceParser =
new SmartStackTraceParser( ATestClass.class.getName(), e, null );
String res = smartStackTraceParser.getString();
- assertEquals( "ATestClass.failInAssert:30 X is not Z", res );
+ assertEquals( "ATestClass.failInAssert:33 X is not Z", res );
}
}
@@ -94,7 +100,7 @@ public class SmartStackTraceParserTest
SmartStackTraceParser smartStackTraceParser =
new SmartStackTraceParser( ATestClass.class.getName(), e, null );
String res = smartStackTraceParser.getString();
- assertEquals( "ATestClass.nestedFailInAssert:35->failInAssert:30 X is not Z", res );
+ assertEquals( "ATestClass.nestedFailInAssert:38->failInAssert:33 X is not Z", res );
}
}
@@ -110,7 +116,7 @@ public class SmartStackTraceParserTest
SmartStackTraceParser smartStackTraceParser =
new SmartStackTraceParser( ATestClass.class.getName(), e, null );
String res = smartStackTraceParser.getString();
- assertEquals( "ATestClass.nestedNpe:45->npe:40 NullPointer It was null", res );
+ assertEquals( "ATestClass.nestedNpe:48->npe:43 NullPointer It was null", res );
}
}
@@ -126,7 +132,7 @@ public class SmartStackTraceParserTest
SmartStackTraceParser smartStackTraceParser =
new SmartStackTraceParser( ATestClass.class.getName(), e, null );
String res = smartStackTraceParser.getString();
- assertEquals( "ATestClass.nestedNpeOutsideTest:55->npeOutsideTest:50 » NullPointer", res );
+ assertEquals( "ATestClass.nestedNpeOutsideTest:58->npeOutsideTest:53 » NullPointer", res );
}
}
@@ -142,7 +148,7 @@ public class SmartStackTraceParserTest
SmartStackTraceParser smartStackTraceParser =
new SmartStackTraceParser( ATestClass.class.getName(), e, null );
String res = smartStackTraceParser.getString();
- assertEquals( "ATestClass.aLongTestErrorMessage:60 Runtime This message will be truncated, so...",
+ assertEquals( "ATestClass.aLongTestErrorMessage:63 Runtime This message will be truncated, so...",
res );
}
}
@@ -159,7 +165,7 @@ public class SmartStackTraceParserTest
SmartStackTraceParser smartStackTraceParser =
new SmartStackTraceParser( ASubClass.class.getName(), e, null );
String res = smartStackTraceParser.getString();
- assertEquals( "ASubClass>ABaseClass.npe:27 » NullPointer It was null", res );
+ assertEquals( "ASubClass>ABaseClass.npe:29 » NullPointer It was null", res );
}
}
@@ -322,7 +328,8 @@ public class SmartStackTraceParserTest
{
String trace = stackTraceWithFocusOnClassAsString( e, StackTraceFocusedOnClass.B.class.getName() );
- assertEquals( "java.lang.RuntimeException: java.lang.IllegalStateException: java.io.IOException: I/O error\n"
+ assertEquals(
+ "java.lang.RuntimeException: java.lang.IllegalStateException: java.io.IOException: I/O error\n"
+ "\tat org.apache.maven.surefire.report.StackTraceFocusedOnClass$B.b(StackTraceFocusedOnClass.java:65)\n"
+ "Caused by: java.lang.IllegalStateException: java.io.IOException: I/O error\n"
+ "\tat org.apache.maven.surefire.report.StackTraceFocusedOnClass$B.b(StackTraceFocusedOnClass.java:61)\n"
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/StackTraceFocusedOnClass.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/StackTraceFocusedOnClass.java
index 64449c0..b544c04 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/StackTraceFocusedOnClass.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/StackTraceFocusedOnClass.java
@@ -32,7 +32,7 @@ final class StackTraceFocusedOnClass
}
}
- static abstract class A
+ abstract static class A
{
abstract void abs()
throws IOException;
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass1.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass1.java
index 5b34f67..e878fd0 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass1.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass1.java
@@ -18,6 +18,7 @@ package org.apache.maven.surefire.report;
* specific language governing permissions and limitations
* under the License.
*/
+
class TestClass1
{
static class InnerBTestClass
diff --git a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass2.java b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass2.java
index ae55026..4c986f0 100644
--- a/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass2.java
+++ b/surefire-providers/common-java5/src/test/java/org/apache/maven/surefire/report/TestClass2.java
@@ -18,6 +18,7 @@ package org.apache.maven.surefire.report;
* specific language governing permissions and limitations
* under the License.
*/
+
class TestClass2
{
static class InnerCTestClass
diff --git a/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java b/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java
index 2397e8b..7fd71f5 100644
--- a/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java
+++ b/surefire-providers/common-junit3/src/test/java/org/apache/maven/surefire/common/junit3/JUnit3TestCheckerTest.java
@@ -19,8 +19,6 @@ package org.apache.maven.surefire.common.junit3;
* under the License.
*/
-import org.apache.maven.surefire.testset.TestSetFailedException;
-
import junit.framework.TestCase;
import junit.framework.TestResult;
@@ -33,25 +31,21 @@ public class JUnit3TestCheckerTest
private final JUnit3TestChecker jUnit3TestChecker = new JUnit3TestChecker( this.getClass().getClassLoader() );
public void testValidJunit4Annotated()
- throws TestSetFailedException
{
assertTrue( jUnit3TestChecker.accept( JUnit3TestCheckerTest.class ) );
}
public void testValidJunit4itsAJunit3Test()
- throws TestSetFailedException
{
assertTrue( jUnit3TestChecker.accept( AlsoValid.class ) );
}
public void testValidJunitSubclassWithoutOwnTestmethods()
- throws TestSetFailedException
{
assertTrue( jUnit3TestChecker.accept( SubClassWithoutOwnTestMethods.class ) );
}
public void testInvalidTest()
- throws TestSetFailedException
{
assertFalse( jUnit3TestChecker.accept( NotValidTest.class ) );
}
@@ -77,7 +71,9 @@ public class JUnit3TestCheckerTest
assertFalse( jUnit3TestChecker.accept( NestedTC.Inner.class ) );
}
-
+ /**
+ *
+ */
public static class AlsoValid
extends TestCase
{
@@ -87,6 +83,9 @@ public class JUnit3TestCheckerTest
}
}
+ /**
+ *
+ */
public static class SuiteOnlyTest
{
public static junit.framework.Test suite()
@@ -95,6 +94,9 @@ public class JUnit3TestCheckerTest
}
}
+ /**
+ *
+ */
public static class CustomSuiteOnlyTest
{
public static MySuite2 suite()
@@ -103,6 +105,9 @@ public class JUnit3TestCheckerTest
}
}
+ /**
+ *
+ */
public static class MySuite2
implements junit.framework.Test
{
@@ -119,6 +124,9 @@ public class JUnit3TestCheckerTest
}
+ /**
+ *
+ */
public static class NotValidTest
{
public void testSomething()
@@ -126,6 +134,9 @@ public class JUnit3TestCheckerTest
}
}
+ /**
+ *
+ */
public abstract static class BaseClassWithTest
extends TestCase
{
@@ -134,6 +145,9 @@ public class JUnit3TestCheckerTest
}
}
+ /**
+ *
+ */
public static class SubClassWithoutOwnTestMethods
extends BaseClassWithTest
{
diff --git a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4ProviderUtilTest.java b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4ProviderUtilTest.java
index 15adc32..9431b0e 100644
--- a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4ProviderUtilTest.java
+++ b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4ProviderUtilTest.java
@@ -28,7 +28,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.*;
+import static org.apache.maven.surefire.common.junit4.JUnit4ProviderUtil.generateFailingTestDescriptions;
/**
* @author Qingzhou Luo
@@ -56,13 +56,13 @@ public class JUnit4ProviderUtilTest
assertEquals( 4, result.size() );
- assertTrue( result.contains( test1Description) );
- assertTrue( result.contains( test2Description) );
- assertTrue( result.contains( test3Description) );
- assertTrue( result.contains( test4Description) );
+ assertTrue( result.contains( test1Description ) );
+ assertTrue( result.contains( test2Description ) );
+ assertTrue( result.contains( test3Description ) );
+ assertTrue( result.contains( test4Description ) );
}
- public void testIllegalTestDescription$NegativeTest()
+ public void testIllegalTestDescriptionNegativeTest()
{
Description test = Description.createSuiteDescription( "someTestMethod" );
ClassMethod classMethod = JUnit4ProviderUtil.toClassMethod( test );
diff --git a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector40Test.java b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector40Test.java
index df4819c..94c2461 100644
--- a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector40Test.java
+++ b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4Reflector40Test.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.common.junit4;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -36,13 +37,16 @@ public class JUnit4Reflector40Test
assertNull( annotatedIgnore );
}
- private static final String reason = "Ignorance is bliss";
+ private static final String REASON = "Ignorance is bliss";
+ /**
+ *
+ */
public static class IgnoreWithDescription
{
@Test
- @Ignore( reason )
+ @Ignore( REASON )
public void testSomething2()
{
}
diff --git a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java
index baf4589..33bc4b8 100644
--- a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java
+++ b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/common/junit4/JUnit4RunListenerTest.java
@@ -87,7 +87,9 @@ public class JUnit4RunListenerTest
Assert.assertEquals( "Succeeded tests", 1, reporter.getTestSucceeded() );
}
-
+ /**
+ *
+ */
public static class STest1
{
@Test
@@ -97,6 +99,9 @@ public class JUnit4RunListenerTest
}
}
+ /**
+ *
+ */
public static class STest2
{
@Test
@@ -105,5 +110,4 @@ public class JUnit4RunListenerTest
}
}
-
}
diff --git a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java
index a204734..d7b0eae 100644
--- a/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java
+++ b/surefire-providers/common-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4TestCheckerTest.java
@@ -1,4 +1,5 @@
package org.apache.maven.surefire.junit4;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -120,6 +121,9 @@ public class JUnit4TestCheckerTest
assertTrue( checker.accept( testClass ) );
}
+ /**
+ *
+ */
public static class AlsoValid
extends TestCase
{
@@ -129,6 +133,9 @@ public class JUnit4TestCheckerTest
}
}
+ /**
+ *
+ */
public static class SuiteOnlyTest
{
public static junit.framework.Test suite()
@@ -137,6 +144,9 @@ public class JUnit4TestCheckerTest
}
}
+ /**
+ *
+ */
public static class CustomSuiteOnlyTest
{
public static MySuite2 suite()
@@ -145,6 +155,9 @@ public class JUnit4TestCheckerTest
}
}
+ /**
+ *
+ */
public static class MySuite2
implements junit.framework.Test
{
@@ -160,7 +173,9 @@ public class JUnit4TestCheckerTest
}
}
-
+ /**
+ *
+ */
@SuppressWarnings( { "UnusedDeclaration" } )
public static class NotValidTest
{
@@ -169,6 +184,9 @@ public class JUnit4TestCheckerTest
}
}
+ /**
+ *
+ */
public abstract static class BaseClassWithTest
{
@Test
@@ -177,11 +195,17 @@ public class JUnit4TestCheckerTest
}
}
+ /**
+ *
+ */
public static class SubClassWithoutOwnTestMethods
extends BaseClassWithTest
{
}
+ /**
+ *
+ */
@RunWith( Suite.class )
public static class SuiteValid1
{
@@ -206,6 +230,9 @@ public class JUnit4TestCheckerTest
}
}
+ /**
+ *
+ */
@RunWith( CustomRunner.class )
public static class SuiteValidCustomRunner
{
@@ -216,6 +243,9 @@ public class JUnit4TestCheckerTest
}
+ /**
+ *
+ */
@RunWith( MySuite.class )
public static class SuiteValid2
{
@@ -225,6 +255,9 @@ public class JUnit4TestCheckerTest
}
}
+ /**
+ *
+ */
public static class SimpleJUnit4TestClass
{
@Test
@@ -251,5 +284,4 @@ public class JUnit4TestCheckerTest
}
}
-
}
diff --git a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java
index b91cdd8..4d16da7 100644
--- a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java
+++ b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/FilterFactoryTest.java
@@ -38,18 +38,31 @@ import java.util.Collections;
import static org.junit.runner.Description.createSuiteDescription;
import static org.junit.runner.Description.createTestDescription;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+/**
+ *
+ */
+@SuppressWarnings( "checkstyle:constantname" )
public class FilterFactoryTest
{
+ /**
+ *
+ */
@RunWith( org.junit.runners.Suite.class )
@org.junit.runners.Suite.SuiteClasses( { FirstClass.class, SecondClass.class } )
- static public class Suite
+ public static class Suite
{
}
- static public class FirstClass
+ /**
+ *
+ */
+ public static class FirstClass
{
@Test
public void testMethod()
@@ -70,7 +83,10 @@ public class FilterFactoryTest
}
}
- static public class SecondClass
+ /**
+ *
+ */
+ public static class SecondClass
{
@Test
public void testMethod()
@@ -85,7 +101,10 @@ public class FilterFactoryTest
}
}
- static public class ThirdClass
+ /**
+ *
+ */
+ public static class ThirdClass
{
@Test
public void testMethod()
@@ -164,7 +183,8 @@ public class FilterFactoryTest
@Test
public void testNegativeIllegalRegex()
{
- try {
+ try
+ {
new TestListResolver( "#%regex[.*.Test.class]" );
}
catch ( IllegalArgumentException e )
@@ -176,7 +196,8 @@ public class FilterFactoryTest
@Test
public void testNegativeIllegalRegex2()
{
- try {
+ try
+ {
new TestListResolver( "%regex[.*.Test.class]#" );
}
catch ( IllegalArgumentException e )
@@ -262,7 +283,8 @@ public class FilterFactoryTest
}
@Test
- public void testBackwardsCompatibilityTestParameterClass() {
+ public void testBackwardsCompatibilityTestParameterClass()
+ {
Filter filter = createMethodFilter( firstClassName );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) );
@@ -273,7 +295,8 @@ public class FilterFactoryTest
}
@Test
- public void testBackwardsCompatibilityTestParameterJavaClass() {
+ public void testBackwardsCompatibilityTestParameterJavaClass()
+ {
Filter filter = createMethodFilter( firstClassName + ".java" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) );
@@ -284,7 +307,8 @@ public class FilterFactoryTest
}
@Test
- public void testBackwardsCompatibilityTestParameterMethod1() {
+ public void testBackwardsCompatibilityTestParameterMethod1()
+ {
Filter filter = createMethodFilter( firstClassName + ".java#testMethod" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) );
@@ -295,7 +319,8 @@ public class FilterFactoryTest
}
@Test
- public void testBackwardsCompatibilityTestParameterMethod2() {
+ public void testBackwardsCompatibilityTestParameterMethod2()
+ {
Filter filter = createMethodFilter( firstClassName + "#testMethod" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) );
@@ -306,7 +331,8 @@ public class FilterFactoryTest
}
@Test
- public void testBackwardsCompatibilityTestParameterMethod3() {
+ public void testBackwardsCompatibilityTestParameterMethod3()
+ {
Filter filter = createMethodFilter( firstClassName + "#testMethod" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) );
@@ -317,7 +343,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithWildcard() {
+ public void testRegexWithWildcard()
+ {
Filter filter =
createMethodFilter( "%regex[" + firstClassRegex + ".*]" );
JUnitCore core = new JUnitCore();
@@ -329,7 +356,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithWildcardClass() {
+ public void testRegexWithWildcardClass()
+ {
Filter filter =
createMethodFilter( "%regex[" + firstClassRegex + ".*.class]" );
JUnitCore core = new JUnitCore();
@@ -341,7 +369,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithExactClass() {
+ public void testRegexWithExactClass()
+ {
Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".class]" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) );
@@ -352,7 +381,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithWildcardJavaClassNegativeTest() {
+ public void testRegexWithWildcardJavaClassNegativeTest()
+ {
Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*.class]" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class ).filterWith( filter ) );
@@ -363,7 +393,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClasses() {
+ public void testRegexWithTwoClasses()
+ {
Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*]" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class )
@@ -375,7 +406,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClassesComplement() {
+ public void testRegexWithTwoClassesComplement()
+ {
Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*]" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class )
@@ -387,7 +419,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClassesAndOneMethod() {
+ public void testRegexWithTwoClassesAndOneMethod()
+ {
Filter filter =
createMethodFilter( "%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".* # otherMethod]" );
JUnitCore core = new JUnitCore();
@@ -400,7 +433,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClassesAndOneMethodComplement() {
+ public void testRegexWithTwoClassesAndOneMethodComplement()
+ {
Filter filter =
createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*# otherMethod]" );
JUnitCore core = new JUnitCore();
@@ -413,7 +447,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClassesAndWildcardMethod() {
+ public void testRegexWithTwoClassesAndWildcardMethod()
+ {
Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*#test.* ]" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class )
@@ -425,7 +460,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClassesAndRegexMethodComplement() {
+ public void testRegexWithTwoClassesAndRegexMethodComplement()
+ {
Filter filter = createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".*#test.*]" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class )
@@ -437,7 +473,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClassesAndRegexMethods() {
+ public void testRegexWithTwoClassesAndRegexMethods()
+ {
Filter filter =
createMethodFilter( "%regex[ " + firstClassRegex + ".*|" + secondClassRegex + ".* # test.*|other.* ]" );
JUnitCore core = new JUnitCore();
@@ -450,7 +487,8 @@ public class FilterFactoryTest
}
@Test
- public void testRegexWithTwoClassesAndRegexMethodsComplement() {
+ public void testRegexWithTwoClassesAndRegexMethodsComplement()
+ {
Filter filter =
createMethodFilter( "!%regex[" + firstClassRegex + ".*|" + secondClassRegex + ".* # test.*|other.* ]" );
JUnitCore core = new JUnitCore();
@@ -463,7 +501,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleRegexClasses() {
+ public void testMultipleRegexClasses()
+ {
Filter filter =
createMethodFilter( "%regex[" + firstClassRegex + ".*], %regex[" + secondClassRegex + ".*]" );
JUnitCore core = new JUnitCore();
@@ -476,7 +515,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleRegexClassesComplement() {
+ public void testMultipleRegexClassesComplement()
+ {
Filter filter =
createMethodFilter( "!%regex[" + firstClassRegex + ".*] , !%regex[" + secondClassRegex + ".*]" );
JUnitCore core = new JUnitCore();
@@ -489,7 +529,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleClasses() {
+ public void testMultipleClasses()
+ {
Filter filter = createMethodFilter( firstClassName + "," + secondClassName );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class )
@@ -501,7 +542,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleClassesMethods() {
+ public void testMultipleClassesMethods()
+ {
Filter filter = createMethodFilter( firstClassName + "#other*," + secondClassName + "#*TestMethod" );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class )
@@ -513,7 +555,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleClassesAndMultipleMethodsWithWildcards() {
+ public void testMultipleClassesAndMultipleMethodsWithWildcards()
+ {
Filter filter = createMethodFilter( firstClassName + "#other*+second*Method,"
+ secondClassName + "#*TestMethod" );
JUnitCore core = new JUnitCore();
@@ -526,7 +569,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleClassesAndMultipleMethodsWithRegex() {
+ public void testMultipleClassesAndMultipleMethodsWithRegex()
+ {
Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".class#other.*|second.*Method],"
+ "%regex[" + secondClassRegex + ".class#.*TestMethod]" );
JUnitCore core = new JUnitCore();
@@ -539,7 +583,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleClassesAndMultipleMethodsMix() {
+ public void testMultipleClassesAndMultipleMethodsMix()
+ {
Filter filter = createMethodFilter( "%regex[" + firstClassRegex + ".class # other.*|second.*Method],"
+ secondClassName + "#*TestMethod" );
JUnitCore core = new JUnitCore();
@@ -552,7 +597,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleClassesAndMultipleMethods() {
+ public void testMultipleClassesAndMultipleMethods()
+ {
Filter filter = createMethodFilter( firstClassName + "#other*+secondTestMethod,"
+ secondClassName + "#*TestMethod" );
JUnitCore core = new JUnitCore();
@@ -565,7 +611,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleClassesComplement() {
+ public void testMultipleClassesComplement()
+ {
Filter filter = createMethodFilter( "!" + firstClassName + ",!" + secondClassName );
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( FirstClass.class, SecondClass.class, ThirdClass.class )
@@ -577,7 +624,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleRegexClassesMethods() {
+ public void testMultipleRegexClassesMethods()
+ {
Filter filter =
createMethodFilter( "%regex[" + firstClassRegex + ".* # test.*|other.*],"
+ "%regex[" + secondClassRegex + ".*#second.*]" );
@@ -591,7 +639,8 @@ public class FilterFactoryTest
}
@Test
- public void testMultipleRegexClassesMethodsComplement() {
+ public void testMultipleRegexClassesMethodsComplement()
+ {
Filter filter =
createMethodFilter( "!%regex[" + firstClassRegex + ".* # test.*|other.*],"
+ "!%regex[" + secondClassRegex + ".*#second.*]" );
@@ -827,7 +876,7 @@ public class FilterFactoryTest
JUnitCore core = new JUnitCore();
Result result = core.run( Request.classes( Suite.class ).filterWith( filter ) );
assertTrue( result.wasSuccessful() );
- assertEquals( 0, result.getRunCount() );//running the Suite
+ assertEquals( 0, result.getRunCount() ); //running the Suite
assertEquals( 0, result.getFailureCount() );
assertEquals( 0, result.getIgnoreCount() );
}
diff --git a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/JUnit48TestCheckerTest.java b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/JUnit48TestCheckerTest.java
index 9ea0829..42bbdaa 100644
--- a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/JUnit48TestCheckerTest.java
+++ b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/JUnit48TestCheckerTest.java
@@ -1,13 +1,5 @@
package org.apache.maven.surefire.common.junit48;
-import org.junit.Test;
-import org.junit.experimental.runners.Enclosed;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -27,6 +19,14 @@ import static org.junit.Assert.assertTrue;
* under the License.
*/
+import org.junit.Test;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
/**
* @author Kristian Rosenvold
*/
@@ -34,7 +34,6 @@ public class JUnit48TestCheckerTest
{
@Test
public void valid48Class()
- throws Exception
{
JUnit48TestChecker tc = new JUnit48TestChecker( this.getClass().getClassLoader() );
assertTrue( tc.accept( BasicTest.class ) );
@@ -42,16 +41,20 @@ public class JUnit48TestCheckerTest
@Test
public void notValid48Class()
- throws Exception
{
JUnit48TestChecker tc = new JUnit48TestChecker( this.getClass().getClassLoader() );
assertFalse( tc.accept( BasicTest2.class ) );
}
-
+ /**
+ *
+ */
@RunWith( Enclosed.class )
public abstract static class BasicTest
{
+ /**
+ *
+ */
public static class InnerTest
{
@Test
@@ -61,9 +64,15 @@ public class JUnit48TestCheckerTest
}
}
+ /**
+ *
+ */
@RunWith( Parameterized.class )
public abstract static class BasicTest2
{
+ /**
+ *
+ */
public static class InnerTest
{
@Test
diff --git a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/ATest.java b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/ATest.java
index 59cc2eb..4a9e17a 100644
--- a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/ATest.java
+++ b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/ATest.java
@@ -18,6 +18,10 @@ package org.apache.maven.surefire.common.junit48.tests;
* specific language governing permissions and limitations
* under the License.
*/
+
+/**
+ *
+ */
public class ATest
{
}
diff --git a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/a/ATest.java b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/a/ATest.java
index 333ffe8..28e6e1c 100644
--- a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/a/ATest.java
+++ b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/a/ATest.java
@@ -18,6 +18,10 @@ package org.apache.maven.surefire.common.junit48.tests.a;
* specific language governing permissions and limitations
* under the License.
*/
+
+/**
+ *
+ */
public class ATest
{
}
diff --git a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/pt/PT.java b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/pt/PT.java
index d16153b..a6f1df4 100644
--- a/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/pt/PT.java
+++ b/surefire-providers/common-junit48/src/test/java/org/apache/maven/surefire/common/junit48/tests/pt/PT.java
@@ -25,6 +25,9 @@ import org.junit.runners.Parameterized;
import java.util.Arrays;
+/**
+ *
+ */
@RunWith( Parameterized.class )
public class PT
{
diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
index e9c53ba..bf85990 100644
--- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
+++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java
@@ -32,7 +32,13 @@ import static org.junit.platform.engine.TestExecutionResult.aborted;
import static org.junit.platform.engine.TestExecutionResult.failed;
import static org.junit.platform.engine.TestExecutionResult.successful;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.inOrder;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
import static org.powermock.reflect.Whitebox.getInternalState;
import java.lang.reflect.Method;
@@ -274,7 +280,7 @@ public class RunListenerAdapterTest
assertThat( report.getValue().getStackTraceWriter() )
.isNotNull();
assertThat( report.getValue().getStackTraceWriter().getThrowable().getTarget() )
- .isSameAs(assumptionFailure);
+ .isSameAs( assumptionFailure );
inOrder.verifyNoMoreInteractions();
adapter.executionFinished( TestIdentifier.from( parent ), successful() );
@@ -335,7 +341,7 @@ public class RunListenerAdapterTest
.isEqualTo( "engine" );
assertThat( report.getValue().getNameText() )
.isNull();
- assertThat(report.getValue().getElapsed())
+ assertThat( report.getValue().getElapsed() )
.isNotNull();
assertThat( report.getValue().getStackTraceWriter() )
.isNull();
@@ -476,7 +482,7 @@ public class RunListenerAdapterTest
ArgumentCaptor<SimpleReportEntry> report = ArgumentCaptor.forClass( SimpleReportEntry.class );
verify( listener )
- .testSetCompleted(report.capture() );
+ .testSetCompleted( report.capture() );
assertThat( report.getValue().getSourceName() )
.isEqualTo( className );
@@ -494,7 +500,7 @@ public class RunListenerAdapterTest
.isNotEmpty();
verify( listener, never() )
- .testSucceeded(any() );
+ .testSucceeded( any() );
verifyNoMoreInteractions( listener );
}
@@ -516,7 +522,7 @@ public class RunListenerAdapterTest
ArgumentCaptor<ReportEntry> entryCaptor = ArgumentCaptor.forClass( ReportEntry.class );
verify( listener ).testStarting( entryCaptor.capture() );
assertEquals( parentDisplay, entryCaptor.getValue().getSourceName() );
- assertNull(entryCaptor.getValue().getSourceText());
+ assertNull( entryCaptor.getValue().getSourceText() );
assertNull( entryCaptor.getValue().getName() );
assertNull( entryCaptor.getValue().getNameText() );
}
@@ -577,7 +583,7 @@ public class RunListenerAdapterTest
ReportEntry value = entryCaptor.getValue();
assertEquals( MyTestClass.class.getName(), value.getSourceName() );
- assertNull(value.getSourceText());
+ assertNull( value.getSourceText() );
assertEquals( "myNamedTestMethod", value.getName() );
assertEquals( "some display name", value.getNameText() );
}
@@ -605,7 +611,8 @@ public class RunListenerAdapterTest
private static TestDescriptor newClassDescriptor( String displayName )
{
return new ClassTestDescriptor( UniqueId.root( "class", MyTestClass.class.getName() ),
- c -> displayName, MyTestClass.class, CONFIG_PARAMS ) {};
+ c -> displayName, MyTestClass.class, CONFIG_PARAMS )
+ { };
}
private static TestDescriptor newClassDescriptor()
diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
index 6d4394e..a03d58b 100644
--- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
+++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/TestMethodFilterTest.java
@@ -42,7 +42,7 @@ import org.junit.platform.engine.UniqueId;
*/
public class TestMethodFilterTest
{
- private static final ConfigurationParameters CONFIG_PARAMS = mock(ConfigurationParameters.class);
+ private static final ConfigurationParameters CONFIG_PARAMS = mock( ConfigurationParameters.class );
private final TestListResolver resolver = mock( TestListResolver.class );
@@ -96,6 +96,9 @@ public class TestMethodFilterTest
return new ClassTestDescriptor( uniqueId, TestClass.class, CONFIG_PARAMS );
}
+ /**
+ *
+ */
public static class TestClass
{
public void testMethod()
diff --git a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
index bae582f..f8d4ba7 100644
--- a/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
+++ b/surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
@@ -31,6 +31,9 @@ import org.apache.maven.surefire.report.TestSetReportEntry;
import java.util.ArrayList;
import java.util.List;
+/**
+ *
+ */
public class JUnitTestSetTest
extends TestCase
{
@@ -51,6 +54,9 @@ public class JUnitTestSetTest
succeededTests.get( 0 ).getName() );
}
+ /**
+ *
+ */
public static final class AlwaysSucceeds
extends TestCase
{
@@ -60,6 +66,9 @@ public class JUnitTestSetTest
}
}
+ /**
+ *
+ */
public static class SuccessListener
implements RunListener
{
@@ -133,6 +142,9 @@ public class JUnitTestSetTest
}
+ /**
+ *
+ */
public static class Suite
{
diff --git a/surefire-providers/surefire-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4ProviderTest.java b/surefire-providers/surefire-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4ProviderTest.java
index 2e411b9..b949baa 100644
--- a/surefire-providers/surefire-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4ProviderTest.java
+++ b/surefire-providers/surefire-junit4/src/test/java/org/apache/maven/surefire/junit4/JUnit4ProviderTest.java
@@ -28,7 +28,12 @@ import java.util.HashMap;
import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.isEmptyOrNullString;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertNotNull;
import static org.junit.runner.Description.createSuiteDescription;
@@ -55,10 +60,12 @@ public class JUnit4ProviderTest
@Test
public void testShouldCreateDescription()
{
- class A {
+ class A
+ {
}
- class B {
+ class B
+ {
}
Description d = JUnit4Provider.createTestsDescription( asList( A.class, B.class ) );
@@ -70,5 +77,4 @@ public class JUnit4ProviderTest
Description b = createSuiteDescription( B.class );
assertThat( d.getChildren(), contains( a, b ) );
}
-
}
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentRunListenerTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentRunListenerTest.java
index a4f6e52..5813ad9 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentRunListenerTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConcurrentRunListenerTest.java
@@ -39,7 +39,7 @@ import org.junit.Test;
import org.junit.runner.Computer;
import org.junit.runner.JUnitCore;
-/*
+/**
* @author Kristian Rosenvold
*/
public class ConcurrentRunListenerTest
@@ -206,6 +206,9 @@ public class ConcurrentRunListenerTest
}
+ /**
+ *
+ */
public static class DummyWithOneIgnore
{
@Test
@@ -225,6 +228,9 @@ public class ConcurrentRunListenerTest
}
}
+ /**
+ *
+ */
public static class DummyWithFailure
{
@Test
@@ -244,6 +250,9 @@ public class ConcurrentRunListenerTest
}
}
+ /**
+ *
+ */
public static class DummyAllOk
{
@@ -263,6 +272,9 @@ public class ConcurrentRunListenerTest
}
}
+ /**
+ *
+ */
public static class Dummy3
{
@@ -281,6 +293,9 @@ public class ConcurrentRunListenerTest
}
}
+ /**
+ *
+ */
public static class Junit3Tc1
extends TestCase
{
@@ -304,6 +319,9 @@ public class ConcurrentRunListenerTest
}
}
+ /**
+ *
+ */
public static class Junit3Tc2
extends TestCase
{
@@ -331,6 +349,9 @@ public class ConcurrentRunListenerTest
}
}
+ /**
+ *
+ */
public static class Junit3OddTest1
extends TestCase
{
@@ -355,6 +376,9 @@ public class ConcurrentRunListenerTest
}
}
+ /**
+ *
+ */
public static class Junit3WithNestedSuite
extends TestCase
{
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java
index ca50956..6942010 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java
@@ -199,13 +199,13 @@ public class ConfigurableParallelComputerTest
return System.currentTimeMillis() - start;
}
- private long timedRun( int NUMTESTS, Result result, Class<?>[] realClasses, JUnitCore jUnitCore, Computer computer )
+ private long timedRun( int numTests, Result result, Class<?>[] realClasses, JUnitCore jUnitCore, Computer computer )
throws ExecutionException
{
long time = runIt( realClasses, jUnitCore, computer );
assertEquals( "No tests should fail, right ?", 0, result.getFailures().size() );
assertEquals( "All tests should succeed, right ?", 0, result.getIgnoreCount() );
- assertEquals( "All tests should succeed, right ?", NUMTESTS * 3, result.getRunCount() );
+ assertEquals( "All tests should succeed, right ?", numTests * 3, result.getRunCount() );
return time;
}
@@ -241,6 +241,9 @@ public class ConfigurableParallelComputerTest
}
}
+ /**
+ *
+ */
public static class Dummy
{
@Test
@@ -261,6 +264,9 @@ public class ConfigurableParallelComputerTest
}
}
+ /**
+ *
+ */
public static class Dummy2
{
@Test
@@ -276,6 +282,9 @@ public class ConfigurableParallelComputerTest
}
}
+ /**
+ *
+ */
public static class SlowTest
{
final int scaling = 100;
@@ -302,6 +311,9 @@ public class ConfigurableParallelComputerTest
}
}
+ /**
+ *
+ */
public static class FailingAssertions
{
@Test
@@ -321,6 +333,9 @@ public class ConfigurableParallelComputerTest
}
}
+ /**
+ *
+ */
public static class Failure
{
@Test
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DiagnosticRunListener.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DiagnosticRunListener.java
index 0dfb1a3..dbc082e 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DiagnosticRunListener.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/DiagnosticRunListener.java
@@ -1,19 +1,41 @@
package org.apache.maven.surefire.junitcore;
/*
- * Copyright 2002-2009 the original author or authors.
+ * 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
*
- * Licensed 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
*
- * 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.
+ */
+
+/*
+ * 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
*
- * 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.
+ * 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.
*
* Also licensed under CPL http://junit.sourceforge.net/cpl-v10.html
*/
@@ -25,7 +47,7 @@ import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;
-/*
+/**
* @author Kristian Rosenvold, kristianAzeniorD0Tno
*/
public class DiagnosticRunListener
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit4Reflector481Test.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit4Reflector481Test.java
index 896af3e..abf74be 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit4Reflector481Test.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnit4Reflector481Test.java
@@ -21,6 +21,7 @@ package org.apache.maven.surefire.junitcore;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
+
import org.apache.maven.surefire.common.junit4.JUnit4Reflector;
import org.apache.maven.surefire.util.ReflectionUtils;
@@ -28,7 +29,10 @@ import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.Description;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
/**
* Reflector Test with junit 4.8.1
@@ -42,33 +46,33 @@ public class JUnit4Reflector481Test
@Test
public void testGetAnnotatedIgnore()
{
- final Method testSomething2 =
- ReflectionUtils.getMethod( IgnoreWithDescription.class, "testSomething2", EMPTY_CLASS_ARRAY );
+ final Method testSomething2 = ReflectionUtils.getMethod( IgnoreWithDescription.class, "testSomething2",
+ EMPTY_CLASS_ARRAY );
final Annotation[] annotations = testSomething2.getAnnotations();
- Description desc =
- Description.createTestDescription( IgnoreWithDescription.class, "testSomething2", annotations );
+ Description desc = Description.createTestDescription( IgnoreWithDescription.class, "testSomething2",
+ annotations );
Ignore annotatedIgnore = JUnit4Reflector.getAnnotatedIgnore( desc );
assertNotNull( annotatedIgnore );
assertEquals(
- "testSomething2" + "(org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription)",
- desc.getDisplayName() );
- assertEquals( "testSomething2"
- + "(org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription)",
- desc.toString() );
+ "testSomething2" + "(org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription)",
+ desc.getDisplayName() );
+ assertEquals(
+ "testSomething2" + "(org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription)",
+ desc.toString() );
assertEquals( "org.apache.maven.surefire.junitcore.JUnit4Reflector481Test$IgnoreWithDescription",
- desc.getClassName() );
+ desc.getClassName() );
assertEquals( "testSomething2", desc.getMethodName() );
assertEquals( 0, desc.getChildren().size() );
assertEquals( 2, desc.getAnnotations().size() );
assertSame( annotatedIgnore, desc.getAnnotation( Ignore.class ) );
- assertEquals( reason, annotatedIgnore.value() );
+ assertEquals( REASON, annotatedIgnore.value() );
}
@Test
public void testGetAnnotatedIgnoreWithoutClass()
{
- final Method testSomething2 =
- ReflectionUtils.getMethod( IgnoreWithDescription.class, "testSomething2", EMPTY_CLASS_ARRAY );
+ final Method testSomething2 = ReflectionUtils.getMethod( IgnoreWithDescription.class, "testSomething2",
+ EMPTY_CLASS_ARRAY );
final Annotation[] annotations = testSomething2.getAnnotations();
Description desc = Description.createSuiteDescription( "testSomething2", annotations );
Ignore annotatedIgnore = JUnit4Reflector.getAnnotatedIgnore( desc );
@@ -80,16 +84,19 @@ public class JUnit4Reflector481Test
assertEquals( 0, desc.getChildren().size() );
assertEquals( 2, desc.getAnnotations().size() );
assertSame( annotatedIgnore, desc.getAnnotation( Ignore.class ) );
- assertEquals( reason, annotatedIgnore.value() );
+ assertEquals( REASON, annotatedIgnore.value() );
}
- private static final String reason = "Ignorance is bliss";
+ private static final String REASON = "Ignorance is bliss";
+ /**
+ *
+ */
public static class IgnoreWithDescription
{
@Test
- @Ignore( reason )
+ @Ignore( REASON )
public void testSomething2()
{
}
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
index 3734afe..0ca33b9 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreParametersTest.java
@@ -24,12 +24,15 @@ import java.util.Map;
import org.junit.Test;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
import static org.hamcrest.core.Is.is;
-/*
+/**
* @author Kristian Rosenvold, kristian.rosenvold@gmail com
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class JUnitCoreParametersTest
{
@Test
@@ -134,38 +137,38 @@ public class JUnitCoreParametersTest
private Map<String, String> newPropertiesClasses()
{
Map<String, String> props = new HashMap<>();
- props.put(JUnitCoreParameters.PARALLEL_KEY, "classes");
- props.put(JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false");
- props.put(JUnitCoreParameters.THREADCOUNT_KEY, "2");
- props.put(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false");
+ props.put( JUnitCoreParameters.PARALLEL_KEY, "classes" );
+ props.put( JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false" );
+ props.put( JUnitCoreParameters.THREADCOUNT_KEY, "2" );
+ props.put( JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false" );
return props;
}
private Map<String, String> newPropertiesMethods()
{
Map<String, String> props = new HashMap<>();
- props.put(JUnitCoreParameters.PARALLEL_KEY, "methods");
- props.put(JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false");
- props.put(JUnitCoreParameters.THREADCOUNT_KEY, "2");
- props.put(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "true");
+ props.put( JUnitCoreParameters.PARALLEL_KEY, "methods" );
+ props.put( JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "false" );
+ props.put( JUnitCoreParameters.THREADCOUNT_KEY, "2" );
+ props.put( JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "true" );
return props;
}
private Map<String, String> newPropertiesBoth()
{
Map<String, String> props = new HashMap<>();
- props.put(JUnitCoreParameters.PARALLEL_KEY, "both");
- props.put(JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "true");
- props.put(JUnitCoreParameters.THREADCOUNT_KEY, "7");
- props.put(JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false");
+ props.put( JUnitCoreParameters.PARALLEL_KEY, "both" );
+ props.put( JUnitCoreParameters.PERCORETHREADCOUNT_KEY, "true" );
+ props.put( JUnitCoreParameters.THREADCOUNT_KEY, "7" );
+ props.put( JUnitCoreParameters.USEUNLIMITEDTHREADS_KEY, "false" );
return props;
}
private Map<String, String> newPropertiesTimeouts( double timeout, double forcedTimeout )
{
Map<String, String> props = new HashMap<>();
- props.put(JUnitCoreParameters.PARALLEL_TIMEOUT_KEY, Double.toString(timeout));
- props.put(JUnitCoreParameters.PARALLEL_TIMEOUTFORCED_KEY, Double.toString(forcedTimeout));
+ props.put( JUnitCoreParameters.PARALLEL_TIMEOUT_KEY, Double.toString( timeout ) );
+ props.put( JUnitCoreParameters.PARALLEL_TIMEOUTFORCED_KEY, Double.toString( forcedTimeout ) );
return props;
}
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListenerTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListenerTest.java
index 08bbd2a..1c38794 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListenerTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreRunListenerTest.java
@@ -22,6 +22,7 @@ package org.apache.maven.surefire.junitcore;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+
import org.apache.maven.surefire.junit4.MockReporter;
import junit.framework.TestCase;
@@ -34,18 +35,20 @@ import org.junit.runner.Result;
import org.junit.runner.notification.RunListener;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.empty;
/**
* @author Kristian Rosenvold
*/
-public class JUnitCoreRunListenerTest
- extends TestCase
+public class JUnitCoreRunListenerTest extends TestCase
{
public void testTestRunStarted()
{
- RunListener jUnit4TestSetReporter =
- new JUnitCoreRunListener( new MockReporter(), new HashMap<String, TestSet>() );
+ RunListener jUnit4TestSetReporter = new JUnitCoreRunListener( new MockReporter(),
+ new HashMap<String, TestSet>() );
JUnitCore core = new JUnitCore();
core.addListener( jUnit4TestSetReporter );
Result result = core.run( new Computer(), STest1.class, STest2.class );
@@ -55,8 +58,8 @@ public class JUnitCoreRunListenerTest
public void testFailedAssumption()
{
- RunListener jUnit4TestSetReporter =
- new JUnitCoreRunListener( new MockReporter(), new HashMap<String, TestSet>() );
+ RunListener jUnit4TestSetReporter = new JUnitCoreRunListener( new MockReporter(),
+ new HashMap<String, TestSet>() );
JUnitCore core = new JUnitCore();
core.addListener( jUnit4TestSetReporter );
Result result = core.run( new Computer(), TestWithAssumptionFailure.class );
@@ -64,16 +67,15 @@ public class JUnitCoreRunListenerTest
assertEquals( 1, result.getRunCount() );
}
- public void testStateForClassesWithNoChildren()
- throws Exception
+ public void testStateForClassesWithNoChildren() throws Exception
{
- Description testDescription =
- Description.createSuiteDescription( "testMethod(cannot.be.loaded.by.junit.Test)" );
- Description st1 = Description.createSuiteDescription( STest1.class);
-// st1.addChild( Description.createSuiteDescription( STest1.class ) );
+ Description testDescription = Description.createSuiteDescription(
+ "testMethod(cannot.be.loaded.by.junit.Test)" );
+ Description st1 = Description.createSuiteDescription( STest1.class );
+ // st1.addChild( Description.createSuiteDescription( STest1.class ) );
testDescription.addChild( st1 );
- Description st2 = Description.createSuiteDescription( STest2.class);
- // st2.addChild( Description.createSuiteDescription( STest2.class ) );
+ Description st2 = Description.createSuiteDescription( STest2.class );
+ // st2.addChild( Description.createSuiteDescription( STest2.class ) );
testDescription.addChild( st2 );
Map<String, TestSet> classMethodCounts = new HashMap<>();
@@ -81,15 +83,14 @@ public class JUnitCoreRunListenerTest
listener.testRunStarted( testDescription );
assertEquals( 2, classMethodCounts.size() );
Iterator<TestSet> iterator = classMethodCounts.values().iterator();
- assertFalse(iterator.next().equals( iterator.next() ));
+ assertFalse( iterator.next().equals( iterator.next() ) );
}
- public void testTestClassNotLoadableFromJUnitClassLoader()
- throws Exception
+ public void testTestClassNotLoadableFromJUnitClassLoader() throws Exception
{
// can't use Description.createTestDescription() methods as these require a loaded Class
- Description testDescription =
- Description.createSuiteDescription( "testMethod(cannot.be.loaded.by.junit.Test)" );
+ Description testDescription = Description.createSuiteDescription(
+ "testMethod(cannot.be.loaded.by.junit.Test)" );
assertEquals( "testMethod", testDescription.getMethodName() );
assertEquals( "cannot.be.loaded.by.junit.Test", testDescription.getClassName() );
// assert that the test class is not visible by the JUnit classloader
@@ -140,6 +141,9 @@ public class JUnitCoreRunListenerTest
assertThat( classMethodCounts.keySet(), empty() );
}
+ /**
+ *
+ */
public static class STest1
{
@Test
@@ -148,6 +152,9 @@ public class JUnitCoreRunListenerTest
}
}
+ /**
+ *
+ */
public static class STest2
{
@Test
@@ -156,6 +163,9 @@ public class JUnitCoreRunListenerTest
}
}
+ /**
+ *
+ */
public static class TestWithAssumptionFailure
{
@Test
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTest.java
index 3e139e1..14dab81 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit47RunnerTest.java
@@ -1,3 +1,24 @@
+package org.apache.maven.surefire.junitcore;
+
+/*
+ * 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.
+ */
+
/*
* JBoss, Home of Professional Open Source
* Copyright 2009, Red Hat Middleware LLC, and individual contributors
@@ -14,7 +35,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.maven.surefire.junitcore;
import junit.framework.Assert;
import junit.framework.TestCase;
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit48RunnerTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit48RunnerTest.java
index 1faa782..c9cc407 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit48RunnerTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/MavenSurefireJUnit48RunnerTest.java
@@ -1,3 +1,24 @@
+package org.apache.maven.surefire.junitcore;
+
+/*
+ * 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.
+ */
+
/*
* JBoss, Home of Professional Open Source
* Copyright 2009, Red Hat Middleware LLC, and individual contributors
@@ -14,7 +35,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.maven.surefire.junitcore;
import junit.framework.Assert;
import junit.framework.TestCase;
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java
index aded93f..8859c19 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire746Test.java
@@ -1,6 +1,25 @@
package org.apache.maven.surefire.junitcore;
/*
+ * 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.
+ */
+
+/*
* JBoss, Home of Professional Open Source
* Copyright 2009, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
@@ -18,7 +37,11 @@ package org.apache.maven.surefire.junitcore;
*/
import java.io.File;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.maven.surefire.booter.BaseProviderFactory;
@@ -83,8 +106,8 @@ public class Surefire746Test
public final ExpectedException exception = ExpectedException.none();
@Test
- public void surefireIsConfused_ByMultipleIgnore_OnClassLevel()
- throws Exception
+ @SuppressWarnings( "checkstyle:methodname" )
+ public void surefireIsConfused_ByMultipleIgnore_OnClassLevel() throws Exception
{
ReporterFactory reporterFactory = JUnitCoreTester.defaultNoXml();
BaseProviderFactory providerParameters = new BaseProviderFactory( reporterFactory, true );
@@ -97,16 +120,14 @@ public class Surefire746Test
final Map<String, TestSet> testSetMap = new ConcurrentHashMap<>();
- RunListener listener =
- ConcurrentRunListener.createInstance( testSetMap, reporterFactory, false, false,
- new DefaultDirectConsoleReporter( System.out ) );
+ RunListener listener = ConcurrentRunListener.createInstance( testSetMap, reporterFactory, false, false,
+ new DefaultDirectConsoleReporter( System.out ) );
TestsToRun testsToRun = new TestsToRun( Collections.<Class<?>>singleton( TestClassTest.class ) );
org.junit.runner.notification.RunListener jUnit4RunListener = new JUnitCoreRunListener( listener, testSetMap );
- List<org.junit.runner.notification.RunListener> customRunListeners =
- new ArrayList<>();
+ List<org.junit.runner.notification.RunListener> customRunListeners = new ArrayList<>();
customRunListeners.add( 0, jUnit4RunListener );
try
@@ -116,31 +137,34 @@ public class Surefire746Test
exception.expect( TestSetFailedException.class );
JUnit4RunListener dummy = new JUnit4RunListener( new MockReporter() );
new JUnitCoreWrapper( new Notifier( dummy, 0 ), jUnitCoreParameters,
- new DefaultDirectConsoleReporter( System.out ) )
- .execute( testsToRun, customRunListeners, null );
+ new DefaultDirectConsoleReporter( System.out ) ).execute( testsToRun, customRunListeners, null );
}
finally
{
RunResult result = reporterFactory.close();
- assertEquals( "JUnit should report correctly number of test ran(Finished)", 1, result.getCompletedCount() );
+ assertEquals( "JUnit should report correctly number of test ran(Finished)", 1,
+ result.getCompletedCount() );
}
}
+ /**
+ *
+ */
@RunWith( TestCaseRunner.class )
public static class TestClassTest
{
@Test
- public void shouldNeverBeCalled()
- throws Exception
+ public void shouldNeverBeCalled() throws Exception
{
}
}
- public static class TestCaseRunner
- extends BlockJUnit4ClassRunner
+ /**
+ *
+ */
+ public static class TestCaseRunner extends BlockJUnit4ClassRunner
{
- public TestCaseRunner( Class<?> klass )
- throws InitializationError
+ public TestCaseRunner( Class<?> klass ) throws InitializationError
{
super( klass );
}
@@ -154,15 +178,13 @@ public class Surefire746Test
}
- private static class TestRunListener
- extends org.junit.runner.notification.RunListener
+ private static class TestRunListener extends org.junit.runner.notification.RunListener
{
@Override
- public void testFinished( Description description )
- throws Exception
+ public void testFinished( Description description ) throws Exception
{
throw new RuntimeException(
- "This Exception will cause Surefire to receive an internal JUnit Description and fail." );
+ "This Exception will cause Surefire to receive an internal JUnit Description and fail." );
}
}
}
\ No newline at end of file
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire813IncorrectResultTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire813IncorrectResultTest.java
index f4ad93c..293b287 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire813IncorrectResultTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/Surefire813IncorrectResultTest.java
@@ -45,6 +45,9 @@ public class Surefire813IncorrectResultTest
assertEquals( 0, run.getFailureCount() );
}
+ /**
+ *
+ */
public static class Test6
{
private final CountDownLatch latch = new CountDownLatch( 1 );
@@ -64,13 +67,13 @@ public class Surefire813IncorrectResultTest
latch.await();
}
- private static final String s = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
+ private static final String STR = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
public void synchPrint()
{
for ( int i = 0; i < 1000; ++i ) // Increase this number if it does no fail
{
- System.out.println( i + ":" + s );
+ System.out.println( i + ":" + STR );
}
}
@@ -80,7 +83,7 @@ public class Surefire813IncorrectResultTest
@Override
public void run()
{
- System.out.println( s );
+ System.out.println( STR );
latch.countDown();
synchPrint();
}
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestMethodTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestMethodTest.java
index d2e1395..3ec149b 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestMethodTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/TestMethodTest.java
@@ -30,6 +30,9 @@ import junit.framework.TestCase;
public class TestMethodTest
extends TestCase
{
+
+ public static final int BIG_UPTIME = 100_000;
+
public void testTestFailure()
{
ReportEntry reportEntry = new SimpleReportEntry( "a", null, "b", null );
@@ -37,6 +40,6 @@ public class TestMethodTest
testMethod.testFailure( reportEntry );
final int elapsed = testMethod.getElapsed();
assertTrue( elapsed >= 0 );
- assertTrue( elapsed < 100000 );
+ assertTrue( elapsed < BIG_UPTIME );
}
}
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/OptimizedParallelComputerTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/OptimizedParallelComputerTest.java
index 9be816f..ad362b5 100644
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/OptimizedParallelComputerTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/OptimizedParallelComputerTest.java
@@ -33,20 +33,28 @@ import org.junit.runner.RunWith;
import java.util.HashMap;
import java.util.Map;
-import static org.apache.maven.surefire.junitcore.JUnitCoreParameters.*;
-import static org.apache.maven.surefire.junitcore.pc.ParallelComputerUtil.*;
+import static org.apache.maven.surefire.junitcore.JUnitCoreParameters.PARALLEL_KEY;
+import static org.apache.maven.surefire.junitcore.JUnitCoreParameters.THREADCOUNT_KEY;
+import static org.apache.maven.surefire.junitcore.JUnitCoreParameters.THREADCOUNTSUITES_KEY;
+import static org.apache.maven.surefire.junitcore.JUnitCoreParameters.THREADCOUNTCLASSES_KEY;
+import static org.apache.maven.surefire.junitcore.pc.ParallelComputerUtil.resolveConcurrency;
+import static org.apache.maven.surefire.junitcore.pc.ParallelComputerUtil.overrideAvailableProcessors;
+import static org.apache.maven.surefire.junitcore.pc.ParallelComputerUtil.setDefaultAvailableProcessors;
import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
/**
- * Testing an algorithm in {@link ParallelComputerUtil} which configures
- * optimized thread resources in ParallelComputer by given {@link org.apache.maven.surefire.junitcore.JUnitCoreParameters}.
+ * Testing an algorithm in {@link ParallelComputerUtil} which configures optimized thread resources in ParallelComputer
+ * by given {@link org.apache.maven.surefire.junitcore.JUnitCoreParameters}.
*
* @author Tibor Digana (tibor17)
* @see ParallelComputerUtil
* @since 2.17
*/
@RunWith( Theories.class )
+@SuppressWarnings( "checkstyle:magicnumber" )
public final class OptimizedParallelComputerTest
{
@DataPoint
@@ -71,13 +79,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountSuites( int cpu )
- throws TestSetFailedException
+ public void threadCountSuites( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "suites");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "suites" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 5, 10, 20 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -91,13 +98,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountClasses( int cpu )
- throws TestSetFailedException
+ public void threadCountClasses( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "classes");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "classes" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 1, 5, 10 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -111,13 +117,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountMethods( int cpu )
- throws TestSetFailedException
+ public void threadCountMethods( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "methods");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "methods" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 1, 2, 5 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -131,13 +136,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountBoth( int cpu )
- throws TestSetFailedException
+ public void threadCountBoth( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "both");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "both" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 1, 2, 5 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -151,13 +155,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountClassesAndMethods( int cpu )
- throws TestSetFailedException
+ public void threadCountClassesAndMethods( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "classesAndMethods");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "classesAndMethods" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 1, 2, 5 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -171,13 +174,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountSuitesAndMethods( int cpu )
- throws TestSetFailedException
+ public void threadCountSuitesAndMethods( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "suitesAndMethods");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "suitesAndMethods" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 2, 3, 5 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -191,13 +193,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountSuitesAndClasses( int cpu )
- throws TestSetFailedException
+ public void threadCountSuitesAndClasses( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "suitesAndClasses");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "suitesAndClasses" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 2, 5, 20 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -211,13 +212,12 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void threadCountAll( int cpu )
- throws TestSetFailedException
+ public void threadCountAll( int cpu ) throws TestSetFailedException
{
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "all");
- properties.put(THREADCOUNT_KEY, "3");
+ properties.put( PARALLEL_KEY, "all" );
+ properties.put( THREADCOUNT_KEY, "3" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 2, 5, 20 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -231,15 +231,14 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void reusableThreadCountSuitesAndClasses( int cpu )
- throws TestSetFailedException
+ public void reusableThreadCountSuitesAndClasses( int cpu ) throws TestSetFailedException
{
// 4 * cpu to 5 * cpu threads to run test classes
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "suitesAndClasses");
- properties.put(THREADCOUNT_KEY, "6");
- properties.put(THREADCOUNTSUITES_KEY, "2");
+ properties.put( PARALLEL_KEY, "suitesAndClasses" );
+ properties.put( THREADCOUNT_KEY, "6" );
+ properties.put( THREADCOUNTSUITES_KEY, "2" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 3, 5, 20 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -253,15 +252,14 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void reusableThreadCountSuitesAndMethods( int cpu )
- throws TestSetFailedException
+ public void reusableThreadCountSuitesAndMethods( int cpu ) throws TestSetFailedException
{
// 4 * cpu to 5 * cpu threads to run test methods
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "suitesAndMethods");
- properties.put(THREADCOUNT_KEY, "6");
- properties.put(THREADCOUNTSUITES_KEY, "2");
+ properties.put( PARALLEL_KEY, "suitesAndMethods" );
+ properties.put( THREADCOUNT_KEY, "6" );
+ properties.put( THREADCOUNTSUITES_KEY, "2" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 3, 5, 20 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -275,15 +273,14 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void reusableThreadCountClassesAndMethods( int cpu )
- throws TestSetFailedException
+ public void reusableThreadCountClassesAndMethods( int cpu ) throws TestSetFailedException
{
// 4 * cpu to 5 * cpu threads to run test methods
overrideAvailableProcessors( cpu );
Map<String, String> properties = new HashMap<>();
- properties.put(PARALLEL_KEY, "classesAndMethods");
- properties.put(THREADCOUNT_KEY, "6");
- properties.put(THREADCOUNTCLASSES_KEY, "2");
+ properties.put( PARALLEL_KEY, "classesAndMethods" );
+ properties.put( THREADCOUNT_KEY, "6" );
+ properties.put( THREADCOUNTCLASSES_KEY, "2" );
JUnitCoreParameters params = new JUnitCoreParameters( properties );
RunnerCounter counter = new RunnerCounter( 3, 5, 20 );
Concurrency concurrency = resolveConcurrency( params, counter );
@@ -297,8 +294,7 @@ public final class OptimizedParallelComputerTest
}
@Theory
- public void reusableThreadCountAll( int cpu )
- throws TestSetFailedException
+ public void reusableThreadCountAll( int cpu ) throws TestSetFailedException
{
// 8 * cpu to 13 * cpu threads to run test methods
overrideAvailableProcessors( cpu );
diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java
index d87d63a..3e752e3 100755
--- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java
+++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/pc/ParallelComputerBuilderTest.java
@@ -51,33 +51,40 @@ import static org.hamcrest.core.AnyOf.anyOf;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
import static org.apache.maven.surefire.junitcore.pc.RangeMatcher.between;
-import static org.junit.Assert.*;
+import static org.junit.Assert.fail;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
/**
* @author Tibor Digana (tibor17)
* @since 2.16
*/
+@SuppressWarnings( "checkstyle:magicnumber" )
public class ParallelComputerBuilderTest
{
private static final int DELAY_MULTIPLIER = 7;
- private static final Object class1Lock = new Object();
+ private static final Object CLASS1BLOCK = new Object();
private static volatile boolean beforeShutdown;
private static volatile Runnable shutdownTask;
- private static final ConsoleStream logger = new DefaultDirectConsoleReporter( System.out );
+ private static final ConsoleStream LOGGER = new DefaultDirectConsoleReporter( System.out );
private static void testKeepBeforeAfter( ParallelComputerBuilder builder, Class<?>... classes )
{
JUnitCore core = new JUnitCore();
for ( int round = 0; round < 5; round++ )
{
- NothingDoingTest1.methods.clear();
+ NothingDoingTest1.METHODS.clear();
Result result = core.run( builder.buildComputer(), classes );
assertTrue( result.wasSuccessful() );
- Iterator<String> methods = NothingDoingTest1.methods.iterator();
+ Iterator<String> methods = NothingDoingTest1.METHODS.iterator();
for ( Class<?> clazz : classes )
{
String a = clazz.getName() + "#a()";
@@ -113,8 +120,8 @@ public class ParallelComputerBuilderTest
@Test
public void testsWithoutChildrenShouldAlsoBeRun()
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
- ParallelComputerBuilder.PC computer = ( ParallelComputerBuilder.PC ) parallelComputerBuilder.buildComputer();
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
+ ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer();
Result result = new JUnitCore().run( computer, TestWithoutPrecalculatedChildren.class );
assertThat( result.getRunCount(), is( 1 ) );
}
@@ -122,7 +129,7 @@ public class ParallelComputerBuilderTest
@Test
public void parallelMethodsReuseOneOrTwoThreads()
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.useOnePool( 4 );
// One thread because one suite: TestSuite, however the capacity is 5.
@@ -168,7 +175,7 @@ public class ParallelComputerBuilderTest
@Test
public void suiteAndClassInOnePool()
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.useOnePool( 5 );
parallelComputerBuilder.parallelSuites( 5 );
parallelComputerBuilder.parallelClasses( 5 );
@@ -190,18 +197,16 @@ public class ParallelComputerBuilderTest
assertThat( computer.getPoolCapacity(), is( 5 ) );
assertTrue( result.wasSuccessful() );
assertThat( Class1.maxConcurrentMethods, is( 2 ) );
- assertThat( timeSpent, anyOf(
- between( 1500 * DELAY_MULTIPLIER - 50, 1750 * DELAY_MULTIPLIER ),
+ assertThat( timeSpent, anyOf( between( 1500 * DELAY_MULTIPLIER - 50, 1750 * DELAY_MULTIPLIER ),
between( 2000 * DELAY_MULTIPLIER - 50, 2250 * DELAY_MULTIPLIER ),
- between( 2500 * DELAY_MULTIPLIER - 50, 2750 * DELAY_MULTIPLIER )
- ) );
+ between( 2500 * DELAY_MULTIPLIER - 50, 2750 * DELAY_MULTIPLIER ) ) );
}
@Test
public void onePoolWithUnlimitedParallelMethods()
{
// see ParallelComputerBuilder Javadoc
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.useOnePool( 8 );
parallelComputerBuilder.parallelSuites( 2 );
parallelComputerBuilder.parallelClasses( 4 );
@@ -229,7 +234,7 @@ public class ParallelComputerBuilderTest
@Test
public void underflowParallelism()
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.useOnePool( 3 );
// One thread because one suite: TestSuite.
@@ -264,7 +269,7 @@ public class ParallelComputerBuilderTest
@Test
public void separatePoolsWithSuite()
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.parallelSuites( 5 );
parallelComputerBuilder.parallelClasses( 5 );
parallelComputerBuilder.parallelMethods( 3 );
@@ -291,7 +296,7 @@ public class ParallelComputerBuilderTest
@Test
public void separatePoolsWithSuiteAndClass()
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.parallelSuites( 5 );
parallelComputerBuilder.parallelClasses( 5 );
parallelComputerBuilder.parallelMethods( 3 );
@@ -321,7 +326,7 @@ public class ParallelComputerBuilderTest
@Test
public void separatePoolsWithSuiteAndSequentialClasses()
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.parallelSuites( 5 );
parallelComputerBuilder.parallelClasses( 1 );
parallelComputerBuilder.parallelMethods( 3 );
@@ -372,7 +377,7 @@ public class ParallelComputerBuilderTest
public void nothingParallel()
{
JUnitCore core = new JUnitCore();
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER );
assertFalse( builder.isOptimized() );
Result result = core.run( builder.buildComputer(), NothingDoingTest1.class, NothingDoingTest2.class );
@@ -396,7 +401,7 @@ public class ParallelComputerBuilderTest
result = core.run( builder.buildComputer(), NothingDoingTest1.class, NothingDoingSuite.class );
assertTrue( result.wasSuccessful() );
- Class<?>[] classes = { NothingDoingTest1.class, NothingDoingSuite.class };
+ Class<?>[] classes = {NothingDoingTest1.class, NothingDoingSuite.class};
builder.useOnePool( 2 ).parallelSuites( 1 ).parallelClasses( 1 );
assertFalse( builder.isOptimized() );
@@ -408,8 +413,8 @@ public class ParallelComputerBuilderTest
result = core.run( builder.buildComputer(), classes );
assertTrue( result.wasSuccessful() );
- classes = new Class<?>[]{ NothingDoingSuite.class, NothingDoingSuite.class, NothingDoingTest1.class,
- NothingDoingTest2.class, NothingDoingTest3.class };
+ classes = new Class<?>[] { NothingDoingSuite.class, NothingDoingSuite.class, NothingDoingTest1.class,
+ NothingDoingTest2.class, NothingDoingTest3.class };
builder.useOnePool( 2 ).parallelSuites( 1 ).parallelClasses( 1 );
assertFalse( builder.isOptimized() );
@@ -425,7 +430,7 @@ public class ParallelComputerBuilderTest
@Test
public void keepBeforeAfterOneClass()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER );
builder.parallelMethods();
assertFalse( builder.isOptimized() );
testKeepBeforeAfter( builder, NothingDoingTest1.class );
@@ -434,7 +439,7 @@ public class ParallelComputerBuilderTest
@Test
public void keepBeforeAfterTwoClasses()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER );
builder.useOnePool( 5 ).parallelClasses( 1 ).parallelMethods( 2 );
assertFalse( builder.isOptimized() );
testKeepBeforeAfter( builder, NothingDoingTest1.class, NothingDoingTest2.class );
@@ -443,15 +448,15 @@ public class ParallelComputerBuilderTest
@Test
public void keepBeforeAfterTwoParallelClasses()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER );
builder.useOnePool( 8 ).parallelClasses( 2 ).parallelMethods( 2 );
assertFalse( builder.isOptimized() );
JUnitCore core = new JUnitCore();
- NothingDoingTest1.methods.clear();
- Class<?>[] classes = { NothingDoingTest1.class, NothingDoingTest2.class, NothingDoingTest3.class };
+ NothingDoingTest1.METHODS.clear();
+ Class<?>[] classes = {NothingDoingTest1.class, NothingDoingTest2.class, NothingDoingTest3.class};
Result result = core.run( builder.buildComputer(), classes );
assertTrue( result.wasSuccessful() );
- ArrayList<String> methods = new ArrayList<>( NothingDoingTest1.methods );
+ ArrayList<String> methods = new ArrayList<>( NothingDoingTest1.METHODS );
assertThat( methods.size(), is( 12 ) );
assertThat( methods.subList( 9, 12 ), is( not( Arrays.asList( "deinit", "deinit", "deinit" ) ) ) );
}
@@ -459,8 +464,8 @@ public class ParallelComputerBuilderTest
@Test
public void notThreadSafeTest()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger )
- .useOnePool( 6 ).optimize( true ).parallelClasses( 3 ).parallelMethods( 3 );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER ).useOnePool( 6 ).optimize(
+ true ).parallelClasses( 3 ).parallelMethods( 3 );
ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer();
Result result = new JUnitCore().run( computer, NotThreadSafeTest1.class, NotThreadSafeTest2.class );
assertTrue( result.wasSuccessful() );
@@ -480,8 +485,8 @@ public class ParallelComputerBuilderTest
@Test
public void mixedThreadSafety()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger )
- .useOnePool( 6 ).optimize( true ).parallelClasses( 3 ).parallelMethods( 3 );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER ).useOnePool( 6 ).optimize(
+ true ).parallelClasses( 3 ).parallelMethods( 3 );
ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer();
Result result = new JUnitCore().run( computer, NotThreadSafeTest1.class, NormalTest1.class );
assertTrue( result.wasSuccessful() );
@@ -502,8 +507,7 @@ public class ParallelComputerBuilderTest
@Test
public void notThreadSafeTestsInSuite()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger )
- .useOnePool( 5 ).parallelMethods( 3 );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER ).useOnePool( 5 ).parallelMethods( 3 );
assertFalse( builder.isOptimized() );
ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer();
Result result = new JUnitCore().run( computer, NotThreadSafeTestSuite.class );
@@ -525,8 +529,8 @@ public class ParallelComputerBuilderTest
@Test
public void mixedThreadSafetyInSuite()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger )
- .useOnePool( 10 ).optimize( true ).parallelSuites( 2 ).parallelClasses( 3 ).parallelMethods( 3 );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER ).useOnePool( 10 ).optimize(
+ true ).parallelSuites( 2 ).parallelClasses( 3 ).parallelMethods( 3 );
ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer();
Result result = new JUnitCore().run( computer, MixedSuite.class );
assertTrue( result.wasSuccessful() );
@@ -547,8 +551,8 @@ public class ParallelComputerBuilderTest
@Test
public void inheritanceWithNotThreadSafe()
{
- ParallelComputerBuilder builder = new ParallelComputerBuilder( logger )
- .useOnePool( 10 ).optimize( true ).parallelSuites( 2 ).parallelClasses( 3 ).parallelMethods( 3 );
+ ParallelComputerBuilder builder = new ParallelComputerBuilder( LOGGER ).useOnePool( 10 ).optimize(
+ true ).parallelSuites( 2 ).parallelClasses( 3 ).parallelMethods( 3 );
ParallelComputerBuilder.PC computer = (ParallelComputerBuilder.PC) builder.buildComputer();
Result result = new JUnitCore().run( computer, OverMixedSuite.class );
assertTrue( result.wasSuccessful() );
@@ -567,8 +571,7 @@ public class ParallelComputerBuilderTest
}
@Test
- public void beforeAfterThreadChanges()
- throws InterruptedException
+ public void beforeAfterThreadChanges() throws InterruptedException
{
// try to GC dead Thread objects from previous tests
for ( int i = 0; i < 5; i++ )
@@ -577,7 +580,7 @@ public class ParallelComputerBuilderTest
TimeUnit.MILLISECONDS.sleep( 500L );
}
Collection<Thread> expectedThreads = jvmThreads();
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER );
parallelComputerBuilder.parallelMethods( 3 );
ParallelComputer computer = parallelComputerBuilder.buildComputer();
Result result = new JUnitCore().run( computer, TestWithBeforeAfter.class );
@@ -613,16 +616,13 @@ public class ParallelComputerBuilderTest
{
Result run( final boolean useInterrupt )
{
- ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( logger )
- .useOnePool( 8 )
- .parallelSuites( 2 )
- .parallelClasses( 3 )
- .parallelMethods( 3 );
+ ParallelComputerBuilder parallelComputerBuilder = new ParallelComputerBuilder( LOGGER ).useOnePool(
+ 8 ).parallelSuites( 2 ).parallelClasses( 3 ).parallelMethods( 3 );
assertFalse( parallelComputerBuilder.isOptimized() );
final ParallelComputerBuilder.PC computer =
- (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer();
+ (ParallelComputerBuilder.PC) parallelComputerBuilder.buildComputer();
shutdownTask = new Runnable()
{
@Override
@@ -636,6 +636,9 @@ public class ParallelComputerBuilderTest
}
}
+ /**
+ *
+ */
public static class Class1
{
static volatile int concurrentMethods = 0;
@@ -643,20 +646,18 @@ public class ParallelComputerBuilderTest
static volatile int maxConcurrentMethods = 0;
@Test
- public void test1()
- throws InterruptedException
+ public void test1() throws InterruptedException
{
- synchronized ( class1Lock )
+ synchronized ( CLASS1BLOCK )
{
++concurrentMethods;
- class1Lock.wait( DELAY_MULTIPLIER * 500L );
+ CLASS1BLOCK.wait( DELAY_MULTIPLIER * 500L );
maxConcurrentMethods = Math.max( maxConcurrentMethods, concurrentMethods-- );
}
}
@Test
- public void test2()
- throws InterruptedException
+ public void test2() throws InterruptedException
{
test1();
Runnable shutdownTask = ParallelComputerBuilderTest.shutdownTask;
@@ -668,71 +669,89 @@ public class ParallelComputerBuilderTest
}
}
- public static class Class2
- extends Class1
+ /**
+ *
+ */
+ public static class Class2 extends Class1
{
}
- public static class Class3
- extends Class1
+ /**
+ *
+ */
+ public static class Class3 extends Class1
{
}
+ /**
+ *
+ */
public static class NothingDoingTest1
{
- static final Collection<String> methods = new ConcurrentLinkedQueue<>();
+ private static final Collection<String> METHODS = new ConcurrentLinkedQueue<>();
@BeforeClass
public static void init()
{
- methods.add( "init" );
+ METHODS.add( "init" );
}
@AfterClass
public static void deinit()
{
- methods.add( "deinit" );
+ METHODS.add( "deinit" );
}
@Test
- public void a()
- throws InterruptedException
+ public void a() throws InterruptedException
{
Thread.sleep( 5 );
- methods.add( getClass().getName() + "#a()" );
+ METHODS.add( getClass().getName() + "#a()" );
}
@Test
- public void b()
- throws InterruptedException
+ public void b() throws InterruptedException
{
Thread.sleep( 5 );
- methods.add( getClass().getName() + "#b()" );
+ METHODS.add( getClass().getName() + "#b()" );
}
}
- public static class NothingDoingTest2
- extends NothingDoingTest1
+ /**
+ *
... 2251 lines suppressed ...