Extract BSF3 into its own tree
git-svn-id: https://svn.apache.org/repos/asf/jakarta/bsf/trunk@800513 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bsf3/BUILDING b/bsf3/BUILDING
deleted file mode 100644
index 4aa48d5..0000000
--- a/bsf3/BUILDING
+++ /dev/null
@@ -1,40 +0,0 @@
-Building BSF 3
---------------
-
-BSF 3 is built with Apache Maven. Download and install Apache Maven
-(version 2.0.4 or newer) from: http://maven.apache.org/download.html.
-
-To build BSF 3, in the top-level BSF 3 directory use the command 'mvn'.
-
-This will automatically download any dependency jars from remote Maven
-repositories. Remote repositories may sometimes be unreliable, if you
-get intermitent repository errors just try running 'mvn' again.
-
-Other useful Maven commands are:
-
-'mvn clean install'
- - to remove old artifacts and rebuild from scratch
-
-'mvn assembly:assembly -Drelease'
- - to build the src and bin distros
-
-'mvn eclipse:eclipse'
- - to setup Eclipse projects for the BSF modules
-
-
-BSF requires a minimum of Java 1.4 to build
-
-Note, currently there is a bug in the BSF 3 projects setup which causes
-the Eclipse projects to be created badly for the test projects when
-running 'mvn eclipse:eclipse' in the BSF top-level directory. A temporary
-work around is to also run 'mvn eclipse:eclipse' within each test project
-directory, eg, testing\javascript or testing\ruby.
-
-Once dependency jars have been downloaded you can use '-o' to run
-Maven in offline mode which is faster, eg 'mvn -o'.
-
-Between BSF releases the BSF build may have dependencies based
-on a SNAPSHOT release. If this is the case the -U parameter
-may sometimes be required to update to the latest SNAPSHOT
-build of that dependency, eg. 'mvn -U'
-
diff --git a/bsf3/LICENSE b/bsf3/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/bsf3/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/bsf3/NOTICE b/bsf3/NOTICE
deleted file mode 100644
index b38dc6c..0000000
--- a/bsf3/NOTICE
+++ /dev/null
@@ -1,11 +0,0 @@
-Apache BSF
-Copyright (c) 1999 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-*----------------------------------------------------------------------*
-* BSF3 was developed according to the JSR-223 specs, but has not yet *
-* been tested via the JSR-223 TCK. BSF can therefore not be considered *
-* a compatible implementation of JSR-223. *
-*----------------------------------------------------------------------*
diff --git a/bsf3/RELEASE_NOTES b/bsf3/RELEASE_NOTES
deleted file mode 100644
index e8b6247..0000000
--- a/bsf3/RELEASE_NOTES
+++ /dev/null
@@ -1,75 +0,0 @@
-Apache BSF 3 Beta3 Release Notes
---------------------------------
-
-Apache BSF 3 is an open-source implementation of JSR-223,
- "Scripting for the Java Platform".
-
-*----------------------------------------------------------------------*
-* BSF3 was developed according to the JSR-223 specs, but has not yet *
-* been tested via the JSR-223 TCK. BSF can therefore not be considered *
-* a compatible implementation of JSR-223. *
-*----------------------------------------------------------------------*
-
-However, the implementation is believed to be complete.
-
-* BSF-3.0 is not compatible with BSF-2.4 - the API is completely different.
-* BSF-3.0 can be deployed and used on Java 1.4+ - it does not require Java 1.6
-
-Incomplete packages
--------------------
-The org.apache.bsf.utils.http and org.apache.bsf.xml packages contain several classes.
-These are not complete, and should not be relied on.
-They are not needed in order to use the javax.script API.
-
-Changes from previous releases
-------------------------------
-
-This 3.0-beta3 release is a maintenance release update to support the latest releases
-of various script language engines.
-
-The classes in the javax.script package have been overhauled to align the API, Javadoc and
-the behaviour with the JSR-223 spec, and several unit tests have been added.
-
-Some of these changes may cause problems for programs that have been written to the BSF 3.0
-Javadoc rather than the JSR-223 spec.
-
-javax.script class changes
-==========================
-AbstractScriptEngine - Javadoc only
-Bindings - Javadoc only
-Compilable - Javadoc only
-CompiledScript - Javadoc only
-Invocable - Javadoc only
-ScriptContext - Javadoc only
-ScriptEngine - Javadoc only
-ScriptEngineFactory - Javadoc only
-
-ScriptEngineManager - Javadoc, also protected fields made private:
-- engineSpis
-- nameAssociations
-- extensionAssocitions
-- mimeTypeAssociations
-- globalscope
-- now uses javax.imageio.spi.ServiceRegistry.lookupProviders()
- rather than the Sun-specfic method sun.misc.Service.providers()
-- put() method checks that key is non-null (NullPointerException)
- and non-empty (IllegalArgumentException)
-- setBindings() throws IllegalArgumentException if the parameter is non-null
-- the registerXXX() methods throw NullPointerException if any of their parameters is null
-- the getEngineByXXX() methods throw NullPointerException if their parameter is null
-
-ScriptException
-- all fields made private and final
-
-SimpleBindings
-- Javadoc
-- protected field "map" made private & final
-- methods now check keys to ensure that they are non-null, non-empty strings
-
-SimpleScriptContext
-- globalScope field now defaults to null
-- reader, writer and errorWriter fields are now protected (rather than private)
- This is required by JSR-223
-- name parameters are now checked to ensure that they are non-null, non-empty strings
-- getBindings() throws IllegalArgumentException if the scope is invalid
-- getScopes() now returns an unmodifiable List
diff --git a/bsf3/bsf-api/pom.xml b/bsf3/bsf-api/pom.xml
deleted file mode 100644
index fcbc934..0000000
--- a/bsf3/bsf-api/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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>
- <artifactId>bsf-api</artifactId>
- <name>Apache BSF API</name>
- <description>BSF API Implementation</description>
-
- <dependencies>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- Exclude unit test support classes -->
- <exclude>org/apache/bsf/utils/*.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/bsf3/bsf-api/src/main/java/javax/script/AbstractScriptEngine.java b/bsf3/bsf-api/src/main/java/javax/script/AbstractScriptEngine.java
deleted file mode 100644
index eaed2d4..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/AbstractScriptEngine.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.io.Reader;
-
-/**
- * Provides a standard implementation for various versions of the eval() methods.
- * Stores the ScriptContext, and provides access to the Bindings stored in the context.
- *
- * The class is not synchronized.
- * The default context - {@link SimpleScriptContext} - is not synchronized either.
- * Sub-classes must provide synchronization if necessary.
- *
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public abstract class AbstractScriptEngine implements ScriptEngine {
-
- /** The default ScriptContext of this AbstractScriptEngine */
- protected ScriptContext context;
- // This field is defined as protected in JSR-223
-
- /**
- * Constructs a ScriptEngine using an uninitialized
- * SimpleScriptContext.
- */
- public AbstractScriptEngine() {
- this.context = new SimpleScriptContext();
- }
-
- /**
- * Constructs a ScriptEngine using the specified Bindings as its
- * ENGINE_SCOPE.
- *
- * @param bindings the Bindings to be used as the ENGINE_SCOPE
- *
- * @throws NullPointerException if the parameter is <tt>null</tt>
- */
- public AbstractScriptEngine(Bindings bindings){
- this();
- if (bindings == null) {
- throw new NullPointerException("bindings is null");
- }
- context.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
- }
-
- /** {@inheritDoc} */
- public Object eval(Reader reader) throws ScriptException{
- return eval(reader, context);
- }
-
- /** {@inheritDoc} */
- public Object eval(Reader reader, Bindings bindings)
- throws ScriptException{
- return eval(reader,getScriptContext(bindings));
- }
-
- /** {@inheritDoc} */
- public Object eval(String script) throws ScriptException{
- return eval(script, context);
- }
-
- /** {@inheritDoc} */
- public Object eval(String script, Bindings bindings) throws ScriptException{
- return eval(script,getScriptContext(bindings));
- }
-
- /** {@inheritDoc} */
- public Object get(String key) {
- return getBindings(ScriptContext.ENGINE_SCOPE).get(key);
- }
-
- /** {@inheritDoc} */
- public Bindings getBindings(int scope) {
- if (scope == ScriptContext.GLOBAL_SCOPE || scope == ScriptContext.ENGINE_SCOPE) {
- return context.getBindings(scope);
- } else {
- throw new IllegalArgumentException("invalid scope");
- }
- }
-
-
- /**
- * Returns a {@link SimpleScriptContext} which:
- * <ul>
- * <li>uses the specified {@link Bindings} as the {@link ENGINE_SCOPE}</li>
- * <li>has the same GLOBAL_SCOPE Bindings as the current context</li>
- * <li>uses the same Reader, Writer and Error Writer as the current context</li>
- * </ul>
- *
- * @param bindings the bindings to be associated with ENGINE_SCOPE
- * @return an instance of SimpleScriptContext
- *
- * @throws NullPointerException if bindings is <tt>null</tt>
- */
- protected ScriptContext getScriptContext(Bindings bindings){
- if (bindings == null) {
- throw new NullPointerException("ENGINE_SCOPE bindings cannot be null");
- }
-
- ScriptContext scriptContext = new SimpleScriptContext();
-
- scriptContext.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
- scriptContext.setBindings(this.getBindings(ScriptContext.GLOBAL_SCOPE), ScriptContext.GLOBAL_SCOPE);
-
- scriptContext.setReader(this.context.getReader());
- scriptContext.setWriter(this.context.getWriter());
- scriptContext.setErrorWriter(this.context.getErrorWriter());
-
- return scriptContext;
- }
-
- /** {@inheritDoc} */
- public void put(String key, Object value) {
-
- if (key == null) {
- throw new NullPointerException("name is null");
- }
-
- if (key.length() == 0) {
- throw new IllegalArgumentException("name is empty");
- }
-
- getBindings(ScriptContext.ENGINE_SCOPE).put(key,value);
- }
-
- /** {@inheritDoc} */
- public void setBindings(Bindings bindings, int scope) {
-
- if (scope == ScriptContext.GLOBAL_SCOPE || scope == ScriptContext.ENGINE_SCOPE) {
- context.setBindings(bindings, scope);
- } else {
- throw new IllegalArgumentException("invalid scope");
- }
- }
-
- /** {@inheritDoc} */
- public ScriptContext getContext() {
- return this.context;
- }
-
- /** {@inheritDoc} */
- public void setContext(ScriptContext context) {
- if (context == null) {
- throw new NullPointerException("context is null");
- }
- this.context = context;
- }
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/Bindings.java b/bsf3/bsf-api/src/main/java/javax/script/Bindings.java
deleted file mode 100644
index 8eed092..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/Bindings.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.util.Map;
-
-/**
- * A mapping of key/value pairs, all of whose keys are non-empty Strings.
- *
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public interface Bindings extends Map/*<String,Object>*/ {
-
- /**
- * Associates the specified value with the specified key in a
- * java.util.Map. If the map previously contained a mapping for
- * this key, the old value is replaced.
- *
- * @param key the String value which uniquely identifies the
- * object
- * @param value the object to be stored.
- *
- * @return the previous value for the mapping, or <tt>null</tt> if there was none.
- *
- * @throws NullPointerException if key is <tt>null</tt>
- * @throws ClassCastException if the key is not a String
- * @throws IllegalArgumentException if the key is an empty string
- */
- public Object put(String key, Object value);
-
- /**
- * Copies all of the mappings from the specified map to this map.
- * These mappings will replace any mappings that this map had for
- * any of the keys currently in the specified map.
- *
- * @param toMerge mappings to be stored in the map.
- *
- * @throws NullPointerException
- * if toMerge map is <tt>null</tt> or if some key in the map is <tt>null</tt>.
- * @throws IllegalArgumentException
- * if some key in the map is an empty String
- * @throws ClassCastException if some key in the map is not a String
- */
- public void putAll(Map/*<? extends String,? extends Object>*/ toMerge);
-
- /**
- * Returns true if this map contains a mapping for the specified key.
- *
- * @param key key whose presence in this map is to be tested.
- * @return <tt>true</tt> if this map contains a mapping for the specified key.
- *
- * @throws NullPointerException if key is <tt>null</tt>
- * @throws ClassCastException if key is not a String
- * @throws IllegalArgumentException if key is empty String
- */
- public boolean containsKey(Object key);
-
- /**
- * Returns the value to which this map maps the specified key.
- * Returns <tt>null</tt> if the map contains no mapping for this key.
- * A return value of <tt>null</tt> does not necessarily indicate that the map contains no mapping for the key;
- * it's also possible that the map explicitly maps the key to <tt>null</tt>.
- * The containsKey operation may be used to distinguish these two cases.
- *
- * @param key key whose presence in this map is to be tested.
- *
- * @return the value to which this map maps the specified key,
- * or <tt>null</tt> if the map contains no mapping for this key.
- *
- * @throws NullPointerException if key is <tt>null</tt>
- * @throws ClassCastException if key is not a String
- * @throws IllegalArgumentException if key is empty String
- */
- public Object get(Object key);
-
- /**
- * Removes the mapping for this key from this map if it is
- * present (optional operation).
- *
- * Returns the value to which the map previously associated the
- * key, or <tt>null</tt> if the map contained no mapping for this key. (A
- * <tt>null</tt> return can also indicate that the map previously
- * associated <tt>null</tt> with the specified key if the implementation
- * supports <tt>null</tt> values.) The map will not contain a mapping for
- * the specified key once the call returns.
- *
- * @param key key of entry to be removed.
- *
- * @return the previous value associated with the key,
- * or <tt>null</tt> if the map contained no mapping for this key.
- *
- * @throws NullPointerException if key is <tt>null</tt>
- * @throws ClassCastException if key is not a String
- * @throws IllegalArgumentException if key is empty String
- */
- public Object remove(Object key);
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/Compilable.java b/bsf3/bsf-api/src/main/java/javax/script/Compilable.java
deleted file mode 100644
index 43dfc30..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/Compilable.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.io.Reader;
-
-/**
- * Optional interface implemented by script engines which
- * can compile scripts to a form that can be executed repeatedly.
- * <p>
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public interface Compilable {
-
- /**
- * Compiles the script (sourced from the String) for later execution.
- *
- * @param script the source of the script represented as String
- * @return an implementation of {@link CompiledScript} to be executed later
- * using one of its eval() methods.
- *
- * @throws ScriptException if the compilation fails for any reason
- * @throws NullPointerException if script is <tt>null</tt>
- */
- public CompiledScript compile(String script) throws ScriptException;
-
- /**
- * Compiles the script (source is read from the Reader) for later execution.
- *
- * @param reader the reader from which the script source is obtained
- * @return an implementation of {@link CompiledScript} to be executed later
- * using one of its eval() methods.
- *
- * @throws ScriptException if the compilation fails for any reason
- * @throws NullPointerException if reader is <tt>null</tt>
- */
- public CompiledScript compile(Reader reader) throws ScriptException;
-}
\ No newline at end of file
diff --git a/bsf3/bsf-api/src/main/java/javax/script/CompiledScript.java b/bsf3/bsf-api/src/main/java/javax/script/CompiledScript.java
deleted file mode 100644
index ebfc777..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/CompiledScript.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 javax.script;
-
-/**
- * Base for classes that store the results of compilations.
- *
- * This class is immutable.
- *
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public abstract class CompiledScript {
-
- public CompiledScript(){
- }
-
- /**
- * Executes the program stored in the CompiledScript object.
- * The default ScriptContext of the associated ScriptEngine is used.
- * The effect of calling this method is same as that of
- * eval(getEngine().getContext()).
- *
- * @return the resultant object after the evaluation of the
- * script (may be <tt>null</tt>)
- * @throws ScriptException if evaluation fails for any reason
- */
- public Object eval() throws ScriptException {
- return eval(getEngine().getContext());
- }
-
- /**
- * Executes the program stored in the CompiledScript object
- * using the supplied Bindings of attributes as the ENGINE_SCOPE
- * of the associated ScriptEngine during script execution.
- *
- * If bindings is <tt>null</tt>, then the effect of calling this method is
- * same as that of eval(getEngine().getContext()).
- * <br/>
- * The GLOBAL_SCOPE Bindings, Reader and Writer associated
- * with the default ScriptContext of the associated ScriptEngine
- * are used.
- *
- * @param bindings the bindings to be used as the ENGINE_SCOPE
- * @return resultant object after the re-evaluation (may be <tt>null</tt>)
- * @throws ScriptException if the evaluation fails for any reason
- */
- public Object eval(Bindings bindings) throws ScriptException{
- ScriptContext context;
- if (bindings == null) {
- context = getEngine().getContext();
- } else {
- // same code as ((AbstractScriptEngine) getEngine()).getScriptContext(bindings);
- context = new SimpleScriptContext();
- context.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
- ScriptContext oldContext = getEngine().getContext();
- context.setBindings(oldContext.getBindings(ScriptContext.GLOBAL_SCOPE), ScriptContext.GLOBAL_SCOPE);
- context.setReader(oldContext.getReader());
- context.setWriter(oldContext.getWriter());
- context.setErrorWriter(oldContext.getErrorWriter());
- }
- return eval(context);
- }
-
- /**
- * Evaluates the compiled script using the specified
- * {@link ScriptContext}.
- *
- * @param context A ScriptContext to be used in the evalution
- * of the script
- * @return resultant object after the evaluation (may be <tt>null</tt>)
- * @throws ScriptException if the evaluation fails for any reason
- * @throws NullPointerException if context is <tt>null</tt>
- */
- public abstract Object eval(ScriptContext context) throws ScriptException;
-
- /**
- * Retrieves a reference to the ScriptEngine whose methods
- * created this CompiledScript object.
- *
- * @return the ScriptEngine which created this CompiledScript
- * object
- */
- public abstract ScriptEngine getEngine();
-
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/Invocable.java b/bsf3/bsf-api/src/main/java/javax/script/Invocable.java
deleted file mode 100644
index 7699650..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/Invocable.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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 javax.script;
-
-/**
- * Optional interface implemented by {@link ScriptEngine}s which
- * allow the invocation of procedures in scripts that have previously
- * been executed.
- * <p>
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public interface Invocable {
-
- /**
- * Invokes a scripting procedure with the given name using the
- * array of objects as its arguments set.
- *
- * @param name name of the scripting procedure
- * @param args arguments set for the scripting procedure
- * @return resultant object after the execution of the procedure
- * @throws ScriptException if the invocation of the scripting procedure
- * fails
- * @throws NoSuchMethodException if method with given name or matching
- * argument types cannot be found
- * @throws NullPointerException if the method name is <tt>null</tt>.
- */
- public Object invokeFunction(String name, Object[] args)
- throws ScriptException, NoSuchMethodException;
-
- /**
- * Invokes a procedure on an object which already defined in the
- * script using the array of objects as its arguments set.
- *
- * @param thiz object on which the procedure is called
- * @param name name of the procedure to be invoked
- * @param args arguments set for the procedure
- * @return resultant object after the execution of the
- * procedure
- * @throws ScriptException if the invocation of the procedure fails
- * @throws NoSuchMethodException if a method with given name or matching
- * argument types cannot be found
- * @throws NullPointerException if the method name is <tt>null</tt>.
- * @throws IllegalArgumentException if the specified <tt>thiz</tt>
- * is <tt>null</tt> or the specified Object is does not represent a scripting object.
- */
- public Object invokeMethod(Object thiz, String name, Object[] args) throws
- ScriptException, NoSuchMethodException;
-
- /**
- * Retrieves an instance of a java class whose methods are
- * implemented using procedures in script which are in the
- * intermediate code repository in the underlying interpreter.
- *
- * @param clasz an interface which the returned class must
- * implement
- * @return an instance of the class which implements the specified
- * interface
- * @throws IllegalArgumentException
- * if the specified Class object is <tt>null</tt> or is not an interface
- */
- public Object getInterface(Class clasz);
-
- /**
- * Retrieves an instance of a java class whose methods are
- * implemented using procedures in script which are in the
- * intermediate code repository in the underlying interpreter.
- *
- * @param thiz The scripting object whose member functions are used to implement the methods of the interface.
- * @param clasz The Class object of the interface to return.
- * @return An instance of requested interface.
- * Will be <tt>null</tt> if the requested interface is unavailable,
- * i.e. if compiled methods in the ScriptEngine cannot be found matching the ones in the requested interface.
- * @throws IllegalArgumentException
- * if the specified Class object is <tt>null</tt> or is not an interface,
- * or if the specified Object is <tt>null</tt> or does not represent a scripting object.
- */
- public Object getInterface(Object thiz, Class clasz);
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/ScriptContext.java b/bsf3/bsf-api/src/main/java/javax/script/ScriptContext.java
deleted file mode 100644
index 6e8603f..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/ScriptContext.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.io.Reader;
-import java.io.Writer;
-import java.util.List;
-
-/**
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public interface ScriptContext {
-
- /** defines an integer for the scope, ENGINE_SCOPE */
- public static final int ENGINE_SCOPE = 100;
-
- /** defines an integer for the scope, GLOBAL_SCOPE */
- public static final int GLOBAL_SCOPE = 200;
-
- /**
- * Retrieves the value of the getAttribute(String, int) for the
- * lowest scope in which it returns a non-null value. Returns
- * <tt>null</tt> if there is no such value exists in any scope.
- *
- *
- * @param name the name of the attribute
- * @return the associated value with the specified name
- * @throws IllegalArgumentException if the name is empty
- * @throws NullPointerException if the name is <tt>null</tt>
- */
- public Object getAttribute(String name);
-
- /**
- * Retrieves the value of an attribute in the specified scope.
- * Returns <tt>null</tt> if the no such value exists in the specified
- * scope.
- *
- * @param name the name of the attribute
- * @param scope the value of the scope
- * @return the associated value for the specified name
- * @throws IllegalArgumentException if the name is empty or the
- * scope is invalid
- * @throws NullPointerException if the name is <tt>null</tt>
- */
- public Object getAttribute(String name, int scope);
-
- /**
- * Retrieves the lowest value of the scope for which the
- * attribute is defined.
- *
- * @param name the name of attribute
- * @return the value corresponding to lowest value of the scope
- * or -1 if no associated value exist in any scope
- * @throws NullPointerException if name is <tt>null</tt>.
- * @throws IllegalArgumentException if name is empty.
- */
- public int getAttributesScope(String name);
-
- /**
- * Retrieves the Bindings instance associated with the given
- * scope. Returns <tt>null</tt> if no Bindings is associated with
- * specified scope.
- *
- * @param scope the scope
- * @return the Bindings associated with the specified scope
- * @throws IllegalArgumentException
- * If no Bindings is defined for the specified scope value in ScriptContext of this type.
- */
- public Bindings getBindings(int scope);
-
- /**
- * Retrieves an instance of java.io.Writer which can be used by
- * scripts to display their output.
- *
- * @return an instance of java.io.Writer
- */
- public Writer getWriter();
-
- /**
- * Returns the Writer to be used to display error output.
- *
- * @return the error writer
- */
- public Writer getErrorWriter();
-
- /**
- * Sets the Writer for scripts to use when displaying output.
- *
- * @param writer the new writer.
- */
- public void setWriter(Writer writer);
-
- /**
- * Sets the Writer for scripts to use when displaying error output.
- *
- * @param writer the new writer.
- */
- public void setErrorWriter(Writer writer);
-
- /**
- * Returns a Reader to be used by the script to read input.
- *
- * @return the reader
- */
- public Reader getReader();
-
- /**
- * Sets the Reader to be used by the script to read input.
- *
- * @param reader the new reader
- */
- public void setReader(Reader reader);
-
- /**
- * Removes the given attribute from the specified scope. Returns
- * the removed object or <tt>null</tt> if no value is associated with the
- * specified key in the specified scope.
- *
- * @param name the name of the attribute
- * @param scope the scope from which to remove the attribute
- * @return previous value associated with specified name
- *
- * @throws NullPointerException if the name is <tt>null</tt>
- * @throws IllegalArgumentException if the name is empty or if the
- * scope is invalid
- */
- public Object removeAttribute(String name, int scope);
-
- /**
- * Associates a specified value with the specifed name in the
- * specified scope.
- *
- * @param name the name of the attribute
- * @param value the value of the attribute
- * @param scope the scope
- * @throws IllegalArgumentException if the name is <tt>null</tt> or the
- * scope is invalid
- * @throws NullPointerException if the name is <tt>null</tt>.
- */
- public void setAttribute(String name, Object value, int scope);
-
- /**
- * Associates the specified Bindings with the specified scope.
- *
- * @param bindings the Bindings to be associated with the
- * specified scope
- * @param scope the scope
- * @throws IllegalArgumentException if the scope is invalid
- * @throws NullPointerException if the bindings is <tt>null</tt> and the
- * scope is ScriptEngine.ENGINE_SCOPE
- */
- public void setBindings(Bindings bindings,int scope);
-
- /**
- * Returns an immutable List of all the valid values for scope in the ScriptContext.
- *
- * @return the list
- */
- public List getScopes();
-
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/ScriptEngine.java b/bsf3/bsf-api/src/main/java/javax/script/ScriptEngine.java
deleted file mode 100644
index 90b84e4..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/ScriptEngine.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.io.Reader;
-
-/**
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public interface ScriptEngine {
-
- /**
- * Reserved key associated with an object array which is used to
- * pass set of positional parameters to the ScriptEngines.
- */
- public static final String ARGV="javax.script.argv";
-
- /**
- * Reserved key associated with name of the file which contains
- * the source of the script.
- */
- public static final String FILENAME = "javax.script.filename";
-
- /**
- * Reserved key associated with the name of the Java
- * ScriptEngine
- */
- public static final String ENGINE = "javax.script.engine";
-
- /**
- * Reserved key associated with the version of the Java
- * ScriptEngine
- */
- public static final String ENGINE_VERSION = "javax.script.engine_version";
-
- /**
- * Reserved key associated with the name of the supported
- * scripting language
- */
- public static final String LANGUAGE = "javax.script.language";
-
- /**
- * Reserved key associated with the version of the supported
- * scripting language
- */
- public static final String LANGUAGE_VERSION = "javax.script.language_version";
-
- /**
- * Reserved key associated with the named value which identifies
- * the short name of the supported language
- */
- public static final String NAME = "javax.script.name";
-
- /**
- * Retrieves an uninitialized Bindings which can be used as the scope of
- * the ScriptEngine.
- *
- * @return a Bindings which can be used to replace the state
- * of the ScriptEngine
- */
- public Bindings createBindings();
-
- /**
- * Evaluates a script obtained using the specified
- * reader as the script source.
- * Returns <tt>null</tt> for scripts that don't return a value.
- *
- * @param reader the source of the script
- * @return the value of the evaluated script
- * @throws ScriptException if an error occurs
- * @throws NullPointerException if argument is <tt>null</tt>
- */
- public Object eval(Reader reader) throws ScriptException;
-
- /**
- * Evaluates a script obtained using a reader as the
- * script source and using the specified namespace as the
- * ENGINE_SCOPE.
- * Returns <tt>null</tt> for scripts that don't return a value.
- *
- * @param reader the script source used to obtained the script
- * @param bindings the bindings to be used as ENGINE_SCOPE
- * @return the value of the evaluated script
- * @throws ScriptException if an error occurs
- * @throws NullPointerException if either argument is <tt>null</tt>
- */
- public Object eval(Reader reader, Bindings bindings)
- throws ScriptException;
-
- /**
- * Evaluates a script obtained using the specified reader as the
- * script source and using the bindings in the specifed
- * ScriptContext.
- * Returns <tt>null</tt> for scripts that don't return a value.
- *
- * @param reader the script source
- * @param context the context contianing different bindings for
- * script evaluation
- * @return the value of the evaluated script
- * @throws ScriptException if an error occurs
- * @throws NullPointerException if either argument is <tt>null</tt>
- */
- public Object eval(Reader reader, ScriptContext context)
- throws ScriptException;
-
- /**
- * Evaluates a script contained in a String and returns the resultant object.
- * Returns <tt>null</tt> for scripts that don't return a value.
- *
- * @param script the String representation of the script
- * @return the value of the evaluated script
- * @throws ScriptException if an error occurs
- * @throws NullPointerException if argument is <tt>null</tt>
- */
- public Object eval(String script) throws ScriptException;
-
- /**
- * Evaluates a piece of script using the specified namespace as
- * the ENGINE_SCOPE.
- * Returns <tt>null</tt> for scripts that don't return a value.
- *
- * @param script the String representation of the script
- * @param bindings the bindings to be used as the ENGINE_SCOPE
- * @return the value of the evaluated script
- * @throws ScriptException if an error occurs
- * @throws NullPointerException if either argument is <tt>null</tt>
- */
- public Object eval(String script ,Bindings bindings)
- throws ScriptException;
-
- /**
- * Evaluates a script using the bindings in the specifed
- * ScriptContext.
- * Returns <tt>null</tt> for scripts that don't return a value.
- *
- * @param script the String representation of the script
- * @param context tbe ScriptContext containing bindings for the
- * script evaluation
- * @return the value of the evaluated script
- * @throws ScriptException if an error occurs
- * @throws NullPointerException if either argument is <tt>null</tt>
- */
- public Object eval(String script, ScriptContext context)
- throws ScriptException;
-
- /**
- * Retrieves the value which is associated with the specified key
- * in the state of the ScriptEngine.
- *
- * @param key the key associated with value.
- * @return an object value which is associated with the key
- * @throws IllegalArgumentException if argument is empty
- * @throws NullPointerException if argument is <tt>null</tt>
- */
- public Object get(String key);
-
- /**
- * Returns a ScriptEngineFactory for the class to which this ScriptEngine belongs.
- *
- * @return The ScriptEngineFactory
- */
- public ScriptEngineFactory getFactory();
-
- /**
- * Retrieves a reference to the associated bindings for the
- * specified scope.
- *
- * Possible scopes are:
- *
- * GLOBAL_SCOPE :
- * if the ScriptEngine was created by ScriptingEngineManager
- * then GLOBAL_SCOPE of it is returned (or <tt>null</tt> if there is no
- * GLOBAL_SCOPE stored in the ScriptEngine).
- *
- * ENGINE_SCOPE :
- * the set of key-value pairs stored in the ScriptEngine is
- * returned.
- *
- * @param scope the specified scope
- * @return associated bindings for the specified scope
- * @throws IllegalArgumentException if the scope is invalid
- */
- public Bindings getBindings(int scope);
-
- /**
- * Associates a key and a value in the ScriptEngine ENGINE_SCOPE bindings.
- *
- * @param key the specified key associated with the value
- * @param value value which is to be associated with the
- * specified key
- * @throws IllegalArgumentException if the key is empty
- * @throws NullPointerException if key is <tt>null</tt>
- */
- public void put(String key, Object value);
-
- /**
- * Associates the specified bindings with the specified scope.
- *
- * @param bindings bindings to be associated with the specified scope
- * @param scope scope which the bindings should be associated with
- * @throws IllegalArgumentException
- * if the scope is invalid
- * @throws NullPointerException
- * if the bindings is <tt>null</tt> and the scope is ScriptContext.ENGINE_SCOPE
- */
- public void setBindings(Bindings bindings, int scope);
-
- /**
- * Returns the default ScriptContext of the ScriptEngine whose Bindings, Readers
- * and Writers are used for script executions when no ScriptContext is specified.
- *
- * @return The default ScriptContext of the ScriptEngine
- */
- public ScriptContext getContext();
-
- /**
- * Sets the default ScriptContext of the ScriptEngine whose Bindings, Readers and
- * Writers are used for script executions when no ScriptContext is specified.
- *
- * @param context
- * scriptContext that will replace the default ScriptContext in the ScriptEngine.
- * @throws NullPointerException if the context is <tt>null</tt>
- */
- public void setContext(ScriptContext context);
-
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/ScriptEngineFactory.java b/bsf3/bsf-api/src/main/java/javax/script/ScriptEngineFactory.java
deleted file mode 100644
index 26f3019..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/ScriptEngineFactory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.util.List;
-
-/**
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public interface ScriptEngineFactory {
-
- /**
- * Retrieves an instance of the associated ScriptEngine.
- *
- * @return an instance of the associated ScriptEngine
- */
- public ScriptEngine getScriptEngine();
-
- /**
- * Retrieves the full name of the ScriptEngine.
- *
- * @return the name of the Script Engine
- */
- public String getEngineName();
-
- /**
- * Retrieves the version of the Script Engine.
- *
- * @return the version of the Script Engine
- */
- public String getEngineVersion();
-
- /**
- * Retrieves the name of the language supported by the
- * ScriptEngine.
- *
- * @return the name of the supported language
- */
- public String getLanguageName();
-
- /**
- * Retrieves the version of the language supported by the
- * ScriptEngine.
- *
- * @return the version of the supported language
- */
- public String getLanguageVersion();
-
- /**
- * Retrieves an immutable list of Strings which are file extensions
- * typically used for files containing scripts written in the
- * language supported by the ScriptEngine.
- *
- * @return immutable list of supported file extensions
- */
- public List getExtensions();
-
- /**
- * Retrieves an immutable list of Strings containing MIME types describing
- * the content which can be processed using the Script Engine.
- *
- * @return immutable list of MIME types
- */
- public List getMimeTypes();
-
- /**
- * Retrieves an immutable list of short descriptive names such as
- * {"javascript", "rhino"} describing the language supported by
- * the Script Engine.
- *
- * @return immutable list of short descriptive names describing the
- * language supported by the ScriptEngine
- */
- public List getNames();
-
- /**
- * Retrieves an associated value for the specified key. Returns
- * <tt>null</tt> if the ScriptEngine does not have an associated value for
- * the key.
- *
- * @return associated value for the specified key
- */
- public Object getParameter(String key);
-
- /**
- * Returns a String which can be used to invoke a method of a Java object
- * using the syntax of the supported scripting language.
- * For instance, an implementaton for a Javascript engine might be;
- * <pre>
- * public String getMethodCallSyntax(String objectName,
- * String method, String[] args) {
- * String ret = objectName;
- * ret += "." + method + "(";
- * for (int i = 0; i < args.length; i++) {
- * ret += args[i];
- * if (i == args.length - 1) {
- * ret += ")";
- * } else {
- * ret += ",";
- * }
- * }
- * return ret;
- * }
- * </pre>
- * @param objectName The name representing the object whose method is to be invoked.
- * @param method The name of the method to invoke.
- * @param args names of the arguments in the method call.
- * @return The String used to invoke the method in the syntax of the scripting language.
- */
- public String getMethodCallSyntax(String objectName, String method, String[] args);
-
- /**
- * Returns a String that can be used as a statement to display
- * the specified String using the syntax of the supported
- * scripting language. For instance, the implementaton for a
- * Perl engine might be;
- * <pre>
- * public String getOutputStatement(String toDisplay) {
- * return "print(" + toDisplay + ")";
- * }
- * </pre>
- * @param toDisplay the string to be displayed
- *
- * @return The string used to display the String in the syntax of
- * the scripting language.
- */
- public String getOutputStatement(String toDisplay);
-
- /**
- * Returns A valid scripting language executable progam with
- * given statements. For instance an implementation for a PHP
- * engine might be:
- * <pre>
- * public String getProgram(String... statements) {
- * $retval = "<?\n";
- * int len = statements.length;
- * for (int i = 0; i < len; i++) {
- * $retval += statements[i] + ";\n";
- * }
- * $retval += "?>";
- * }
- * </pre>
- *
- * @param statements the statements to be executed,
- * e.g. as returned by the {@link #getMethodCallSyntax} or {@link #getOutputStatement} methods
- * @return The Program
- */
- public String getProgram(String[] statements);
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/ScriptEngineManager.java b/bsf3/bsf-api/src/main/java/javax/script/ScriptEngineManager.java
deleted file mode 100644
index b428fc4..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/ScriptEngineManager.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.imageio.spi.ServiceRegistry;
-
-/**
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public class ScriptEngineManager {
-
- /**
- * Stores all instances of classes which implement
- * ScriptEngineFactory which are found in resources
- * META-INF/services/javax.script.ScriptEngineFactory
- */
- private final HashSet engineSpis = new HashSet();
-
- /**
- * Maps language names to the associated ScriptEngineFactory
- */
- private final HashMap nameAssociations = new HashMap();
-
- /**
- * Maps file extensions to the associated ScriptEngineFactory
- */
- private final HashMap extensionAssociations = new HashMap();
-
- /** Maps MIME types to the associated ScriptEngineFactory */
- private final HashMap mimeTypeAssociations = new HashMap();
-
- /** Stores the bindings associated with GLOBAL_SCOPE. Defaults to SimpleBindings. */
- private Bindings globalscope = new SimpleBindings();
-
- /**
- * Constructs a ScriptEngineManager and
- * initializes it using the current context classloader.
- */
- public ScriptEngineManager() {
- this(Thread.currentThread().getContextClassLoader());
- }
-
- /**
- * Constructs a ScriptEngineManager and
- * initializes it using the specified classloader.
- *
- * @param loader the classloader to use (may be <tt>null</tt>)
- */
- public ScriptEngineManager(ClassLoader loader) {
- Iterator iterator = ServiceRegistry.lookupProviders(ScriptEngineFactory.class, loader);
-
- while (iterator.hasNext()) {
- ScriptEngineFactory factory;
- try {
- factory = (ScriptEngineFactory) iterator.next();
- } catch (Error ignored) {
- continue;
- }
- engineSpis.add(factory);
-
- List data = factory.getNames();
- // gets all descriptive names for Scripting Engine
- for (int i=0; i<data.size(); i++) {
- nameAssociations.put(data.get(i), factory);
- }
- // gets all supported extensions
- data = factory.getExtensions();
- for (int i=0; i<data.size(); i++) {
- extensionAssociations.put(data.get(i), factory);
- }
- // gets all supported MIME types
- data = factory.getMimeTypes();
- for (int i=0; i<data.size(); i++) {
- mimeTypeAssociations.put(data.get(i), factory);
- }
- }
-
- initXMLHelper(loader);
- }
-
- /**
- * Initialise the xml helper here so BSF clients don't have to.
- * (Temporary approach for beta2 release)
- */
- private void initXMLHelper(ClassLoader loader) {
- try {
- Class xmlHelperClass = Class.forName("org.apache.bsf.xml.XMLHelper", true, loader);
- Method initMethod = xmlHelperClass.getMethod("init", new Class[]{});
- initMethod.invoke(null, new Object[]{});
- } catch (Throwable e) {
- // ignore
- }
- }
-
- /**
- * Retrieves the associated value for the spefied key in the
- * GLOBAL_SCOPE
- *
- * @param key the associated key of the value stored in the
- * GLOBAL_SCOPE
- * @return the value associated with the specifed key
- */
- public Object get(String key){
- return globalscope.get(key);
- }
-
- /**
- * Retrieves a new instance of a ScriptingEngine for the
- * specified extension of a script file. Returns <tt>null</tt> if no
- * suitable ScriptingEngine is found.
- *
- * @param extension the specified extension of a script file
- * @return a new instance of a ScriptingEngine which supports the
- * specified script file extension
- *
- * @throws NullPointerException if extension is null
- */
- public ScriptEngine getEngineByExtension(String extension){
-
- if (extension == null) {
- throw new NullPointerException("extension must not be null");
- }
-
- ScriptEngine engine = null;
-
- ScriptEngineFactory factory =
- (ScriptEngineFactory) extensionAssociations.get(extension);
-
- if (factory != null) {
- // gets a new instance of the Scripting Engine
- engine = factory.getScriptEngine();
- // sets the GLOBAL SCOPE
- engine.setBindings(globalscope,ScriptContext.GLOBAL_SCOPE);
- }
-
- return engine;
- }
-
- /**
- * Retrieves new instance the ScriptingEngine for a specifed MIME
- * type. Returns <tt>null</tt> if no suitable ScriptingEngine is found.
- *
- * @param mimeType the specified MIME type
- * @return a new instance of a ScriptingEngine which supports the
- * specified MIME type
- *
- * @throws NullPointerException if mimeType is null
- */
- public ScriptEngine getEngineByMimeType(String mimeType){
-
- if (mimeType == null) {
- throw new NullPointerException("mimeType must not be null");
- }
-
- ScriptEngine engine = null;
- ScriptEngineFactory factory =
- (ScriptEngineFactory) mimeTypeAssociations.get(mimeType);
-
- if (factory != null) {
- // gets a new instance of the Scripting Engine
- engine = factory.getScriptEngine();
- // sets the GLOBAL SCOPE
- engine.setBindings(globalscope,ScriptContext.GLOBAL_SCOPE);
- }
-
- return engine;
- }
-
- /**
- * Retrieves a new instance of a ScriptEngine the specified
- * descriptive name. Returns <tt>null</tt> if no suitable ScriptEngine is
- * found.
- *
- * @param shortName the short name of the engine
- * @return a new instance of a ScriptEngine which supports the
- * specifed name
- * @throws NullPointerException - if shortName is null
- */
- public ScriptEngine getEngineByName(String shortName){
- if (shortName == null) {
- throw new NullPointerException("shortName must not be null");
- }
-
- ScriptEngine engine = null;
- ScriptEngineFactory factory =
- (ScriptEngineFactory) nameAssociations.get(shortName);
-
- if (factory != null) {
- engine = factory.getScriptEngine();
- engine.setBindings(globalscope,ScriptContext.GLOBAL_SCOPE);
- }
-
- return engine;
- }
-
- /**
- * Retrieves an array of instances of ScriptEngineFactory class
- * which are found by the discovery mechanism.
- *
- * @return a list of all discovered ScriptEngineFactory
- * instances
- */
- public List getEngineFactories(){
- ArrayList factories = new ArrayList();
- Iterator iter = engineSpis.iterator();
-
- while(iter.hasNext()) {
- factories.add(iter.next());
- }
- return factories;
- }
-
- /**
- * Retrieves the bindings corresponds to GLOBAL_SCOPE.
- *
- * @return the bindings of GLOBAL_SCOPE
- */
- public Bindings getBindings(){
- return globalscope;
- }
-
- /**
- * Associates the specifed value with the specified key in
- * GLOBAL_SCOPE.
- *
- * @param key the associated key for specified value
- * @param value the associated value for the specified key
- *
- * @throws NullPointerException if key is null
- * @throws IllegalArgumentException if key is the empty String
- */
- public void put(String key, Object value){
- if (key == null) {
- throw new NullPointerException("key must not be null");
- }
- if (key.length() == 0) {
- throw new IllegalArgumentException("key must not be the empty string");
- }
- globalscope.put(key, value);
- }
-
- /**
- * Register a extension with a ScriptEngineFactory. It
- * overrides any such association discovered previously.
- *
- * @param extension the extension associated with the specified
- * ScriptEngineFactory class
- * @param factory the ScriptEngineFactory associated with
- * the specified extension
- *
- * @throws NullPointerException if any of the parameters is <tt>null</tt>
- */
- public void registerEngineExtension(String extension, ScriptEngineFactory factory){
- if (extension == null || factory == null) {
- throw new NullPointerException("parameters must be non-null");
- }
- extensionAssociations.put(extension, factory);
- }
-
- /**
- * Registers descriptive name with a ScriptEngineFactory.
- * It overrides any associations discovered previously.
- *
- * @param name a descriptive name associated with the specifed
- * ScriptEngineFactory class
- * @param factory the ScriptEngineFactory associated with
- * the specified descriptive name
- *
- * @throws NullPointerException if any of the parameters is <tt>null</tt>
- */
- public void registerEngineName(String name, ScriptEngineFactory factory){
- if (name == null || factory == null) {
- throw new NullPointerException("parameters must be non-null");
- }
- nameAssociations.put(name, factory);
- }
-
- /**
- * Registers a MIME type with a ScriptEngineFactory. It
- * overrides any associations discovered previously.
- *
- * @param mimeType the MIME type associated with specified
- * ScriptEngineFactory class
- * @param factory the ScriptEngineFactory associated with the
- * specified MIME type
- *
- * @throws NullPointerException if any of the parameters is <tt>null</tt>
- */
- public void registerEngineMimeType(String mimeType,ScriptEngineFactory factory){
- if (mimeType == null || factory == null) {
- throw new NullPointerException("parameters must be non-null");
- }
- mimeTypeAssociations.put(mimeType,factory);
- }
-
- /**
- * Sets the GLOBAL_SCOPE value to the specified bindings.
- *
- * @param bindings the bindings to be stored in GLOBAL_SCOPE
- * @throws IllegalArgumentException if bindings is <tt>null</tt>
- */
- public void setBindings(Bindings bindings){
- if (bindings == null){
- throw new IllegalArgumentException("bindings must not be null");
- }
- globalscope = bindings;
- }
-}
\ No newline at end of file
diff --git a/bsf3/bsf-api/src/main/java/javax/script/ScriptException.java b/bsf3/bsf-api/src/main/java/javax/script/ScriptException.java
deleted file mode 100644
index 824989b..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/ScriptException.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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 javax.script;
-
-/**
- * Generic Exception class for the Scripting APIs.
- *
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public class ScriptException extends Exception {
-
- private static final long serialVersionUID = 2L;
-
- /** Stores the file name of the script */
- private final String fileName; // default null
-
- /**
- * Stores the line number of the script in which the error has
- * occured
- */
- private final int lineNumber; // default = -1;
-
- /**
- * Stores the column number of the script in which the error has
- * occured
- */
- private final int columnNumber; // default = -1;
-
- /** Stores the message which describes the cause of error */
- private final String message; // default null
-
- /**
- * Constructs a new exception with the specified cause.
- *
- * @param exception the cause of exception
- */
- public ScriptException(Exception exception) {
- super(exception);
- this.message = null;
- this.fileName = null;
- this.lineNumber = -1;
- this.columnNumber = -1;
- }
-
- /**
- * Constructs a new exception with the specified detailed
- * message.
- *
- * @param message the datailed message which caused the
- * exception
- */
- public ScriptException(String message) {
- this(message, null, -1, -1);
- }
-
- /**
- * Constructs a new exception with the spcified detailed message
- * of cause, the file name of the source of script and the line
- * number of the script where the error has occured.
- *
- * @param message the detailed message of cause of exception
- * @param fileName the file name which contains the script
- * @param lineNumber the line number of the script where the error has
- * occured
- */
- public ScriptException(String message,String fileName,int lineNumber) {
- this(message, fileName, lineNumber, -1);
- }
-
- /**
- * Constructs a new exception using the detailed message of
- * cause, file name which contains the script, line number and
- * column number in which the error has occured.
- *
- * @param message the detailed message of the cause of
- * exception
- * @param fileName the name of the file which contains the
- * script
- * @param lineNumber the line number of the script where the
- * error has occured
- * @param columnNumber the column number of the script where the
- * error has occured
- */
- public ScriptException(String message, String fileName, int lineNumber, int columnNumber) {
- super(message);
- this.message = message;
- this.fileName = fileName;
- this.lineNumber = lineNumber;
- this.columnNumber = columnNumber;
- }
-
- /**
- * Retrieves the file name in which the script is contained.
- *
- * @return Returns the file name in which the script is contained
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
- * Retrieves the column number of the script where the error has
- * occured. If the information is not available, returns -1.
- *
- * @return Returns the column number of the script where the
- * error has occured
- */
- public int getColumnNumber() {
- return columnNumber;
- }
-
- /**
- * Retrieves the line number of the script where the error has
- * occured. If the information is not available, returns -1.
- *
- * @return Returns the line number of the script where the error
- * has occured
- */
- public int getLineNumber() {
- return lineNumber;
- }
-
- /**
- * Retrieves a String describing the cause of error.
- *
- * @return a String describing the cause of error
- */
- public String getMessage(){
- StringBuffer buffer = new StringBuffer();
- buffer.append(message);
- if (fileName != null) {
- buffer.append("in: " + fileName);
- }
- if (lineNumber != -1) {
- buffer.append(" at line no: " + lineNumber);
- }
- if (columnNumber != -1) {
- buffer.append(" at column number: " + columnNumber);
- }
- return buffer.toString();
- }
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java b/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java
deleted file mode 100644
index dea8d22..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A simple implementation of Bindings, backed by a HashMap (or other Map).
- * This class is not synchronized (nor is HashMap).
- *
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public class SimpleBindings implements Bindings {
-
- /**
- * In which the key-value pairs are stored.
- */
- private final Map/*<String,Object>*/ map;
-
- /**
- * Constructs a SimpleBindings.
- */
- public SimpleBindings(){
- map = new HashMap/*<String,Object>*/();
- }
-
- /**
- * Constructs a SimpleBindings and initializes it using a
- * specified map.
- *
- * @param map a map which is used to initialize the
- * SimpleBindings
- * @throws NullPointerException if the map is null
- */
- public SimpleBindings(Map/*<String,Object>*/ map){
- if (map == null){
- throw new NullPointerException("parameter must not be null");
- }
- this.map = map;
- }
-
-
-
- /**
- * Check the conditions which keys need to satisfy:
- * <br/>
- * + String<br/>
- * + non-null<br/>
- * + non-empty<br/>
- *
- * @param key key to be checked
- *
- * @throws NullPointerException if key is <tt>null</tt>
- * @throws ClassCastException if key is not String
- * @throws llegalArgumentException if key is empty String
- */
- private void validateKey(Object key){
- if (key == null) {
- throw new NullPointerException("key must not be null");
- }
- if (!(key instanceof String)) {
- throw new ClassCastException("key must be a String");
- }
- if (((String)key).length() == 0) {
- throw new IllegalArgumentException("key must not be the empty string");
- }
- }
-
- /**
- * Associates the specified value with the specified key in a
- * java.util.Map. If the map previously contained a mapping for
- * this key, the old value is replaced.
- *
- * @param key the String value which uniquely identifies the
- * object
- * @param value the object to be stored.
- *
- * @return the previous value for the mapping (may be <tt>null</tt>), or <tt>null</tt> if there was none.
- *
- * @throws NullPointerException if the key is <tt>null</tt>
- * @throws IllegalArgumentException if the key is empty
- */
- public Object put(String key, Object value) {
- validateKey(key);
- return map.put(key,value);
- }
-
- /**
- * This method is only needed for Java 1.4 compatibility.
- *
- * @deprecated use put(String, Object) instead
- */
- public Object put(Object key, Object value) {
- validateKey(key);
- return map.put(key,value);
- }
-
- /** {@inheritDoc} */
- public void putAll(Map/*<? extends String,? extends Object>*/ toMerge) {
-
- Set keySet= toMerge.keySet();
- Iterator keys= keySet.iterator();
-
- while (keys.hasNext()) {
- validateKey(keys.next());
- }
-
- map.putAll(toMerge);
- }
-
- /** {@inheritDoc} */
- public int size() {
- return map.size();
- }
-
- /** {@inheritDoc} */
- public void clear() {
- map.clear();
- }
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return map.isEmpty();
- }
-
- /** {@inheritDoc} */
- public boolean containsKey(Object key) {
- validateKey(key);
- return map.containsKey(key);
- }
- /** {@inheritDoc} */
- public boolean containsValue(Object value) {
- return map.containsValue(value);
- }
-
- /** {@inheritDoc} */
- public Collection values() {
- return map.values();
- }
-
- /** {@inheritDoc} */
- public Set/*<Map.Entry<String,Object>>*/ entrySet() {
- return map.entrySet();
- }
-
- /** {@inheritDoc} */
- public Object get(Object key) {
- validateKey(key);
- return map.get(key);
- }
-
- /** {@inheritDoc} */
- public Set/*<String>*/ keySet() {
- return map.keySet();
- }
-
- /** {@inheritDoc} */
- public Object remove(Object key) {
- validateKey(key);
- return map.remove(key);
- }
-
-
-}
diff --git a/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java b/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java
deleted file mode 100644
index 338bc30..0000000
--- a/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * A simple implementation of {@link ScriptContext}.
- *
- * This class is not synchronized.
- *
- * See Javadoc of <a href="http://java.sun.com/javase/6/docs/api/javax/script/package-summary.html">Java Scripting API</a>
- */
-public class SimpleScriptContext implements ScriptContext {
-
- /**
- * This is the scope bindings for GLOBAL_SCOPE.
- * By default, a <tt>null</tt> value (which means no global scope) is used.
- * */
- protected Bindings globalScope = null;
-
- /**
- * This is the scope bindings for ENGINE_SCOPE .
- * By default, a SimpleBindings is used.
- */
- protected Bindings engineScope = new SimpleBindings();
-
- /** The reader to be used for input from scripts. */
- protected Reader reader;
-
- /** The writer to be used for displaying output from scripts */
- protected Writer writer;
-
- /** The writer to be used for displaying error output from scripts */
- protected Writer errorWriter;
-
- // N.B. These fields are mandated as protected by the JSR-223 spec.
-
- /** Immutable list of scopes returned by {@link #getScopes()}*/
- private static final List SCOPES =
- Collections.unmodifiableList(
- Arrays.asList(new Integer[] { new Integer(ENGINE_SCOPE), new Integer(GLOBAL_SCOPE) })
- );
-
- /**
- * Create a new instance,
- * setting the Reader and Writers from the corresponding System streams.
- */
- public SimpleScriptContext() {
- reader = new InputStreamReader(System.in);
- writer = new PrintWriter(System.out, true);
- errorWriter = new PrintWriter(System.err, true);
- }
-
- /**
- * Check if name is <tt>null</tt> or empty string
- * @param name to be checked
- * @throws NullPointerException if the name is <tt>null</tt>
- * @throws IllegalArgumentException if the name is the empty string
- */
- private void checkName(String name){
- if (name == null){
- throw new NullPointerException("name must not be null");
- }
- if (name.length() == 0){
- throw new IllegalArgumentException("name must not be an empty string");
- }
- }
-
-
- /** {@inheritDoc} */
- public Object getAttribute(String name) {
-
- checkName(name);
-
- final Object engineObject = engineScope.get(name);
- if (engineObject != null) {
- return engineObject;
- } else if (globalScope != null) {
- return globalScope.get(name);
- } else {
- return null;
- }
- }
-
- /** {@inheritDoc} */
- public Object getAttribute(String name, int scope) {
-
- checkName(name);
-
- switch (scope) {
- case ENGINE_SCOPE:
- return engineScope.get(name);
- case GLOBAL_SCOPE:
- return globalScope != null ? globalScope.get(name) : null;
- default:
- throw new IllegalArgumentException("invalid scope");
- }
- }
-
- /** {@inheritDoc} */
- public int getAttributesScope(String name) {
-
- checkName(name);
-
- if (engineScope.containsKey(name)) {
- return ENGINE_SCOPE;
- } else if(globalScope != null && globalScope.containsKey(name)) {
- return GLOBAL_SCOPE;
- }
-
- return -1;
- }
-
- /** {@inheritDoc} */
- public Bindings getBindings(int scope) {
-
- switch (scope) {
- case ENGINE_SCOPE:
- return engineScope;
- case GLOBAL_SCOPE:
- return globalScope;
- default:
- throw new IllegalArgumentException("invalid scope");
- }
- }
-
- /** {@inheritDoc} */
- public Object removeAttribute(String name, int scope) {
-
- checkName(name);
-
- switch (scope) {
- case ENGINE_SCOPE:
- return engineScope.remove(name);
- case GLOBAL_SCOPE:
- return globalScope != null ? globalScope.remove(name) : null;
- default:
- throw new IllegalArgumentException("invalid scope");
- }
- }
-
- /** {@inheritDoc} */
- public void setAttribute(String name, Object value, int scope) {
-
- checkName(name);
-
- switch (scope) {
- case ENGINE_SCOPE:
- engineScope.put(name, value);
- break;
- case GLOBAL_SCOPE:
- if (globalScope != null) {
- globalScope.put(name, value);
- }
- break;
- default:
- throw new IllegalArgumentException("invalid scope");
- }
- }
-
- /** {@inheritDoc} */
- public void setBindings(Bindings bindings, int scope) {
-
- switch (scope) {
- case ENGINE_SCOPE:
- if (bindings == null) {
- throw new NullPointerException("binding is null for ENGINE_SCOPE scope");
- }
- engineScope = bindings;
- break;
- case GLOBAL_SCOPE:
- globalScope = bindings;
- break;
- default:
- throw new IllegalArgumentException("invalid scope");
- }
- }
-
- /** {@inheritDoc} */
- public List getScopes() {
- return SCOPES;
- }
-
- /** {@inheritDoc} */
- public Reader getReader() {
- return reader;
- }
-
- /** {@inheritDoc} */
- public void setReader(Reader reader) {
- this.reader = reader;
- }
-
- /** {@inheritDoc} */
- public Writer getWriter() {
- return writer;
- }
-
- /** {@inheritDoc} */
- public void setWriter(Writer writer) {
- this.writer = writer;
- }
-
- /** {@inheritDoc} */
- public Writer getErrorWriter() {
- return errorWriter;
- }
-
- /** {@inheritDoc} */
- public void setErrorWriter(Writer writer) {
- this.errorWriter = writer;
- }
-
-}
diff --git a/bsf3/bsf-api/src/main/resources/META-INF/LICENSE b/bsf3/bsf-api/src/main/resources/META-INF/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/bsf3/bsf-api/src/main/resources/META-INF/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/bsf3/bsf-api/src/main/resources/META-INF/NOTICE b/bsf3/bsf-api/src/main/resources/META-INF/NOTICE
deleted file mode 100644
index 7891d93..0000000
--- a/bsf3/bsf-api/src/main/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,17 +0,0 @@
-Apache BSF
-Copyright (c) 1999 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-*----------------------------------------------------------------------*
-* BSF3 was developed according to the JSR-223 specs, but has not yet *
-* been tested via the JSR-223 TCK. BSF can therefore not be considered *
-* a compatible implementation of JSR-223. *
-*----------------------------------------------------------------------*
-
-
-
-
-
-
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/AbstractScriptEngineTest.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/AbstractScriptEngineTest.java
deleted file mode 100644
index 5b3fa42..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/AbstractScriptEngineTest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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;
-
-import javax.script.Bindings;
-import javax.script.ScriptContext;
-import javax.script.SimpleBindings;
-import javax.script.SimpleScriptContext;
-
-import junit.framework.TestCase;
-
-import org.apache.bsf.utils.TestScriptEngine;
-
-public class AbstractScriptEngineTest extends TestCase {
-
- private final TestScriptEngine engine = new TestScriptEngine();
-
- public void testCtor1(){
- ScriptContext b = engine.getContext();
- assertNotNull(b);
- }
-
- public void testCtor2(){
- try {
- new TestScriptEngine(null);
- fail("Should have thrown NPE");
- } catch (NullPointerException expected) {
- }
- Bindings b = new SimpleBindings();
- new TestScriptEngine(b); // should be OK
- }
-
- public void testSetBindings(){
- try {
- engine.setBindings(null, -123);
- fail("Should have generated illegal arg exception");
- } catch (IllegalArgumentException e) {
- }
- try {
- engine.setBindings(null, ScriptContext.ENGINE_SCOPE);
- fail("Should have generated NPE");
- } catch (NullPointerException e) {
- }
- engine.setBindings(null, ScriptContext.GLOBAL_SCOPE); // should be OK
- Bindings bindings = new SimpleBindings();
- engine.setBindings(bindings , ScriptContext.ENGINE_SCOPE);
- engine.setBindings(bindings , ScriptContext.GLOBAL_SCOPE);
- }
-
- public void testGetBindings(){
- try {
- engine.getBindings(-123);
- fail("Should have generated illegal arg exception");
- } catch (IllegalArgumentException e) {
- }
- assertNotNull(engine.getBindings(ScriptContext.ENGINE_SCOPE));
- assertNull(engine.getBindings(ScriptContext.GLOBAL_SCOPE)); // null is the default
- engine.setBindings(null, ScriptContext.GLOBAL_SCOPE);// null is allowed here
- assertNull(engine.getBindings(ScriptContext.GLOBAL_SCOPE));
- engine.setBindings(new SimpleBindings(), ScriptContext.GLOBAL_SCOPE);
- assertNotNull(engine.getBindings(ScriptContext.GLOBAL_SCOPE));
- }
-
- public void testContext(){
- final ScriptContext initial = engine.getContext();
- assertNotNull(initial);
- final SimpleScriptContext newContext = new SimpleScriptContext();
- assertNotSame(initial, newContext);
- engine.setContext(newContext);
- ScriptContext updated = engine.getContext();
- assertNotNull(updated);
- assertSame(updated, newContext);
- }
-
- public void testgetScriptContext(){
- try {
- engine.getScriptContext(null);
- fail("Should have caused NPE");
- } catch (NullPointerException e) {
- }
- final SimpleBindings bindings = new SimpleBindings();
- ScriptContext sc = engine.getScriptContext(bindings);
- assertEquals(bindings, sc.getBindings(ScriptContext.ENGINE_SCOPE));
- assertNull(sc.getBindings(ScriptContext.GLOBAL_SCOPE));
- }
-
- public void testPutGet(){
- try {
- engine.put(null, null);
- fail("Should have caused NPE");
- } catch (NullPointerException e) {
- }
- try {
- engine.put("", null);
- fail("Should have caused IllegalArg");
- } catch (IllegalArgumentException e) {
- }
- engine.put("null", null);
- engine.put("notnull", "");
- try {
- engine.get(null);
- fail("Should have caused NPE");
- } catch (NullPointerException e) {
- }
- try {
- engine.get("");
- fail("Should have caused IllegalArg");
- } catch (IllegalArgumentException e) {
- }
- assertNull(engine.get("null"));
- assertNotNull(engine.get("notnull"));
- }
-}
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/ScriptEngineManagerTest.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/ScriptEngineManagerTest.java
deleted file mode 100644
index c653aef..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/ScriptEngineManagerTest.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * 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;
-
-import java.util.List;
-
-import javax.script.Compilable;
-import javax.script.CompiledScript;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-import javax.script.SimpleBindings;
-
-import junit.framework.TestCase;
-
-import org.apache.bsf.utils.TestScriptEngine;
-import org.apache.bsf.utils.TestScriptEngineFactory;
-
-public class ScriptEngineManagerTest extends TestCase {
- private ScriptEngineManager mgr = null;
-
- public ScriptEngineManagerTest() {
- super("ScriptEngineManagerTest");
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- mgr = new ScriptEngineManager();
- }
-
- public void testScriptEngineManager() {
- assertNotNull(mgr);
- List facs = mgr.getEngineFactories();
- assertNotNull(facs);
- assertTrue(facs.size() > 0); // need at least one
- }
-
- public void testGetPut() {
- mgr.put("x", new Integer(1));
- Object retValue = mgr.get("x");
- assertEquals(new Integer(1), retValue);
- try {
- mgr.get(null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- mgr.get("");
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- assertNull(mgr.get("missing_Key"));
- assertNull(mgr.get("null_Key"));
- mgr.put("null_Key", null);
- assertNull(mgr.get("null_Key"));
- }
-
- public void testGetEngineByExtension() {
- ScriptEngine engine;
-
- engine = mgr.getEngineByExtension("tEst");
- assertNotNull(engine);
- assertTrue(engine instanceof TestScriptEngine);
-
- engine = mgr.getEngineByExtension("teSt");
- assertNotNull(engine);
- assertTrue(engine instanceof TestScriptEngine);
- }
-
- public void testGetEngineByMimeType() {
- ScriptEngine engine;
- engine = mgr.getEngineByMimeType("application/junit");
- assertNotNull(engine);
- assertTrue(engine instanceof TestScriptEngine);
- }
-
- public void testGetEngineByName() {
- ScriptEngine engine;
-
- engine = mgr.getEngineByName("JUnit");
- assertNotNull(engine);
- assertTrue(engine instanceof TestScriptEngine);
- }
-
- public void testGetEngineFactories() {
- boolean found = false;
- List factories = mgr.getEngineFactories();
-
- for(int i = 0; i < factories.size(); i++) {
- if (factories.get(i) instanceof TestScriptEngineFactory) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- fail("ScriptEngineManager.getEngineFactories(): " +
- "TestScriptEngineFactory is not present ..");
- }
- }
-
- public void testRegisterEngineExtension() {
- try {
- mgr.registerEngineExtension(null, null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- mgr.registerEngineExtension(null, new TestScriptEngineFactory());
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- mgr.registerEngineExtension("", null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- assertNull(mgr.getEngineByExtension("")); // not yet defined
- // Empty extensions are allowed
- mgr.registerEngineExtension("", new TestScriptEngineFactory());
- assertNotNull(mgr.getEngineByExtension("")); //now defined
- assertNull(mgr.getEngineByExtension("junit2")); // not yet defined
- mgr.registerEngineExtension("junit2", new TestScriptEngineFactory());
- assertNotNull(mgr.getEngineByExtension("junit2")); //now defined
- }
-
- public void testRegisterEngineName() {
- try {
- mgr.registerEngineName(null, null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- mgr.registerEngineName(null, new TestScriptEngineFactory());
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- mgr.registerEngineName("", null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- assertNull(mgr.getEngineByName("")); // not yet defined
- // Empty extensions are allowed
- mgr.registerEngineName("", new TestScriptEngineFactory());
- assertNotNull(mgr.getEngineByName("")); //now defined
- assertNull(mgr.getEngineByName("junit2")); // not yet defined
- mgr.registerEngineName("junit2", new TestScriptEngineFactory());
- assertNotNull(mgr.getEngineByName("junit2")); //now defined
- }
-
- public void testRegisterEngineMimeType() {
- try {
- mgr.registerEngineMimeType(null, null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- mgr.registerEngineMimeType(null, new TestScriptEngineFactory());
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- mgr.registerEngineMimeType("", null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- assertNull(mgr.getEngineByMimeType("")); // not yet defined
- // Empty extensions are allowed
- mgr.registerEngineMimeType("", new TestScriptEngineFactory());
- assertNotNull(mgr.getEngineByMimeType("")); //now defined
- assertNull(mgr.getEngineByMimeType("junit2")); // not yet defined
- mgr.registerEngineMimeType("junit2", new TestScriptEngineFactory());
- assertNotNull(mgr.getEngineByMimeType("junit2")); //now defined
- }
-
- public void testSetBindings() {
- assertNotNull(mgr.getBindings());
- try {
- mgr.setBindings(null);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- final SimpleBindings bindings = new SimpleBindings();
- assertNotSame(bindings, mgr.getBindings());
- mgr.setBindings(bindings);
- assertSame(bindings, mgr.getBindings());
- }
-
- public void testEvalAndCompile() throws ScriptException{
- ScriptEngine se = mgr.getEngineByName("JUnit");
- assertNotNull(se);
- se.put("key", "value");
- assertEquals("value",se.eval("key"));
- if (se instanceof Compilable){
- Compilable co = (Compilable) se;
- CompiledScript cs = co.compile("key");
- assertNotNull(cs);
- assertEquals("value",cs.eval());
- assertEquals("value",cs.eval());
- } else {
- fail("Expected engine to implement Compilable");
- }
- }
-
-}
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java
deleted file mode 100644
index b988061..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/ScriptExceptionTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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;
-
-import javax.script.ScriptException;
-
-import junit.framework.TestCase;
-
-public class ScriptExceptionTest extends TestCase {
-
- public void testException1(){
- ScriptException ex = new ScriptException("");
- try {
- throw ex;
- } catch (ScriptException e) {
- assertEquals(-1, e.getLineNumber());
- assertEquals(-1, e.getColumnNumber());
- assertNull(e.getFileName()); // this is not defined by the spec. or the Java 6 API
- }
- }
-
- public void testException2(){
- ScriptException ex = new ScriptException(new Exception());
- try {
- throw ex;
- } catch (ScriptException e) {
- assertEquals(-1, e.getLineNumber());
- assertEquals(-1, e.getColumnNumber());
- assertNull(e.getFileName()); // this is not defined by the spec. or the Java 6 API
- }
- }
-
- public void testException3(){
- final String fileName = "file";
- ScriptException ex = new ScriptException("test", fileName, 10);
- try {
- throw ex;
- } catch (ScriptException e) {
- assertEquals(10, e.getLineNumber());
- assertEquals(-1, e.getColumnNumber());
- assertEquals(fileName, e.getFileName());
- final String message = e.getMessage();
- assertFalse(-1 == message.indexOf("test"));
- assertFalse(-1 == message.indexOf(fileName));
- assertFalse(-1 == message.indexOf(""+10));
- }
- }
-
- public void testException4(){
- final String fileName = "file";
- ScriptException ex = new ScriptException("test", fileName, 10, 30);
- try {
- throw ex;
- } catch (ScriptException e) {
- assertEquals(10, e.getLineNumber());
- assertEquals(30, e.getColumnNumber());
- assertEquals(fileName, e.getFileName());
- final String message = e.getMessage();
- assertFalse(-1 == message.indexOf("test"));
- assertFalse(-1 == message.indexOf(fileName));
- assertFalse(-1 == message.indexOf(""+10));
- assertFalse(-1 == message.indexOf(""+30));
- }
- }
-}
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/SimpleBindingsTest.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/SimpleBindingsTest.java
deleted file mode 100644
index 4e76dd2..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/SimpleBindingsTest.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.script.*;
-
-import junit.framework.TestCase;
-
-public class SimpleBindingsTest extends TestCase {
-
- Bindings bindings;
-
- public void setUp(){
- bindings = new SimpleBindings();
- }
-
- public void testConstruct(){
- assertNotNull(bindings);
- try {
- new SimpleBindings(null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- new SimpleBindings(new HashMap());
- }
-
-
-
- public void testBadParams(){
- try {
- bindings.containsKey(null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- bindings.containsKey("");
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- bindings.containsKey(Boolean.FALSE);
- fail("Expected ClassCastException");
- } catch (ClassCastException e) {
- }
-
- try {
- bindings.get(null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- bindings.get("");
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- bindings.get(Boolean.FALSE);
- fail("Expected ClassCastException");
- } catch (ClassCastException e) {
- }
-
-
- try {
- bindings.put(null, null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- bindings.put("", null);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
-// try {
-// bindings.put(Boolean.FALSE, null);
-// fail("Expected ClassCastException");
-// } catch (ClassCastException e) {
-// }
-
- try {
- bindings.remove(null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- bindings.remove("");
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- bindings.remove(Boolean.FALSE);
- fail("Expected ClassCastException");
- } catch (ClassCastException e) {
- }
-
- try {
- bindings.putAll(null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- Map map = new HashMap();
- map.put("OK", null);
- map.put("", null);
- bindings.putAll(map);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- Map map = new HashMap();
- map.put("OK", null);
- map.put(Boolean.FALSE, null);
- bindings.putAll(map);
- bindings.remove(Boolean.FALSE);
- fail("Expected ClassCastException");
- } catch (ClassCastException e) {
- }
- }
-
- // Most of these are standard Map tests
- public void testValid(){
- assertFalse(bindings.containsKey("key"));
- assertNull(bindings.get("key"));
- bindings.put("key", Boolean.FALSE);
- assertNotNull(bindings.get("key"));
- assertTrue(bindings.containsKey("key"));
- assertFalse(bindings.containsKey("null"));
- bindings.put("null", null);
- assertTrue(bindings.containsKey("null"));
- assertNull(bindings.get("null"));
- assertNull(bindings.remove("null"));
- assertNotNull(bindings.remove("key"));
- assertNull(bindings.remove("key"));
- }
-}
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/SimpleScriptContextTest.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/SimpleScriptContextTest.java
deleted file mode 100644
index f6863b7..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/SimpleScriptContextTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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;
-
-import java.util.List;
-
-import javax.script.*;
-
-import junit.framework.TestCase;
-
-public class SimpleScriptContextTest extends TestCase {
-
- ScriptContext context;
-
- public void setUp(){
- context = new SimpleScriptContext();
- }
-
- public void testCtor(){
- assertNotNull(context);
- }
-
- public void testInvalidGetAttribute(){
- try {
- context.getAttribute(null);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- context.getAttribute("");
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- context.getAttribute(null, ScriptContext.ENGINE_SCOPE);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- context.getAttribute("", 0);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- context.getAttribute("OK", 0);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- context.getAttribute(null, ScriptContext.ENGINE_SCOPE);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- context.getAttribute("", ScriptContext.ENGINE_SCOPE);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testInvalidRemoveAttribute(){
- try {
- context.removeAttribute(null, ScriptContext.ENGINE_SCOPE);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- context.removeAttribute("", 0);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- context.removeAttribute("OK", 0);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- try {
- context.removeAttribute(null, ScriptContext.ENGINE_SCOPE);
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- try {
- context.removeAttribute("", ScriptContext.ENGINE_SCOPE);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- }
- public void testBindings(){
- try {
- context.getBindings(0);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- }
- assertNotNull(context.getBindings(ScriptContext.ENGINE_SCOPE));
- assertNull(context.getBindings(ScriptContext.GLOBAL_SCOPE)); // no global default
- context.setBindings(null, ScriptContext.GLOBAL_SCOPE); // OK
- try {
- context.setBindings(null, ScriptContext.ENGINE_SCOPE); // Not OK
- fail("Expected NullPointerException");
- } catch (NullPointerException e) {
- }
- }
-
- public void testScopes(){
- List l = context.getScopes();
- assertNotNull(l);
- assertTrue(l.size() >=2);
- try {
- l.remove(0);
- fail("Expected UnsupportedOperationException");
- } catch (UnsupportedOperationException e) {
- }
- }
-}
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestCompiledScript.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestCompiledScript.java
deleted file mode 100644
index 05a03ff..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestCompiledScript.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.utils;
-
-import javax.script.CompiledScript;
-import javax.script.ScriptContext;
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-
-/**
- * Minimal CompiledScript implementation.
- */
-public class TestCompiledScript extends CompiledScript {
-
- private final ScriptEngine engine;
- private final String compiled;
-
- public TestCompiledScript(TestScriptEngine testScriptEngine, String script) {
- engine = testScriptEngine;
- compiled = script;
- }
-
- public Object eval(ScriptContext context) throws ScriptException {
- return context.getAttribute(compiled);
- }
-
- public ScriptEngine getEngine() {
- return engine;
- }
-
-}
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestScriptEngine.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestScriptEngine.java
deleted file mode 100644
index 67860b7..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestScriptEngine.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * 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.utils;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import javax.script.AbstractScriptEngine;
-import javax.script.Bindings;
-import javax.script.Compilable;
-import javax.script.CompiledScript;
-import javax.script.Invocable;
-import javax.script.ScriptContext;
-import javax.script.ScriptEngineFactory;
-import javax.script.ScriptException;
-import javax.script.SimpleBindings;
-
-/**
- * Minimal Script engine used for JUnit tests.
- */
-public class TestScriptEngine extends AbstractScriptEngine implements Compilable, Invocable {
-
- public TestScriptEngine() {
- super();
- }
-
- public TestScriptEngine(Bindings n) {
- super(n);
- }
-
- // Allow test access to protected method
- public ScriptContext getScriptContext(Bindings bindings){
- return super.getScriptContext(bindings);
- }
-
- public Bindings createBindings() {
- return new SimpleBindings();
- }
-
- public Object eval(Reader reader, ScriptContext context)
- throws ScriptException {
- return eval(readerToString(reader), context);
- }
-
- /**
- * @param reader
- * @return
- * @throws ScriptException
- */
- private String readerToString(Reader reader) throws ScriptException {
- StringBuffer sb = new StringBuffer();
- char cbuf[] = new char[1024];
- try {
- while(reader.read(cbuf) != -1){
- sb.append(cbuf);
- }
- } catch (IOException e) {
- throw new ScriptException(e);
- }
- return sb.toString();
- }
-
- // Very simple evaluator - just return the context value for the script
- public Object eval(String script, ScriptContext context)
- throws ScriptException {
- return context.getAttribute(script);
- }
-
- public ScriptEngineFactory getFactory() {
- return new TestScriptEngineFactory();
- }
-
- // Compilable methods
-
- public CompiledScript compile(String script) throws ScriptException {
- return new TestCompiledScript(this, script);
- }
-
- public CompiledScript compile(Reader reader) throws ScriptException {
- String script = readerToString(reader);
- return new TestCompiledScript(this, script);
- }
-
- // Invokable methods
-
- public Object getInterface(Class clasz) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Object getInterface(Object thiz, Class clasz) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Object invokeFunction(String name, Object[] args)
- throws ScriptException, NoSuchMethodException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Object invokeMethod(Object thiz, String name, Object[] args)
- throws ScriptException, NoSuchMethodException {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestScriptEngineFactory.java b/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestScriptEngineFactory.java
deleted file mode 100644
index 658c93e..0000000
--- a/bsf3/bsf-api/src/test/java/org/apache/bsf/utils/TestScriptEngineFactory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.utils;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineFactory;
-
-/**
- * Minimal ScriptEngineFactory for use in JUnit tests.
- */
-public class TestScriptEngineFactory implements ScriptEngineFactory {
-
-
- public ScriptEngine getScriptEngine() {
- return new TestScriptEngine();
- }
-
- public String getEngineName() {
- return "TestScriptEngine";
- }
- public String getEngineVersion() {
- return "1.0";
- }
- public List getExtensions() {
- return Collections.unmodifiableList(Arrays.asList(new String[]{"tEst","teSt"}));
- }
- public String getLanguageName() {
- return "TestScript";
- }
- public String getLanguageVersion() {
- return "1.0";
- }
- public List getMimeTypes() {
- return Collections.unmodifiableList(Arrays.asList(new String[]{"application/junit"}));
- }
-
- public Object getParameter(String key) {
- if (key == ScriptEngine.ENGINE) {
- return getEngineName();
- } else if (key == ScriptEngine.ENGINE_VERSION) {
- return getEngineVersion();
- } else if (key == ScriptEngine.NAME) {
- return getNames();
- } else if (key == ScriptEngine.LANGUAGE) {
- return getLanguageName();
- } else if(key == ScriptEngine.ENGINE_VERSION) {
- return getLanguageVersion();
- } else if (key == "THREADING") {
- return "MULTITHREADED";
- }
- return null;
- }
-
- public String getMethodCallSyntax(String obj, String method, String[] args) {
- // TODO Auto-generated method stub
- return "callMethod";
- }
-
- public List getNames() {
- return Collections.unmodifiableList(Arrays.asList(new String[]{"JUnit"}));
- }
-
- public String getOutputStatement(String toDisplay) {
- // TODO Auto-generated method stub
- return "outputStatment";
- }
-
- public String getProgram(String[] statements) {
- // TODO Auto-generated method stub
- return "program";
- }
-}
diff --git a/bsf3/bsf-api/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory b/bsf3/bsf-api/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory
deleted file mode 100644
index 6803681..0000000
--- a/bsf3/bsf-api/src/test/resources/META-INF/services/javax.script.ScriptEngineFactory
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# 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.
-#
-#
-
-org.apache.bsf.utils.TestScriptEngineFactory # JUnit engine
-
diff --git a/bsf3/bsf-engines/build.xml b/bsf3/bsf-engines/build.xml
deleted file mode 100644
index ef9d4c8..0000000
--- a/bsf3/bsf-engines/build.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?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 name="Engine-Installer">
-
- <property name="bsf.version" value="3.0-SNAPSHOT"/>
- <property name="download.dir" value="/target/engines-download/"/>
- <property name="download.file" value="${basedir}${download.dir}engines.zip"/>
- <property name="merged.engines.dir" value="${basedir}/target/merged-engines"/>
-
- <target name="check-merged">
- <condition property="already.merged" >
- <and>
- <available file="${basedir}/target/bsf-engines-${bsf.version}.jar"/>
- </and>
- </condition>
-
- </target>
-
- <!-- Install the bsf.engines jar into the local maven repo -->
- <target name="install-engines" depends="merge-engines">
-
- <exec executable="mvn${maven.suffix}" dir="${basedir}" failonerror="true">
- <arg line="install:install-file -DgroupId=org.apache.bsf -DartifactId=bsf-engines -Dversion=${bsf.version} -Dpackaging=jar -DgeneratePom=true -Dfile=${basedir}/target/bsf-engines-${bsf.version}.jar"/>
- </exec>
-
- </target>
-
- <target name="merge-engines" depends="check-merged, download-engines" unless="already.merged">
-
- <mkdir dir="${basedir}${download.dir}"/>
- <unzip src="${download.file}" dest="${basedir}${download.dir}engines" overwrite="true"/>
-
- <!-- now unzip all the engine jars into a single directory -->
-
- <mkdir dir="${merged.engines.dir}"/>
- <unzip src="${basedir}${download.dir}engines/beanshell/build/bsh-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <!-- unzip src="${basedir}${download.dir}engines/browserjs/build/browserjs-engine.jar" dest="${merged.engines.dir}" overwrite="true"/ -->
- <!-- unzip src="${basedir}${download.dir}engines/ejs/build/js-engine.jar" dest="${merged.engines.dir}" overwrite="true"/ -->
- <unzip src="${basedir}${download.dir}engines/freemarker/build/freemarker-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/groovy/build/groovy-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jacl/build/jacl-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jaskell/build/jaskell-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/java/build/java-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/javascript/build/js-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jawk/build/jawk-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jelly/build/jelly-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jep/build/jep-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jexl/build/jexl-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jruby/build/jruby-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <!-- unzip src="${basedir}${download.dir}engines/jst/build/jst-engine.jar" dest="${merged.engines.dir}" overwrite="true"/ -->
- <unzip src="${basedir}${download.dir}engines/judo/build/judo-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/juel/build/juel-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/jython/build/jython-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/ognl/build/ognl-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/pnuts/build/pnuts-jsr223.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/scheme/build/scheme-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/velocity/build/velocity-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/xpath/build/xpath-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
- <unzip src="${basedir}${download.dir}engines/xslt/build/xslt-engine.jar" dest="${merged.engines.dir}" overwrite="true"/>
-
- <!-- Copy in the META-INF files for services, LICENSE and NOTICE -->
-
- <copy todir="${merged.engines.dir}" overwrite="true">
- <fileset dir="${basedir}/src/main/resources"/>
- </copy>
-
- <!-- Now zip all that up into a single jar -->
-
- <zip destfile="${basedir}/target/bsf-engines.tmp.jar" basedir="${merged.engines.dir}" />
-
- <!-- Delete work directory -->
- <delete dir="${merged.engines.dir}" />
-
- <!-- Use Retroweaver to convert all the classes to JDK 1.4 -->
-
- <retroweaver inputjar="${basedir}/target/bsf-engines.tmp.jar" outputjar="${basedir}/target/bsf-engines-${bsf.version}.jar"/>
-
- <!-- Delete the temporary work file -->
- <delete file="${basedir}/target/bsf-engines.tmp.jar"/>
-
- </target>
-
- <taskdef name="retroweaver" classname="com.rc.retroweaver.ant.RetroWeaverTask">
- <classpath>
- <pathelement location="${localRepository}/net/sourceforge/retroweaver/retroweaver/1.2.3/retroweaver-1.2.3.jar"/>
- <pathelement location="${localRepository}/net/sourceforge/retroweaver/retroweaver-rt/1.2.3/retroweaver-rt-1.2.3.jar"/>
- <pathelement location="${localRepository}/asm/asm/2.2.1/asm-2.2.1.jar"/>
- <pathelement location="${localRepository}/asm/asm-commons/2.2.1/asm-commons-2.2.1.jar"/>
- <pathelement location="${localRepository}/backport-util-concurrent/backport-util-concurrent/2.1/backport-util-concurrent-2.1.jar"/>
- </classpath>
- </taskdef>
-
- <target name="check-downloaded">
- <condition property="already.downloaded" >
- <and>
- <available file="${basedir}${download.dir}engines.zip"/>
- </and>
- </condition>
-
- <!-- these are required for the mvn install command to work correctly -->
- <condition property="maven.suffix" value="">
- <os family="unix"/>
- </condition>
- <condition property="maven.suffix" value=".bat">
- <os family="windows"/>
- </condition>
- </target>
-
- <target name="download-engines" depends="check-downloaded" unless="already.downloaded">
- <mkdir dir="${basedir}${download.dir}"/>
- <get src="https://scripting.dev.java.net/files/documents/4957/37593/jsr223-engines.zip"
- dest="${download.file}"
- verbose="true"
- usetimestamp="false"/>
- <unzip src="${download.file}"
- dest="${basedir}${download.dir}engines"
- overwrite="false"/>
- </target>
-
-</project>
diff --git a/bsf3/bsf-engines/pom.xml b/bsf3/bsf-engines/pom.xml
deleted file mode 100644
index 4a06769..0000000
--- a/bsf3/bsf-engines/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?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>pom</packaging>
- <artifactId>bsf-engines</artifactId>
- <name>Apache BSF project to install 3rd party script engines</name>
- <description>Apache BSF project to install 3rd party script engines</description>
-
- <dependencies>
- <dependency>
- <groupId>net.sourceforge.retroweaver</groupId>
- <artifactId>retroweaver</artifactId>
- <version>1.2.3</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.retroweaver</groupId>
- <artifactId>retroweaver-rt</artifactId>
- <version>1.2.3</version>
- </dependency>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>2.2.1</version>
- </dependency>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm-commons</artifactId>
- <version>2.2.1</version>
- </dependency>
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>2.1</version>
- </dependency>
- </dependencies>
-
- <build>
- <defaultGoal>package</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>install-engines</id>
- <phase>validate</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant target="install-engines">
- <property name="localRepository" value="${settings.localRepository}"/>
- </ant>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/bsf3/bsf-engines/src/main/resources/META-INF/LICENSE b/bsf3/bsf-engines/src/main/resources/META-INF/LICENSE
deleted file mode 100644
index 61934d8..0000000
--- a/bsf3/bsf-engines/src/main/resources/META-INF/LICENSE
+++ /dev/null
@@ -1,250 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-======================================
- LICENSES FOR INCLUDED DEPENDENCIES
-======================================
-
-All the source code for the Apache BSF project is released under the
-license above. Additionally, the Apache BSF binary distribution
-includes a number of third-party script engines which are released under
-the following BSD license:
-
- ============================================================================
- The script engines BSD License
- ============================================================================
-
-Copyright (c) 2006, Sun Microsystems, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- - Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- - Neither the name of the Sun Microsystems, Inc. nor the names of
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
diff --git a/bsf3/bsf-engines/src/main/resources/META-INF/NOTICE b/bsf3/bsf-engines/src/main/resources/META-INF/NOTICE
deleted file mode 100644
index c85f14f..0000000
--- a/bsf3/bsf-engines/src/main/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,19 +0,0 @@
-Apache BSF
-Copyright (c) 1999 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-The Apache BSF binary distribution includes software distributed under the
-BSD License. See the LICENSE file for details.
-
-COPYRIGHT NOTICES
-
-* The Apache BSF binary includes script engines under the following copyright:
- Copyright (c) 2006, Sun Microsystems, Inc.
-
-
-
-
-
-
diff --git a/bsf3/bsf-engines/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory b/bsf3/bsf-engines/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory
deleted file mode 100644
index f4eb5d7..0000000
--- a/bsf3/bsf-engines/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# 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.
-#
-#
-
-bsh.engine.BshScriptEngineFactory
-com.sun.script.freemarker.FreeMarkerScriptEngineFactory
-com.sun.script.groovy.GroovyScriptEngineFactory
-com.sun.script.jacl.JaclScriptEngineFactory
-com.sun.script.jaskell.JaskellScriptEngineFactory
-com.sun.script.java.JavaScriptEngineFactory
-com.sun.phobos.script.javascript.RhinoScriptEngineFactory
-com.sun.phobos.script.javascript.EmbeddedRhinoScriptEngineFactory
-com.sun.script.jawk.JawkScriptEngineFactory
-com.sun.script.jelly.JellyScriptEngineFactory
-com.sun.script.jep.JepScriptEngineFactory
-com.sun.script.jexl.JexlScriptEngineFactory
-com.sun.script.jruby.JRubyScriptEngineFactory
-com.sun.script.judo.JudoScriptEngineFactory
-com.sun.script.juel.JuelScriptEngineFactory
-com.sun.script.jython.JythonScriptEngineFactory
-com.sun.script.ognl.OgnlScriptEngineFactory
-org.pnuts.scriptapi.PnutsScriptEngineFactory
-com.sun.script.scheme.SchemeScriptEngineFactory
-com.sun.script.velocity.VelocityScriptEngineFactory
-com.sun.script.xpath.XPathScriptEngineFactory
-com.sun.script.xslt.XSLTScriptEngineFactory
-
diff --git a/bsf3/bsf-utils/pom.xml b/bsf3/bsf-utils/pom.xml
deleted file mode 100644
index a98c049..0000000
--- a/bsf3/bsf-utils/pom.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?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>
- <artifactId>bsf-utils</artifactId>
- <name>Apache BSF Utils</name>
- <description>BSF API Utility classes</description>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-api</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-engines</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.2</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.2</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>rhino</groupId>
- <artifactId>js</artifactId>
- <version>1.6R7</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- <version>2.2.0</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/Main.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/Main.java
deleted file mode 100644
index 9ef3f0d..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/Main.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * 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;
-
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.script.Bindings;
-import javax.script.Compilable;
-import javax.script.Invocable;
-import javax.script.ScriptContext;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineFactory;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-/**
- * This is the main driver for BSF to be run on the command line
- * to eval scripts directly.
- *
- * @author Sanjiva Weerawarana
- * @author Matthew J. Duftler
- * @author Sam Ruby
- */
-public class Main {
- private static final String SHOW_ENGINE = "engine";
- private static final String SHOW_FACTORIES = "factories";
- private static final String ARG_IN = "-in";
- private static final String ARG_LANG = "-lang";
- private static final String ARG_EXT = "-ext";
- private static final String ARG_SHOW = "-show";
- private static final String DEFAULT_IN_FILE_NAME = "<STDIN>";
-
- /**
- * Static driver to be able to run BSF scripts from the command line.
- *
- * @param args command line arguments
- */
- public static void main(String[] args) throws IOException {
- if ((args.length == 0) || (args.length % 2 != 0)) {
- printHelp();
- System.exit(1);
- }
-
- Hashtable argsTable = new Hashtable();
-
- for (int i = 0; i < args.length; i += 2) {
- argsTable.put(args[i], args[i + 1]);
- }
-
- String inFileName = (String) argsTable.get(ARG_IN);
- String extension = (String) argsTable.get(ARG_EXT);
- String language = (String) argsTable.get(ARG_LANG);
- String show = (String) argsTable.get(ARG_SHOW);
-
- ScriptEngineManager mgr = new ScriptEngineManager();
- final List engineFactories = mgr.getEngineFactories();
- if (engineFactories.isEmpty()){
- throw new RuntimeException("Could not find any engine factories");
- }
-
- final int engineCount = engineFactories.size();
- if (SHOW_FACTORIES.equalsIgnoreCase(show)) {
- System.err.println("Found "+engineCount+ " engine factories");
- for (Iterator iter = engineFactories.iterator(); iter.hasNext();){
- ScriptEngineFactory fac = (ScriptEngineFactory) iter.next();
- showFactory(fac, false);
- }
- return;
- }
-
- if (language == null && extension == null && inFileName != null) {
- int i = inFileName.lastIndexOf('.');
- if (i > 0) {
- extension = inFileName.substring(i+1);
- }
- }
- if (extension == null && language == null) {
- throw new IllegalArgumentException("unable to determine language");
- }
-
- Reader in;
-
- if (inFileName != null) {
- in = new FileReader(inFileName);
- } else {
- in = new InputStreamReader(System.in);
- inFileName = DEFAULT_IN_FILE_NAME;
- }
-
- try {
- ScriptEngine engine;
- if (language != null) {
- engine = mgr.getEngineByName(language);
- if (engine == null){
- throw new IllegalArgumentException("unable to find engine using Language: "+language);
- }
- } else {
- engine = mgr.getEngineByExtension(extension);
- if (engine == null){
- throw new IllegalArgumentException("unable to find engine using Extension: "+extension);
- }
- }
- if (SHOW_ENGINE.equalsIgnoreCase(show)){
- ScriptEngineFactory fac = engine.getFactory();
- showFactory(fac, true);
- System.err.println("Engine="+engine.getClass().getName());
- if (engine instanceof Compilable){
- System.err.println("Engine supports Compilable interface.");
- }
- if (engine instanceof Invocable){
- System.err.println("Engine supports Invocable interface.");
- }
- System.err.println();
- }
- Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);
- bindings.put("args", args);
- Object obj = engine.eval(in);
- System.err.println("Result: " + obj);
- } catch (ScriptException e) {
- e.printStackTrace();
- }
- }
-
- private static void showFactory(ScriptEngineFactory fac, boolean full) {
- StringBuffer sb = new StringBuffer();
- sb.append('[');
- sb.append(fac.getClass().getName());
- sb.append("]\n");
-
- try {
- sb.append(fac.getEngineName());
- sb.append(" ");
- try {
- sb.append(fac.getEngineVersion());
- } catch (NoClassDefFoundError e) {
- sb.append("N/A");
- }
- sb.append(" for ");
- sb.append(fac.getLanguageName());
- sb.append(" ");
- try {
- sb.append(fac.getLanguageVersion());
- } catch (NoClassDefFoundError e) {
- sb.append("N/A");
- }
- sb.append("\n");
-
- Iterator iter=fac.getNames().iterator();
- char sep = '{';
- while(iter.hasNext()){
- sb.append(sep);
- sb.append(iter.next());
- sep=',';
- }
- if (sep == ','){
- sb.append("} ");
- }
- iter=fac.getExtensions().iterator();
- sep='[';
- while(iter.hasNext()){
- sb.append(sep);
- sb.append('.');
- sb.append(iter.next());
- sep=',';
- }
- if (sep == ','){
- sb.append("] ");
- }
- iter=fac.getMimeTypes().iterator();
- sep='(';
- while(iter.hasNext()){
- sb.append(sep);
- sb.append(iter.next());
- sep=',';
- }
- if (sep == ','){
- sb.append(")");
- }
- sb.append("\n");
- if (full){
- sb.append("OutputStatement: ");
- try {
- sb.append(fac.getOutputStatement("String"));
- } catch (Exception e) {
- sb.append(e.toString());
- }
- sb.append("\n");
- sb.append("Program: ");
- try {
- sb.append(fac.getProgram(new String[]{"Line1","Line2"}));
- } catch (Exception e) {
- sb.append(e.toString());
- }
- sb.append("\n");
- sb.append("Method call: ");
- try {
- sb.append(fac.getMethodCallSyntax("object", "method", new String[]{"Arg1","Arg2"}));
- } catch (Exception e) {
- sb.append(e.toString());
- }
- sb.append("\n");
- }
- } catch (Throwable t) {
- sb.append(t.toString());
- } finally {
- System.err.println(sb.toString());
- }
- }
-
- private static void printHelp() {
- System.err.println("Usage:");
- System.err.println();
- System.err.println(" java " + Main.class.getName() + " [opts] [args]");
- System.err.println();
- System.err.println(" opts:");
- System.err.println();
- System.err.println(
- " [-lang shortname] (e.g. jexl, jython) Overrides -ext.");
- System.err.println(
- " [-in fileName] default: " + DEFAULT_IN_FILE_NAME);
- System.err.println(
- " [-ext extension] default: "
- + "<If -in is specified and neither -ext nor -lang");
- System.err.println(
- " "
- + " are, attempt to determine");
- System.err.println(
- " "
- + " extension from file extension;");
- System.err.println(
- " "
- + " otherwise, -ext or -lang is required.>");
- System.err.println(
- " [-show item]");
- System.err.println(
- " " + SHOW_FACTORIES + " - list all engine factories and exit");
- System.err.println(
- " " +SHOW_ENGINE + " - list details of selected factory and engine");
- System.err.println();
- System.err.println();
- System.err.println(
- " The command-line arguments are stored in the array 'args'");
- }
-}
\ No newline at end of file
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/GenericHttpScriptContext.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/GenericHttpScriptContext.java
deleted file mode 100644
index 78b8baf..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/GenericHttpScriptContext.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * 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.utils.http;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-
-import javax.script.SimpleScriptContext;
-import javax.servlet.Servlet;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-public class GenericHttpScriptContext extends SimpleScriptContext implements HttpScriptContext {
-
- public static final String[] defaultMethods = {"GET", "POST"};
- protected boolean disableScript = false;
- protected boolean displayResults = false;
- protected String scriptDir;
- protected String[] languages;
- protected String[] methods;
- protected HttpServletRequest request;
- protected HttpServletResponse response;
- protected Servlet servlet;
- protected boolean useSession = true;
-
- public GenericHttpScriptContext() {
- super();
- }
-
- public boolean disableScript() {
- return disableScript;
-
- }
-
- public boolean displayResults() {
- return displayResults;
-
- }
-
- public String[] getAllowedLanguages() {
- return languages;
- }
-
- public Object getAttribute(String key, Object value, int scope){
-
- switch (scope) {
- case HttpScriptContext.ENGINE_SCOPE:
- return request.getAttribute(key);
- case HttpScriptContext.SESSION_SCOPE:
- if (useSession()) {
- return request.getSession().getAttribute(key);
- } else {
- return null;
- }
- case HttpScriptContext.APPLICATION_SCOPE:
- return servlet.getServletConfig().getServletContext().getAttribute(key);
- default:
- return null;
- }
- }
-
-
- public void setAttribute(String key, Object value, int scope)
- throws IllegalArgumentException {
-
- switch (scope) {
- case HttpScriptContext.REQUEST_SCOPE:
- request.setAttribute(key, value);
- break;
- case HttpScriptContext.SESSION_SCOPE:
- if (useSession()) {
- request.getSession().setAttribute(key, value);
- } else {
- throw new IllegalArgumentException("Session is disabled");
- }
- break;
- case HttpScriptContext.APPLICATION_SCOPE:
- servlet.getServletConfig().getServletContext().setAttribute(
- key, value);
- break;
- default:
- throw new IllegalArgumentException("Invalid scope");
- }
- }
-
- public void forward(String relativePath) throws ServletException, IOException {
-
- ServletContext context = servlet.getServletConfig().getServletContext();
-
- String baseURI;
- String requestURI = request.getRequestURI();
-
- if(relativePath.startsWith("/")){
- baseURI = requestURI.substring(0, request.getContextPath().length());
-
- }else{
- baseURI = requestURI.substring(0, requestURI.lastIndexOf("/"));
- }
-
- context.getRequestDispatcher(baseURI+relativePath).forward(request, response);
- }
-
-
- public String[] getMethods() {
- return methods;
- }
-
- public HttpServletRequest getRequest() {
- return new HttpScriptRequest(this, request);
- }
-
- public HttpServletResponse getResponse() {
- return new HttpScriptResponse(this, response);
- }
-
- public Reader getScriptSource() {
-
- String requestURI = request.getRequestURI();
- String resourcePath =
- requestURI.substring(request.getContextPath().length());
-
- if(scriptDir == null){
- // should I construct a reader by combing contextRoot+ resourcePath
- }else{
- String fullPath;
- if(scriptDir.endsWith("/") || resourcePath.startsWith("/")){
- fullPath = scriptDir + resourcePath;
- }else{
- fullPath = scriptDir+"/"+resourcePath;
- }
- try{
- return new FileReader(fullPath);
- }catch(IOException ioe){
- }
- }
-
- return null;
- }
-
- public Servlet getServlet() {
- return servlet;
- }
-
- public void include(String relativePath) throws ServletException, IOException {
- ServletContext context = servlet.getServletConfig().getServletContext();
-
- String baseURI;
- String requestURI = request.getRequestURI();
-
- if(relativePath.startsWith("/")){
- baseURI = requestURI.substring(0, request.getContextPath().length());
-
- }else{
- baseURI = requestURI.substring(0, requestURI.lastIndexOf("/"));
- }
-
- context.getRequestDispatcher(baseURI+relativePath).include(request, response);
- }
-
- public void initialize(Servlet servlet, HttpServletRequest request,
- HttpServletResponse response) throws ServletException {
-
- this.request = request;
- this.response = response;
- this.servlet = servlet;
-
- ServletContext context = servlet.getServletConfig().getServletContext();
-
- scriptDir = context.getInitParameter("script-directory");
-
- if(scriptDir == null || !(new File(scriptDir).isDirectory())){
- throw new ServletException("Specifed script directory either does " +
- "not exist or not a directory");
- }
-
- String disable = context.getInitParameter("script-disable");
- if(disable != null && disable.equals("true")){
- disableScript = true;
- return;
- }
-
- String session = context.getInitParameter("script-use-session");
- if(session != null && session.equals("false")){
- useSession = false;
- }
-
- String display = context.getInitParameter("script-display-results");
- if(display != null && display.equals("true")){
- displayResults = true;
- }
-
- String methodNames = context.getInitParameter("script-methods");
- if(methodNames != null){
- methods = methodNames.split(",");
- }else{
- methods = defaultMethods;
- }
-
- String languageNames = context.getInitParameter("allowed-languages");
- if(languageNames != null){
- languages = languageNames.split(",");
- }
- }
-
- public void release() {
- disableScript = false;
- displayResults = false;
- useSession = true;
- servlet = null;
- request = null;
- response = null;
- }
-
-
- public boolean useSession() {
- return useSession;
- }
-
- public Writer getWriter() {
- try{
- return response.getWriter();
- }catch(IOException ioe){
- return null;
- }
- }
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptContext.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptContext.java
deleted file mode 100644
index 707b8ef..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptContext.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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.utils.http;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import javax.script.ScriptContext;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * HttpScriptContext is a subinteface of ScriptContext which is used
- * to connect a ScriptEngine and implicit objects form a servlet
- * container to for a single request.
- *
- * @author Nandika Jayawardana <nandika@opensource.lk>
- * @author Sanka Samaranayake <sanka@opensource.lk>
- */
-public interface HttpScriptContext extends ScriptContext {
-
- // TODO: Workout what these scope values need to be
-
- /** Integer value for the level of SCRIPT_SCOPE */
- public static final int REQUEST_SCOPE = 0;
-
- /** Integer value for the level of SESSION_SCOPE */
- public static final int SESSION_SCOPE = 300;
-
- /** Integer value for the level of APPLICATION_SCOPE */
- public static final int APPLICATION_SCOPE = 400;
-
- /**
- * Retrieves a boolean value which indicates whether the script
- * execution has been disabled in the Web Application.
- *
- * @return a booean indicating whether the script execution is
- * allowed
- */
- public boolean disableScript();
-
- /**
- * Retrieves a boolean value which indicates whether the
- * HttpScriptServlet executing in this context should display the
- * results of script evaluations.
- *
- * @return a boolean indicating whether the results of script
- * eveluations should be displayed
- */
- public boolean displayResults();
-
- /**
- * Forwards the request to the resource identified by the
- * specified relative path.
- *
- * @param relativePath the URI to process the request
- * @throws IOException if an input or output error occurs while
- * processing the HTTP request
- * @throws ServletException if the HTTP cannot be handled
- */
- public void forward(String relativePath)
- throws ServletException, IOException;
-
- /**
- * Retrieves an array of Strings describing the languages that may
- * be used by scripts which is running in the associated
- * HttpScriptContext. Returns null if no restrictions apply.
- *
- * @return a String array of permitted languages
- */
- public String[] getAllowedLanguages();
-
- /**
- * Retrieves an array of string describing HTTP request methods
- * which are handled by servlets executing in current context.
- *
- * @return a String array of HTTP request methods handled by
- * servelts in the current context
- */
- public String[] getMethods();
-
- /**
- * Retrieves a HttpScriptRequest for the current request. If the
- * session state is disabled, an adapter whose getSession()
- * method returns null should be used.
- *
- * @return the current request
- */
- public HttpServletRequest getRequest();
-
- /**
- * Retrieves a HttpScriptResponse for the current request.
- *
- * @return the current response
- */
- public HttpServletResponse getResponse();
-
- /**
- * Retrieves a reader form which the executing script can be
- * read.
- *
- * @return a reader from which the script can be read.
- */
- public Reader getScriptSource();
-
- /**
- * Retrieves the associated HttpScriptServlet.
- *
- * @return a reader form which the script source can be read
- */
- public Servlet getServlet();
-
- /**
- * Includes the resource in the sepcified relative path.
- *
- * @param relativePath the URI of the request to be processed
- * @throws IOException if an input or output error occurs while
- * processing the HTTP request
- * @throws ServletException if the servlet cannot handled the
- * HTTP request
- */
- public void include(String relativePath) throws IOException,
- ServletException;
-
- /**
- * Initialize the current HttpScriptContext for processing of
- * single request. Implementation must initialize request,
- * session and application scopes. Further it should store
- * servlet, request and response references for use.
- *
- * @param servlet the HttpServlet which execute the request
- * @param req the current request
- * @param res the current response
- * @throws ServletException if the servlet cannot handle the HTTP
- * request
- */
- public void initialize(Servlet servlet,
- HttpServletRequest req,HttpServletResponse res) throws
- ServletException;
-
- /**
- * Clears any state stored in the current HttpScriptContext such
- * that it can be reused to serve another request.
- */
- public void release();
-
- /**
- * Retrieves a boolean value which indicates whether the
- * HttpSession associated with the current request is exposed in
- * SESSION_SCOPE attribute and in the HttpScriptRequest.
- *
- * @return a boolean value which indicates whether the session is
- * vaild
- */
- public boolean useSession();
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptRequest.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptRequest.java
deleted file mode 100644
index 8719608..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptRequest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.utils.http;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpSession;
-
-/**
- * HttpScriptRequest class is a wrapper used to wrap
- * HttpServletRequest in HttpScriptContext.getResponse() method.
- *
- * @author Nandika Jayawardana <nandika@opensource.lk>
- * @author Sanka Samaranayake <sanka@opensource.lk>
- */
-public class HttpScriptRequest extends HttpServletRequestWrapper {
-
- private final HttpScriptContext context;
-
- public HttpScriptRequest(HttpScriptContext context, HttpServletRequest req){
- super(req);
- this.context = context;
- }
-
- public RequestDispatcher getRequestDispatcher(String path) {
- return null;
- }
-
- public HttpSession getSession() {
- return (context.useSession()) ? super.getSession() : null;
- }
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptResponse.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptResponse.java
deleted file mode 100644
index 0417fbc..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptResponse.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.utils.http;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
-/**
- * HttpScriptResponse is a Wrapper class which is used to wrap the a
- * HttpServletResponse in HttpScriptContext.getReponse() method.
- *
- * @author Nandika Jayawarda <nandika@opensource.lk>
- * @author Sanka Samaranayake <sanka@opensource.lk>
- */
-public class HttpScriptResponse extends HttpServletResponseWrapper {
-
- public HttpScriptResponse(HttpScriptContext context, HttpServletResponse res){
- super(res);
- }
-
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptServlet.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptServlet.java
deleted file mode 100644
index 267237b..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/HttpScriptServlet.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * 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.utils.http;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.util.List;
-
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-import javax.servlet.GenericServlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * HttpScriptServlet contains method which allows execution of
- * scripts written in one or more languages. It uses a ScriptEngine
- * supplied by calling its getEngine method to execute a script in a
- * HttpScriptContext supplied by calling its getContext method.
- *
- * @author Nandika Jayawardana <nandika@opensource.lk>
- * @author Sanka Samaranayake <sanka@opensource.lk>
- */
-public class HttpScriptServlet extends GenericServlet {
- private static final long serialVersionUID = 1L;
-
- public HttpScriptServlet(){
- }
-
- /**
- * Retrieves a HttpScriptContext initialized using specified
- * HttpServletRequest, HttpServletResponse and a reference to
- * this HttpScriptServlet.
- *
- * @param req the supplied HttpServletRequest instance
- * @param res the supplied HttpServletResponse instance
- * @return an initialized HttpScriptContext
- * @throws ServletException if an error occurs
- */
- public HttpScriptContext getContext(HttpServletRequest req,
- HttpServletResponse res) throws ServletException {
-
- return null; // TODO
- }
-
- /**
- * Returns a ScriptEngine instance which is used by the
- * HttpScriptServlet to executes a single request.
- *
- * @param req the current request
- * @return an instance of a ScriptEngine which is used by the
- * HttpScriptServlet to executes a single request
- */
- public ScriptEngine getEngine(HttpServletRequest req) {
- return null; // TODO
- }
-
- /**
- * Called to indicate that the ScriptEngine returned by call to
- * getEngine() is no longer in use.
- *
- * @param eng the ScriptEngine which is no longer in use
- */
- public void releaseEngine(ScriptEngine eng) {
-
- }
-
- /**
- * Executes a script using the HttpScriptContext obtained by a
- * call to getContext() and the ScriptEngine obtained by a call
- * to getEngine().
- *
- * @param req the current request
- * @param res the current response
- * @throws IllegalArgumentException if the req is not an
- * instance of HttpServletRequest or if the res is not an
- * instance of HttpServletResponse
- * @throws IOException if an input, output error occurs
- * @throws ServletException if error occurs in processing the
- * request
- */
- public void service(ServletRequest req,ServletResponse res)
- throws IllegalArgumentException, IOException, ServletException {
-
- HttpServletRequest request;
- HttpServletResponse response;
- HttpScriptContext context;
- ScriptEngine engine;
- Object retValue;
-
- if( !(req instanceof HttpServletRequest) ||
- !(res instanceof HttpServletResponse)){
- throw new IllegalArgumentException(
- "Method arguments should be HttpServletRequest and " +
- "HttpServletResponse type");
- }
-
- request = (HttpServletRequest)req;
- response =(HttpServletResponse)res;
-
- context = getContext(request, response);
- if (context.disableScript()) {
- response.setStatus(HttpServletResponse.SC_FORBIDDEN);
- return;
- }
-
- String requestMethod = request.getMethod();
- String[] allowedMethods = context.getMethods();
- int score;
-
- for (score=0; score<allowedMethods.length; score++ ) {
- if (requestMethod.equalsIgnoreCase(allowedMethods[score])) {
- break;
- }
- }
-
- if (score == allowedMethods.length) {
- response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- return;
- }
-
- engine = getEngine(request);
-
- String[] languages = context.getAllowedLanguages();
- List names = engine.getFactory().getNames();
-
- if (languages != null) {
-
- boolean found = false;
-
- for (int i=0; i<languages.length; i++) {
- for (int j=0; j<names.size(); j++) {
- if (languages[i].equals(names.get(i))) {
- found = true;
- }
- }
- }
-
- if (!found) {
- response.setStatus(HttpServletResponse.SC_FORBIDDEN);
- return;
- }
- }
-
- try {
-
- Reader reader = context.getScriptSource();
- if (reader == null) {
- response.setStatus(HttpServletResponse.SC_NOT_FOUND);
- return;
- }
-
- engine.put("javax.script.filename", request.getRequestURI());
- engine.put("Request", context.getRequest());
- engine.put("Response",context.getResponse());
- engine.put("Servlet", context.getServlet());
- engine.put("Context", context);
-
- retValue = engine.eval(reader, context);
-
- response.setContentType("text/html");
- if ((retValue != null) && (context.displayResults())) {
- response.getWriter().write(retValue.toString());
- }
-
- response.getWriter().close();
- } catch (ScriptException se) {
-
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- throw new ServletException(se);
-
- } finally {
-
- releaseEngine(engine);
- context.release();
- }
- }
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/ScriptEnginePool.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/ScriptEnginePool.java
deleted file mode 100644
index 8efc10d..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/utils/http/ScriptEnginePool.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.utils.http;
-
-import java.util.LinkedList;
-
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineFactory;
-
-public class ScriptEnginePool {
-
- static private final int DEFAULT_SIZE = 10;
- private final LinkedList pool = new LinkedList();
- //GuardedBy("this")
- private int engines = 0;
- private final int capacity;
- private final ScriptEngineFactory factory;
- private final boolean isMultithreaded;
-
- public ScriptEnginePool(ScriptEngineFactory factory, int capacity){
- this.factory = factory;
- this.capacity = capacity;
-
- String param = (String)factory.getParameter("THREADING");
- if (param != null && param.equals("MULTITHREADED")) {
- this.isMultithreaded = true;
- pool.add(factory.getScriptEngine());
- } else {
- this.isMultithreaded = false;
- }
- }
-
- public ScriptEnginePool(ScriptEngineFactory factory){
- this(factory,DEFAULT_SIZE);
- }
-
- public synchronized void free(ScriptEngine eng){
- pool.add(eng); // should I clear the engine namespaces ..
- notifyAll();
- }
-
- public synchronized ScriptEngine get(){
- if (isMultithreadingSupported()) {
- return (ScriptEngine) pool.getFirst();
- } else {
- if (!pool.isEmpty()) {
- return (ScriptEngine)pool.removeFirst();
- } else {
- if (engines<capacity) {
- engines++;
- return factory.getScriptEngine();
- }
- while (!pool.isEmpty()) {
- try{
- wait();
- }catch(InterruptedException ie){
- }
- }
- return (ScriptEngine) pool.removeFirst();
- }
- }
- }
-
- public boolean isMultithreadingSupported(){
- return this.isMultithreaded;
- }
-
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/DefaultXMLHelper.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/DefaultXMLHelper.java
deleted file mode 100644
index e91418d..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/DefaultXMLHelper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.xml;
-
-import java.io.ByteArrayInputStream;
-
-import javax.script.ScriptException;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.w3c.dom.Node;
-
-/**
- * Default XMLHelper for when no specific XMLHelper is implemented
- * for a script engine. Just converts XML to text Strings.
- */
-public class DefaultXMLHelper extends XMLHelper {
-
- public OMElement toOMElement(Object scriptXML) throws ScriptException {
- try {
-
- StAXOMBuilder builder = new StAXOMBuilder(
- new ByteArrayInputStream(scriptXML.toString().getBytes()));
- return builder.getDocumentElement();
-
- } catch (XMLStreamException e) {
- throw new ScriptException(e);
- }
- }
-
- public Object toScriptXML(OMElement om) throws ScriptException {
- return om.toString();
- }
-
- public Node toDOMNode(Object scriptXML) throws ScriptException {
- throw new UnsupportedOperationException("not implemented yet");
- }
-
- public Object toScriptXML(XMLStreamReader reader) throws ScriptException {
- throw new UnsupportedOperationException("not implemented yet");
- }
-
- public Object toScriptXML(Node node) throws ScriptException {
- throw new UnsupportedOperationException("not implemented yet");
- }
-
- public XMLStreamReader toXMLStreamReader(Object scriptXML) throws ScriptException {
- throw new UnsupportedOperationException("not implemented yet");
- }
-
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JRubyReXMLHelper.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JRubyReXMLHelper.java
deleted file mode 100644
index cd92644..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JRubyReXMLHelper.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.xml;
-
-import java.io.ByteArrayInputStream;
-
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-
-/**
- * XMLHelper for Ruby ReXML
- *
- * TODO: Find a more efficent way to do this with JRuby
- */
-public class JRubyReXMLHelper extends DefaultXMLHelper {
-
- private final ScriptEngine scriptEngine;
-
- JRubyReXMLHelper(ScriptEngine scriptEngine) {
- this.scriptEngine = scriptEngine;
- }
-
- public OMElement toOMElement(Object scriptXML) throws ScriptException {
- if (scriptXML == null) {
- return null;
- }
- try {
-
- byte[] xmlBytes = scriptXML.toString().getBytes();
- StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(xmlBytes));
- return builder.getDocumentElement();
-
- } catch (Exception e) {
- throw new ScriptException(e);
- }
- }
-
- public Object toScriptXML(OMElement om) throws ScriptException {
- if (om == null) {
- return null;
- }
- StringBuffer srcFragment = new StringBuffer("Document.new(<<EOF\n");
- srcFragment.append(om.toString());
- srcFragment.append("\nEOF\n");
- srcFragment.append(")");
- return scriptEngine.eval(srcFragment.toString());
- }
-
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XAxiomHelper.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XAxiomHelper.java
deleted file mode 100644
index 4eb307a..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XAxiomHelper.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.xml;
-
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-
-import org.apache.axiom.om.OMElement;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.ContextFactory;
-import org.mozilla.javascript.ContextHelper;
-import org.mozilla.javascript.Scriptable;
-import org.mozilla.javascript.ScriptableObject;
-import org.mozilla.javascript.xml.XMLLib;
-import org.mozilla.javascript.xml.XMLObject;
-
-/**
- * XMLHelper for JavaScript E4X using Axiom
- */
-public class JavaScriptE4XAxiomHelper extends DefaultXMLHelper {
-
- private final Scriptable scope;
-
- JavaScriptE4XAxiomHelper(ScriptEngine engine) {
-
- // tell Rhino to use Axiom E4X impl
- if (!ContextFactory.hasExplicitGlobal()) {
- ContextFactory.initGlobal(new AxiomE4XContextFactory());
- }
-
- Context cx = Context.enter();
- try {
-
- this.scope = cx.initStandardObjects();
-
- } finally {
- Context.exit();
- }
- }
-
- public OMElement toOMElement(Object scriptXML) throws ScriptException {
- if (scriptXML == null) {
- return null;
- }
-
- if (!(scriptXML instanceof XMLObject)) {
- return null;
- }
-
- Object o = ScriptableObject.callMethod( (Scriptable) scriptXML, "getXmlObject", new Object[0]);
- return (OMElement) o;
-// return (OMElement) ScriptableObject.callMethod( (Scriptable) scriptXML, "getXmlObject", new Object[0]);
- }
-
- public Object toScriptXML(OMElement om) throws ScriptException {
- if (om == null) {
- return null;
- }
- Context cx = Context.enter();
- try {
-
- // TODO: why is this needed? A bug in axiom-e4x?
- ContextHelper.setTopCallScope(cx, scope);
-
- return cx.newObject(scope, "XML", new Object[]{om});
-
- } finally {
- Context.exit();
- }
- }
-
- public static void init() {
- ContextFactory.initGlobal(new AxiomE4XContextFactory());
- }
-}
-
-class AxiomE4XContextFactory extends ContextFactory {
-
- protected XMLLib.Factory getE4xImplementationFactory() {
- return org.mozilla.javascript.xml.XMLLib.Factory.create(
- "org.wso2.javascript.xmlimpl.XMLLibImpl"
- );
- }
-}
-
-
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XHelper.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XHelper.java
deleted file mode 100644
index 483585c..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XHelper.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.xml;
-
-import javax.script.ScriptEngine;
-
-/**
- * XMLHelper for JavaScript E4X
- */
-public class JavaScriptE4XHelper extends DefaultXMLHelper {
-
- public static XMLHelper getXMLHelper(ScriptEngine engine) {
-
- try {
- Class.forName("org.wso2.javascript.xmlimpl.XMLLibImpl", true, JavaScriptE4XHelper.class.getClassLoader());
- return new JavaScriptE4XAxiomHelper(engine);
- } catch (ClassNotFoundException e) {
- // TODO: also support Rhino 1.6R7 DOM based E4X impl
- return new JavaScriptE4XXmlBeansHelper(engine);
- }
- }
-
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XXmlBeansHelper.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XXmlBeansHelper.java
deleted file mode 100644
index 78f64cb..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/JavaScriptE4XXmlBeansHelper.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.xml;
-
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.xmlbeans.XmlObject;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.Scriptable;
-import org.mozilla.javascript.ScriptableObject;
-import org.mozilla.javascript.Wrapper;
-import org.mozilla.javascript.xml.XMLObject;
-
-/**
- * XMLHelper for JavaScript E4X using XmlBeans
- */
-public class JavaScriptE4XXmlBeansHelper extends DefaultXMLHelper {
-
- private final Scriptable scope;
-
- JavaScriptE4XXmlBeansHelper(ScriptEngine engine) {
- Context cx = Context.enter();
- try {
- this.scope = cx.initStandardObjects();
- } finally {
- Context.exit();
- }
- }
-
- public OMElement toOMElement(Object scriptXML) throws ScriptException {
- if (scriptXML == null) {
- return null;
- }
-
- if (!(scriptXML instanceof XMLObject)) {
- return null;
- }
-
- // TODO: E4X Bug? Shouldn't need this copy, but without it the outer element gets lost???
- Scriptable jsXML =
- (Scriptable) ScriptableObject.callMethod((Scriptable) scriptXML, "copy", new Object[0]);
- Wrapper wrapper =
- (Wrapper) ScriptableObject.callMethod(jsXML, "getXmlObject", new Object[0]);
-
- XmlObject xmlObject = (XmlObject) wrapper.unwrap();
-
- try {
- StAXOMBuilder builder = new StAXOMBuilder(xmlObject.newInputStream());
- return builder.getDocumentElement();
-
- } catch (XMLStreamException e) {
- throw new ScriptException(e);
- }
- }
-
- public Object toScriptXML(OMElement om) throws ScriptException {
- if (om == null) {
- return null;
- }
- Context cx = Context.enter();
- try {
-
- XmlObject xml = null;
- try {
- xml = XmlObject.Factory.parse(om.getXMLStreamReader());
- } catch (Exception e) {
- throw new ScriptException(e);
- }
- Object wrappedXML = cx.getWrapFactory().wrap(cx, scope, xml, XmlObject.class);
- return cx.newObject(scope, "XML", new Object[]{wrappedXML});
-
- } finally {
- Context.exit();
- }
- }
-
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/XMLHelper.java b/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/XMLHelper.java
deleted file mode 100644
index fe6d9d5..0000000
--- a/bsf3/bsf-utils/src/main/java/org/apache/bsf/xml/XMLHelper.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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.xml;
-
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.w3c.dom.Node;
-
-/**
- * Utility for converting between Java representations of XML such DOM nodes,
- * StAX streams, or Axiom OMElements, into script language representations such
- * as JavaScript E4X, Ruby ReXML, or Python ElementTree.
- */
-public abstract class XMLHelper {
-
- /**
- * Register axiom-e4x if its available
- * @deprecated temp approach for beta2 release
- */
- public static void init() {
- try {
- Class.forName("org.wso2.javascript.xmlimpl.XMLLibImpl", true, JavaScriptE4XHelper.class.getClassLoader());
- JavaScriptE4XAxiomHelper.init();
- } catch (ClassNotFoundException e) {
- }
- }
-
- public static XMLHelper getArgHelper(ScriptEngine engine) {
- // TODO: better discovery mechanisim than hardcoded class names
- if (engine == null) {
- return null;
- }
- String language = engine.getFactory().getLanguageName();
- if ("ECMAScript".endsWith(language)) {
- return JavaScriptE4XHelper.getXMLHelper(engine);
- } else if ("ruby".endsWith(language)) {
- return new JRubyReXMLHelper(engine);
- } else {
- return new DefaultXMLHelper();
- }
- }
-
- public abstract Object toScriptXML(OMElement om) throws ScriptException;
- public abstract OMElement toOMElement(Object scriptXML) throws ScriptException;
-
- public abstract Object toScriptXML(XMLStreamReader reader) throws ScriptException;
- public abstract XMLStreamReader toXMLStreamReader(Object scriptXML) throws ScriptException;
-
- public abstract Object toScriptXML(Node node) throws ScriptException;
- public abstract Node toDOMNode(Object scriptXML) throws ScriptException;
-}
diff --git a/bsf3/bsf-utils/src/main/java/org/mozilla/javascript/ContextHelper.java b/bsf3/bsf-utils/src/main/java/org/mozilla/javascript/ContextHelper.java
deleted file mode 100644
index 432e658..0000000
--- a/bsf3/bsf-utils/src/main/java/org/mozilla/javascript/ContextHelper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.mozilla.javascript;
-
-/**
- * Hack to enable creating E4X XML from Axiom OMElements
- * outside of a script invocation. To do this requires
- * Context.topCallScope not be null, but outside of a script
- * invocation it is null, hence this method to enable setting it.
- * Could be a bug in the Axiom E4X impl as the XmlBeans impl
- * does not require this.
- */
-public class ContextHelper {
-
- public static void setTopCallScope(Context cx, Scriptable scope) {
- if (cx.topCallScope == null) {
- cx.topCallScope = scope;
- }
- }
-
-}
diff --git a/bsf3/bsf-utils/src/main/resources/LICENSE b/bsf3/bsf-utils/src/main/resources/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/bsf3/bsf-utils/src/main/resources/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
diff --git a/bsf3/bsf-utils/src/main/resources/NOTICE b/bsf3/bsf-utils/src/main/resources/NOTICE
deleted file mode 100644
index 7891d93..0000000
--- a/bsf3/bsf-utils/src/main/resources/NOTICE
+++ /dev/null
@@ -1,17 +0,0 @@
-Apache BSF
-Copyright (c) 1999 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-*----------------------------------------------------------------------*
-* BSF3 was developed according to the JSR-223 specs, but has not yet *
-* been tested via the JSR-223 TCK. BSF can therefore not be considered *
-* a compatible implementation of JSR-223. *
-*----------------------------------------------------------------------*
-
-
-
-
-
-
diff --git a/bsf3/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java b/bsf3/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java
deleted file mode 100644
index 89edfa5..0000000
--- a/bsf3/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.apache.bsf.xml;
-/*
- * 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.
- */
-import javax.script.Bindings;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.bsf.xml.XMLHelper;
-import org.mozilla.javascript.xml.XMLObject;
-
-/**
- * Tests for converting btw OMElement and E4X
- */
-public class JavaScriptXMLHelperTestCase extends TestCase {
-
- private ScriptEngine engine;
-
- private XMLHelper xmlHelper;
-
- public void testToOmElement() throws ScriptException {
- Object scriptXML = engine.eval("<a><b>petra</b></a>");
- assertTrue(scriptXML instanceof XMLObject);
-
- OMElement om = xmlHelper.toOMElement(scriptXML);
- assertNotNull(om);
- assertEquals("<a><b>petra</b></a>", om.toString());
- }
-
- public void testToScriptXML() throws ScriptException {
- OMElement om = xmlHelper.toOMElement(engine.eval("<a><b>petra</b></a>"));
-
- Bindings bindings = engine.createBindings();
- bindings.put("xml", xmlHelper.toScriptXML(om));
-
- assertEquals("xml", engine.eval("typeof xml", bindings));
- assertEquals("petra", engine.eval("xml.b.toString()", bindings));
- }
-
- public void setUp() {
- ScriptEngineManager manager = new ScriptEngineManager();
- engine = manager.getEngineByExtension("js");
- xmlHelper = XMLHelper.getArgHelper(engine);
- }
-
-}
diff --git a/bsf3/distribution/bin.xml b/bsf3/distribution/bin.xml
deleted file mode 100644
index f3d5008..0000000
--- a/bsf3/distribution/bin.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?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.
- -->
-<assembly>
-
- <id>bin</id>
-
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <directory>.</directory>
- <outputDirectory>bsf-${bsf.version}</outputDirectory>
- <includes>
- <include>RELEASE_NOTES</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>distribution/src/bin/</directory>
- <outputDirectory>bsf-${bsf.version}</outputDirectory>
- <includes>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>README</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>bsf-api/target</directory>
- <outputDirectory>bsf-${bsf.version}/lib</outputDirectory>
- <includes>
- <include>bsf-api-${bsf.version}.jar</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>bsf-engines/target</directory>
- <outputDirectory>bsf-${bsf.version}/lib</outputDirectory>
- <includes>
- <include>bsf-engines-${bsf.version}.jar</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>bsf-utils/target</directory>
- <outputDirectory>bsf-${bsf.version}/lib</outputDirectory>
- <includes>
- <include>bsf-utils-${bsf.version}.jar</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>distribution/target</directory>
- <outputDirectory>bsf-${bsf.version}/lib</outputDirectory>
- <includes>
- <include>bsf-all-${bsf.version}.jar</include>
- </includes>
- </fileSet>
- </fileSets>
- <dependencySets>
- <!-- dependencySet>
- <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>
- <includes>
- <include>org.apache.axis2:addressing:mar</include>
- <include>org.apache.rampart:rampart:mar</include>
- <include>org.apache.sandesha2:sandesha2:mar</include>
- </includes>
- <excludes>
- <exclude>org.apache.axis2:addressing:mar</exclude>
- <exclude>org.apache.rampart:rampart:mar</exclude>
- <exclude>org.apache.sandesha2:sandesha2:mar</exclude>
- </excludes>
- </dependencySet -->
- </dependencySets>
-</assembly>
diff --git a/bsf3/distribution/build.xml b/bsf3/distribution/build.xml
deleted file mode 100644
index 8b3ace1..0000000
--- a/bsf3/distribution/build.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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.
--->
-
-<!-- ***NOTE*** temporary hack till can work out how to use the Maven assembly plugin -->
-
-<project name="Create-bsf-all">
-
- <property name="bsf.version" value="3.0-SNAPSHOT"/>
-
- <target name="create-bsf-all">
-
- <mkdir dir="${basedir}/target/bsf-all"/>
- <unzip src="${localRepository}/org/apache/bsf/bsf-api/${bsf.version}/bsf-api-${bsf.version}.jar" dest="${basedir}/target/bsf-all" overwrite="false"/>
- <unzip src="${localRepository}/org/apache/bsf/bsf-engines/${bsf.version}/bsf-engines-${bsf.version}.jar" dest="${basedir}/target/bsf-all" overwrite="false"/>
- <unzip src="${localRepository}/org/apache/bsf/bsf-utils/${bsf.version}/bsf-utils-${bsf.version}.jar" dest="${basedir}/target/bsf-all" overwrite="false"/>
-
- <copy file="${basedir}/src/bin/LICENSE" tofile="${basedir}/target/bsf-all/LICENSE" overwrite="true" />
- <copy file="${basedir}/src/bin/NOTICE" tofile="${basedir}/target/bsf-all/NOTICE" overwrite="true" />
-
- <zip destfile="${basedir}/target/bsf-all-${bsf.version}.jar" basedir="${basedir}/target/bsf-all" />
-
- <!-- Remove work directory -->
- <delete dir="${basedir}/target/bsf-all"/>
-
- <!-- these are required for the mvn install command to work correctly -->
- <condition property="maven.suffix" value="">
- <os family="unix"/>
- </condition>
- <condition property="maven.suffix" value=".bat">
- <os family="windows"/>
- </condition>
-
- <exec executable="mvn${maven.suffix}" dir="${basedir}" failonerror="true">
- <arg line="install:install-file -DgroupId=org.apache.bsf -DartifactId=bsf-all -Dversion=${bsf.version} -Dpackaging=jar -DgeneratePom=false -Dfile=${basedir}/target/bsf-all-${bsf.version}.jar"/>
- </exec>
-
- </target>
-
-</project>
diff --git a/bsf3/distribution/pom.xml b/bsf3/distribution/pom.xml
deleted file mode 100644
index 22145b1..0000000
--- a/bsf3/distribution/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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>pom</packaging>
- <artifactId>bsf-all</artifactId>
- <name>Apache BSF project to create the bsf-all jar</name>
- <description>Apache BSF project to create the bsf-all jar</description>
-
- <build>
- <defaultGoal>package</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>create-bsf-all</id>
- <phase>validate</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <ant target="create-bsf-all">
- <property name="localRepository" value="${settings.localRepository}"/>
- </ant>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/bsf3/distribution/src.xml b/bsf3/distribution/src.xml
deleted file mode 100644
index efe0fe6..0000000
--- a/bsf3/distribution/src.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?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.
- -->
-<assembly>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>src</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <!-- directory>src/main/release</directory -->
- <outputDirectory>bsf-${bsf.version}-src</outputDirectory>
- <includes>
- <include>LICENSE</include>
- <include>NOTICE</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>.</directory>
- <outputDirectory>bsf-${bsf.version}-src</outputDirectory>
- <includes>
- <include>BUILDING</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>RELEASE_NOTES</include>
- <include>pom.xml</include>
- <include>bsf-api/**/*</include>
- <include>bsf-engines/**/*</include>
- <include>bsf-utils/**/*</include>
- <include>distribution/**/*</include>
- <include>testing/**/*</include>
- </includes>
- <excludes>
- <exclude>**/target</exclude>
- <exclude>**/target/**/*</exclude>
- <exclude>**/build</exclude>
- <exclude>**/build/**/*</exclude>
- <exclude>**/.settings</exclude>
- <exclude>**/.classpath</exclude>
- <exclude>**/.project</exclude>
- <exclude>**/.wtpmodules</exclude>
- <exclude>**/*.iml</exclude>
- <exclude>**/.settings</exclude>
- <exclude>**/.settings/**/*</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/bsf3/distribution/src/bin/LICENSE b/bsf3/distribution/src/bin/LICENSE
deleted file mode 100644
index 61934d8..0000000
--- a/bsf3/distribution/src/bin/LICENSE
+++ /dev/null
@@ -1,250 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
-
-======================================
- LICENSES FOR INCLUDED DEPENDENCIES
-======================================
-
-All the source code for the Apache BSF project is released under the
-license above. Additionally, the Apache BSF binary distribution
-includes a number of third-party script engines which are released under
-the following BSD license:
-
- ============================================================================
- The script engines BSD License
- ============================================================================
-
-Copyright (c) 2006, Sun Microsystems, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- - Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
- - Neither the name of the Sun Microsystems, Inc. nor the names of
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
diff --git a/bsf3/distribution/src/bin/NOTICE b/bsf3/distribution/src/bin/NOTICE
deleted file mode 100644
index 1087fbf..0000000
--- a/bsf3/distribution/src/bin/NOTICE
+++ /dev/null
@@ -1,25 +0,0 @@
-Apache BSF
-Copyright (c) 1999 - 2009 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-*----------------------------------------------------------------------*
-* BSF3 was developed according to the JSR-223 specs, but has not yet *
-* been tested via the JSR-223 TCK. BSF can therefore not be considered *
-* a compatible implementation of JSR-223. *
-*----------------------------------------------------------------------*
-
-The Apache BSF binary distribution includes software distributed under the
-BSD License. See the LICENSE file for details.
-
-COPYRIGHT NOTICES
-
-* The Apache BSF binary includes script engines under the following copyright:
- Copyright (c) 2006, Sun Microsystems, Inc.
-
-
-
-
-
-
diff --git a/bsf3/distribution/src/bin/README b/bsf3/distribution/src/bin/README
deleted file mode 100644
index 6b013d1..0000000
--- a/bsf3/distribution/src/bin/README
+++ /dev/null
@@ -1,27 +0,0 @@
-BSF 3 beta3
------------
-
-The BSF 3 binary release contains several jars:
-
-bsf-api-beta3.jar
-- this contains all the javax.script classes as defined in the
- JSR-223 specification. This jar may be used as an application
- dependency when the application is using javax.script classes
-
-bsf-engines-beta3.jar
-- this contains several JSR-223 script engine implementations
- which enable a script language to be used via the javax.script
- APIs. This jar does not include the actual script language
- implementations, these need to be obtained separately.
-
-bsf-utils-beta3.jar
-- this contains various BSF specific utilities which aid using
- script languages from Java applications.
-
-bsf-all-beta3.jar
-- this contains all the other BSF jars merged into a single jar for
- ease of use. If you're not sure which jar to use then use this one.
-
-BSF 3 is compatible with Java 1.4.2 and above. Specific script
-languages may have further requirements on the Java version.
-
diff --git a/bsf3/pom.xml b/bsf3/pom.xml
deleted file mode 100644
index e1cc550..0000000
--- a/bsf3/pom.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-<?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 xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
- http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.bsf</groupId>
- <artifactId>parent</artifactId>
- <version>3.0-SNAPSHOT</version>
-
- <name>Apache BSF</name>
- <description>Apache BSF</description>
-
- <packaging>pom</packaging>
- <url>http://jakarta.apache.org/bsf/</url>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <bsf.version>3.0-SNAPSHOT</bsf.version>
- </properties>
-
- <issueManagement>
- <url>http://issues.apache.org/jira/browse/BSF</url>
- </issueManagement>
-
- <mailingLists>
- <mailingList>
- <name>Apache BSF Developer List</name>
- <subscribe>bsf-dev-subscribe@jakarta.apache.org</subscribe>
- <unsubscribe>bsf-dev-unsubscribe@jakarta.apache.org</unsubscribe>
- <post>bsf-dev@jakarta.apache.org</post>
- <archive>http://mail-archives.apache.org/mod_mbox/jakarta-bsf-dev/</archive>
- </mailingList>
- <mailingList>
- <name>Apache BSF User List</name>
- <subscribe>bsf-user-subscribe@jakarta.apache.org</subscribe>
- <unsubscribe>bsf-user-unsubscribe@jakarta.apache.org</unsubscribe>
- <post>bsf-user@jakarta.apache.org</post>
- <archive>http://mail-archives.apache.org/mod_mbox/jakarta-bsf-user/</archive>
- </mailingList>
- </mailingLists>
-
- <inceptionYear>1999</inceptionYear>
-
- <licenses>
- <license>
- <name>The Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/jakarta/bsf/trunk/bsf3</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/jakarta/bsf/trunk/bsf3</developerConnection>
- <url>http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/</url>
- </scm>
-
- <organization>
- <name>Apache Software Foundation</name>
- <url>http://www.apache.org/</url>
- </organization>
-
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.1</version>
- <configuration>
- <descriptors>
- <descriptor>distribution/bin.xml</descriptor>
- <descriptor>distribution/src.xml</descriptor>
- </descriptors>
- <finalName>bsf-${bsf.version}</finalName>
- </configuration>
- </plugin>
-
- <!--<plugin>-->
- <!--<artifactId>maven-site-plugin</artifactId>-->
- <!--<inherited>false</inherited>-->
- <!--</plugin>-->
- <!---->
- <!-- plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.1</version>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <attach>true</attach>
- </configuration>
- </plugin -->
- </plugins>
- </build>
- <activation>
- <property>
- <name>release</name>
- </property>
- </activation>
- </profile>
- </profiles>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0</version>
- <configuration>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.2</version>
- <configuration>
- <includes>
- <include>**/*Test*.java</include>
- </includes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.1</version>
- <configuration>
- <archive>
- <manifestEntries>
- <Extension-Name>${pom.groupId}</Extension-Name>
- <Specification-Title>${pom.artifactId}</Specification-Title>
- <Specification-Vendor>Apache Software Foundation</Specification-Vendor>
- <Specification-Version>${pom.version}</Specification-Version>
- <Implementation-Title>Apache BSF</Implementation-Title>
- <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
- <Implementation-Vendor>Apache Software Foundation</Implementation-Vendor>
- <Implementation-Version>${pom.version}</Implementation-Version>
- <X-Compile-Source-JDK>1.4</X-Compile-Source-JDK>
- <X-Compile-Target-JDK>1.4</X-Compile-Target-JDK>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-
-
- <reporting>
- <plugins>
- <plugin>
- <inherited>false</inherited>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.1</version>
- <configuration>
- <aggregate>true</aggregate>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-5</version>
- <inherited>false</inherited>
- </plugin>
- </plugins>
- </reporting>
-
- <distributionManagement>
-
- <repository>
- <id>apache.rsync</id>
- <name>Apache rsync Repository</name>
- <url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
- </repository>
-
- <snapshotRepository>
- <id>apache.snapshots</id>
- <name>Apache Snapshot Repository</name>
- <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
- </snapshotRepository>
-
- </distributionManagement>
-
- <modules>
- <module>bsf-api</module>
- <module>bsf-engines</module>
- <module>bsf-utils</module>
- <module>distribution</module>
- <module>testing</module>
- </modules>
-
-</project>
\ No newline at end of file
diff --git a/bsf3/testing/e4x-1.6R7-Axiom/pom.xml b/bsf3/testing/e4x-1.6R7-Axiom/pom.xml
deleted file mode 100644
index 7e55126..0000000
--- a/bsf3/testing/e4x-1.6R7-Axiom/pom.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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-e4x-1.6R7-Axiom</artifactId>
- <name>Apache BSF testing for JavaScript/E4X 1.6R7 Axiom</name>
- <description>Apache BSF testing for JavaScript/E4X with Rhino 1.6R7 uing Axiom E4X impl</description>
-
- <repositories>
- <!-- This is for the WSO2 E4X impl -->
- <repository>
- <id>wso2</id>
- <url>http://dist.wso2.org/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>rhino</groupId>
- <artifactId>js</artifactId>
- <version>1.6R7</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.5</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.wso2.wsf.javascript</groupId>
- <artifactId>axiom-e4x</artifactId>
- <version>0.29</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>rhino</groupId>
- <artifactId>js-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/e4x-1.6R7-Axiom/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java b/bsf3/testing/e4x-1.6R7-Axiom/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java
deleted file mode 100644
index 4acdbbc..0000000
--- a/bsf3/testing/e4x-1.6R7-Axiom/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.e4x;
-
-import java.io.StringReader;
-
-import javax.script.Bindings;
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.bsf.xml.XMLHelper;
-
-/**
- * Tests a basic JavaScrip/E4X invocation
- */
-public class HelloTestCase extends TestCase {
-
- private XMLHelper xmlHelper;
- private ScriptEngine engine;
-
- public void testInvokeFunctionInXML() throws ScriptException, XMLStreamException, FactoryConfigurationError, NoSuchMethodException {
- engine.eval("function isXML(xml) { return typeof xml == 'xml'; }" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
-
- Object xmlIn = xmlHelper.toScriptXML(createOMElement("<a><b>petra</b></a>"));
-
- Object o = invocableScript.invokeFunction("isXML", new Object[]{xmlIn});
- assertTrue(o instanceof Boolean);
- assertTrue(((Boolean)o).booleanValue());
- }
-
- public void testInvokeFunctionOutXML() throws ScriptException, XMLStreamException, FactoryConfigurationError, NoSuchMethodException {
- engine.eval("function hello(xml) { return <foo>{xml.b}</foo>; }" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
-
- Object xmlIn = xmlHelper.toScriptXML(createOMElement("<a><b>petra</b></a>"));
-
- Object xmlOut = invocableScript.invokeFunction("hello", new Object[]{xmlIn});
- OMElement omOut = xmlHelper.toOMElement(xmlOut);
- assertEquals("<foo><b>petra</b></foo>", omOut.toString());
- }
-
- public void testE4X() throws ScriptException, XMLStreamException, FactoryConfigurationError {
- Object o = xmlHelper.toScriptXML(createOMElement("<a><b>petra</b></a>"));
- OMElement om = xmlHelper.toOMElement(o);
- assertEquals("<a><b>petra</b></a>", om.toString());
-
- Bindings bindings = engine.createBindings();
- bindings.put("o", o);
- Object x = engine.eval("typeof o", bindings);
- assertEquals("xml", x);
- }
-
- protected OMElement createOMElement(String s) throws XMLStreamException, FactoryConfigurationError {
- XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(s));
- StAXOMBuilder builder = new StAXOMBuilder(parser);
- OMElement om = builder.getDocumentElement();
- return om;
- }
-
- protected void setUp() {
- engine = new ScriptEngineManager().getEngineByExtension("js");
- xmlHelper = XMLHelper.getArgHelper(engine);
- }
-
-}
diff --git a/bsf3/testing/e4x/pom.xml b/bsf3/testing/e4x/pom.xml
deleted file mode 100644
index a4ab59f..0000000
--- a/bsf3/testing/e4x/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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-e4x</artifactId>
- <name>Apache BSF testing for JavaScript/E4X</name>
- <description>Apache BSF testing for JavaScript/E4X</description>
-
- <repositories>
- <!-- This is for the WSO2 E4X impl -->
- <repository>
- <id>wso2</id>
- <url>http://dist.wso2.org/maven</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <layout>legacy</layout>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>rhino</groupId>
- <artifactId>js</artifactId>
- <version>1.6R5</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- <version>2.2.0</version>
- <scope>runtime</scope>
- </dependency>
-<!--
- <dependency>
- <groupId>org.mozilla.javascript</groupId>
- <artifactId>js-core</artifactId>
- <version>SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.wso2.javascript.rhino</groupId>
- <artifactId>js-axiom</artifactId>
- <version>SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
--->
- <dependency>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- <version>1.2.2</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0.1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.0</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java b/bsf3/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java
deleted file mode 100644
index 3d88d25..0000000
--- a/bsf3/testing/e4x/src/test/java/org/apache/bsf/testing/e4x/HelloTestCase.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.e4x;
-
-import java.io.StringReader;
-
-import javax.script.Bindings;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.bsf.xml.XMLHelper;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.ContextHelper;
-
-/**
- * Tests a basic JavaScrip/E4X invocation
- */
-public class HelloTestCase extends TestCase {
-
-// private ScriptEngine engine;
-// private XMLHelper xmlHelper;
-
-// public void testInvokeFunction() throws ScriptException, XMLStreamException, FactoryConfigurationError {
-// engine.eval("function isXML(xml) { return typeof xml.b == xml; }" );
-// engine.eval("function hello(xml) { return <foo>{xml.b}</foo>; }" );
-// assertTrue(engine instanceof Invocable);
-// Invocable invocableScript = (Invocable) engine;
-//
-// Object xmlIn = xmlHelper.toScriptXML(createOm("<a><b>petra</b></a>"));
-//
-// Object o = invocableScript.invokeFunction("isXML", new Object[]{xmlIn});
-// assertTrue(o instanceof Boolean);
-// assertTrue(((Boolean)o).booleanValue());
-//
-// Object xmlOut = invocableScript.invokeFunction("hello", new Object[]{xmlIn});
-//
-// OMElement omOut = xmlHelper.toOMElement(xmlOut);
-// assertEquals("<foo><b>petra</b></foo>", omOut.toString());
-// }
-
- public void testE4X() throws ScriptException, XMLStreamException, FactoryConfigurationError {
- ScriptEngine engine = new ScriptEngineManager().getEngineByExtension("js");
- XMLHelper convertor = XMLHelper.getArgHelper(engine);
- Object o = convertor.toScriptXML(createOMElement("<a><b>petra</b></a>"));
- OMElement om = convertor.toOMElement(o);
- assertEquals("<a><b>petra</b></a>", om.toString());
-
- Bindings bindings = engine.createBindings();
- bindings.put("o", o);
- Object x = engine.eval("typeof o", bindings);
- assertEquals("xml", x);
- }
-
- protected OMElement createOMElement(String s) throws XMLStreamException, FactoryConfigurationError {
- XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(s));
- StAXOMBuilder builder = new StAXOMBuilder(parser);
- OMElement om = builder.getDocumentElement();
- return om;
- }
-
- protected void setUp() {
-// ScriptEngineManager manager = new ScriptEngineManager();
-// engine = manager.getEngineByExtension("js");
-// xmlHelper = XMLHelper.getArgHelper(engine);
- Context cx = Context.enter();
- try {
- ContextHelper.setTopCallScope(cx, cx.initStandardObjects());
- } finally {
- Context.exit();
- }
- }
-}
diff --git a/bsf3/testing/e4x/src/test/java/org/mozilla/javascript/ContextHelper.java b/bsf3/testing/e4x/src/test/java/org/mozilla/javascript/ContextHelper.java
deleted file mode 100644
index 2498d8d..0000000
--- a/bsf3/testing/e4x/src/test/java/org/mozilla/javascript/ContextHelper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.mozilla.javascript;
-
-/**
- * Hack to enable creating E4X XML from Axiom OMElements
- * outside of a script invocation. To do this requires
- * Context.topCallScope not be null, but outside of a script
- * invocation it is null, hence this method to enable setting it.
- * Could be a bug in the Axiom E4X impl as the XmlBeans impl
- * does not require this.
- */
-public class ContextHelper {
-
- public static void setTopCallScope(Context cx, Scriptable scope) {
- cx.topCallScope = scope;
- }
-
-}
diff --git a/bsf3/testing/groovy-1.1/pom.xml b/bsf3/testing/groovy-1.1/pom.xml
deleted file mode 100644
index 0fab46b..0000000
--- a/bsf3/testing/groovy-1.1/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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-groovy-1.1</artifactId>
- <name>Apache BSF testing for Groovy 1.1 release</name>
- <description>Apache BSF testing for Groovy</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>groovy</groupId>
- <artifactId>groovy-all</artifactId>
- <version>1.1-rc-1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/groovy-1.1/src/test/java/org/apache/bsf/testing/groovy/GroovyTestcase.java b/bsf3/testing/groovy-1.1/src/test/java/org/apache/bsf/testing/groovy/GroovyTestcase.java
deleted file mode 100644
index 27f12b1..0000000
--- a/bsf3/testing/groovy-1.1/src/test/java/org/apache/bsf/testing/groovy/GroovyTestcase.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.groovy;
-
-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 Groovy functionality
- */
-public class GroovyTestcase extends TestCase {
-
- public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("groovy");
- engine.eval("def hello(name) { return 'Hello ' + name }" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
- assertEquals("Hello petra", invocableScript.invokeFunction("hello", new Object[]{"petra"}));
- }
-
-}
diff --git a/bsf3/testing/groovy/pom.xml b/bsf3/testing/groovy/pom.xml
deleted file mode 100644
index 17ebda9..0000000
--- a/bsf3/testing/groovy/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?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-groovy</artifactId>
- <name>Apache BSF testing for Groovy</name>
- <description>Apache BSF testing for Groovy</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>groovy</groupId>
- <artifactId>groovy-all</artifactId>
- <version>1.0</version>
- <exclusions>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xerces</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant-launcher</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jmock</groupId>
- <artifactId>jmock</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jmock</groupId>
- <artifactId>jmock-cglib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- </exclusion>
- <exclusion>
- <groupId>bsf</groupId>
- <artifactId>bsf</artifactId>
- </exclusion>
- <exclusion>
- <groupId>mx4j</groupId>
- <artifactId>mx4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>openejb</groupId>
- <artifactId>openejb-loader</artifactId>
- </exclusion>
- <exclusion>
- <groupId>axion</groupId>
- <artifactId>axion</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-primitives</groupId>
- <artifactId>commons-primitives</artifactId>
- </exclusion>
- <exclusion>
- <groupId>regexp</groupId>
- <artifactId>regexp</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>radeox</groupId>
- <artifactId>radeox</artifactId>
- </exclusion>
- <exclusion>
- <groupId>radeox</groupId>
- <artifactId>radeox-oro</artifactId>
- </exclusion>
- <exclusion>
- <groupId>nekohtml</groupId>
- <artifactId>nekohtml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>qdox</groupId>
- <artifactId>qdox</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xstream</groupId>
- <artifactId>xstream</artifactId>
- </exclusion>
- <exclusion>
- <groupId>qdox</groupId>
- <artifactId>qdox</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xpp3</groupId>
- <artifactId>xpp3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.tonicsystems</groupId>
- <artifactId>jarjar</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/groovy/src/test/java/org/apache/bsf/testing/groovy/GroovyTestcase.java b/bsf3/testing/groovy/src/test/java/org/apache/bsf/testing/groovy/GroovyTestcase.java
deleted file mode 100644
index 27f12b1..0000000
--- a/bsf3/testing/groovy/src/test/java/org/apache/bsf/testing/groovy/GroovyTestcase.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.groovy;
-
-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 Groovy functionality
- */
-public class GroovyTestcase extends TestCase {
-
- public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("groovy");
- engine.eval("def hello(name) { return 'Hello ' + name }" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
- assertEquals("Hello petra", invocableScript.invokeFunction("hello", new Object[]{"petra"}));
- }
-
-}
diff --git a/bsf3/testing/javascript/pom.xml b/bsf3/testing/javascript/pom.xml
deleted file mode 100644
index 4f20c3b..0000000
--- a/bsf3/testing/javascript/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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-javascript</artifactId>
- <name>Apache BSF testing for JavaScript</name>
- <description>Apache BSF testing for JavaScript</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>rhino</groupId>
- <artifactId>js</artifactId>
- <version>1.6R5</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java b/bsf3/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java
deleted file mode 100644
index 7a6ba9b..0000000
--- a/bsf3/testing/javascript/src/test/java/org/apache/bsf/testing/javascript/JavaScriptTestcase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.javascript;
-
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-import junit.framework.TestCase;
-
-
-public class JavaScriptTestcase extends TestCase {
-
- public void testEval() throws ScriptException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("js");
- assertTrue(((Boolean)engine.eval("true;")).booleanValue());
- assertFalse(((Boolean)engine.eval("false;")).booleanValue());
- }
-
- public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("js");
- engine.eval("function hello(s) { return 'Hello ' + s; }" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
- assertEquals("Hello petra", invocableScript.invokeFunction("hello", new Object[]{"petra"}));
- }
-
- public void testInvokeMethod() throws ScriptException, NoSuchMethodException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("js");
- engine.eval("function hello(s) { return 'Hello ' + s; }" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
-
- Object thiz = engine.eval("this;");
- assertEquals("Hello petra", invocableScript.invokeMethod(thiz, "hello", new Object[]{"petra"}));
- }
-
-}
diff --git a/bsf3/testing/jexl/pom.xml b/bsf3/testing/jexl/pom.xml
deleted file mode 100644
index a7c547e..0000000
--- a/bsf3/testing/jexl/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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-jexl</artifactId>
- <name>Apache BSF testing for Jexl</name>
- <description>Apache BSF testing for Jexl</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-jexl</groupId>
- <artifactId>commons-jexl</artifactId>
- <version>1.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/jexl/src/test/java/org/apache/bsf/testing/jexl/JexlTestCase.java b/bsf3/testing/jexl/src/test/java/org/apache/bsf/testing/jexl/JexlTestCase.java
deleted file mode 100644
index 8734078..0000000
--- a/bsf3/testing/jexl/src/test/java/org/apache/bsf/testing/jexl/JexlTestCase.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.jexl;
-
-import javax.script.Compilable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-import junit.framework.TestCase;
-
-/**
- * Simple testcase to verify basic Jexl functionality
- */
-public class JexlTestCase extends TestCase {
-
- public void testExpression() throws ScriptException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByName("jexl");
- assertNotNull("Should find an engine",engine);
- assertTrue("engine should be compilable",engine instanceof Compilable);
- assertEquals("Should be 579",new Long(579),engine.eval("123+456;"));
- //assertEquals("Should still be 579",new Long(579),engine.eval("999;123+456"));
- }
-
-}
diff --git a/bsf3/testing/jruby-1.1.2/pom.xml b/bsf3/testing/jruby-1.1.2/pom.xml
deleted file mode 100644
index d068c31..0000000
--- a/bsf3/testing/jruby-1.1.2/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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-jruby-1.1.2</artifactId>
- <name>Apache BSF testing for JRuby 1.1.2</name>
- <description>Apache BSF testing for JRuby 1.1.2</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>1.1.2</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/jruby-1.1.2/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java b/bsf3/testing/jruby-1.1.2/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java
deleted file mode 100644
index 6d4510d..0000000
--- a/bsf3/testing/jruby-1.1.2/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.javascript;
-
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-import junit.framework.TestCase;
-
-
-public class RubyTestcase extends TestCase {
-
-// public void testEval() throws ScriptException {
-// ScriptEngineManager manager = new ScriptEngineManager();
-// ScriptEngine engine = manager.getEngineByExtension("js");
-// assertTrue(((Boolean)engine.eval("true;")).booleanValue());
-// assertFalse(((Boolean)engine.eval("false;")).booleanValue());
-// }
-
- public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("rb");
- engine.eval("def hello(s)\n return \"Hello \" + s\nend" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
- assertEquals("Hello petra", invocableScript.invokeFunction("hello", new Object[]{"petra"}));
- }
-
-// public void testInvokeMethod() throws ScriptException {
-// ScriptEngineManager manager = new ScriptEngineManager();
-// ScriptEngine engine = manager.getEngineByExtension("js");
-// engine.eval("function hello(s) { return 'Hello ' + s; }" );
-// assertTrue(engine instanceof Invocable);
-// Invocable invocableScript = (Invocable) engine;
-//
-// Object thiz = engine.eval("this;");
-// assertEquals("Hello petra", invocableScript.invokeMethod(thiz, "hello", new Object[]{"petra"}));
-// }
-
-}
diff --git a/bsf3/testing/jruby-1.2.0/pom.xml b/bsf3/testing/jruby-1.2.0/pom.xml
deleted file mode 100644
index 01050c9..0000000
--- a/bsf3/testing/jruby-1.2.0/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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-jruby-1.2.0</artifactId>
- <name>Apache BSF testing for JRuby 1.2.0</name>
- <description>Apache BSF testing for JRuby 1.2.0</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>1.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/jruby-1.2.0/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java b/bsf3/testing/jruby-1.2.0/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java
deleted file mode 100644
index 6d4510d..0000000
--- a/bsf3/testing/jruby-1.2.0/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.javascript;
-
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-import junit.framework.TestCase;
-
-
-public class RubyTestcase extends TestCase {
-
-// public void testEval() throws ScriptException {
-// ScriptEngineManager manager = new ScriptEngineManager();
-// ScriptEngine engine = manager.getEngineByExtension("js");
-// assertTrue(((Boolean)engine.eval("true;")).booleanValue());
-// assertFalse(((Boolean)engine.eval("false;")).booleanValue());
-// }
-
- public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("rb");
- engine.eval("def hello(s)\n return \"Hello \" + s\nend" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
- assertEquals("Hello petra", invocableScript.invokeFunction("hello", new Object[]{"petra"}));
- }
-
-// public void testInvokeMethod() throws ScriptException {
-// ScriptEngineManager manager = new ScriptEngineManager();
-// ScriptEngine engine = manager.getEngineByExtension("js");
-// engine.eval("function hello(s) { return 'Hello ' + s; }" );
-// assertTrue(engine instanceof Invocable);
-// Invocable invocableScript = (Invocable) engine;
-//
-// Object thiz = engine.eval("this;");
-// assertEquals("Hello petra", invocableScript.invokeMethod(thiz, "hello", new Object[]{"petra"}));
-// }
-
-}
diff --git a/bsf3/testing/jython-2.2/pom.xml b/bsf3/testing/jython-2.2/pom.xml
deleted file mode 100644
index 03b353f..0000000
--- a/bsf3/testing/jython-2.2/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java b/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
deleted file mode 100644
index 79290a7..0000000
--- a/bsf3/testing/jython-2.2/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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" }));
- }
-
-}
diff --git a/bsf3/testing/pom.xml b/bsf3/testing/pom.xml
deleted file mode 100644
index 3b64433..0000000
--- a/bsf3/testing/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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>
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.bsf</groupId>
- <artifactId>parent</artifactId>
- <version>3.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>bsf-tests</artifactId>
- <packaging>pom</packaging>
- <name>Apache BSF Tests</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>e4x</module>
- <module>e4x-1.6R7-Axiom</module>
- <module>groovy</module>
- <module>groovy-1.1</module>
- <module>javascript</module>
- <module>python</module>
- <module>jython-2.2</module>
- <module>ruby</module>
- <module>jruby-1.1.2</module>
- <module>jruby-1.2.0</module>
- </modules>
- </profile>
-
- </profiles>
-
-</project>
diff --git a/bsf3/testing/python/pom.xml b/bsf3/testing/python/pom.xml
deleted file mode 100644
index 59ca6d1..0000000
--- a/bsf3/testing/python/pom.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?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-python</artifactId>
- <name>Apache BSF testing for Python</name>
- <description>Apache BSF testing for Python</description>
-
- <repositories>
- <!-- This is reqquired for Jython as 2.2 Beta1 hasn't made it to the maven repos yet -->
- <repository>
- <id>ant</id>
- <url>http://people.apache.org/~antelder/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>jython</groupId>
- <artifactId>jython</artifactId>
- <version>2.2b1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java b/bsf3/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
deleted file mode 100644
index 79290a7..0000000
--- a/bsf3/testing/python/src/test/java/org/apache/bsf/testing/python/HelloTestCase.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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" }));
- }
-
-}
diff --git a/bsf3/testing/ruby/pom.xml b/bsf3/testing/ruby/pom.xml
deleted file mode 100644
index 64b5a02..0000000
--- a/bsf3/testing/ruby/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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-ruby</artifactId>
- <name>Apache BSF testing for Ruby</name>
- <description>Apache BSF testing for Ruby</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.bsf</groupId>
- <artifactId>bsf-all</artifactId>
- <version>3.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jruby</groupId>
- <artifactId>jruby-complete</artifactId>
- <version>1.0.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/bsf3/testing/ruby/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java b/bsf3/testing/ruby/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java
deleted file mode 100644
index 6d4510d..0000000
--- a/bsf3/testing/ruby/src/test/java/org/apache/bsf/testing/javascript/RubyTestcase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.javascript;
-
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
-import junit.framework.TestCase;
-
-
-public class RubyTestcase extends TestCase {
-
-// public void testEval() throws ScriptException {
-// ScriptEngineManager manager = new ScriptEngineManager();
-// ScriptEngine engine = manager.getEngineByExtension("js");
-// assertTrue(((Boolean)engine.eval("true;")).booleanValue());
-// assertFalse(((Boolean)engine.eval("false;")).booleanValue());
-// }
-
- public void testInvokeFunction() throws ScriptException, NoSuchMethodException {
- ScriptEngineManager manager = new ScriptEngineManager();
- ScriptEngine engine = manager.getEngineByExtension("rb");
- engine.eval("def hello(s)\n return \"Hello \" + s\nend" );
- assertTrue(engine instanceof Invocable);
- Invocable invocableScript = (Invocable) engine;
- assertEquals("Hello petra", invocableScript.invokeFunction("hello", new Object[]{"petra"}));
- }
-
-// public void testInvokeMethod() throws ScriptException {
-// ScriptEngineManager manager = new ScriptEngineManager();
-// ScriptEngine engine = manager.getEngineByExtension("js");
-// engine.eval("function hello(s) { return 'Hello ' + s; }" );
-// assertTrue(engine instanceof Invocable);
-// Invocable invocableScript = (Invocable) engine;
-//
-// Object thiz = engine.eval("this;");
-// assertEquals("Hello petra", invocableScript.invokeMethod(thiz, "hello", new Object[]{"petra"}));
-// }
-
-}