[java-support] 10/11: JSPT-95 Move Rhino implementation out of test

Rod Widdowson rdw at steadingsoftware.com
Mon May 4 14:38:28 UTC 2020


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch dev/JSPT-95
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=333a909fabced0e24c4417b7d4a3ab3c7816e6f7

commit 333a909fabced0e24c4417b7d4a3ab3c7816e6f7
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Apr 4 14:23:45 2020 +0100

    JSPT-95 Move Rhino implementation out of test
    
    https://issues.shibboleth.net/jira/browse/JSPT-95
---
 .project                                                | 11 +++++++++++
 pom.xml                                                 | 17 +++++++----------
 .../utilities/java/support/scripting/RhinoEngine.java   |  3 +--
 .../utilities/java/support/scripting/RhinoFactory.java  |  8 ++++----
 4 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/.project b/.project
index 281fc6a..067a767 100644
--- a/.project
+++ b/.project
@@ -20,8 +20,19 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.springframework.ide.eclipse.core.springbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
+		<nature>org.springframework.ide.eclipse.core.springnature</nature>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 		<nature>org.eclipse.m2e.core.maven2Nature</nature>
diff --git a/pom.xml b/pom.xml
index 7a14f0b..bbbc9a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,6 +62,13 @@
             <artifactId>graal-sdk</artifactId>
             <version>${graalvm.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.mozilla</groupId>
+            <artifactId>rhino</artifactId>
+	    <!-- runtime in parent pom -->
+	    <scope>compile</scope>
+            <!--  version in parent pom -->
+        </dependency>
 
         <!-- OPTIONAL Compile Dependencies -->
         <dependency>
@@ -152,16 +159,6 @@
             <artifactId>spring-web</artifactId>
             <scope>test</scope>
         </dependency>
-
-        <!-- Use of GraalVM rhino is currently test only
-             Move to compile of we ever want to release -->
-        <dependency>
-            <groupId>org.mozilla</groupId>
-            <artifactId>rhino</artifactId>
-            <scope>test</scope>
-            <!--  version in parent pom -->
-        </dependency>
-
     </dependencies>
 
     <distributionManagement>
diff --git a/src/test/java/net/shibboleth/utilities/java/support/scripting/RhinoEngine.java b/src/main/java/net/shibboleth/utilities/java/support/scripting/RhinoEngine.java
similarity index 99%
rename from src/test/java/net/shibboleth/utilities/java/support/scripting/RhinoEngine.java
rename to src/main/java/net/shibboleth/utilities/java/support/scripting/RhinoEngine.java
index 33b4cc7..d423872 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/scripting/RhinoEngine.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/scripting/RhinoEngine.java
@@ -95,8 +95,7 @@ public class RhinoEngine extends AbstractScriptEngine implements ScriptEngine, C
                 }
                 final Object o = script.exec(ctx, scope);
                 return Context.jsToJava(o, Object.class);
-            } 
-            finally {
+            } finally {
                 Context.exit();
             }
 
diff --git a/src/test/java/net/shibboleth/utilities/java/support/scripting/RhinoFactory.java b/src/main/java/net/shibboleth/utilities/java/support/scripting/RhinoFactory.java
similarity index 91%
rename from src/test/java/net/shibboleth/utilities/java/support/scripting/RhinoFactory.java
rename to src/main/java/net/shibboleth/utilities/java/support/scripting/RhinoFactory.java
index a772ebe..1cc27c8 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/scripting/RhinoFactory.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/scripting/RhinoFactory.java
@@ -68,22 +68,22 @@ public class RhinoFactory implements ScriptEngineFactory {
     }
 
     /** {@inheritDoc} */
-    public Object getParameter(String key) {
+    public Object getParameter(final String key) {
         throw new RuntimeScriptingException("Unsupported method getMethodCallSyntax");
     }
 
     /** {@inheritDoc} */
-    public String getMethodCallSyntax(String obj, String m, String... args) {
+    public String getMethodCallSyntax(final String obj, final String m, final String... args) {
         throw new RuntimeScriptingException("Unsupported method getMethodCallSyntax");
     }
 
     /** {@inheritDoc} */
-    public String getOutputStatement(String toDisplay) {
+    public String getOutputStatement(final String toDisplay) {
         throw new RuntimeScriptingException("Unsupported method getMethodCallSyntax");
     }
 
     /** {@inheritDoc} */
-    public String getProgram(String... statements) {
+    public String getProgram(final String... statements) {
         throw new RuntimeScriptingException("Unsupported method getMethodCallSyntax");
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list