Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpath assertion - Textfield not in FlowLayout #4125

Closed
asfimport opened this issue Oct 5, 2016 · 5 comments
Closed

xpath assertion - Textfield not in FlowLayout #4125

asfimport opened this issue Oct 5, 2016 · 5 comments

Comments

@asfimport
Copy link
Collaborator

Lenzen (Bug 60203):
The xpath assertion Textfield is not in FlowLayout. The XPath Assertion TestField have fixed values (like 300 x 600). That's not pretty for a long row.

Severity: normal
OS: Windows NT

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
Should we apply this patch before 3.1? (I think it is a safe thing to do)

The doc will have to be updated in either case, since it shows an old view, where no textarea was used.

Created attachment xpathassertion.patch: Use more available space for the textarea

xpathassertion.patch
diff --git a/src/components/org/apache/jmeter/assertions/gui/XPathAssertionGui.java b/src/components/org/apache/jmeter/assertions/gui/XPathAssertionGui.java
index f3732b1..59d56eb 100644
--- a/src/components/org/apache/jmeter/assertions/gui/XPathAssertionGui.java
+++ b/src/components/org/apache/jmeter/assertions/gui/XPathAssertionGui.java
@@ -27,7 +27,6 @@ import javax.swing.JPanel;
 import org.apache.jmeter.assertions.XPathAssertion;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.gui.layout.VerticalLayout;
 
 public class XPathAssertionGui extends AbstractAssertionGui {
 
@@ -76,14 +75,22 @@ public class XPathAssertionGui extends AbstractAssertionGui {
     }
 
     private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
-        setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
+        setLayout(new BorderLayout());
         setBorder(makeBorder());
 
-        add(makeTitlePanel());
-        Box box = Box.createVerticalBox();
-        box.add(createScopePanel(true));
-        add(box);
-        
+        Box topBox = Box.createVerticalBox();
+
+        topBox.add(makeTitlePanel());
+
+        topBox.add(createScopePanel(true));
+
+        xml = new XMLConfPanel();
+        xml.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils
+                .getResString("xpath_assertion_option"))); //$NON-NLS-1$
+        topBox.add(xml);
+
+        add(topBox, BorderLayout.NORTH);
+
         // USER_INPUT
         JPanel sizePanel = new JPanel(new BorderLayout());
         sizePanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
@@ -91,13 +98,7 @@ public class XPathAssertionGui extends AbstractAssertionGui {
                 getXPathAttributesTitle()));
         xpath = new XPathPanel();
         sizePanel.add(xpath);
-
-        xml = new XMLConfPanel();
-        xml.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils
-                .getResString("xpath_assertion_option"))); //$NON-NLS-1$
-        add(xml);
-
-        add(sizePanel);
+        add(sizePanel, BorderLayout.CENTER);
     }
 
     /**
diff --git a/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java b/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java
index 04eae16..497254f 100644
--- a/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java
+++ b/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java
@@ -20,6 +20,7 @@ package org.apache.jmeter.assertions.gui;
 
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.BorderLayout;
 
 import javax.swing.Box;
 import javax.swing.JButton;
@@ -62,18 +63,18 @@ public class XPathPanel extends JPanel {
     }
 
     private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
+        setLayout(new BorderLayout());
+
         Box hbox = Box.createHorizontalBox();
+
         hbox.add(Box.createHorizontalGlue());
-        hbox.add(JTextScrollPane.getInstance(getXPathField()));
+        hbox.add(getNegatedCheckBox());
         hbox.add(Box.createHorizontalGlue());
         hbox.add(getCheckXPathButton());
+        hbox.add(Box.createHorizontalGlue());
 
-        Box vbox = Box.createVerticalBox();
-        vbox.add(hbox);
-        vbox.add(Box.createVerticalGlue());
-        vbox.add(getNegatedCheckBox());
-
-        add(vbox);
+        add(JTextScrollPane.getInstance(getXPathField()), BorderLayout.CENTER);
+        add(hbox, BorderLayout.SOUTH);
 
         setDefaultValues();
     }

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
+1 for commiting before 3.1

@asfimport
Copy link
Collaborator Author

Lenzen (migrated from Bugzilla):
I would be happy, if you can apply this path before 3.1.

@asfimport
Copy link
Collaborator Author

Lenzen (migrated from Bugzilla):
I would be happy, if you can apply this patch before 3.1.

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
Date: Thu Oct 6 17:04:13 2016
New Revision: 1763632

URL: http://svn.apache.org/viewvc?rev=1763632&view=rev
Log:
Use more available space for textarea in XPath Assertion.

#4125

Modified:
jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathAssertionGui.java
jmeter/trunk/src/components/org/apache/jmeter/assertions/gui/XPathPanel.java
jmeter/trunk/xdocs/changes.xml
jmeter/trunk/xdocs/images/screenshots/xpath_assertion.png
jmeter/trunk/xdocs/usermanual/component_reference.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant