jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1561147 - /jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java
Date Fri, 24 Jan 2014 20:21:44 GMT
Author: sebb
Date: Fri Jan 24 20:21:43 2014
New Revision: 1561147

URL: http://svn.apache.org/r1561147
Log:
Allow for Headless testing; simplify test case

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java

Modified: 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=1561147&r1=1561146&r2=1561147&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/gui/util/JSyntaxTextAreaTest.java Fri Jan 24 20:21:43
2014
@@ -18,6 +18,7 @@
 
 package org.apache.jmeter.gui.util;
 
+import java.awt.HeadlessException;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.util.HashSet;
@@ -29,18 +30,15 @@ import org.fife.ui.rsyntaxtextarea.Synta
 
 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");
+    public void testSetLanguage() {
+        try {
+            JSyntaxTextArea textArea = new JSyntaxTextArea(30, 50, false);
+            textArea.setLanguage(null);
+            assertEquals(SyntaxConstants.SYNTAX_STYLE_NONE, textArea.getSyntaxEditingStyle());
+        } catch (HeadlessException he) {
+            // Does not work in headless mode
+        }
     }
-    
-    assertEquals(SyntaxConstants.SYNTAX_STYLE_NONE, textArea.getSyntaxEditingStyle());
-    
-  }
   
     public void testSyntaxNames() throws IllegalArgumentException,
             IllegalAccessException {



Mime
View raw message