mirror of https://github.com/jenkinsci/jenkins.git
detecting a problem in a test explicitly.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11967 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
parent
f0a7f18f8e
commit
a82273ad38
|
@ -13,10 +13,13 @@ import hudson.model.FreeStyleProject;
|
|||
import hudson.model.Hudson;
|
||||
import hudson.model.Item;
|
||||
import hudson.model.UpdateCenter;
|
||||
import hudson.model.Saveable;
|
||||
import hudson.tasks.Mailer;
|
||||
import hudson.Launcher.LocalLauncher;
|
||||
import hudson.util.StreamTaskListener;
|
||||
import hudson.util.ProcessTreeKiller;
|
||||
import hudson.remoting.Channel;
|
||||
import hudson.maven.MavenBuildProxy;
|
||||
import junit.framework.TestCase;
|
||||
import org.jvnet.hudson.test.HudsonHomeLoader.CopyExisting;
|
||||
import org.jvnet.hudson.test.recipes.Recipe;
|
||||
|
@ -269,6 +272,14 @@ public abstract class HudsonTestCase extends TestCase {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sometimes a part of a test case may ends up creeping into the serialization tree of {@link Saveable#save()},
|
||||
* so detect that and flag that as an error.
|
||||
*/
|
||||
private Object writeReplace() {
|
||||
throw new AssertionError("HudsonTestCase "+getName()+" is not supposed to be serialized");
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends {@link com.gargoylesoftware.htmlunit.WebClient} and provide convenience methods
|
||||
* for accessing Hudson.
|
||||
|
@ -386,7 +397,5 @@ public abstract class HudsonTestCase extends TestCase {
|
|||
System.setProperty("hudson.unitTest","true");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(HudsonTestCase.class.getName());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue