Skip to content
Permalink
Browse files
Make error prone happier by using static inner class
While we are here, switch to junit5 methods.
  • Loading branch information
FSchumacher committed Apr 18, 2022
1 parent fb63220 commit a91c28d82bbf8631c9051830bb5e78336da9266f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
@@ -17,8 +17,6 @@

package org.apache.jmeter.control;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;
import java.util.List;

@@ -35,6 +33,7 @@
import org.apache.jmeter.threads.TestCompiler;
import org.apache.jmeter.threads.ThreadGroup;
import org.apache.jorphan.collections.ListedHashTree;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;


@@ -81,11 +80,14 @@ public void testIssue57958() throws Exception {
thread.setOnErrorStopThread(true);
thread.run();

assertEquals("Must one transaction samples with parent debug sample", 1, listener.events.size());
assertEquals("Number of samples in transaction : 1, number of failing samples : 1", listener.events.get(0).getResult().getResponseMessage());
Assertions.assertEquals(1, listener.events.size(),
"Must one transaction samples with parent debug sample");
Assertions.assertEquals("Number of samples in transaction : 1, number of failing samples : 1",
listener.events.get(0).getResult().getResponseMessage());
}

public class TestSampleListener extends ResultCollector implements SampleListener {
public static class TestSampleListener extends ResultCollector implements SampleListener {
private static final long serialVersionUID = -1373192220822942714L;
public List<SampleEvent> events = new ArrayList<>();

@Override
@@ -92,7 +92,7 @@ private static SampleResult result(boolean isSuccess, SampleResult... subResults
return result;
}

private class SimpleSender implements SampleSender {
private static class SimpleSender implements SampleSender {

private SampleResult result;

0 comments on commit a91c28d

Please sign in to comment.