From fc26e4a843570429d1fb11219fb48bc658dafb13 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sat, 16 Oct 2010 18:27:08 +0000 Subject: [PATCH] Reenable scripting test, only hudson uses OpenJDK which has no Rhino engine, so add assume. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1023346 13f79535-47bb-0310-9956-ffa450edef68 --- .../dataimport/TestScriptTransformer.java | 110 ++++++++++-------- 1 file changed, 62 insertions(+), 48 deletions(-) diff --git a/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestScriptTransformer.java b/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestScriptTransformer.java index bb94750df76..7c1076512a3 100644 --- a/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestScriptTransformer.java +++ b/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestScriptTransformer.java @@ -16,7 +16,6 @@ */ package org.apache.solr.handler.dataimport; -import org.junit.Ignore; import org.junit.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -44,17 +43,21 @@ import java.util.Map; public class TestScriptTransformer extends AbstractDataImportHandlerTestCase { @Test - @Ignore public void testBasic() { - String script = "function f1(row,context){" - + "row.put('name','Hello ' + row.get('name'));" + "return row;\n" + "}"; - Context context = getContext("f1", script); - Map map = new HashMap(); - map.put("name", "Scott"); - EntityProcessorWrapper sep = new EntityProcessorWrapper(new SqlEntityProcessor(), null); - sep.init(context); - sep.applyTransformer(map); - assertEquals(map.get("name"), "Hello Scott"); + try { + String script = "function f1(row,context){" + + "row.put('name','Hello ' + row.get('name'));" + "return row;\n" + "}"; + Context context = getContext("f1", script); + Map map = new HashMap(); + map.put("name", "Scott"); + EntityProcessorWrapper sep = new EntityProcessorWrapper(new SqlEntityProcessor(), null); + sep.init(context); + sep.applyTransformer(map); + assertEquals(map.get("name"), "Hello Scott"); + } catch (DataImportHandlerException e) { + assumeFalse("JRE does not contain a JavaScript engine (OpenJDK)", "