incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1512303 - in /sling/trunk/contrib/extensions/healthcheck/core: pom.xml src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
Date Fri, 09 Aug 2013 13:44:33 GMT
Author: bdelacretaz
Date: Fri Aug  9 13:44:33 2013
New Revision: 1512303

URL: http://svn.apache.org/r1512303
Log:
SLING-2987 - avoid com.sun dependency

Modified:
    sling/trunk/contrib/extensions/healthcheck/core/pom.xml
    sling/trunk/contrib/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java

Modified: sling/trunk/contrib/extensions/healthcheck/core/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/core/pom.xml?rev=1512303&r1=1512302&r2=1512303&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/core/pom.xml (original)
+++ sling/trunk/contrib/extensions/healthcheck/core/pom.xml Fri Aug  9 13:44:33 2013
@@ -148,9 +148,9 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.scripting.javascript</artifactId>
-            <version>2.0.12</version>
+            <groupId>rhino</groupId>
+            <artifactId>js</artifactId>
+            <version>1.6R6</version>
             <scope>test</scope>
         </dependency>
      </dependencies>

Modified: sling/trunk/contrib/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java?rev=1512303&r1=1512302&r2=1512303&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/impl/ScriptableHealthCheckTest.java
Fri Aug  9 13:44:33 2013
@@ -17,6 +17,7 @@
  */
 package org.apache.sling.hc.impl;
 
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import java.lang.reflect.Field;
@@ -35,8 +36,6 @@ import org.mockito.Mockito;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.LoggerFactory;
 
-import com.sun.script.javascript.RhinoScriptEngine;
-
 public class ScriptableHealthCheckTest {
     
     private ScriptableHealthCheck hc;
@@ -50,9 +49,10 @@ public class ScriptableHealthCheckTest {
         ctx = Mockito.mock(ComponentContext.class);
         props = new Hashtable<String, String>();
         
-        final ScriptEngine engine = new RhinoScriptEngine();
+        final ScriptEngine rhino = new ScriptEngineManager().getEngineByExtension("js");
+        assertNotNull("With the rhino jar in our classpath, we should get a js script engine",
rhino);
         final ScriptEngineManager manager = Mockito.mock(ScriptEngineManager.class);
-        Mockito.when(manager.getEngineByExtension(Matchers.same("ecma"))).thenReturn(engine);
+        Mockito.when(manager.getEngineByExtension(Matchers.same("ecma"))).thenReturn(rhino);
         final Field f = hc.getClass().getDeclaredField("scriptEngineManager");
         f.setAccessible(true);
         f.set(hc, manager);



Mime
View raw message