You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2016/09/24 15:13:44 UTC
[23/40] maven git commit: [MNG-6075] Increase the model validation
level to the next minor level version.
[MNG-6075] Increase the model validation level to the next minor level version.
Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/615390d7
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/615390d7
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/615390d7
Branch: refs/heads/MNG-6012-Missing-Profile-At-End
Commit: 615390d7cfddb328704cf64f0a942a0f40d5c9df
Parents: 0fbad04
Author: Christian Schulte <sc...@apache.org>
Authored: Mon Aug 1 09:46:57 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Mon Aug 1 09:52:44 2016 +0200
----------------------------------------------------------------------
.../project/AbstractMavenProjectTestCase.java | 2 ++
.../validation/DefaultModelValidatorTest.java | 38 ++++++++++----------
2 files changed, 21 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/615390d7/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
----------------------------------------------------------------------
diff --git a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
index 7db65d8..68f0219 100644
--- a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
+++ b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
@@ -28,6 +28,7 @@ import org.apache.maven.artifact.repository.MavenArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.model.building.ModelBuildingException;
+import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
@@ -196,6 +197,7 @@ public abstract class AbstractMavenProjectTestCase
{
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setLocalRepository( getLocalRepository() );
+ configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
initRepoSession( configuration );
return configuration;
}
http://git-wip-us.apache.org/repos/asf/maven/blob/615390d7/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
index dde532d..3f44634 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
@@ -440,12 +440,12 @@ public class DefaultModelValidatorTest
{
SimpleProblemCollector result = validateRaw( "duplicate-plugin.xml" );
- assertViolations( result, 0, 0, 4 );
+ assertViolations( result, 0, 4, 0 );
- assertTrue( result.getWarnings().get( 0 ).contains( "duplicate declaration of plugin test:duplicate" ) );
- assertTrue( result.getWarnings().get( 1 ).contains( "duplicate declaration of plugin test:managed-duplicate" ) );
- assertTrue( result.getWarnings().get( 2 ).contains( "duplicate declaration of plugin profile:duplicate" ) );
- assertTrue( result.getWarnings().get( 3 ).contains( "duplicate declaration of plugin profile:managed-duplicate" ) );
+ assertTrue( result.getErrors().get( 0 ).contains( "duplicate declaration of plugin test:duplicate" ) );
+ assertTrue( result.getErrors().get( 1 ).contains( "duplicate declaration of plugin test:managed-duplicate" ) );
+ assertTrue( result.getErrors().get( 2 ).contains( "duplicate declaration of plugin profile:duplicate" ) );
+ assertTrue( result.getErrors().get( 3 ).contains( "duplicate declaration of plugin profile:managed-duplicate" ) );
}
public void testDuplicatePluginExecution()
@@ -466,12 +466,12 @@ public class DefaultModelValidatorTest
{
SimpleProblemCollector result = validate( "reserved-repository-id.xml" );
- assertViolations( result, 0, 0, 4 );
+ assertViolations( result, 0, 4, 0 );
- assertContains( result.getWarnings().get( 0 ), "'repositories.repository.id'" + " must not be 'local'" );
- assertContains( result.getWarnings().get( 1 ), "'pluginRepositories.pluginRepository.id' must not be 'local'" );
- assertContains( result.getWarnings().get( 2 ), "'distributionManagement.repository.id' must not be 'local'" );
- assertContains( result.getWarnings().get( 3 ),
+ assertContains( result.getErrors().get( 0 ), "'repositories.repository.id'" + " must not be 'local'" );
+ assertContains( result.getErrors().get( 1 ), "'pluginRepositories.pluginRepository.id' must not be 'local'" );
+ assertContains( result.getErrors().get( 2 ), "'distributionManagement.repository.id' must not be 'local'" );
+ assertContains( result.getErrors().get( 3 ),
"'distributionManagement.snapshotRepository.id' must not be 'local'" );
}
@@ -520,9 +520,9 @@ public class DefaultModelValidatorTest
{
SimpleProblemCollector result = validate( "bad-version.xml" );
- assertViolations( result, 0, 0, 1 );
+ assertViolations( result, 0, 1, 0 );
- assertContains( result.getWarnings().get( 0 ), "'version' must not contain any of these characters" );
+ assertContains( result.getErrors().get( 0 ), "'version' must not contain any of these characters" );
}
public void testBadSnapshotVersion()
@@ -530,9 +530,9 @@ public class DefaultModelValidatorTest
{
SimpleProblemCollector result = validate( "bad-snapshot-version.xml" );
- assertViolations( result, 0, 0, 1 );
+ assertViolations( result, 0, 1, 0 );
- assertContains( result.getWarnings().get( 0 ), "'version' uses an unsupported snapshot version format" );
+ assertContains( result.getErrors().get( 0 ), "'version' uses an unsupported snapshot version format" );
}
public void testBadRepositoryId()
@@ -540,15 +540,15 @@ public class DefaultModelValidatorTest
{
SimpleProblemCollector result = validate( "bad-repository-id.xml" );
- assertViolations( result, 0, 0, 4 );
+ assertViolations( result, 0, 4, 0 );
- assertContains( result.getWarnings().get( 0 ),
+ assertContains( result.getErrors().get( 0 ),
"'repositories.repository.id' must not contain any of these characters" );
- assertContains( result.getWarnings().get( 1 ),
+ assertContains( result.getErrors().get( 1 ),
"'pluginRepositories.pluginRepository.id' must not contain any of these characters" );
- assertContains( result.getWarnings().get( 2 ),
+ assertContains( result.getErrors().get( 2 ),
"'distributionManagement.repository.id' must not contain any of these characters" );
- assertContains( result.getWarnings().get( 3 ),
+ assertContains( result.getErrors().get( 3 ),
"'distributionManagement.snapshotRepository.id' must not contain any of these characters" );
}