jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1771597 - /jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderInBrowser.java
Date Sun, 27 Nov 2016 14:15:22 GMT
Author: fschumacher
Date: Sun Nov 27 14:15:22 2016
New Revision: 1771597

URL: http://svn.apache.org/viewvc?rev=1771597&view=rev
Log:
Fix freeze when running tests in headless mode. Followup to r1771577

Bugzilla Id: 60144

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderInBrowser.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderInBrowser.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderInBrowser.java?rev=1771597&r1=1771596&r2=1771597&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderInBrowser.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/RenderInBrowser.java Sun Nov
27 14:15:22 2016
@@ -21,6 +21,7 @@ package org.apache.jmeter.visualizers;
 
 import java.awt.BorderLayout;
 import java.awt.Dimension;
+import java.awt.GraphicsEnvironment;
 
 import javafx.application.Platform;
 import javafx.beans.value.ChangeListener;
@@ -49,13 +50,22 @@ import org.apache.jmeter.util.JMeterUtil
  */
 public class RenderInBrowser extends SamplerResultTab implements ResultRenderer {
 
-    private final JFXPanel jfxPanel = new JFXPanel();
+    private final JFXPanel jfxPanel;
     private WebEngine engine;
     private final JLabel lblStatus = new JLabel();
     private final JProgressBar progressBar = new JProgressBar();
 
     private JPanel browserPanel;
 
+    public RenderInBrowser() {
+        // If we are in headless mode, JFXPanel will freeze us, so don't instantiate it.
+        if (GraphicsEnvironment.isHeadless()) {
+            jfxPanel = null;
+        } else {
+            jfxPanel = new JFXPanel();
+        }
+    }
+
     /** {@inheritDoc} */
     @Override
     public void renderResult(SampleResult sampleResult) {



Mime
View raw message