michael-o commented on a change in pull request #6:
URL: https://github.com/apache/maven-verifier/pull/6#discussion_r778672107



##########
File path: src/test/java/org/apache/maven/it/Embedded3xLauncherTest.java
##########
@@ -0,0 +1,55 @@
+package org.apache.maven.it;
+
+/*
+ * 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 static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Properties;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+public class Embedded3xLauncherTest
+{
+    @Rule
+    public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    
+    private Embedded3xLauncher launcher;
+    
+    private final String workingDir = Paths.get( "src/test/resources" 
).toAbsolutePath().toString();
+
+    @Test
+    public void testWithClasspath() throws Exception
+    {
+        launcher = Embedded3xLauncher.createFromClasspath();
+        File logFile = temporaryFolder.newFile( "build.log" );
+
+        int exitCode = launcher.run( new String[]{ "clean" }, new 
Properties(), workingDir, logFile );
+
+        assertThat( "exit code unexpected, build log: " + 
System.lineSeparator() +
+                String.join(System.lineSeparator(), Files.readAllLines( 
logFile.toPath() ) ), exitCode , is ( 0 ) );

Review comment:
       `exitCode,`

##########
File path: src/main/java/org/apache/maven/it/Embedded3xLauncher.java
##########
@@ -268,4 +271,26 @@ public String getMavenVersion()
         throw new LauncherException( "Could not determine embedded Maven 
version" );
     }
 
+    /**
+     * Replicates the logic from <a href="https://git.io/JSMug";>Maven start 
script</a> to find 
+     * the project's base directory.
+     * @param workingDirectory the working directory
+     * @return the project's base directory
+     */
+    private static File findProjectBaseDirectory( File workingDirectory )

Review comment:
       Works both on Windows and POSIX-like?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to