Skip to content

Commit

Permalink
Review feedback: prefer not generating test case
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuch committed Jun 18, 2024
1 parent 69fd3e3 commit e2093a1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/jdk/java/nio/channels/SocketChannel/OpenLeak.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import java.util.List;
import java.util.Locale;

import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

Expand Down Expand Up @@ -105,16 +104,15 @@ static List<Object[]> testCases() throws Exception {

final List<Object[]> cases = new ArrayList<>();
cases.add(new Object[]{sa, UnresolvedAddressException.class});
cases.add(new Object[]{isa, ConnectException.class});
if (isa != null) {
cases.add(new Object[]{isa, ConnectException.class});
}
return cases;
}

@ParameterizedTest
@MethodSource("testCases")
public void test(SocketAddress sa, Class<? extends Throwable> expectedException) throws Exception {
if (sa == null) {
Assumptions.abort("No suitable port could be found for " + expectedException);
}
System.err.printf("%nExpecting %s for %s%n", expectedException, sa);

int i = 0;
Expand Down

0 comments on commit e2093a1

Please sign in to comment.