changeset 816:2fb899e95c4b

vars: $ -> @
author Devel 1
date Tue, 16 Jan 2018 16:46:20 +0100
parents a58bbf4ee5e6
children c5f42c314230
files stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSequenceFilter.java stress-tester/src/main/java/com/passus/st/vars/VarsCompiler.java stress-tester/src/test/java/com/passus/st/client/http/filter/HttpVarsFilterTest.java stress-tester/src/test/java/com/passus/st/vars/VarsCompilerTest.java stress-tester/src/test/java/com/passus/st/vars/VarsExecutorTest.java
diffstat 5 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSequenceFilter.java	Tue Jan 16 15:49:22 2018 +0100
+++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSequenceFilter.java	Tue Jan 16 16:46:20 2018 +0100
@@ -380,10 +380,10 @@
 
         values = (Map<String, ValueExtractor>) config.get("values", Collections.EMPTY_MAP);
 
-        ReporterDestination reporterWrapper = Registry.getInstance().get(
+        ReporterDestination reporterDestination = Registry.getInstance().get(
                 ReporterDestination.SERVICE_NAME, ReporterDestination.class);
-        if (reporterWrapper != null) {
-            listener = reporterWrapper;
+        if (reporterDestination != null) {
+            listener = reporterDestination;
         }
     }
 
--- a/stress-tester/src/main/java/com/passus/st/vars/VarsCompiler.java	Tue Jan 16 15:49:22 2018 +0100
+++ b/stress-tester/src/main/java/com/passus/st/vars/VarsCompiler.java	Tue Jan 16 16:46:20 2018 +0100
@@ -16,7 +16,7 @@
 public class VarsCompiler {
 
     private static final byte VAR_START_1 = (byte) '{';
-    private static final byte VAR_START_2 = (byte) '$';
+    private static final byte VAR_START_2 = (byte) '@';
 
     private static final byte VAR_END = (byte) '}';
 
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpVarsFilterTest.java	Tue Jan 16 15:49:22 2018 +0100
+++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpVarsFilterTest.java	Tue Jan 16 16:46:20 2018 +0100
@@ -53,7 +53,7 @@
                 + "Content-Type: application/x-www-form-urlencoded\r\n"
                 + "Content-Length: 23\r\n"
                 + "\r\n"
-                + "user=admin&pass={$var1}";
+                + "user=admin&pass={@var1}";
         HttpRequest request = TestHttpUtils.request(reqs);
 
         HttpVarsFilter filter = new HttpVarsFilter(resolver);
@@ -77,13 +77,13 @@
         String c1
                 = "--------------------1456847137\r\n"
                 + "Content-Disposition: form-data; name=\"name\"\r\n\r\n"
-                + "Filter {$name}\r\n"
+                + "Filter {@name}\r\n"
                 + "--------------------1456847137\r\n"
                 + "Content-Disposition: form-data; name=\"description\"\r\n\r\n"
                 + "Komputery korzystajÄ…ce z netu bez logowania do domeny\r\n"
                 + "--------------------1456847137\r\n"
                 + "Content-Disposition: form-data; name=\"type\"\r\n\r\n"
-                + "{$type}\r\n";
+                + "{@type}\r\n";
         String cn = "--------------------1456847137--\r\n";
 
         byte[] bytes = (hdrs + c1 + cn).getBytes(UTF_8);
@@ -108,7 +108,7 @@
     @Test
     public void testPut() throws IOException {
         HttpRequestBuilder builder = new HttpRequestBuilder("http://test.com", HttpMethod.PUT);
-        builder.content("{\"abc\": \"{$var1}\"}", "application/json");
+        builder.content("{\"abc\": \"{@var1}\"}", "application/json");
         HttpRequest request = builder.build();
 
         HttpVarsFilter filter = new HttpVarsFilter(resolver);
@@ -122,7 +122,7 @@
 
     @Test
     public void testPutDeflate() throws IOException {
-        String json = "{\"abc\": \"{$var1}\"}";
+        String json = "{\"abc\": \"{@var1}\"}";
         byte[] plain = json.getBytes(); //18
         byte[] deflate = CompressionUtils.deflate(plain); //26
 
--- a/stress-tester/src/test/java/com/passus/st/vars/VarsCompilerTest.java	Tue Jan 16 15:49:22 2018 +0100
+++ b/stress-tester/src/test/java/com/passus/st/vars/VarsCompilerTest.java	Tue Jan 16 16:46:20 2018 +0100
@@ -16,8 +16,8 @@
     @DataProvider(name = "validOneVar")
     public Object[][] validOneVar() {
         return new Object[][]{
-            {"{$var}", "var", 0, 5},
-            {"abc {$var} def", "var", 4, 9}
+            {"{@var}", "var", 0, 5},
+            {"abc {@var} def", "var", 4, 9}
         };
     }
 
@@ -34,7 +34,7 @@
 
     @Test
     public void testSearch_ManyVars() {
-        List<Var> vars = compiler.search("a {$var1} {$var2} bcd {$var2}");
+        List<Var> vars = compiler.search("a {@var1} {@var2} bcd {@var2}");
         assertFalse(vars == null);
         assertEquals(3, vars.size());
 
--- a/stress-tester/src/test/java/com/passus/st/vars/VarsExecutorTest.java	Tue Jan 16 15:49:22 2018 +0100
+++ b/stress-tester/src/test/java/com/passus/st/vars/VarsExecutorTest.java	Tue Jan 16 16:46:20 2018 +0100
@@ -22,14 +22,14 @@
     @DataProvider(name = "contents")
     public Object[][] contents() {
         return new Object[][]{
-            {"{$var1}", true, "abcdef"},
-            {"{$var1}{$var3}", true, "abcdefa"},
-            {"a {$var1} b {$var2}", true, "a abcdef b abc"},
-            {"a {$var1} b {$var2} c {$unresolvable}", true, "a abcdef b abc c {$unresolvable}"},
-            {"a {$var1} {$bad@var%name}", true, "a abcdef {$bad@var%name}"},
-            {"{$var1}g", true, "abcdefg"},
-            {"{$var", false, null},
-            {"{$unresolvable}", false, null},
+            {"{@var1}", true, "abcdef"},
+            {"{@var1}{@var3}", true, "abcdefa"},
+            {"a {@var1} b {@var2}", true, "a abcdef b abc"},
+            {"a {@var1} b {@var2} c {@unresolvable}", true, "a abcdef b abc c {@unresolvable}"},
+            {"a {@var1} {@bad$var%name}", true, "a abcdef {@bad$var%name}"},
+            {"{@var1}g", true, "abcdefg"},
+            {"{@var", false, null},
+            {"{@unresolvable}", false, null},
             {"", false, null}
         };
     }