jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject [jmeter] branch master updated: Fix spotless violations
Date Tue, 01 Oct 2019 09:34:10 GMT
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 5de440e  Fix spotless violations
5de440e is described below

commit 5de440e558612bac648a6fd7407c02adb51ce3a1
Author: pmouawad <p.mouawad@ubik-ingenierie.com>
AuthorDate: Tue Oct 1 11:33:52 2019 +0200

    Fix spotless violations
---
 .../apache/jmeter/assertions/XmlAssertionTest.java  | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/components/src/test/java/org/apache/jmeter/assertions/XmlAssertionTest.java
b/src/components/src/test/java/org/apache/jmeter/assertions/XmlAssertionTest.java
index 951a877..e371b86 100644
--- a/src/components/src/test/java/org/apache/jmeter/assertions/XmlAssertionTest.java
+++ b/src/components/src/test/java/org/apache/jmeter/assertions/XmlAssertionTest.java
@@ -32,13 +32,12 @@ public class XmlAssertionTest extends JMeterTestCase {
     private XMLAssertion assertion;
     private SampleResult sampleResult;
     private AssertionResult result;
-    private final String invalidXml = "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't
forget me this weekend!</body></note1>";
-    private final String validXml = "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't
forget me this weekend!</body></note>";
-    private final String noXml = "response Data";
-    private final String unsecureXML = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
+ 
-            "<!DOCTYPE foo [\n" + 
-            "   <!ENTITY xxe SYSTEM \"file:///etc/passwd\" > ]>\n" + 
-            "<foo>&xxe;</foo>";
+    private static final String INVALID_XML = "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>"
+            + "Don't forget me this weekend!</body></note1>";
+    private static final String VALID_XML = "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't
forget me this weekend!</body></note>";
+    private static final String NO_XML = "response Data";
+    private static final String UNSECURE_XML = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
+ "<!DOCTYPE foo [\n"
+            + "   <!ENTITY xxe SYSTEM \"file:///etc/passwd\" > ]>\n" + "<foo>&xxe;</foo>";
 
     @Before
     public void setUp() {
@@ -52,7 +51,7 @@ public class XmlAssertionTest extends JMeterTestCase {
 
     @Test
     public void testUnsecureX() throws Exception {
-        sampleResult.setResponseData(unsecureXML, null);
+        sampleResult.setResponseData(UNSECURE_XML, null);
         result = assertion.getResult(sampleResult);
         Assert.assertTrue(result.isFailure());
         Assert.assertTrue(result.isError());
@@ -62,7 +61,7 @@ public class XmlAssertionTest extends JMeterTestCase {
 
     @Test
     public void testValidXML() throws Exception {
-        sampleResult.setResponseData(validXml, null);
+        sampleResult.setResponseData(VALID_XML, null);
         result = assertion.getResult(sampleResult);
         Assert.assertFalse(result.isFailure());
         Assert.assertFalse(result.isError());
@@ -71,7 +70,7 @@ public class XmlAssertionTest extends JMeterTestCase {
 
     @Test
     public void testInvalidXML() throws Exception {
-        sampleResult.setResponseData(invalidXml, null);
+        sampleResult.setResponseData(INVALID_XML, null);
         result = assertion.getResult(sampleResult);
         Assert.assertTrue(result.isFailure());
         Assert.assertTrue(result.isError());
@@ -80,7 +79,7 @@ public class XmlAssertionTest extends JMeterTestCase {
 
     @Test
     public void testNoXML() throws Exception {
-        sampleResult.setResponseData(noXml, null);
+        sampleResult.setResponseData(NO_XML, null);
         result = assertion.getResult(sampleResult);
         Assert.assertTrue(result.isFailure());
         Assert.assertTrue(result.isError());


Mime
View raw message