11/*
2- * Copyright (c) 2000, 2023 , Oracle and/or its affiliates.
2+ * Copyright (c) 2000, 2025 , Oracle and/or its affiliates.
33 *
44 * Licensed under the Universal Permissive License v 1.0 as shown at
55 * https://oss.oracle.com/licenses/upl.
66 */
77package bootstrap ;
88
9+ import com .oracle .bedrock .runtime .LocalPlatform ;
910import com .tangosol .net .CacheFactory ;
1011import com .tangosol .net .Coherence ;
1112import com .tangosol .net .CoherenceConfiguration ;
1718import com .tangosol .net .events .annotation .SessionLifecycleEvents ;
1819import com .tangosol .net .events .application .LifecycleEvent ;
1920import org .junit .jupiter .api .AfterEach ;
21+ import org .junit .jupiter .api .BeforeEach ;
2022import org .junit .jupiter .api .BeforeAll ;
2123import org .junit .jupiter .api .Test ;
24+ import org .junit .jupiter .api .TestInfo ;
2225
2326import java .util .ArrayList ;
2427import java .util .List ;
@@ -45,6 +48,15 @@ static void setup()
4548 System .setProperty ("coherence.cluster" , "CoherenceBootstrapTests" );
4649 }
4750
51+ @ BeforeEach
52+ public void setupTest (TestInfo info )
53+ {
54+ System .err .println (">>>> Starting test " + info .getDisplayName ());
55+
56+ m_nClusterPort = LocalPlatform .get ().getAvailablePorts ().next ();
57+ System .setProperty ("test.multicast.port" , String .valueOf (m_nClusterPort ));
58+ }
59+
4860 @ AfterEach
4961 void cleanup ()
5062 {
@@ -291,4 +303,8 @@ public void onEvent(LifecycleEvent event)
291303
292304 final Map <String , List <LifecycleEvent .Type >> f_events = new ConcurrentHashMap <>();
293305 }
306+
307+ // ----- data members ---------------------------------------------------
308+
309+ private static int m_nClusterPort ;
294310 }
0 commit comments