Skip to content

Commit

Permalink
[PDI-11374] Fix Unit Test
Browse files Browse the repository at this point in the history
Updated unit test as the expected exception in the test was no longer
thrown in the init method
  • Loading branch information
Matt Tucker committed Nov 30, 2015
1 parent 1d3775a commit 1ea0520
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,17 @@ public void testMaxSheetNameLength() throws Exception {
when( mockHelper.initStepMetaInterface.getSheetname() )
.thenReturn( "12345678901234567890123456789012" ); // 32 character
step.init( mockHelper.initStepMetaInterface, mockHelper.initStepDataInterface );

String content = baos.toString( "UTF-8" ); // e.g. ISO-8859-1
if ( !content.contains( "12345678901234567890123456789012" ) ) {
try {
step.prepareNextOutputFile();
fail();
}
} catch (KettleException expected) {
String content = expected.getMessage();
if ( !content.contains( "12345678901234567890123456789012" ) ) {
fail();
} else {
// We expected this error message, the sheet name is too long for Excel
}
}
} finally {
System.setErr( err );
}
Expand Down

0 comments on commit 1ea0520

Please sign in to comment.