Test fix for DIH TestScriptTransformer: Lucene-Solr-Maven-trunk build#397 produced an exception with the message "<script> can be used only in java 6 or above Processing Document # 1", while the test was only ignoring those exceptions with the exact message "<script> can be used only in java 6 or above" - switched the test for this to require the expected message as a prefix rather than exact equality.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2012-02-21 19:05:31 +00:00
parent 208e9626d4
commit 2421399023
1 changed files with 8 additions and 4 deletions

View File

@ -53,7 +53,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
sep.applyTransformer(map);
assertEquals(map.get("name"), "Hello Scott");
} catch (DataImportHandlerException e) {
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)", "<script> can be used only in java 6 or above".equals(e.getMessage()));
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)",
e.getMessage().startsWith("<script> can be used only in java 6 or above"));
throw e;
}
}
@ -85,7 +86,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
sep.applyTransformer(map);
assertEquals(map.get("name"), "Hello Scott");
} catch (DataImportHandlerException e) {
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)", "<script> can be used only in java 6 or above".equals(e.getMessage()));
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)",
e.getMessage().startsWith("<script> can be used only in java 6 or above"));
throw e;
}
}
@ -101,7 +103,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
.item(0));
assertTrue(config.script.text.indexOf("checkNextToken") > -1);
} catch (DataImportHandlerException e) {
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)", "<script> can be used only in java 6 or above".equals(e.getMessage()));
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)",
e.getMessage().startsWith("<script> can be used only in java 6 or above"));
throw e;
}
}
@ -129,7 +132,8 @@ public class TestScriptTransformer extends AbstractDataImportHandlerTestCase {
sep.applyTransformer(map);
assertNull(map.get("$hasMore"));
} catch (DataImportHandlerException e) {
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)", "<script> can be used only in java 6 or above".equals(e.getMessage()));
assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)",
e.getMessage().startsWith("<script> can be used only in java 6 or above"));
throw e;
}
}