Skip to content

Suite may be empty and will produce java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 #1116

@juherr

Description

@juherr

The current implementation doesn't manage the case where the suite is empty:

Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0

        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
        at java.base/java.util.Objects.checkIndex(Objects.java:361)
        at java.base/java.util.ArrayList.get(ArrayList.java:427)
        at org.ops4j.pax.exam.testng.listener.PaxExam.stageReactor(PaxExam.java:224)
        at org.ops4j.pax.exam.testng.listener.PaxExam.onStart(PaxExam.java:186)
        at org.testng.SuiteRunner.invokeListeners(SuiteRunner.java:242)
        at org.testng.SuiteRunner.run(SuiteRunner.java:310)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

https://github.com/ops4j/org.ops4j.pax.exam2/blob/master/drivers/pax-exam-testng/src/main/java/org/ops4j/pax/exam/testng/driver/DriverListener.java#L153-L154

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions