public void testShouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorrectly()
throws Exception
{
Model model = new Model();
Build build = new Build();
build.setSourceDirectory( "correct" );
Resource res = new Resource();
res.setDirectory( "${project.build.sourceDirectory}" );
build.addResource( res );
Resource res2 = new Resource();
res2.setDirectory( "${pom.build.sourceDirectory}" );
build.addResource( res2 );
Resource res3 = new Resource();
res3.setDirectory( "${build.sourceDirectory}" );
build.addResource( res3 );
model.setBuild( build );
ModelInterpolator interpolator = createInterpolator();
Model out = interpolator.interpolate( model, context );
List outResources = out.getBuild().getResources();
Iterator resIt = outResources.iterator();
assertEquals( build.getSourceDirectory(), ( (Resource) resIt.next() ).getDirectory() );
assertEquals( build.getSourceDirectory(), ( (Resource) resIt.next() ).getDirectory() );
assertEquals( build.getSourceDirectory(), ( (Resource) resIt.next() ).getDirectory() );
}