diff --git a/core/src/test/java/hudson/ChannelTestCase.java b/core/src/test/java/hudson/ChannelRule.java similarity index 92% rename from core/src/test/java/hudson/ChannelTestCase.java rename to core/src/test/java/hudson/ChannelRule.java index decfceee34..b94adc4898 100644 --- a/core/src/test/java/hudson/ChannelTestCase.java +++ b/core/src/test/java/hudson/ChannelRule.java @@ -1,33 +1,31 @@ package hudson; -import junit.framework.TestCase; - -import java.io.IOException; -import java.util.concurrent.Future; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import hudson.remoting.Channel; import hudson.remoting.FastPipedInputStream; import hudson.remoting.FastPipedOutputStream; +import java.io.IOException; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import org.junit.rules.ExternalResource; /** * Test that uses a connected channel. * * @author Kohsuke Kawaguchi */ -public abstract class ChannelTestCase extends TestCase { +public final class ChannelRule extends ExternalResource { /** * Two channels that are connected to each other, but shares the same classloader. */ - protected Channel french; - protected Channel british; - private ExecutorService executors = Executors.newCachedThreadPool(); + public Channel french; + public Channel british; + private ExecutorService executors; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Override protected void before() throws Exception { + executors = Executors.newCachedThreadPool(); final FastPipedInputStream p1i = new FastPipedInputStream(); final FastPipedInputStream p2i = new FastPipedInputStream(); final FastPipedOutputStream p1o = new FastPipedOutputStream(p1i); @@ -47,8 +45,7 @@ public abstract class ChannelTestCase extends TestCase { british = f2.get(); } - @Override - protected void tearDown() throws Exception { + @Override protected void after() { try { french.close(); // this will automatically initiate the close on the other channel, too. french.join(); @@ -98,6 +95,8 @@ public abstract class ChannelTestCase extends TestCase { */ e.printStackTrace(); + } catch (InterruptedException x) { + throw new AssertionError(x); } executors.shutdownNow(); } diff --git a/core/src/test/java/hudson/FilePathTest.java b/core/src/test/java/hudson/FilePathTest.java index 3fe2788f20..e6d60ecdfd 100644 --- a/core/src/test/java/hudson/FilePathTest.java +++ b/core/src/test/java/hudson/FilePathTest.java @@ -27,13 +27,6 @@ import hudson.FilePath.TarCompression; import hudson.model.TaskListener; import hudson.remoting.VirtualChannel; import hudson.util.NullStream; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.output.NullOutputStream; -import org.apache.tools.ant.Project; -import org.apache.tools.ant.taskdefs.Chmod; -import org.jvnet.hudson.test.Bug; -import org.mockito.Mockito; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -56,18 +49,29 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.output.NullOutputStream; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.taskdefs.Chmod; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; import org.jvnet.hudson.test.Issue; - +import org.mockito.Mockito; import static org.mockito.Mockito.*; /** * @author Kohsuke Kawaguchi */ -public class FilePathTest extends ChannelTestCase { +public class FilePathTest { - public void testCopyTo() throws Exception { - File tmp = File.createTempFile("testCopyTo",""); - FilePath f = new FilePath(french,tmp.getPath()); + @Rule public ChannelRule channels = new ChannelRule(); + @Rule public TemporaryFolder temp = new TemporaryFolder(); + + @Test public void copyTo() throws Exception { + File tmp = temp.newFile(); + FilePath f = new FilePath(channels.french, tmp.getPath()); f.copyTo(new NullStream()); assertTrue("target does not exist", tmp.exists()); assertTrue("could not delete target " + tmp.getPath(), tmp.delete()); @@ -79,12 +83,12 @@ public class FilePathTest extends ChannelTestCase { */ // TODO: this test is much too slow to be a traditional unit test. Should be extracted into some stress test // which is no part of the default test harness? - public void testNoFileLeakInCopyTo() throws Exception { + @Test public void noFileLeakInCopyTo() throws Exception { for (int j=0; j<2500; j++) { - File tmp = File.createTempFile("testCopyFrom",""); + File tmp = temp.newFile(); FilePath f = new FilePath(tmp); - File tmp2 = File.createTempFile("testCopyTo",""); - FilePath f2 = new FilePath(british,tmp2.getPath()); + File tmp2 = temp.newFile(); + FilePath f2 = new FilePath(channels.british, tmp2.getPath()); f.copyTo(f2); @@ -105,11 +109,10 @@ public class FilePathTest extends ChannelTestCase { * * Also see JENKINS-7897 */ - @Bug(7871) - public void testNoRaceConditionInCopyTo() throws Exception { - final File tmp = File.createTempFile("testNoRaceConditionInCopyTo",""); + @Issue("JENKINS-7871") + @Test public void noRaceConditionInCopyTo() throws Exception { + final File tmp = temp.newFile(); - try { int fileSize = 90000; givenSomeContentInFile(tmp, fileSize); @@ -119,9 +122,6 @@ public class FilePathTest extends ChannelTestCase { // THEN copied count was always equal the expected size for (Future f : results) assertEquals(fileSize,f.get().intValue()); - } finally { - tmp.delete(); - } } private void givenSomeContentInFile(File file, int size) throws IOException { @@ -173,7 +173,7 @@ public class FilePathTest extends ChannelTestCase { } } - FilePath f = new FilePath(french, file.getPath()); + FilePath f = new FilePath(channels.french, file.getPath()); Sink sink = new Sink(); f.copyTo(sink); return sink.count; @@ -189,31 +189,24 @@ public class FilePathTest extends ChannelTestCase { } } - public void testRepeatCopyRecursiveTo() throws Exception { + @Test public void repeatCopyRecursiveTo() throws Exception { // local->local copy used to return 0 if all files were "up to date" // should return number of files processed, whether or not they were copied or already current - File tmp = Util.createTempDir(), src = new File(tmp, "src"), dst = new File(tmp, "dst"); - try { - assertTrue(src.mkdir()); - assertTrue(dst.mkdir()); + File src = temp.newFolder("src"); + File dst = temp.newFolder("dst"); File.createTempFile("foo", ".tmp", src); FilePath fp = new FilePath(src); assertEquals(1, fp.copyRecursiveTo(new FilePath(dst))); // copy again should still report 1 assertEquals(1, fp.copyRecursiveTo(new FilePath(dst))); - } finally { - Util.deleteRecursive(tmp); - } } - @Bug(9540) - public void testErrorMessageInRemoteCopyRecursive() throws Exception { - File tmp = Util.createTempDir(); - try { - File src = new File(tmp, "src"); - File dst = new File(tmp, "dst"); + @Issue("JENKINS-9540") + @Test public void errorMessageInRemoteCopyRecursive() throws Exception { + File src = temp.newFolder("src"); + File dst = temp.newFolder("dst"); FilePath from = new FilePath(src); - FilePath to = new FilePath(british, dst.getAbsolutePath()); + FilePath to = new FilePath(channels.british, dst.getAbsolutePath()); for (int i = 0; i < 10000; i++) { // TODO is there a simpler way to force the TarOutputStream to be flushed and the reader to start? // Have not found a way to make the failure guaranteed. @@ -241,24 +234,17 @@ public class FilePathTest extends ChannelTestCase { } finally { toF.chmod(700); } - } finally { - Util.deleteRecursive(tmp); - } } - public void testArchiveBug4039() throws Exception { - File tmp = Util.createTempDir(); - try { - FilePath d = new FilePath(french,tmp.getPath()); + @Issue("JENKINS-4039") + @Test public void archiveBug() throws Exception { + FilePath d = new FilePath(channels.french, temp.getRoot().getPath()); d.child("test").touch(0); d.zip(new NullOutputStream()); d.zip(new NullOutputStream(),"**/*"); - } finally { - Util.deleteRecursive(tmp); - } } - public void testNormalization() throws Exception { + @Test public void normalization() throws Exception { compare("abc/def\\ghi","abc/def\\ghi"); // allow mixed separators {// basic '.' trimming @@ -311,8 +297,8 @@ public class FilePathTest extends ChannelTestCase { assertEquals(answer,new FilePath((VirtualChannel)null,original).getRemote()); } - // @Bug(6494) - public void testGetParent() throws Exception { + @Issue("JENKINS-6494") + @Test public void getParent() throws Exception { FilePath fp = new FilePath((VirtualChannel)null, "/abc/def"); assertEquals("/abc", (fp = fp.getParent()).getRemote()); assertEquals("/", (fp = fp.getParent()).getRemote()); @@ -338,9 +324,8 @@ public class FilePathTest extends ChannelTestCase { return new FilePath(building); } - public void testList() throws Exception { - File baseDir = Util.createTempDir(); - try { + @Test public void list() throws Exception { + File baseDir = temp.getRoot(); final Set expected = new HashSet(); expected.add(createFilePath(baseDir, "top", "sub", "app.log")); expected.add(createFilePath(baseDir, "top", "sub", "trace.log")); @@ -348,14 +333,10 @@ public class FilePathTest extends ChannelTestCase { expected.add(createFilePath(baseDir, "top", "db", "trace.log")); final FilePath[] result = new FilePath(baseDir).list("**"); assertEquals(expected, new HashSet(Arrays.asList(result))); - } finally { - Util.deleteRecursive(baseDir); - } } - public void testListWithExcludes() throws Exception { - File baseDir = Util.createTempDir(); - try { + @Test public void listWithExcludes() throws Exception { + File baseDir = temp.getRoot(); final Set expected = new HashSet(); expected.add(createFilePath(baseDir, "top", "sub", "app.log")); createFilePath(baseDir, "top", "sub", "trace.log"); @@ -363,14 +344,10 @@ public class FilePathTest extends ChannelTestCase { createFilePath(baseDir, "top", "db", "trace.log"); final FilePath[] result = new FilePath(baseDir).list("**", "**/trace.log"); assertEquals(expected, new HashSet(Arrays.asList(result))); - } finally { - Util.deleteRecursive(baseDir); - } } - public void testListWithDefaultExcludes() throws Exception { - File baseDir = Util.createTempDir(); - try { + @Test public void listWithDefaultExcludes() throws Exception { + File baseDir = temp.getRoot(); final Set expected = new HashSet(); expected.add(createFilePath(baseDir, "top", "sub", "backup~")); expected.add(createFilePath(baseDir, "top", "CVS", "somefile,v")); @@ -379,13 +356,10 @@ public class FilePathTest extends ChannelTestCase { assertEquals(0, new FilePath(baseDir).list("**", "").length); final FilePath[] result = new FilePath(baseDir).list("**", "", false); assertEquals(expected, new HashSet(Arrays.asList(result))); - } finally { - Util.deleteRecursive(baseDir); - } } - @Bug(11073) - public void testIsUnix() { + @Issue("JENKINS-11073") + @Test public void isUnix() { VirtualChannel dummy = Mockito.mock(VirtualChannel.class); FilePath winPath = new FilePath(dummy, " c:\\app\\hudson\\workspace\\3.8-jelly-db\\jdk/jdk1.6.0_21/label/sqlserver/profile/sqlserver\\acceptance-tests\\distribution.zip"); @@ -408,9 +382,8 @@ public class FilePathTest extends ChannelTestCase { * Also tries to check that a problem with setting the last-modified date on Windows doesn't fail the whole copy * - well at least when running this test on a Windows OS. See JENKINS-11073 */ - public void testCopyToWithPermission() throws IOException, InterruptedException { - File tmp = Util.createTempDir(); - try { + @Test public void copyToWithPermission() throws IOException, InterruptedException { + File tmp = temp.getRoot(); File child = new File(tmp,"child"); FilePath childP = new FilePath(child); childP.touch(4711); @@ -421,7 +394,7 @@ public class FilePathTest extends ChannelTestCase { chmodTask.setPerm("0400"); chmodTask.execute(); - FilePath copy = new FilePath(british,tmp.getPath()).child("copy"); + FilePath copy = new FilePath(channels.british, tmp.getPath()).child("copy"); childP.copyToWithPermission(copy); assertEquals(childP.mode(),copy.mode()); @@ -433,19 +406,15 @@ public class FilePathTest extends ChannelTestCase { // Windows seems to have random failures when setting the timestamp on newly generated // files. So test that: for (int i=0; i<100; i++) { - copy = new FilePath(british,tmp.getPath()).child("copy"+i); + copy = new FilePath(channels.british, tmp.getPath()).child("copy"+i); childP.copyToWithPermission(copy); } - } finally { - Util.deleteRecursive(tmp); - } } - public void testSymlinkInTar() throws Exception { + @Test public void symlinkInTar() throws Exception { if (Functions.isWindows()) return; // can't test on Windows - FilePath tmp = new FilePath(Util.createTempDir()); - try { + FilePath tmp = new FilePath(temp.getRoot()); FilePath in = tmp.child("in"); in.mkdirs(); in.child("c").touch(0); @@ -458,13 +427,10 @@ public class FilePathTest extends ChannelTestCase { tar.untar(dst, TarCompression.NONE); assertEquals("c",dst.child("b").readLink()); - } finally { - tmp.deleteRecursive(); - } } - @Bug(13649) - public void testMultiSegmentRelativePaths() throws Exception { + @Issue("JENKINS-13649") + @Test public void multiSegmentRelativePaths() throws Exception { VirtualChannel d = Mockito.mock(VirtualChannel.class); FilePath winPath = new FilePath(d, "c:\\app\\jenkins\\workspace"); FilePath nixPath = new FilePath(d, "/opt/jenkins/workspace"); @@ -477,10 +443,9 @@ public class FilePathTest extends ChannelTestCase { assertEquals("/opt/jenkins/workspace/foo/bar/manchu", new FilePath(nixPath, "foo/bar/manchu").getRemote()); } - public void testValidateAntFileMask() throws Exception { - File tmp = Util.createTempDir(); - try { - FilePath d = new FilePath(french, tmp.getPath()); + @Test public void validateAntFileMask() throws Exception { + File tmp = temp.getRoot(); + FilePath d = new FilePath(channels.french, tmp.getPath()); d.child("d1/d2/d3").mkdirs(); d.child("d1/d2/d3/f.txt").touch(0); d.child("d1/d2/d3/f.html").touch(0); @@ -492,9 +457,6 @@ public class FilePathTest extends ChannelTestCase { assertValidateAntFileMask(Messages.FilePath_validateAntFileMask_doesntMatchAnything("index.htm"), d, "index.htm"); assertValidateAntFileMask(Messages.FilePath_validateAntFileMask_doesntMatchAndSuggest("f.html", "d1/d2/d3/f.html"), d, "f.html"); // TODO lots more to test, e.g. multiple patterns separated by commas; ought to have full code coverage for this method - } finally { - Util.deleteRecursive(tmp); - } } @SuppressWarnings("deprecation") @@ -504,10 +466,9 @@ public class FilePathTest extends ChannelTestCase { @Issue("JENKINS-7214") @SuppressWarnings("deprecation") - public void testValidateAntFileMaskBounded() throws Exception { - File tmp = Util.createTempDir(); - try { - FilePath d = new FilePath(french, tmp.getPath()); + @Test public void validateAntFileMaskBounded() throws Exception { + File tmp = temp.getRoot(); + FilePath d = new FilePath(channels.french, tmp.getPath()); FilePath d2 = d.child("d1/d2"); d2.mkdirs(); for (int i = 0; i < 100; i++) { @@ -524,16 +485,12 @@ public class FilePathTest extends ChannelTestCase { } catch (InterruptedException x) { // good } - } finally { - Util.deleteRecursive(tmp); - } } - @Bug(15418) - public void testDeleteLongPathOnWindows() throws Exception { - File tmp = Util.createTempDir(); - try { - FilePath d = new FilePath(french, tmp.getPath()); + @Issue("JENKINS-15418") + @Test public void deleteLongPathOnWindows() throws Exception { + File tmp = temp.getRoot(); + FilePath d = new FilePath(channels.french, tmp.getPath()); // construct a very long path StringBuilder sb = new StringBuilder(); @@ -551,16 +508,11 @@ public class FilePathTest extends ChannelTestCase { Util.deleteRecursive(firstDirectory); assertFalse("Could not delete directory!", firstDirectory.exists()); - - } finally { - Util.deleteRecursive(tmp); - } } - @Bug(16215) - public void testInstallIfNecessaryAvoidsExcessiveDownloadsByUsingIfModifiedSince() throws Exception { - final File tmp = Util.createTempDir(); - try { + @Issue("JENKINS-16215") + @Test public void installIfNecessaryAvoidsExcessiveDownloadsByUsingIfModifiedSince() throws Exception { + File tmp = temp.getRoot(); final FilePath d = new FilePath(tmp); d.child(".timestamp").touch(123000); @@ -574,15 +526,11 @@ public class FilePathTest extends ChannelTestCase { assertFalse(d.installIfNecessaryFrom(url, null, null)); verify(con).setIfModifiedSince(123000); - } finally { - Util.deleteRecursive(tmp); - } } - @Bug(16215) - public void testInstallIfNecessaryPerformsInstallation() throws Exception { - final File tmp = Util.createTempDir(); - try { + @Issue("JENKINS-16215") + @Test public void installIfNecessaryPerformsInstallation() throws Exception { + File tmp = temp.getRoot(); final FilePath d = new FilePath(tmp); final HttpURLConnection con = mock(HttpURLConnection.class); @@ -595,9 +543,6 @@ public class FilePathTest extends ChannelTestCase { .thenReturn(someZippedContent()); assertTrue(d.installIfNecessaryFrom(url, null, null)); - } finally { - Util.deleteRecursive(tmp); - } } private URL someUrlToZipFile(final URLConnection con) throws IOException { @@ -622,11 +567,9 @@ public class FilePathTest extends ChannelTestCase { return new ByteArrayInputStream(buf.toByteArray()); } - @Bug(16846) - public void testMoveAllChildrenTo() throws IOException, InterruptedException { - final File tmp = Util.createTempDir(); - try - { + @Issue("JENKINS-16846") + @Test public void moveAllChildrenTo() throws IOException, InterruptedException { + File tmp = temp.getRoot(); final String dirname = "sub"; final File top = new File(tmp, "test"); final File sub = new File(top, dirname); @@ -644,10 +587,5 @@ public class FilePathTest extends ChannelTestCase { // test conflict subdir src.moveAllChildrenTo(dst); - } - finally - { - Util.deleteRecursive(tmp); - } } } diff --git a/core/src/test/java/hudson/LauncherTest.java b/core/src/test/java/hudson/LauncherTest.java index bba913d8e6..84dde944f3 100644 --- a/core/src/test/java/hudson/LauncherTest.java +++ b/core/src/test/java/hudson/LauncherTest.java @@ -29,26 +29,31 @@ import hudson.model.TaskListener; import hudson.remoting.Callable; import hudson.util.ProcessTree; import hudson.util.StreamTaskListener; -import jenkins.security.MasterToSlaveCallable; -import org.apache.commons.io.FileUtils; -import org.jvnet.hudson.test.Bug; - import java.io.ByteArrayOutputStream; import java.io.File; +import jenkins.security.MasterToSlaveCallable; +import org.apache.commons.io.FileUtils; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.jvnet.hudson.test.Issue; -public class LauncherTest extends ChannelTestCase { - @Bug(4611) - public void testRemoteKill() throws Exception { +public class LauncherTest { + + @Rule public ChannelRule channels = new ChannelRule(); + @Rule public TemporaryFolder temp = new TemporaryFolder(); + + @Issue("JENKINS-4611") + @Test public void remoteKill() throws Exception { if (File.pathSeparatorChar != ':') { System.err.println("Skipping, currently Unix-specific test"); return; } - File tmp = File.createTempFile("testRemoteKill", ""); - tmp.delete(); + File tmp = temp.newFile(); - try { - FilePath f = new FilePath(french, tmp.getPath()); + FilePath f = new FilePath(channels.french, tmp.getPath()); Launcher l = f.createLauncher(StreamTaskListener.fromStderr()); Proc p = l.launch().cmds("sh", "-c", "echo $$$$ > "+tmp+"; sleep 30").stdout(System.out).stderr(System.err).start(); while (!tmp.exists()) @@ -58,7 +63,7 @@ public class LauncherTest extends ChannelTestCase { assertTrue(p.join()!=0); long end = System.currentTimeMillis(); assertTrue("join finished promptly", (end - start < 15000)); - french.call(NOOP); // this only returns after the other side of the channel has finished executing cancellation + channels.french.call(NOOP); // this only returns after the other side of the channel has finished executing cancellation Thread.sleep(2000); // more delay to make sure it's gone assertNull("process should be gone",ProcessTree.get().get(Integer.parseInt(FileUtils.readFileToString(tmp).trim()))); @@ -69,9 +74,6 @@ public class LauncherTest extends ChannelTestCase { // hudson.model.Hudson.instance.nodes[0].rootPath.createLauncher(new hudson.util.StreamTaskListener(System.err)). // launch().cmds("sleep", "1d").stdout(System.out).stderr(System.err).start().kill() // hangs and on slave machine pgrep sleep => one process; after manual kill, script returns. - } finally { - tmp.delete(); - } } private static final Callable NOOP = new MasterToSlaveCallable() { @@ -80,8 +82,8 @@ public class LauncherTest extends ChannelTestCase { } }; - @Bug(15733) - public void testDecorateByEnv() throws Exception { + @Issue("JENKINS-15733") + @Test public void decorateByEnv() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); TaskListener l = new StreamBuildListener(baos); Launcher base = new Launcher.LocalLauncher(l); @@ -93,8 +95,8 @@ public class LauncherTest extends ChannelTestCase { assertTrue(log, log.contains("val1 val2")); } - @Bug(18368) - public void testDecoratedByEnvMaintainsIsUnix() throws Exception { + @Issue("JENKINS-18368") + @Test public void decoratedByEnvMaintainsIsUnix() throws Exception { ByteArrayOutputStream output = new ByteArrayOutputStream(); TaskListener listener = new StreamBuildListener(output); Launcher remoteLauncher = new Launcher.RemoteLauncher(listener, FilePath.localChannel, false); @@ -105,8 +107,8 @@ public class LauncherTest extends ChannelTestCase { assertEquals(true, decorated.isUnix()); } - @Bug(18368) - public void testDecoratedByPrefixMaintainsIsUnix() throws Exception { + @Issue("JENKINS-18368") + @Test public void decoratedByPrefixMaintainsIsUnix() throws Exception { ByteArrayOutputStream output = new ByteArrayOutputStream(); TaskListener listener = new StreamBuildListener(output); Launcher remoteLauncher = new Launcher.RemoteLauncher(listener, FilePath.localChannel, false); diff --git a/core/src/test/java/hudson/util/ProcessTreeTest.java b/core/src/test/java/hudson/util/ProcessTreeTest.java index 6b398f366e..f3d5d3e6f2 100644 --- a/core/src/test/java/hudson/util/ProcessTreeTest.java +++ b/core/src/test/java/hudson/util/ProcessTreeTest.java @@ -1,19 +1,23 @@ package hudson.util; -import hudson.ChannelTestCase; -import hudson.remoting.Callable; +import hudson.ChannelRule; import hudson.remoting.VirtualChannel; import hudson.util.ProcessTree.OSProcess; import hudson.util.ProcessTree.ProcessCallable; -import jenkins.security.MasterToSlaveCallable; - import java.io.IOException; import java.io.Serializable; +import jenkins.security.MasterToSlaveCallable; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; /** * @author Kohsuke Kawaguchi */ -public class ProcessTreeTest extends ChannelTestCase { +public class ProcessTreeTest { + + @Rule public ChannelRule channels = new ChannelRule(); + static class Tag implements Serializable { ProcessTree tree; OSProcess p; @@ -21,12 +25,12 @@ public class ProcessTreeTest extends ChannelTestCase { private static final long serialVersionUID = 1L; } - public void testRemoting() throws Exception { + @Test public void remoting() throws Exception { // on some platforms where we fail to list any processes, this test will just not work if (ProcessTree.get()==ProcessTree.DEFAULT) return; - Tag t = french.call(new MyCallable()); + Tag t = channels.french.call(new MyCallable()); // make sure the serialization preserved the reference graph assertSame(t.p.getTree(), t.tree);