}
public void testExpressionEvaluation()
throws Exception
{
ArchivaProjectModel model = new ArchivaProjectModel();
model.setGroupId( "org.apache.maven.archiva" );
model.setArtifactId( "archiva-test-project" );
model.setVersion( "1.0-SNAPSHOT" );
List<Dependency> deps = new ArrayList<Dependency>();
deps.add( createDependency( "org.apache.maven.archiva", "archiva-model", "${archiva.version}" ) );
deps.add( createDependency( "org.apache.maven.archiva", "archiva-common", "${archiva.version}" ) );
deps.add( createDependency( "org.apache.maven.archiva", "archiva-indexer", "${archiva.version}" ) );
model.setDependencies( deps );
model.addProperty( "archiva.version", "1.0-SNAPSHOT" );
ProjectModelExpressionFilter filter = lookupExpression();
model = filter.filter( model );
assertNotNull( model );
assertEquals( "Group ID", "org.apache.maven.archiva", model.getGroupId() );
assertEquals( "Artifact ID", "archiva-test-project", model.getArtifactId() );
assertEquals( "Version", "1.0-SNAPSHOT", model.getVersion() );
assertNotNull( "Dependencies", model.getDependencies() );
assertEquals( "Dependencies Size", 3, model.getDependencies().size() );
Iterator<Dependency> it = model.getDependencies().iterator();
while ( it.hasNext() )
{
Dependency dep = it.next();
assertEquals( "Dependency [" + dep.getArtifactId() + "] Group ID", "org.apache.maven.archiva", dep
.getGroupId() );