You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2023/08/20 09:22:30 UTC
[maven-surefire] branch master updated (27548ec1c -> 8ca7a0950)
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
from 27548ec1c [SUREFIRE-2177] Use junit-bom instead of single JUnit 5 versions
new d48befbf2 [MNG-6847] Use diamond operator
new 8ca7a0950 [MNG-6847] Apply spotless
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java | 4 ++--
.../apache/maven/plugin/surefire/util/DependenciesScannerTest.java | 6 +++---
.../java/org/apache/maven/surefire/report/FileReporterTest.java | 4 ++--
.../java/org/apache/maven/surefire/booter/SurefireReflector.java | 2 +-
.../org/apache/maven/surefire/booter/SurefireReflectorTest.java | 2 +-
.../java/org/apache/maven/surefire/its/fixture/OutputValidator.java | 2 +-
.../src/test/java/debug/ParallelTest.java | 2 +-
.../java/org/apache/maven/surefire/junit4/JUnit4ProviderTest.java | 2 +-
.../org/apache/maven/surefire/junitcore/AsynchronousRunner.java | 2 +-
.../maven/surefire/junitcore/ConfigurableParallelComputer.java | 3 +--
.../maven/surefire/junitcore/pc/SharedThreadPoolStrategy.java | 2 +-
11 files changed, 15 insertions(+), 16 deletions(-)
[maven-surefire] 01/02: [MNG-6847] Use diamond operator
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit d48befbf2e368018e33048f588a79960779526af
Author: Tim te Beek <ti...@gmail.com>
AuthorDate: Sat Aug 19 20:47:30 2023 +0000
[MNG-6847] Use diamond operator
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.staticanalysis.UseDiamondOperator?organizationId=QXBhY2hlIE1hdmVu
Co-authored-by: Moderne <te...@moderne.io>
---
.../org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java | 4 ++--
.../apache/maven/plugin/surefire/util/DependenciesScannerTest.java | 6 +++---
.../java/org/apache/maven/surefire/report/FileReporterTest.java | 4 ++--
.../java/org/apache/maven/surefire/booter/SurefireReflector.java | 2 +-
.../org/apache/maven/surefire/booter/SurefireReflectorTest.java | 2 +-
.../java/org/apache/maven/surefire/its/fixture/OutputValidator.java | 2 +-
.../src/test/java/debug/ParallelTest.java | 2 +-
.../java/org/apache/maven/surefire/junit4/JUnit4ProviderTest.java | 2 +-
.../org/apache/maven/surefire/junitcore/AsynchronousRunner.java | 2 +-
.../maven/surefire/junitcore/ConfigurableParallelComputer.java | 2 +-
.../maven/surefire/junitcore/pc/SharedThreadPoolStrategy.java | 2 +-
11 files changed, 15 insertions(+), 15 deletions(-)
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 22bb2e78d..dee5e3926 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
@@ -131,7 +131,7 @@ public class AbstractSurefireMojoTest {
public void setupMojo() {
Artifact mojoArtifact = mojo.getMojoArtifact();
- mojo.setPluginArtifactMap(new LinkedHashMap<String, Artifact>());
+ mojo.setPluginArtifactMap(new LinkedHashMap<>());
mojo.getPluginArtifactMap().put(mojoArtifact.getGroupId() + ":" + mojoArtifact.getArtifactId(), mojoArtifact);
Artifact forkedBooter = new DefaultArtifact(
"org.apache.maven.surefire",
@@ -143,7 +143,7 @@ public class AbstractSurefireMojoTest {
mock(ArtifactHandler.class));
mojo.getPluginArtifactMap().put("org.apache.maven.surefire:surefire-booter", forkedBooter);
- mojo.setProjectArtifactMap(new LinkedHashMap<String, Artifact>());
+ mojo.setProjectArtifactMap(new LinkedHashMap<>());
MavenSession session = mock(MavenSession.class);
mojo.setSession(session);
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 05b339131..e392d8c02 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
@@ -157,9 +157,9 @@ public class DependenciesScannerTest {
List<String> scanDependencies = new ArrayList<>();
scanDependencies.add("org.surefire.dependency:dependent-artifact3:test-jar");
- 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(mainArtifact, testArtifact);
@@ -223,7 +223,7 @@ public class DependenciesScannerTest {
assertEquals(1, classNames.size());
assertEquals("org.test2.ClassA", classNames.getClassName(0));
- Map<String, String> props = new HashMap<String, String>();
+ Map<String, String> props = new HashMap<>();
classNames.writeTo(props);
assertEquals(1, props.size());
assertFalse(props.values().contains("org.test.ClassA"));
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 98478237c..12c159023 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
@@ -49,7 +49,7 @@ public class FileReporterTest extends TestCase {
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>());
+ reporter.testSetCompleted(wrappedReportEntry, createTestSetStats(), new ArrayList<>());
File expectedReportFile = new File(reportDir, TEST_NAME + ".txt");
assertTrue(
@@ -70,7 +70,7 @@ public class FileReporterTest extends TestCase {
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>());
+ reporter.testSetCompleted(wrappedReportEntry, createTestSetStats(), new ArrayList<>());
File expectedReportFile = new File(reportDir, TEST_NAME + "-" + suffixText + ".txt");
assertTrue(
diff --git a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
index 0f0f99b28..90d227941 100644
--- a/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
+++ b/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SurefireReflector.java
@@ -198,7 +198,7 @@ public final class SurefireReflector {
public void setMainCliOptions(Object o, List<CommandLineOption> options) {
if (baseProviderFactory.isAssignableFrom(o.getClass())) {
- List<Enum<?>> newOptions = checkedList(new ArrayList<Enum<?>>(options.size()), commandLineOptionsClass);
+ List<Enum<?>> newOptions = checkedList(new ArrayList<>(options.size()), commandLineOptionsClass);
Collection<Integer> ordinals = toOrdinals(options);
for (Enum<?> e : commandLineOptionsClass.getEnumConstants()) {
if (ordinals.contains(e.ordinal())) {
diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
index 4e90ffd3b..25b73bae5 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SurefireReflectorTest.java
@@ -158,7 +158,7 @@ public class SurefireReflectorTest extends TestCase {
SurefireReflector surefireReflector = getReflector();
Object foo = getFoo();
- surefireReflector.setProviderProperties(foo, new HashMap<String, String>());
+ surefireReflector.setProviderProperties(foo, new HashMap<>());
assertTrue(isCalled(foo));
}
diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java
index eddf8e721..42819c5d8 100644
--- a/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java
+++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/fixture/OutputValidator.java
@@ -184,7 +184,7 @@ public class OutputValidator {
public String[] getStringsOrderInLog(String[] strings) throws VerificationException {
String[] retArr = new String[strings.length];
- List<String> strList = new ArrayList<String>(Arrays.asList(strings));
+ List<String> strList = new ArrayList<>(Arrays.asList(strings));
int i = 0;
for (String line : loadLogLines()) {
for (int j = 0; j < strList.size(); j++) {
diff --git a/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java b/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java
index 6863f628f..098673f91 100644
--- a/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java
+++ b/surefire-its/src/test/resources/surefire-1179-testng-parallel-dataprovider/src/test/java/debug/ParallelTest.java
@@ -21,7 +21,7 @@ public class ParallelTest
@DataProvider( parallel = true, name = "dataProvider" )
public Iterator<Object[]> dataProvider()
{
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
for ( int i = 0; i < 5000; i++ )
{
data.add( new Object[]{ "ID_" + i } );
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 c66ae824d..960bc8dc6 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
@@ -49,7 +49,7 @@ public class JUnit4ProviderTest {
private JUnit4Provider getJUnit4Provider() {
BaseProviderFactory providerParameters = new BaseProviderFactory(true);
- providerParameters.setProviderProperties(new HashMap<String, String>());
+ providerParameters.setProviderProperties(new HashMap<>());
providerParameters.setClassLoaders(getClass().getClassLoader());
providerParameters.setTestRequest(new TestRequest(null, null, null));
providerParameters.setRunOrderParameters(new RunOrderParameters("hourly", new File("")));
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java
index e2ac33539..e4f7df924 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/AsynchronousRunner.java
@@ -36,7 +36,7 @@ import org.junit.runners.model.RunnerScheduler;
*/
@Deprecated
public class AsynchronousRunner implements RunnerScheduler {
- private final List<Future<Object>> futures = Collections.synchronizedList(new ArrayList<Future<Object>>());
+ private final List<Future<Object>> futures = Collections.synchronizedList(new ArrayList<>());
private final ExecutorService fService;
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java
index f62813469..3cb1f68a4 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java
@@ -54,7 +54,7 @@ public class ConfigurableParallelComputer extends Computer {
private final ExecutorService fService;
private final List<AsynchronousRunner> nonBlockers =
- Collections.synchronizedList(new ArrayList<AsynchronousRunner>());
+ Collections.synchronizedList(new ArrayList<>());
public ConfigurableParallelComputer() {
this(true, true, Executors.newCachedThreadPool(DAEMON_THREAD_FACTORY), false);
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/SharedThreadPoolStrategy.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/SharedThreadPoolStrategy.java
index 6ca88bbf6..e24ad1bfa 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/SharedThreadPoolStrategy.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/pc/SharedThreadPoolStrategy.java
@@ -35,7 +35,7 @@ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
*/
final class SharedThreadPoolStrategy extends AbstractThreadPoolStrategy {
SharedThreadPoolStrategy(ConsoleLogger logger, ExecutorService threadPool) {
- super(logger, threadPool, new ConcurrentLinkedQueue<Future<?>>());
+ super(logger, threadPool, new ConcurrentLinkedQueue<>());
}
@Override
[maven-surefire] 02/02: [MNG-6847] Apply spotless
Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit 8ca7a09500fcca366039fcaaa33a927c40225078
Author: Tim te Beek <ti...@moderne.io>
AuthorDate: Sat Aug 19 23:01:10 2023 +0200
[MNG-6847] Apply spotless
---
.../apache/maven/surefire/junitcore/ConfigurableParallelComputer.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java
index 3cb1f68a4..49c0037bd 100644
--- a/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java
+++ b/surefire-providers/surefire-junit47/src/main/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputer.java
@@ -53,8 +53,7 @@ public class ConfigurableParallelComputer extends Computer {
private final ExecutorService fService;
- private final List<AsynchronousRunner> nonBlockers =
- Collections.synchronizedList(new ArrayList<>());
+ private final List<AsynchronousRunner> nonBlockers = Collections.synchronizedList(new ArrayList<>());
public ConfigurableParallelComputer() {
this(true, true, Executors.newCachedThreadPool(DAEMON_THREAD_FACTORY), false);