jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1747044 - in /jmeter/trunk: src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java xdocs/changes.xml
Date Mon, 06 Jun 2016 17:18:18 GMT
Author: fschumacher
Date: Mon Jun  6 17:18:18 2016
New Revision: 1747044

URL: http://svn.apache.org/viewvc?rev=1747044&view=rev
Log:
Error count in report dashboard is one off.

Bugzilla Id: 59621

Added:
    jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java?rev=1747044&r1=1747043&r2=1747044&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/report/processor/ErrorsSummaryConsumer.java Mon
Jun  6 17:18:18 2016
@@ -115,7 +115,7 @@ public class ErrorsSummaryConsumer exten
 
             Long data = info.getData();
             if (data == null) {
-                data = Long.valueOf(1);
+                data = ZERO;
             }
             info.setData(Long.valueOf(data.longValue() + 1));
         }

Added: jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java?rev=1747044&view=auto
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
(added)
+++ jmeter/trunk/test/src/org/apache/jmeter/report/processor/ErrorsSummaryConsumerTest.java
Mon Jun  6 17:18:18 2016
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.jmeter.report.processor;
+
+import org.apache.jmeter.report.core.Sample;
+import org.apache.jmeter.report.core.SampleMetadata;
+import org.apache.jmeter.save.CSVSaveService;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ErrorsSummaryConsumerTest {
+
+    @Test
+    public void testErrorSampleCounter() {
+        ErrorsSummaryConsumer consumer = new ErrorsSummaryConsumer();
+        Sample sample = createSample(false);
+        AbstractSummaryConsumer<Long>.SummaryInfo info = consumer.new SummaryInfo(
+                false);
+        Assert.assertEquals(null, info.getData());
+        consumer.updateData(info, sample);
+        Assert.assertEquals(Long.valueOf(1), info.getData());
+        consumer.updateData(info, sample);
+        Assert.assertEquals(Long.valueOf(2), info.getData());
+    }
+
+    /**
+     * Create a dummy sample that is either successful or a failure depending on
+     * the {@code success} flag
+     * 
+     * @param success
+     *            flag do determine if the sample should be successful or not
+     * @return newly created sample
+     */
+    private Sample createSample(boolean success) {
+        SampleMetadata metadata = new SampleMetadata(',',
+                CSVSaveService.SUCCESSFUL);
+        Sample sample = new Sample(0, metadata, String.valueOf(success));
+        return sample;
+    }
+
+}

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1747044&r1=1747043&r2=1747044&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Jun  6 17:18:18 2016
@@ -151,6 +151,7 @@ Summary
 <h3>General</h3>
 <ul>
     <li><bug>59607</bug>JMeter crashes when reading large test plan (greater
than 2g). Based on fix by Felix Draxler (felix.draxler at sap.com)</li>
+    <li><bug>59621</bug>Error count in report dashboard is one off.</li>
 </ul>
 
  <!--  =================== Thanks =================== -->



Mime
View raw message