use of org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration in project maven-plugins by apache.
the class ArtifactTypeMappingServiceTest method testConfigWithNoType.
public void testConfigWithNoType() {
try {
XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration("dummy");
XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration(ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT);
childConfig.setAttribute("mapping", "ejb");
rootConfig.addChild(childConfig);
ArtifactTypeMappingService service = new ArtifactTypeMappingService();
service.configure(rootConfig);
fail("Should have failed");
} catch (EarPluginException e) {
// OK
} catch (PlexusConfigurationException e) {
e.printStackTrace();
fail("Unexpected " + e.getMessage());
}
}
use of org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration in project maven-plugins by apache.
the class ArtifactTypeMappingServiceTest method getServiceWithRarMappingToMyRar.
// Utilities
protected ArtifactTypeMappingService getServiceWithRarMappingToMyRar() {
try {
XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration("artifact-type-mappings");
XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration(ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT);
childConfig.setAttribute("type", "MyRar");
childConfig.setAttribute("mapping", "rar");
rootConfig.addChild(childConfig);
ArtifactTypeMappingService service = new ArtifactTypeMappingService();
service.configure(rootConfig);
return service;
} catch (EarPluginException e) {
e.printStackTrace();
fail(e.getMessage());
} catch (PlexusConfigurationException e) {
e.printStackTrace();
fail(e.getMessage());
}
// Won't occur
return null;
}
use of org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration in project maven-plugins by apache.
the class ArtifactTypeMappingServiceTest method testConfigWithUnknownStandardType.
public void testConfigWithUnknownStandardType() {
try {
XmlPlexusConfiguration rootConfig = new XmlPlexusConfiguration("dummy");
XmlPlexusConfiguration childConfig = new XmlPlexusConfiguration(ArtifactTypeMappingService.ARTIFACT_TYPE_MAPPING_ELEMENT);
childConfig.setAttribute("type", "generic");
childConfig.setAttribute("mapping", "notAStandardType");
rootConfig.addChild(childConfig);
ArtifactTypeMappingService service = new ArtifactTypeMappingService();
service.configure(rootConfig);
fail("Should have failed");
} catch (EarPluginException e) {
// OK
} catch (PlexusConfigurationException e) {
e.printStackTrace();
fail("Unexpected " + e.getMessage());
}
}
Aggregations