jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1298866 - in /jmeter/trunk: src/components/org/apache/jmeter/assertions/ src/components/org/apache/jmeter/extractor/ src/components/org/apache/jmeter/modifiers/ src/components/org/apache/jmeter/timers/ src/components/org/apache/jmeter/visu...
Date Fri, 09 Mar 2012 15:18:19 GMT
Author: sebb
Date: Fri Mar  9 15:18:19 2012
New Revision: 1298866

URL: http://svn.apache.org/viewvc?rev=1298866&view=rev
Log:
Bug 52869 - JSR223 language list currently uses BSF list which is wrong

Added:
    jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java   (with props)
    jmeter/trunk/src/core/org/apache/jmeter/util/ScriptingBeanInfoSupport.java   (with props)
Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionBeanInfo.java
    jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorBeanInfo.java
    jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorBeanInfo.java
    jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerBeanInfo.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerBeanInfo.java
    jmeter/trunk/src/core/org/apache/jmeter/util/BSFBeanInfoSupport.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionBeanInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionBeanInfo.java?rev=1298866&r1=1298865&r2=1298866&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionBeanInfo.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/JSR223AssertionBeanInfo.java
Fri Mar  9 15:18:19 2012
@@ -18,9 +18,9 @@
 
 package org.apache.jmeter.assertions;
 
-import org.apache.jmeter.util.BSFBeanInfoSupport;
+import org.apache.jmeter.util.JSR223BeanInfoSupport;
 
