11/*
2- * Copyright (c) 2009, 2019 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2009, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2323
2424/* @test
2525 * @bug 6863110
26+ * @library /test/lib
2627 * @summary Newly connected/accepted SctpChannel should fire OP_READ if registered with a Selector
2728 * @author chegar
2829 */
4950import static java .nio .channels .SelectionKey .OP_CONNECT ;
5051import static java .nio .channels .SelectionKey .OP_READ ;
5152
53+ import jtreg .SkippedException ;
54+
5255public class CommUp {
5356 static CountDownLatch acceptLatch = new CountDownLatch (1 );
5457 static final int TIMEOUT = 10000 ;
@@ -61,12 +64,6 @@ public class CommUp {
6164 void test (String [] args ) {
6265 SocketAddress address = null ;
6366
64- if (!Util .isSCTPSupported ()) {
65- out .println ("SCTP protocol is not supported" );
66- out .println ("Test cannot be run" );
67- return ;
68- }
69-
7067 if (args .length == 2 ) {
7168 /* requested to connecct to a specific address */
7269 try {
@@ -355,6 +352,10 @@ public HandlerResult handleNotification(
355352 void sleep (long millis ) { try { Thread .currentThread ().sleep (millis ); }
356353 catch (InterruptedException ie ) { unexpected (ie ); }}
357354 public static void main (String [] args ) throws Throwable {
355+ if (!Util .isSCTPSupported ()) {
356+ throw new SkippedException ("SCTP protocol is not supported" );
357+ }
358+
358359 Class <?> k = new Object (){}.getClass ().getEnclosingClass ();
359360 try {k .getMethod ("instanceMain" ,String [].class )
360361 .invoke ( k .newInstance (), (Object ) args );}
0 commit comments