4040/**
4141 * @author Kohsuke Kawaguchi
4242 */
43- public class ChannelTest {
43+ class ChannelTest {
44+
4445 private static final Logger LOGGER = Logger .getLogger (ChannelTest .class .getName ());
4546
4647 @ ParameterizedTest
4748 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
48- public void testCapability (ChannelRunner channelRunner ) throws Exception {
49+ void testCapability (ChannelRunner channelRunner ) throws Exception {
4950 assumeFalse (
5051 channelRunner instanceof InProcessCompatibilityRunner ,
5152 "In-process runner does not support multi-classloader RPC" );
@@ -55,7 +56,7 @@ public void testCapability(ChannelRunner channelRunner) throws Exception {
5556 @ Issue ("JENKINS-9050" )
5657 @ ParameterizedTest
5758 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
58- public void testFailureInDeserialization (ChannelRunner channelRunner ) throws Exception {
59+ void testFailureInDeserialization (ChannelRunner channelRunner ) throws Exception {
5960 channelRunner .withChannel (channel -> {
6061 final IOException e = assertThrows (IOException .class , () -> channel .call (new CallableImpl ()));
6162 assertEquals ("foobar" , e .getCause ().getCause ().getMessage ());
@@ -82,12 +83,12 @@ private void readObject(ObjectInputStream ois) {
8283 @ Issue ("JENKINS-10424" )
8384 @ ParameterizedTest
8485 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
85- public void testExportCallerDeallocation (ChannelRunner channelRunner ) throws Exception {
86+ void testExportCallerDeallocation (ChannelRunner channelRunner ) throws Exception {
8687 channelRunner .withChannel (channel -> {
8788 for (int i = 0 ; i < 100 ; i ++) {
8889 final GreeterImpl g = new GreeterImpl ();
8990 channel .call (new GreetingTask (g ));
90- assertEquals (g . name , "Kohsuke" );
91+ assertEquals ("Kohsuke" , g . name );
9192 assertFalse (
9293 channel .exportedObjects .isExported (g ),
9394 "in this scenario, auto-unexport by the caller should kick in." );
@@ -101,12 +102,12 @@ public void testExportCallerDeallocation(ChannelRunner channelRunner) throws Exc
101102 @ Issue ("JENKINS-10424" )
102103 @ ParameterizedTest
103104 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
104- public void testExportCalleeDeallocation (ChannelRunner channelRunner ) throws Exception {
105+ void testExportCalleeDeallocation (ChannelRunner channelRunner ) throws Exception {
105106 channelRunner .withChannel (channel -> {
106107 for (int j = 0 ; j < 10 ; j ++) {
107108 final GreeterImpl g = new GreeterImpl ();
108109 channel .call (new GreetingTask (channel .export (Greeter .class , g )));
109- assertEquals (g . name , "Kohsuke" );
110+ assertEquals ("Kohsuke" , g . name );
110111 boolean isExported = channel .exportedObjects .isExported (g );
111112 if (!isExported ) {
112113 // it is unlikely but possible that GC happens on remote node
@@ -137,7 +138,7 @@ public void testExportCalleeDeallocation(ChannelRunner channelRunner) throws Exc
137138
138139 @ ParameterizedTest
139140 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
140- public void testGetSetProperty (ChannelRunner channelRunner ) throws Exception {
141+ void testGetSetProperty (ChannelRunner channelRunner ) throws Exception {
141142 channelRunner .withChannel (channel -> {
142143 channel .setProperty ("foo" , "bar" );
143144 assertEquals ("bar" , channel .getProperty ("foo" ));
@@ -152,7 +153,7 @@ public void testGetSetProperty(ChannelRunner channelRunner) throws Exception {
152153
153154 @ ParameterizedTest
154155 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
155- public void testWaitForRemoteProperty (ChannelRunner channelRunner ) throws Exception {
156+ void testWaitForRemoteProperty (ChannelRunner channelRunner ) throws Exception {
156157 channelRunner .withChannel (channel -> {
157158 Future <Void > f = channel .callAsync (new WaitForRemotePropertyCallable ());
158159 assertEquals ("bar" , channel .waitForRemoteProperty ("foo" ));
@@ -206,7 +207,7 @@ public Object call() {
206207
207208 @ ParameterizedTest
208209 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
209- public void testClassLoaderHolder (ChannelRunner channelRunner ) throws Exception {
210+ void testClassLoaderHolder (ChannelRunner channelRunner ) throws Exception {
210211 channelRunner .withChannel (channel -> {
211212 URLClassLoader ucl = new URLClassLoader (new URL [0 ]);
212213 ClassLoaderHolder h = channel .call (new Echo <>(new ClassLoaderHolder (ucl )));
@@ -232,7 +233,7 @@ public T call() throws RuntimeException {
232233 @ Issue ("JENKINS-39150" )
233234 @ ParameterizedTest
234235 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
235- public void testDiagnostics (ChannelRunner channelRunner ) throws Exception {
236+ void testDiagnostics (ChannelRunner channelRunner ) throws Exception {
236237 assumeFalse (channelRunner instanceof ForkRunner , "Can't call diagnostics on forked runners" );
237238 channelRunner .withChannel (channel -> {
238239 StringWriter sw = new StringWriter ();
@@ -247,7 +248,7 @@ public void testDiagnostics(ChannelRunner channelRunner) throws Exception {
247248
248249 @ ParameterizedTest
249250 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
250- public void testCallSiteStacktrace (ChannelRunner channelRunner ) throws Exception {
251+ void testCallSiteStacktrace (ChannelRunner channelRunner ) throws Exception {
251252 channelRunner .withChannel (channel -> {
252253 final Exception e = assertThrows (Exception .class , () -> this .failRemotelyToBeWrappedLocally (channel ));
253254 assertEquals ("Local Nested" , e .getMessage ());
@@ -291,7 +292,7 @@ public Void call() throws IOException {
291292 @ Issue ("JENKINS-45023" )
292293 @ ParameterizedTest
293294 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
294- public void testShouldNotAcceptUserRequestsWhenIsBeingClosed (ChannelRunner channelRunner ) throws Exception {
295+ void testShouldNotAcceptUserRequestsWhenIsBeingClosed (ChannelRunner channelRunner ) throws Exception {
295296 channelRunner .withChannel (channel -> {
296297 // Create a sample request to the channel
297298 final Callable <Void , Exception > testPayload = new NeverEverCallable ();
@@ -318,7 +319,7 @@ public void testShouldNotAcceptUserRequestsWhenIsBeingClosed(ChannelRunner chann
318319 @ Issue ("JENKINS-45294" )
319320 @ ParameterizedTest
320321 @ MethodSource (ChannelRunners .PROVIDER_METHOD )
321- public void testShouldNotAcceptUserRPCRequestsWhenIsBeingClosed (ChannelRunner channelRunner ) throws Exception {
322+ void testShouldNotAcceptUserRPCRequestsWhenIsBeingClosed (ChannelRunner channelRunner ) throws Exception {
322323 channelRunner .withChannel (channel -> {
323324 Collection <String > src = new ArrayList <>();
324325 src .add ("Hello" );
@@ -490,7 +491,7 @@ private void assertFailsWithChannelClosedException(Channel channel, TestRunnable
490491 }
491492
492493 @ Test
493- public void isClosedChannelException () {
494+ void isClosedChannelException () {
494495 assertThat (Channel .isClosedChannelException (null ), is (false ));
495496 assertThat (Channel .isClosedChannelException (new IOException ()), is (false ));
496497 assertThat (Channel .isClosedChannelException (new ClosedChannelException ()), is (true ));
0 commit comments