use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.
the class DescribeMojoTest method testParsePluginInfoGAV.
public void testParsePluginInfoGAV() throws Throwable {
DescribeMojo mojo = new DescribeMojo();
PrivateAccessor.setField(mojo, "groupId", "org.test");
PrivateAccessor.setField(mojo, "artifactId", "test");
PrivateAccessor.setField(mojo, "version", "1.0");
PluginInfo pi = (PluginInfo) PrivateAccessor.invoke(mojo, "parsePluginLookupInfo", null, null);
assertEquals(pi.getGroupId(), "org.test");
assertEquals(pi.getArtifactId(), "test");
assertEquals(pi.getVersion(), "1.0");
assertNull(pi.getPrefix());
}
use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.
the class DescribeMojoTest method testParsePluginInfoPluginGA.
public void testParsePluginInfoPluginGA() throws Throwable {
DescribeMojo mojo = new DescribeMojo();
PrivateAccessor.setField(mojo, "plugin", "org.test:test");
PluginInfo pi = (PluginInfo) PrivateAccessor.invoke(mojo, "parsePluginLookupInfo", null, null);
assertEquals("org.test", pi.getGroupId());
assertEquals("test", pi.getArtifactId());
assertNull(pi.getVersion());
assertNull(pi.getPrefix());
}
use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.
the class DescribeMojoTest method testLookupPluginDescriptorGMissingA.
public void testLookupPluginDescriptorGMissingA() throws Throwable {
DescribeMojo mojo = new DescribeMojo();
PluginInfo pi = new PluginInfo();
pi.setGroupId("org.test");
try {
PrivateAccessor.invoke(mojo, "lookupPluginDescriptor", new Class[] { PluginInfo.class }, new Object[] { pi });
fail();
} catch (Exception e) {
assertTrue(e.getMessage().startsWith("You must specify either"));
}
}
use of org.apache.maven.plugins.help.DescribeMojo.PluginInfo in project maven-plugins by apache.
the class DescribeMojoTest method testParsePluginInfoPluginGAV.
public void testParsePluginInfoPluginGAV() throws Throwable {
DescribeMojo mojo = new DescribeMojo();
PrivateAccessor.setField(mojo, "plugin", "org.test:test:1.0");
PluginInfo pi = (PluginInfo) PrivateAccessor.invoke(mojo, "parsePluginLookupInfo", null, null);
assertEquals("org.test", pi.getGroupId());
assertEquals("test", pi.getArtifactId());
assertEquals("1.0", pi.getVersion());
assertNull(pi.getPrefix());
}
Aggregations