You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/10/24 18:02:32 UTC
[maven] 01/03: Remove non-usable test
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch maven.config-from-start-scripts
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 6acc6d75226caa70f1c0d5cc0ff44623dfc8e16f
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Oct 24 19:46:49 2021 +0200
Remove non-usable test
---
.../java/org/apache/maven/cli/MavenCliTest.java | 160 ---------------------
.../test/projects/config-illegal/.mvn/maven.config | 1 -
.../src/test/projects/config/.mvn/maven.config | 3 -
.../mavenConfigProperties/.mvn/maven.config | 5 -
4 files changed, 169 deletions(-)
diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
index 4191e88..952033e 100644
--- a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
+++ b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java
@@ -161,166 +161,6 @@ public class MavenCliTest
}
@Test
- public void testMavenConfig()
- throws Exception
- {
- System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY,
- new File( "src/test/projects/config" ).getCanonicalPath() );
- CliRequest request = new CliRequest( new String[0], null );
-
- // read .mvn/maven.config
- cli.initialize( request );
- cli.cli( request );
- assertEquals( "multithreaded", request.commandLine.getOptionValue( CLIManager.BUILDER ) );
- assertEquals( "8", request.commandLine.getOptionValue( CLIManager.THREADS ) );
-
- // override from command line
- request = new CliRequest( new String[]{ "--builder", "foobar" }, null );
- cli.cli( request );
- assertEquals( "foobar", request.commandLine.getOptionValue( "builder" ) );
- }
-
- @Test
- public void testMavenConfigInvalid()
- throws Exception
- {
- System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY,
- new File( "src/test/projects/config-illegal" ).getCanonicalPath() );
- CliRequest request = new CliRequest( new String[0], null );
-
- cli.initialize( request );
- assertThrows( ParseException.class, () -> cli.cli( request ) );
- }
-
- /**
- * Read .mvn/maven.config with the following definitions:
- * <pre>
- * -T
- * 3
- * -Drevision=1.3.0
- * "-Dlabel=Apache Maven"
- * </pre>
- * and check if the {@code -T 3} option can be overwritten via command line
- * argument.
- *
- * @throws Exception in case of failure.
- */
- @Test
- public void testMVNConfigurationThreadCanBeOverwrittenViaCommandLine()
- throws Exception
- {
- System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY,
- new File( "src/test/projects/mavenConfigProperties" ).getCanonicalPath() );
- CliRequest request = new CliRequest( new String[]{ "-T", "5" }, null );
-
- cli.initialize( request );
- // read .mvn/maven.config
- cli.cli( request );
-
- assertEquals( "5", request.commandLine.getOptionValue( CLIManager.THREADS ) );
- }
-
- /**
- * Read .mvn/maven.config with the following definitions:
- * <pre>
- * -T
- * 3
- * -Drevision=1.3.0
- * "-Dlabel=Apache Maven"
- * </pre>
- * and check if the {@code -Drevision-1.3.0} option can be overwritten via command line
- * argument.
- *
- * @throws Exception
- */
- @Test
- public void testMVNConfigurationDefinedPropertiesCanBeOverwrittenViaCommandLine()
- throws Exception
- {
- System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY,
- new File( "src/test/projects/mavenConfigProperties" ).getCanonicalPath() );
- CliRequest request = new CliRequest( new String[]{ "-Drevision=8.1.0" }, null );
-
- cli.initialize( request );
- // read .mvn/maven.config
- cli.cli( request );
- cli.properties( request );
-
- String revision = System.getProperty( "revision" );
- assertEquals( "8.1.0", revision );
- }
-
- /**
- * Read .mvn/maven.config with the following definitions:
- * <pre>
- * -T
- * 3
- * -Drevision=1.3.0
- * "-Dlabel=Apache Maven"
- * </pre>
- * and check if the {@code -Drevision-1.3.0} option can be overwritten via command line
- * argument.
- *
- * @throws Exception
- */
- @Test
- public void testMVNConfigurationCLIRepeatedPropertiesLastWins()
- throws Exception
- {
- System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY,
- new File( "src/test/projects/mavenConfigProperties" ).getCanonicalPath() );
- CliRequest request = new CliRequest( new String[]{ "-Drevision=8.1.0", "-Drevision=8.2.0" }, null );
-
- cli.initialize( request );
- // read .mvn/maven.config
- cli.cli( request );
- cli.properties( request );
-
- String revision = System.getProperty( "revision" );
- assertEquals( "8.2.0", revision );
- }
-
- /**
- * Read .mvn/maven.config with the following definitions:
- * <pre>
- * -T
- * 3
- * -Drevision=1.3.0
- * "-Dlabel=Apache Maven"
- * </pre>
- * and check if the {@code -Drevision-1.3.0} option can be overwritten via command line argument when there are
- * funky arguments present.
- *
- * @throws Exception
- */
- @Test
- public void testMVNConfigurationFunkyArguments()
- throws Exception
- {
- System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY,
- new File( "src/test/projects/mavenConfigProperties" ).getCanonicalPath() );
- CliRequest request = new CliRequest(
- new String[]{ "-Drevision=8.1.0", "--file=-Dpom.xml", "\"-Dfoo=bar ", "\"-Dfoo2=bar two\"",
- "-Drevision=8.2.0" }, null );
-
- cli.initialize( request );
- // read .mvn/maven.config
- cli.cli( request );
- cli.properties( request );
-
- assertEquals( "3", request.commandLine.getOptionValue( CLIManager.THREADS ) );
-
- String revision = System.getProperty( "revision" );
- assertEquals( "8.2.0", revision );
-
- assertEquals( "bar ", request.getSystemProperties().getProperty( "foo" ) );
- assertEquals( "bar two", request.getSystemProperties().getProperty( "foo2" ) );
- assertEquals( "Apache Maven", request.getSystemProperties().getProperty( "label" ) );
-
- assertEquals( "-Dpom.xml", request.getCommandLine().getOptionValue( CLIManager.ALTERNATE_POM_FILE ) );
- }
-
- @Test
public void testStyleColors()
throws Exception
{
diff --git a/maven-embedder/src/test/projects/config-illegal/.mvn/maven.config b/maven-embedder/src/test/projects/config-illegal/.mvn/maven.config
deleted file mode 100644
index 8541464..0000000
--- a/maven-embedder/src/test/projects/config-illegal/.mvn/maven.config
+++ /dev/null
@@ -1 +0,0 @@
-deploy
diff --git a/maven-embedder/src/test/projects/config/.mvn/maven.config b/maven-embedder/src/test/projects/config/.mvn/maven.config
deleted file mode 100644
index 280d577..0000000
--- a/maven-embedder/src/test/projects/config/.mvn/maven.config
+++ /dev/null
@@ -1,3 +0,0 @@
--T8
---builder
-multithreaded
diff --git a/maven-embedder/src/test/projects/mavenConfigProperties/.mvn/maven.config b/maven-embedder/src/test/projects/mavenConfigProperties/.mvn/maven.config
deleted file mode 100644
index 8257023..0000000
--- a/maven-embedder/src/test/projects/mavenConfigProperties/.mvn/maven.config
+++ /dev/null
@@ -1,5 +0,0 @@
--T
-3
--Drevision=1.3.0
-"-Dlabel=Apache Maven"
-