use of org.apache.maven.project.MavenProject in project maven-plugins by apache.
the class DefaultAssemblyReaderTest method testGetAssemblyForDescriptorReference_ShouldReadBinaryAssemblyRef.
public void testGetAssemblyForDescriptorReference_ShouldReadBinaryAssemblyRef() throws IOException, AssemblyReadException, InvalidAssemblerConfigurationException {
final File basedir = fileManager.createTempDir();
expect(configSource.getBasedir()).andReturn(basedir).anyTimes();
expect(configSource.getProject()).andReturn(new MavenProject(new Model())).anyTimes();
expect(configSource.isIgnoreMissingDescriptor()).andReturn(false).anyTimes();
DefaultAssemblyArchiverTest.setupInterpolators(configSource);
mockManager.replayAll();
final Assembly result = new DefaultAssemblyReader().getAssemblyForDescriptorReference("bin", configSource);
assertEquals("bin", result.getId());
mockManager.verifyAll();
}
use of org.apache.maven.project.MavenProject in project maven-plugins by apache.
the class AssemblyExpressionEvaluatorTest method testShouldResolveModelGroupId.
public void testShouldResolveModelGroupId() throws ExpressionEvaluationException {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
model.setVersion("1");
model.setPackaging("jar");
configSourceStub.setMavenProject(new MavenProject(model));
setupInterpolation();
final Object result = new AssemblyExpressionEvaluator(configSourceStub).evaluate("assembly.${groupId}");
assertEquals("assembly.group.id", result);
}
use of org.apache.maven.project.MavenProject in project maven-plugins by apache.
the class ReaderFormatterTest method createBasicMavenProject.
private MavenProject createBasicMavenProject() {
final Model model = new Model();
model.setArtifactId("anArtifact");
model.setGroupId("group");
model.setVersion("version");
return new MavenProject(model);
}
use of org.apache.maven.project.MavenProject in project maven-plugins by apache.
the class AssemblyExpressionEvaluatorTest method testShouldReturnUnchangedInputForUnresolvedExpression.
public void testShouldReturnUnchangedInputForUnresolvedExpression() throws ExpressionEvaluationException {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
model.setVersion("1");
model.setPackaging("jar");
configSourceStub.setMavenProject(new MavenProject(model));
setupInterpolation();
final Object result = new AssemblyExpressionEvaluator(configSourceStub).evaluate("assembly.${unresolved}");
assertEquals("assembly.${unresolved}", result);
}
use of org.apache.maven.project.MavenProject in project maven-plugins by apache.
the class AssemblyExpressionEvaluatorTest method testShouldResolveModelPropertyBeforeModelGroupId.
public void testShouldResolveModelPropertyBeforeModelGroupId() throws ExpressionEvaluationException {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
model.setVersion("1");
model.setPackaging("jar");
final Properties props = new Properties();
props.setProperty("groupId", "other.id");
model.setProperties(props);
configSourceStub.setMavenProject(new MavenProject(model));
setupInterpolation();
final Object result = new AssemblyExpressionEvaluator(configSourceStub).evaluate("assembly.${groupId}");
assertEquals("assembly.other.id", result);
}
Aggregations