}
@Test
public void testSalienceWarnings() {
final ConversionResult result = new ConversionResult();
final List<DataListener> listeners = new ArrayList<DataListener>();
final GuidedDecisionTableGeneratorListener listener = new GuidedDecisionTableGeneratorListener( result );
listeners.add( listener );
//Convert
final ExcelParser parser = new ExcelParser( listeners );
final InputStream is = this.getClass().getResourceAsStream( "SalienceWarnings.xls" );
try {
parser.parseFile( is );
} finally {
try {
is.close();
} catch ( IOException ioe ) {
fail( ioe.getMessage() );
}
}
//Check conversion results
assertEquals( 2,
result.getMessages().size() );
assertEquals( ConversionMessageType.WARNING,
result.getMessages().get( 0 ).getMessageType() );
assertFalse( result.getMessages().get( 0 ).getMessage().indexOf( "Priority is not an integer literal, in cell C7" ) == -1 );
assertEquals( ConversionMessageType.WARNING,
result.getMessages().get( 1 ).getMessageType() );
assertFalse( result.getMessages().get( 1 ).getMessage().indexOf( "Priority is not an integer literal, in cell C8" ) == -1 );
//Check basics
List<GuidedDecisionTable52> dtables = listener.getGuidedDecisionTables();
assertNotNull( dtables );