mirror of https://github.com/apache/maven.git
Add tests for new methods
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@570891 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
32f2fce4ee
commit
4f6f890697
|
@ -20,6 +20,7 @@ package org.apache.maven.embedder;
|
|||
*/
|
||||
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
@ -37,8 +38,11 @@ public class ValidateConfigurationTest
|
|||
ConfigurationValidationResult result = MavenEmbedder.validateConfiguration( configuration );
|
||||
|
||||
assertTrue( result.isUserSettingsFilePresent() );
|
||||
|
||||
assertTrue( result.isUserSettingsFileParses() );
|
||||
assertNotNull( result.getUserSettings() );
|
||||
assertNull( result.getUserSettingsException() );
|
||||
assertNull( result.getGlobalSettings() );
|
||||
assertNull( result.getGlobalSettingsException() );
|
||||
}
|
||||
|
||||
public void testConfigurationOnlyUserSettingsAreActiveAndItIsInvalid()
|
||||
|
@ -51,8 +55,12 @@ public class ValidateConfigurationTest
|
|||
ConfigurationValidationResult result = MavenEmbedder.validateConfiguration( configuration );
|
||||
|
||||
assertTrue( result.isUserSettingsFilePresent() );
|
||||
|
||||
assertFalse( result.isUserSettingsFileParses() );
|
||||
assertNull( result.getUserSettings() );
|
||||
assertNotNull( result.getUserSettingsException() );
|
||||
assertTrue( result.getUserSettingsException() instanceof XmlPullParserException );
|
||||
assertNull( result.getGlobalSettings() );
|
||||
assertNull( result.getGlobalSettingsException() );
|
||||
}
|
||||
|
||||
public void testConfigurationOnlyGlobalSettingsAreActiveAndItIsValid()
|
||||
|
@ -65,8 +73,11 @@ public class ValidateConfigurationTest
|
|||
ConfigurationValidationResult result = MavenEmbedder.validateConfiguration( configuration );
|
||||
|
||||
assertTrue( result.isGlobalSettingsFilePresent() );
|
||||
|
||||
assertTrue( result.isGlobalSettingsFileParses() );
|
||||
assertNotNull( result.getGlobalSettings() );
|
||||
assertNull( result.getGlobalSettingsException() );
|
||||
assertNull( result.getUserSettings() );
|
||||
assertNull( result.getUserSettingsException() );
|
||||
}
|
||||
|
||||
public void testConfigurationOnlyGlobalSettingsAreActiveAndItIsInvalid()
|
||||
|
@ -79,7 +90,11 @@ public class ValidateConfigurationTest
|
|||
ConfigurationValidationResult result = MavenEmbedder.validateConfiguration( configuration );
|
||||
|
||||
assertTrue( result.isGlobalSettingsFilePresent() );
|
||||
|
||||
assertFalse( result.isGlobalSettingsFileParses() );
|
||||
assertNull( result.getGlobalSettings() );
|
||||
assertNotNull( result.getGlobalSettingsException() );
|
||||
assertTrue( result.getGlobalSettingsException() instanceof XmlPullParserException );
|
||||
assertNull( result.getUserSettings() );
|
||||
assertNull( result.getUserSettingsException() );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue