You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/05/11 08:31:19 UTC

[GitHub] [maven-integration-testing] cstamas opened a new pull request, #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

cstamas opened a new pull request, #158:
URL: https://github.com/apache/maven-integration-testing/pull/158

   An IT for Maven 3.9+ that "exercise" both resolver transport: wagon and native.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870172914


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    private void performTest( final String transport, final String logSnippet ) throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+            verifier.setLogFileName( transport + "-transport.log" );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=" + transport );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            // verify maven console output contains "[DEBUG] Using transporter XXXTransporter"
+            verifyLogHasLine( verifier, logSnippet );
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    private void verifyLogHasLine( final Verifier verifier, final String logSnippet )
+            throws VerificationException
+    {
+        List<String> lines = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
+
+        for ( String line : lines )
+        {
+            if ( !line.contains( logSnippet ) )

Review Comment:
   should be
   ```
   if ( line.contains( logSnippet ) )
   ```



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1124272468

   Works for me now except for the JEtty log output which I don't understand....


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870109065


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    public void testResolverTransportNative()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "native" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.native" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=native" );

Review Comment:
   sure, as it fallbacks to wagon, that's not the point here



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123846265

   Fix merged, so the IT can be as well....


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123413971

   On
   ```
   Java version: 1.8.0_322, vendor: OpenJDK BSD Porting Team, runtime: /usr/local/openjdk8/jre
   Default locale: de_DE, platform encoding: UTF-8
   OS name: "freebsd", version: "12.3-stable", arch: "amd64", family: "unix"
   ```


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870318471


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    private void performTest( final String transport, final String logSnippet ) throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+            verifier.setLogFileName( transport + "-transport.log" );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=" + transport );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            // verify maven console output contains "[DEBUG] Using transporter XXXTransporter"
+            verifyLogHasLine( verifier, logSnippet );
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    private void verifyLogHasLine( final Verifier verifier, final String logSnippet )

Review Comment:
   Agreed



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1124288722

   https://github.com/apache/maven/pull/732 is merged, so am merging this one as well (ongoing branches not having merged PR will fail here)


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870174840


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    private void performTest( final String transport, final String logSnippet ) throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+            verifier.setLogFileName( transport + "-transport.log" );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=" + transport );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            // verify maven console output contains "[DEBUG] Using transporter XXXTransporter"
+            verifyLogHasLine( verifier, logSnippet );
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    private void verifyLogHasLine( final Verifier verifier, final String logSnippet )
+            throws VerificationException
+    {
+        List<String> lines = verifier.loadFile( verifier.getBasedir(), verifier.getLogFileName(), false );
+
+        for ( String line : lines )
+        {
+            if ( !line.contains( logSnippet ) )

Review Comment:
   fixed



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123373546

   > Yes, this is what I will look for. Can you add this as a comment to the tests. It is not obvious from the code itself.
   
   Done.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870072935


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );

Review Comment:
   I can remove it and test still pass ...



##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    public void testResolverTransportNative()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "native" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.native" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=native" );

Review Comment:
   I can remove it and test still pass ...



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1124179020

   Still testing...


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870536089


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    private void performTest( final String transport, final String logSnippet ) throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+            verifier.setLogFileName( transport + "-transport.log" );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=" + transport );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            // verify maven console output contains "[DEBUG] Using transporter XXXTransporter"
+            verifyLogHasLine( verifier, logSnippet );
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    private void verifyLogHasLine( final Verifier verifier, final String logSnippet )

Review Comment:
   There is `verifier.verifyTextInLog(...)`



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123404480

   [INFO] Downloading from maven-core-it: http://localhost:53770/org/apache/maven/its/resolver-transport/wagon/dependency/1.0/dependency-1.0.pom
   [WARNING] Checksum validation failed, expected '97641443fee307b6c3593080be865df89ace3d86' (REMOTE_EXTERNAL) but is actually 'cd16a85341375c7f9dda5edd75dedb83e213e425' from maven-core-it for http://localhost:53770/org/apache/maven/its/resolver-transport/wagon/dependency/1.0/dependency-1.0.pom
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870300031


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    private void performTest( final String transport, final String logSnippet ) throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+            verifier.setLogFileName( transport + "-transport.log" );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );

Review Comment:
   space



##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    private void performTest( final String transport, final String logSnippet ) throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+            verifier.setLogFileName( transport + "-transport.log" );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=" + transport );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            // verify maven console output contains "[DEBUG] Using transporter XXXTransporter"
+            verifyLogHasLine( verifier, logSnippet );
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    private void verifyLogHasLine( final Verifier verifier, final String logSnippet )

Review Comment:
   I bet I have seen this in other ITs already. I guess `Verifier` needs this bundled. Out of scope for this PR.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870565382


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    private void performTest( final String transport, final String logSnippet ) throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "project" ).getAbsolutePath() );
+            verifier.setLogFileName( transport + "-transport.log" );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=" + transport );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            // verify maven console output contains "[DEBUG] Using transporter XXXTransporter"
+            verifyLogHasLine( verifier, logSnippet );
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    private void verifyLogHasLine( final Verifier verifier, final String logSnippet )

Review Comment:
   fixed



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870109314


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );

