Skip to content

Commit

Permalink
Prepare for API change in JUnit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgars Batna committed Jul 23, 2024
1 parent 225d1e0 commit 12db0eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

Expand Down Expand Up @@ -78,7 +79,7 @@ public void annotationDoesNotFailForPipeline() throws Exception {
TestResultAction action = getTestResultActionForPipeline("workspace2.zip", "pipelineTest.groovy", Result.UNSTABLE);

ClassResult cr = getClassResult(action, TEST_PACKAGE, "SignupTest");
List<CaseResult> caseResults = cr.getChildren();
Collection<CaseResult> caseResults = cr.getChildren();
assertEquals(3, caseResults.size());

CaseResult failingCase = cr.getCaseResult("A_003_Type_the_text__jenkins__into_the_field__username_");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import hudson.util.DescribableList;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Rule;
Expand Down Expand Up @@ -88,7 +89,7 @@ public void testAttachmentsShownForTestcases_SignupTest() throws Exception {
TestResultAction action = getTestResultActionForBuild("workspace2.zip", Result.UNSTABLE);

ClassResult classResult = getClassResult(action, "SignupTest");
List<CaseResult> cases = classResult.getChildren();
List<CaseResult> cases = new ArrayList<>(classResult.getChildren());
assertEquals(3, cases.size());

// Each test case should have the respective one attachment
Expand All @@ -103,7 +104,7 @@ public void testAttachmentsShownForTestcases_SignupTest_WithRunnerPrefix() throw
TestResultAction action = getTestResultActionForBuild("workspace3.zip", Result.UNSTABLE);

ClassResult classResult = getClassResult(action, "SignupTest");
List<CaseResult> cases = classResult.getChildren();
List<CaseResult> cases = new ArrayList<>(classResult.getChildren());
assertEquals(3, cases.size());

// Each test case should have the respective one attachment
Expand All @@ -127,7 +128,7 @@ public void testAttachmentsShownForTestcases_LoginTest() throws Exception {
TestResultAction action = getTestResultActionForBuild("workspace2.zip", Result.UNSTABLE);

ClassResult classResult = getClassResult(action, "LoginTest");
List<CaseResult> cases = classResult.getChildren();
List<CaseResult> cases = new ArrayList<>(classResult.getChildren());
assertEquals(4, cases.size());

// Each test case should have the respective one (or zero) attachments
Expand All @@ -154,7 +155,7 @@ public void testAttachmentsShownForTestcases_MiscTest1() throws Exception {
TestResultAction action = getTestResultActionForBuild("workspace2.zip", Result.UNSTABLE);

ClassResult classResult = getClassResult(action, "MiscTest1");
List<CaseResult> cases = classResult.getChildren();
List<CaseResult> cases = new ArrayList<>(classResult.getChildren());
assertEquals(1, cases.size());

// Attachment should not be inherited from testsuite
Expand All @@ -177,7 +178,7 @@ public void testAttachmentsShownForTestcases_MiscTest2() throws Exception {
TestResultAction action = getTestResultActionForBuild("workspace2.zip", Result.UNSTABLE);

ClassResult classResult = getClassResult(action, "MiscTest2");
List<CaseResult> cases = classResult.getChildren();
List<CaseResult> cases = new ArrayList<>(classResult.getChildren());
assertEquals(2, cases.size());

// Alphabetically first comes the "doNothing" test
Expand Down

0 comments on commit 12db0eb

Please sign in to comment.