jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1561134 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java xdocs/changes.xml
Date Fri, 24 Jan 2014 19:50:51 GMT
Author: sebb
Date: Fri Jan 24 19:50:51 2014
New Revision: 1561134

URL: http://svn.apache.org/r1561134
Log:
Older TestBeans incompatible with 2.11 when using TextAreaEditor
Bugzilla Id: 56059

Added:
    jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java?rev=1561134&r1=1561133&r2=1561134&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java Fri Jan 24 19:50:51
2014
@@ -93,11 +93,17 @@ public class JSyntaxTextArea extends RSy
      * @param language
      */
     public void setLanguage(String language) {
-        final String style = languageProperties.getProperty(language);
-        if (style == null) {
-            super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
+        if(language == null) {
+          // TODO: Log a message?
+          // But how to find the name of the offending GUI element in the case of a TestBean?
+          super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
         } else {
-            super.setSyntaxEditingStyle(style);
+          final String style = languageProperties.getProperty(language);
+          if (style == null) {
+              super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
+          } else {
+              super.setSyntaxEditingStyle(style);
+          }
         }
     }
 

Added: jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java?rev=1561134&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java (added)
+++ jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java Fri Jan 24 19:50:51
2014
@@ -0,0 +1,38 @@
+/*
+ * 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.gui.util;
+
+import org.apache.jmeter.junit.JMeterTestCase;
+import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
+
+public class JSyntaxTextAreaTest extends JMeterTestCase {
+
+  public void testSetLanguage(){
+    JSyntaxTextArea textArea = new JSyntaxTextArea(30, 50, false);
+    
+    try {
+      textArea.setLanguage(null);
+    } catch(Exception e){
+      fail("No Exception expected");
+    }
+    
+    assertEquals(SyntaxConstants.SYNTAX_STYLE_NONE, textArea.getSyntaxEditingStyle());
+    
+  }
+}

Propchange: jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.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=1561134&r1=1561133&r2=1561134&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Fri Jan 24 19:50:51 2014
@@ -152,6 +152,7 @@ A workaround is to use a Java 7 update 4
 
 <h3>General</h3>
 <ul>
+<li><bugzilla>56059</bugzilla> - Older TestBeans incompatible with 2.11
when using TextAreaEditor</li>
 </ul>
 
 <!-- =================== Improvements =================== -->



Mime
View raw message