Review Comment:
   sure, as wagon is the default, but is here only to be explicit



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123568367

   Now i have ...
   
   ```
   Caused by: java.lang.NoSuchMethodError: org.eclipse.aether.spi.connector.layout.RepositoryLayout.getChecksums(Lorg/eclipse/aether/artifact/Artifact;ZLjava/net/URI;)Ljava/util/List;
       at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:257)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:520)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:408)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:235)
       at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:212)
       at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:272)
       at org.apache.maven.resolver.examples.maven.ResolveArtifactMojo.execute (ResolveArtifactMojo.java:98)
   ```


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123571081

   Both tests use the same project directory .... pleas add
   
   ```
   verifier.setLogFileName( ... );
   ```
   
   without it we have logs in file `log.txt` which content logs from last executed test


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870122411


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    public void testResolverTransportNative()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "native" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.native" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=native" );

Review Comment:
   We should check if in log we have
   
   ```
   [DEBUG] Using transporter ...
   ```
   
   If we explicite selected transport, no fallback should occurs.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123506079

   Will test again...


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123394490

   Do not merge pls, I'll do myself once done


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123537993

   We should also check what happens if wrong transport will be provided, like `maven.resolver.transport=xxx`
   We will be sure that property is used at all


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123538639

   > Is it ok?
   
   That should not happen, especially as now assertion to debug log is added. Did you return the removed line?


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123552489

   > We should also check what happens if wrong transport will be provided, like `maven.resolver.transport=xxx` We will be sure that property is used at all
   
   IMHO, this is not a UT, this IT merely ensures that selected transport IS used and WORKS.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas merged pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas merged PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870023132


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,89 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption(new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    public void testResolverTransportNative()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "native" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.native" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption(new File( testDir, "settings.xml" ).getAbsolutePath() );

Review Comment:
   space missing



##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,89 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption(new File( testDir, "settings.xml" ).getAbsolutePath() );

Review Comment:
   space missing



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870024752


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,89 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption(new File( testDir, "settings.xml" ).getAbsolutePath() );

Review Comment:
   > Where is the verification that the transport actually works, i.e., the right one is picked?
   
   Maven build fails if project deps cannot be resolved... is that what you asking?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123359503

   > Where is the verification that the transport actually works, i.e., the right one is picked?
   
   Maven build fails if project deps cannot be resolved... is that what you asking?


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870073498


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );
+            // Maven will fail if project dependencies cannot be resolved.
+            // As dependency exists ONLY in HTTP repo, it MUST be reached using selected transport and
+            // successfully resolved from it.
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+            verifier.resetStreams();
+        }
+        finally
+        {
+            server.stop();
+        }
+    }
+
+    public void testResolverTransportNative()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "native" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.native" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=native" );

Review Comment:
   I can remove it and test still pass ...
   
   ```
   verifier.addCliOption( "-Dmaven.resolver.transport=native" );
   ```



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] slawekjaranowski commented on a diff in pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#discussion_r870074803


##########
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7470ResolverTransportTest.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.maven.it;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7470">MNG-7470</a>:
+ * check that Maven two bundled transports works as expected.
+ */
+public class MavenITmng7470ResolverTransportTest
+        extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng7470ResolverTransportTest()
+    {
+        super( "[3.9.0,)" );
+    }
+
+    public void testResolverTransportWagon()
+            throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-7470-resolver-transport" );
+
+        HttpServer server = HttpServer.builder()
+                .port( 0 )
+                .source( new File( testDir, "repo" ) )
+                .build();
+        server.start();
+        try
+        {
+            Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+            HashMap<String, String> properties = new HashMap<>();
+            properties.put( "@port@", Integer.toString( server.port() ) );
+            verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", properties );
+
+            verifier = newVerifier( new File( testDir, "wagon" ).getAbsolutePath() );
+            verifier.deleteDirectory( "target" );
+            verifier.deleteArtifacts( "org.apache.maven.its.resolver-transport.wagon" );
+            verifier.addCliOption( "-X" );
+            verifier.addCliOption("-s" );
+            verifier.addCliOption( new File( testDir, "settings.xml" ).getAbsolutePath() );
+            verifier.addCliOption( "-Pmaven-core-it-repo" );
+            verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );

Review Comment:
   only one line ...
   ```
    verifier.addCliOption( "-Dmaven.resolver.transport=wagon" );
   ```



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123368629

   > > Where is the verification that the transport actually works, i.e., the right one is picked?
   > 
   > Maven build fails if project deps cannot be resolved... is that what you asking?
   
   Yes, this is what I will look for. Can you add this as a comment to the tests. It is not obvious from the code itself.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] michael-o commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
michael-o commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123375096

   Testing...


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123475324

   @michael-o @slawekjaranowski so pushed all I wanted, and locally tested, updated description.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123577828

   > Both tests use the same project directory .... pleas add
   > 
   > ```
   > verifier.setLogFileName( ... );
   > ```
   > 
   > without it we have logs in file `log.txt` which content logs from last executed test
   
   fixed


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven-integration-testing] cstamas commented on pull request #158: [MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport

Posted by GitBox <gi...@apache.org>.
cstamas commented on PR #158:
URL: https://github.com/apache/maven-integration-testing/pull/158#issuecomment-1123569929

   @slawekjaranowski cool, that's expected with latest maven 3.9.x build, as it uses resolver 1.8.0 but has no fix in https://github.com/apache/maven/pull/732 Now, to verify, build locally that PR and run ITs with it, and they should all pass OK


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org