mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-27 16:08:21 +00:00
Reformat the code using mvn clean process-sources
This commit is contained in:
@@ -19,7 +19,6 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.assertj.core.api.Condition;
|
||||
|
||||
/**
|
||||
|
@@ -20,7 +20,6 @@ import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.assertj.core.api.Condition;
|
||||
|
||||
/**
|
||||
|
@@ -23,14 +23,11 @@ import java.nio.file.attribute.PosixFileAttributeView;
|
||||
import java.nio.file.attribute.PosixFilePermission;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.jboss.fuse.mvnd.client.BuildProperties;
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
import org.jboss.fuse.mvnd.client.ClientOutput;
|
||||
import org.jboss.fuse.mvnd.client.DefaultClient;
|
||||
import org.jboss.fuse.mvnd.client.Environment;
|
||||
import org.jboss.fuse.mvnd.junit.MvndNativeTest;
|
||||
import org.jboss.fuse.mvnd.junit.TestLayout;
|
||||
|
@@ -20,15 +20,12 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
import org.jboss.fuse.mvnd.client.ClientLayout;
|
||||
import org.jboss.fuse.mvnd.client.ClientOutput;
|
||||
import org.jboss.fuse.mvnd.junit.MvndNativeTest;
|
||||
import org.jboss.fuse.mvnd.junit.MvndTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
@@ -52,7 +49,8 @@ public class ModuleAndPluginNativeIT {
|
||||
|
||||
final Path localMavenRepo = layout.getLocalMavenRepository();
|
||||
final Path[] installedJars = {
|
||||
localMavenRepo.resolve("org/jboss/fuse/mvnd/test/module-and-plugin/module-and-plugin-maven-plugin/0.0.1-SNAPSHOT/module-and-plugin-maven-plugin-0.0.1-SNAPSHOT.jar"),
|
||||
localMavenRepo.resolve(
|
||||
"org/jboss/fuse/mvnd/test/module-and-plugin/module-and-plugin-maven-plugin/0.0.1-SNAPSHOT/module-and-plugin-maven-plugin-0.0.1-SNAPSHOT.jar"),
|
||||
};
|
||||
Stream.of(installedJars).forEach(jar -> Assertions.assertThat(jar).doesNotExist());
|
||||
|
||||
@@ -68,7 +66,8 @@ public class ModuleAndPluginNativeIT {
|
||||
|
||||
/* Build #2: with the mojo source changed to output "Hi" to target/hello.txt */
|
||||
{
|
||||
final Path mojoPath = layout.multiModuleProjectDirectory().resolve("plugin/src/main/java/org/jboss/fuse/mvnd/test/module/plugin/mojo/HelloMojo.java");
|
||||
final Path mojoPath = layout.multiModuleProjectDirectory()
|
||||
.resolve("plugin/src/main/java/org/jboss/fuse/mvnd/test/module/plugin/mojo/HelloMojo.java");
|
||||
String mojoSource = new String(Files.readAllBytes(mojoPath), StandardCharsets.UTF_8);
|
||||
mojoSource = mojoSource.replace("\"Hello\".getBytes", "\"Hi\".getBytes");
|
||||
Files.write(mojoPath, mojoSource.getBytes(StandardCharsets.UTF_8));
|
||||
|
@@ -19,9 +19,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.jboss.fuse.mvnd.assertj.EqualsInOrderAmongOthers;
|
||||
import org.jboss.fuse.mvnd.assertj.MatchInOrderAmongOthers;
|
||||
@@ -58,9 +56,12 @@ public class MultiModuleTest {
|
||||
|
||||
final Path localMavenRepo = layout.getLocalMavenRepository();
|
||||
final Path[] installedJars = {
|
||||
localMavenRepo.resolve("org/jboss/fuse/mvnd/test/multi-module/multi-module-api/0.0.1-SNAPSHOT/multi-module-api-0.0.1-SNAPSHOT.jar"),
|
||||
localMavenRepo.resolve("org/jboss/fuse/mvnd/test/multi-module/multi-module-hello/0.0.1-SNAPSHOT/multi-module-hello-0.0.1-SNAPSHOT.jar"),
|
||||
localMavenRepo.resolve("org/jboss/fuse/mvnd/test/multi-module/multi-module-hi/0.0.1-SNAPSHOT/multi-module-hi-0.0.1-SNAPSHOT.jar")
|
||||
localMavenRepo.resolve(
|
||||
"org/jboss/fuse/mvnd/test/multi-module/multi-module-api/0.0.1-SNAPSHOT/multi-module-api-0.0.1-SNAPSHOT.jar"),
|
||||
localMavenRepo.resolve(
|
||||
"org/jboss/fuse/mvnd/test/multi-module/multi-module-hello/0.0.1-SNAPSHOT/multi-module-hello-0.0.1-SNAPSHOT.jar"),
|
||||
localMavenRepo.resolve(
|
||||
"org/jboss/fuse/mvnd/test/multi-module/multi-module-hi/0.0.1-SNAPSHOT/multi-module-hi-0.0.1-SNAPSHOT.jar")
|
||||
};
|
||||
Stream.of(installedJars).forEach(jar -> Assertions.assertThat(jar).doesNotExist());
|
||||
|
||||
|
@@ -21,7 +21,6 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
|
||||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
||||
|
||||
|
@@ -19,9 +19,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
import org.jboss.fuse.mvnd.client.ClientLayout;
|
||||
@@ -47,7 +45,8 @@ public class SingleModuleNativeIT {
|
||||
Files.delete(helloFilePath);
|
||||
}
|
||||
|
||||
final Path installedJar = layout.getLocalMavenRepository().resolve("org/jboss/fuse/mvnd/test/single-module/single-module/0.0.1-SNAPSHOT/single-module-0.0.1-SNAPSHOT.jar");
|
||||
final Path installedJar = layout.getLocalMavenRepository().resolve(
|
||||
"org/jboss/fuse/mvnd/test/single-module/single-module/0.0.1-SNAPSHOT/single-module-0.0.1-SNAPSHOT.jar");
|
||||
Assertions.assertThat(installedJar).doesNotExist();
|
||||
|
||||
final ClientOutput o = Mockito.mock(ClientOutput.class);
|
||||
@@ -61,7 +60,8 @@ public class SingleModuleNativeIT {
|
||||
inOrder.verify(o).accept(Mockito.contains(MvndTestUtil.plugin(props, "maven-compiler-plugin") + ":testCompile"));
|
||||
inOrder.verify(o).accept(Mockito.contains(MvndTestUtil.plugin(props, "maven-surefire-plugin") + ":test"));
|
||||
inOrder.verify(o).accept(Mockito.contains(MvndTestUtil.plugin(props, "maven-install-plugin") + ":install"));
|
||||
inOrder.verify(o).accept(Mockito.contains("SUCCESS build of project org.jboss.fuse.mvnd.test.single-module:single-module"));
|
||||
inOrder.verify(o)
|
||||
.accept(Mockito.contains("SUCCESS build of project org.jboss.fuse.mvnd.test.single-module:single-module"));
|
||||
|
||||
assertJVM(o, props);
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
package org.jboss.fuse.mvnd.it;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.jboss.fuse.mvnd.client.ClientOutput;
|
||||
import org.jboss.fuse.mvnd.junit.MvndTest;
|
||||
import org.mockito.InOrder;
|
||||
|
@@ -17,9 +17,7 @@ package org.jboss.fuse.mvnd.it;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.jboss.fuse.mvnd.assertj.MatchInOrderAmongOthers;
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
|
@@ -16,9 +16,7 @@
|
||||
package org.jboss.fuse.mvnd.it;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.jboss.fuse.mvnd.assertj.MatchInOrderAmongOthers;
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
|
@@ -19,7 +19,6 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
|
@@ -19,7 +19,6 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
@ExtendWith(MvndTestExtension.class)
|
||||
|
@@ -25,12 +25,11 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.jboss.fuse.mvnd.client.DefaultClient;
|
||||
import org.jboss.fuse.mvnd.client.BuildProperties;
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
import org.jboss.fuse.mvnd.client.DaemonInfo;
|
||||
import org.jboss.fuse.mvnd.client.DaemonRegistry;
|
||||
import org.jboss.fuse.mvnd.client.DefaultClient;
|
||||
import org.jboss.fuse.mvnd.client.Layout;
|
||||
import org.jboss.fuse.mvnd.jpm.ProcessImpl;
|
||||
import org.junit.jupiter.api.extension.AfterAllCallback;
|
||||
@@ -59,7 +58,8 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
|
||||
} else {
|
||||
final MvndNativeTest mvndNativeTest = testClass.getAnnotation(MvndNativeTest.class);
|
||||
store.put(MvndResource.class.getName(),
|
||||
MvndResource.create(context.getRequiredTestClass().getSimpleName(), mvndNativeTest.projectDir(), true, mvndNativeTest.timeoutSec() * 1000L));
|
||||
MvndResource.create(context.getRequiredTestClass().getSimpleName(), mvndNativeTest.projectDir(), true,
|
||||
mvndNativeTest.timeoutSec() * 1000L));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.bootException = e;
|
||||
@@ -87,11 +87,13 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
|
||||
f.set(testInstance, resource.layout);
|
||||
} else if (f.getType() == Client.class) {
|
||||
if (resource.isNative) {
|
||||
final Path mvndNativeExecutablePath = Paths.get(System.getProperty("mvnd.native.executable")).toAbsolutePath().normalize();
|
||||
final Path mvndNativeExecutablePath = Paths.get(System.getProperty("mvnd.native.executable"))
|
||||
.toAbsolutePath().normalize();
|
||||
if (!Files.isRegularFile(mvndNativeExecutablePath)) {
|
||||
throw new IllegalStateException("mvnd executable does not exist: " + mvndNativeExecutablePath);
|
||||
}
|
||||
f.set(testInstance, new NativeTestClient(resource.layout, mvndNativeExecutablePath, resource.timeoutMs));
|
||||
f.set(testInstance,
|
||||
new NativeTestClient(resource.layout, mvndNativeExecutablePath, resource.timeoutMs));
|
||||
} else {
|
||||
f.set(testInstance, new DefaultClient(() -> resource.layout, BuildProperties.getInstance()));
|
||||
}
|
||||
@@ -119,7 +121,8 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
|
||||
private final boolean isNative;
|
||||
private final long timeoutMs;
|
||||
|
||||
public static MvndResource create(String className, String rawProjectDir, boolean isNative, long timeoutMs) throws IOException {
|
||||
public static MvndResource create(String className, String rawProjectDir, boolean isNative, long timeoutMs)
|
||||
throws IOException {
|
||||
if (rawProjectDir == null) {
|
||||
throw new IllegalStateException("rawProjectDir of @MvndTest must be set");
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.jboss.fuse.mvnd.client.Client;
|
||||
import org.jboss.fuse.mvnd.client.ClientLayout;
|
||||
import org.jboss.fuse.mvnd.client.ClientOutput;
|
||||
|
@@ -16,7 +16,6 @@
|
||||
package org.jboss.fuse.mvnd.junit;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
import org.jboss.fuse.mvnd.client.ClientLayout;
|
||||
|
||||
public class TestLayout extends ClientLayout {
|
||||
|
Reference in New Issue
Block a user