assertEquals( 2,
results1.getMessages().size() );
//Second file also contains errors.. expect some added messages
kfs.write( "src/main/resources/r2.drl", drl2_1 );
IncrementalResults results2 = ( (InternalKieBuilder) kieBuilder ).createFileSet( "src/main/resources/r2.drl" ).build();
assertEquals( 1,
results2.getAddedMessages().size() );
assertEquals( 0,
results2.getRemovedMessages().size() );
//Correct second file... expect original errors relating to the file to be removed
kfs.write( "src/main/resources/r2.drl", drl2_2 );
IncrementalResults results3 = ( (InternalKieBuilder) kieBuilder ).createFileSet( "src/main/resources/r2.drl" ).build();
assertEquals( 0,
results3.getAddedMessages().size() );
assertEquals( 1,
results3.getRemovedMessages().size() );
//Remove first file... expect related errors to be removed
kfs.delete( "src/main/resources/r1.drl" );
IncrementalResults results4 = ( (InternalKieBuilder) kieBuilder ).createFileSet( "src/main/resources/r1.drl" ).build();
assertEquals( 0,
results4.getAddedMessages().size() );
assertEquals( 2,
results4.getRemovedMessages().size() );
}