jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r589069 - in /jakarta/bsf/trunk/bsf3/testing: ./ jython-2.2/ jython-2.2/src/ jython-2.2/src/main/ jython-2.2/src/test/ jython-2.2/src/test/java/ jython-2.2/src/test/java/org/ jython-2.2/src/test/java/org/apache/ jython-2.2/src/test/java/org...
Date Sat, 27 Oct 2007 10:43:41 GMT
Author: antelder
Date: Sat Oct 27 03:43:37 2007
New Revision: 589069

URL: http://svn.apache.org/viewvc?rev=589069&view=rev
Log:
Add a test for Jython 2.2

Added:
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml   (with props)
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/main/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
  (with props)
    jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/resources/
Modified:
    jakarta/bsf/trunk/bsf3/testing/pom.xml

Added: jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml
URL: http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml?rev=589069&view=auto
==============================================================================
--- jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml (added)
+++ jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml Sat Oct 27 03:43:37 2007
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * Licensed to the Apache Software Foundation (ASF) under one
+    * or more contributor license agreements.  See the NOTICE file
+    * distributed with this work for additional information
+    * regarding copyright ownership.  The ASF licenses this file
+    * to you under the Apache License, Version 2.0 (the
+    * "License"); you may not use this file except in compliance
+    * with the License.  You may obtain a copy of the License at
+    * 
+    *   http://www.apache.org/licenses/LICENSE-2.0
+    * 
+    * Unless required by applicable law or agreed to in writing,
+    * software distributed under the License is distributed on an
+    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    * KIND, either express or implied.  See the License for the
+    * specific language governing permissions and limitations
+    * under the License.    
+-->
+<project>
+    <parent>
+        <groupId>org.apache.bsf</groupId>
+        <artifactId>parent</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <groupId>org.apache.bsf.testing</groupId>
+    <artifactId>bsf-testing-jython-2.2</artifactId>
+    <name>Apache BSF testing for Jython 2.2</name>
+    <description>Apache BSF testing for Python</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.bsf</groupId>
+            <artifactId>bsf-all</artifactId>
+            <version>3.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.python</groupId>
+            <artifactId>jython</artifactId>
+            <version>2.2.1</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

Propchange: jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: jakarta/bsf/trunk/bsf3/testing/jython-2.2/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java?rev=589069&view=auto
==============================================================================
--- jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
(added)
+++ jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
Sat Oct 27 03:43:37 2007
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.bsf.testing.python;
+
+import javax.script.Invocable;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
+
+import junit.framework.TestCase;
+
+/**
+ * Simple hello testcase to verify basic Jython functionality
+ */
+public class HelloTestCase extends TestCase {
+
+	public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
+		ScriptEngineManager manager = new ScriptEngineManager();
+		ScriptEngine engine = manager.getEngineByExtension("py");
+		engine.eval("def hello(name):\n return 'Hello ' + name");
+		assertTrue(engine instanceof Invocable);
+		Invocable invocableScript = (Invocable) engine;
+		assertEquals("Hello Monty", invocableScript.invokeFunction("hello", new Object[] { "Monty"
}));
+	}
+
+}

Propchange: jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/bsf/trunk/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: jakarta/bsf/trunk/bsf3/testing/pom.xml
URL: http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/testing/pom.xml?rev=589069&r1=589068&r2=589069&view=diff
==============================================================================
--- jakarta/bsf/trunk/bsf3/testing/pom.xml (original)
+++ jakarta/bsf/trunk/bsf3/testing/pom.xml Sat Oct 27 03:43:37 2007
@@ -42,6 +42,7 @@
                 <module>groovy-1.1</module>
                 <module>javascript</module>
                 <module>python</module>
+                <module>jython-2.2</module>
                 <module>ruby</module>
             </modules>
         </profile>



---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


Mime
View raw message