-public class JSR223AssertionBeanInfo extends BSFBeanInfoSupport {
+public class JSR223AssertionBeanInfo extends JSR223BeanInfoSupport {
 
     public JSR223AssertionBeanInfo() {
         super(JSR223Assertion.class);

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorBeanInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorBeanInfo.java?rev=1298866&r1=1298865&r2=1298866&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorBeanInfo.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/JSR223PostProcessorBeanInfo.java
Fri Mar  9 15:18:19 2012
@@ -18,9 +18,9 @@
 
 package org.apache.jmeter.extractor;
 
-import org.apache.jmeter.util.BSFBeanInfoSupport;
+import org.apache.jmeter.util.JSR223BeanInfoSupport;
 
-public class JSR223PostProcessorBeanInfo extends BSFBeanInfoSupport {
+public class JSR223PostProcessorBeanInfo extends JSR223BeanInfoSupport {
 
     public JSR223PostProcessorBeanInfo() {
         super(JSR223PostProcessor.class);

Modified: jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorBeanInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorBeanInfo.java?rev=1298866&r1=1298865&r2=1298866&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorBeanInfo.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/modifiers/JSR223PreProcessorBeanInfo.java
Fri Mar  9 15:18:19 2012
@@ -18,9 +18,9 @@
 
 package org.apache.jmeter.modifiers;
 
-import org.apache.jmeter.util.BSFBeanInfoSupport;
+import org.apache.jmeter.util.JSR223BeanInfoSupport;
 
-public class JSR223PreProcessorBeanInfo extends BSFBeanInfoSupport {
+public class JSR223PreProcessorBeanInfo extends JSR223BeanInfoSupport {
 
     public JSR223PreProcessorBeanInfo() {
         super(JSR223PreProcessor.class);

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerBeanInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerBeanInfo.java?rev=1298866&r1=1298865&r2=1298866&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerBeanInfo.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/JSR223TimerBeanInfo.java Fri Mar
 9 15:18:19 2012
@@ -18,9 +18,9 @@
 
 package org.apache.jmeter.timers;
 
-import org.apache.jmeter.util.BSFBeanInfoSupport;
+import org.apache.jmeter.util.JSR223BeanInfoSupport;
 
-public class JSR223TimerBeanInfo extends BSFBeanInfoSupport {
+public class JSR223TimerBeanInfo extends JSR223BeanInfoSupport {
 
     public JSR223TimerBeanInfo() {
         super(JSR223Timer.class);

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerBeanInfo.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerBeanInfo.java?rev=1298866&r1=1298865&r2=1298866&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerBeanInfo.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/JSR223ListenerBeanInfo.java
Fri Mar  9 15:18:19 2012
@@ -18,9 +18,9 @@
 
 package org.apache.jmeter.visualizers;
 
-import org.apache.jmeter.util.BSFBeanInfoSupport;
+import org.apache.jmeter.util.JSR223BeanInfoSupport;
 
-public class JSR223ListenerBeanInfo extends BSFBeanInfoSupport {
+public class JSR223ListenerBeanInfo extends JSR223BeanInfoSupport {
 
     public JSR223ListenerBeanInfo() {
         super(JSR223Listener.class);

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/BSFBeanInfoSupport.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/BSFBeanInfoSupport.java?rev=1298866&r1=1298865&r2=1298866&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/BSFBeanInfoSupport.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/BSFBeanInfoSupport.java Fri Mar  9 15:18:19
2012
@@ -18,18 +18,13 @@
 
 package org.apache.jmeter.util;
 
-import java.beans.PropertyDescriptor;
 import java.util.Arrays;
 import java.util.Properties;
 
-import org.apache.jmeter.testbeans.BeanInfoSupport;
-import org.apache.jmeter.testbeans.gui.FileEditor;
-import org.apache.jmeter.testbeans.gui.TextAreaEditor;
-
 /**
- * Parent class to handle common GUI design
+ * Parent class to handle common GUI design for BSF test elements
  */
-public abstract class BSFBeanInfoSupport extends BeanInfoSupport {
+public abstract class BSFBeanInfoSupport extends ScriptingBeanInfoSupport {
 
     private final static String[] LANGUAGE_TAGS;
 
@@ -45,39 +40,7 @@ public abstract class BSFBeanInfoSupport
     }
 
     protected BSFBeanInfoSupport(Class<?> beanClass) {
-        super(beanClass);
-        PropertyDescriptor p;
-
-        p = property("scriptLanguage"); // $NON-NLS-1$
-        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
-        p.setValue(DEFAULT, ""); // $NON-NLS-1$
-        p.setValue(TAGS, LANGUAGE_TAGS);
-
-        createPropertyGroup("scriptingLanguage", // $NON-NLS-1$
-                new String[] { "scriptLanguage" }); // $NON-NLS-1$
-
-        p = property("parameters"); // $NON-NLS-1$
-        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
-        p.setValue(DEFAULT, ""); // $NON-NLS-1$
-
-        createPropertyGroup("parameterGroup", // $NON-NLS-1$
-                new String[] { "parameters" }); // $NON-NLS-1$
-
-        p = property("filename"); // $NON-NLS-1$
-        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
-        p.setValue(DEFAULT, ""); // $NON-NLS-1$
-        p.setPropertyEditorClass(FileEditor.class);
-
-        createPropertyGroup("filenameGroup",  // $NON-NLS-1$
-                new String[] { "filename" }); // $NON-NLS-1$
-
-        p = property("script"); // $NON-NLS-1$
-        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
-        p.setValue(DEFAULT, ""); // $NON-NLS-1$
-        p.setPropertyEditorClass(TextAreaEditor.class);
-
-        createPropertyGroup("scripting", // $NON-NLS-1$
-                new String[] { "script" }); // $NON-NLS-1$
+        super(beanClass, LANGUAGE_TAGS);
     }
 
 }

Added: jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java?rev=1298866&view=auto
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java (added)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java Fri Mar  9 15:18:19
2012
@@ -0,0 +1,55 @@
+/*
+ * 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.jmeter.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.script.ScriptEngineFactory;
+import javax.script.ScriptEngineManager;
+
+/**
+ * Parent class to handle common GUI design for JSR223 test elements
+ */
+public abstract class JSR223BeanInfoSupport extends ScriptingBeanInfoSupport {
+
+    private final static String[] LANGUAGE_TAGS;
+
+    static {
+        List<String> shortNames = new ArrayList<String>();
+        ScriptEngineManager sem = new ScriptEngineManager();
+        @SuppressWarnings("unchecked") // can be dropped in Java 1.6
+        final List<ScriptEngineFactory> engineFactories = sem.getEngineFactories();
+        for(ScriptEngineFactory fact : engineFactories){
+            @SuppressWarnings("unchecked") // can be dropped in Java 1.6
+            List<String> names = fact.getNames();
+            for(String shorName : names) {
+                shortNames.add(shorName);
+            }
+        }
+        LANGUAGE_TAGS = shortNames.toArray(new String[shortNames.size()]);
+        Arrays.sort(LANGUAGE_TAGS);
+    }
+
+    protected JSR223BeanInfoSupport(Class<?> beanClass) {
+        super(beanClass, LANGUAGE_TAGS);
+    }
+
+}

Propchange: jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jmeter/trunk/src/core/org/apache/jmeter/util/JSR223BeanInfoSupport.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: jmeter/trunk/src/core/org/apache/jmeter/util/ScriptingBeanInfoSupport.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/ScriptingBeanInfoSupport.java?rev=1298866&view=auto
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/ScriptingBeanInfoSupport.java (added)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/ScriptingBeanInfoSupport.java Fri Mar  9
15:18:19 2012
@@ -0,0 +1,68 @@
+/*
+ * 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.jmeter.util;
+
+import java.beans.PropertyDescriptor;
+
+import org.apache.jmeter.testbeans.BeanInfoSupport;
+import org.apache.jmeter.testbeans.gui.FileEditor;
+import org.apache.jmeter.testbeans.gui.TextAreaEditor;
+
+/**
+ * Parent class to define common GUI parameters for BSF and JSR223 test elements
+ */
+public abstract class ScriptingBeanInfoSupport extends BeanInfoSupport {
+
+    protected ScriptingBeanInfoSupport(Class<?> beanClass, String[] LANGUAGE_TAGS)
{
+        super(beanClass);
+        PropertyDescriptor p;
+
+        p = property("scriptLanguage"); // $NON-NLS-1$
+        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+        p.setValue(DEFAULT, ""); // $NON-NLS-1$
+        p.setValue(TAGS, LANGUAGE_TAGS);
+
+        createPropertyGroup("scriptingLanguage", // $NON-NLS-1$
+                new String[] { "scriptLanguage" }); // $NON-NLS-1$
+
+        p = property("parameters"); // $NON-NLS-1$
+        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+        p.setValue(DEFAULT, ""); // $NON-NLS-1$
+
+        createPropertyGroup("parameterGroup", // $NON-NLS-1$
+                new String[] { "parameters" }); // $NON-NLS-1$
+
+        p = property("filename"); // $NON-NLS-1$
+        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+        p.setValue(DEFAULT, ""); // $NON-NLS-1$
+        p.setPropertyEditorClass(FileEditor.class);
+
+        createPropertyGroup("filenameGroup",  // $NON-NLS-1$
+                new String[] { "filename" }); // $NON-NLS-1$
+
+        p = property("script"); // $NON-NLS-1$
+        p.setValue(NOT_UNDEFINED, Boolean.TRUE);
+        p.setValue(DEFAULT, ""); // $NON-NLS-1$
+        p.setPropertyEditorClass(TextAreaEditor.class);
+
+        createPropertyGroup("scripting", // $NON-NLS-1$
+                new String[] { "script" }); // $NON-NLS-1$
+    }
+
+}

Propchange: jmeter/trunk/src/core/org/apache/jmeter/util/ScriptingBeanInfoSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jmeter/trunk/src/core/org/apache/jmeter/util/ScriptingBeanInfoSupport.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1298866&r1=1298865&r2=1298866&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Fri Mar  9 15:18:19 2012
@@ -79,6 +79,7 @@ When doing replacement of User Defined V
 <ul>
 <li>Bug 51737 - TCPSampler : Packet gets converted/corrupted</li>
 <li>Bug 52868 - BSF language list should be sorted</li>
+<li>Bug 52869 - JSR223 language list currently uses BSF list which is wrong</li>
 </ul>
 
 <h3>Controllers</h3>



Mime
View raw message