提交 41426c32 编写于 作者: K kohsuke

[FIXED HUDSON-2694] Detection of the test mode now is done by Java code

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13546 71c3de6d-444a-0410-be80-ed276b4c234a
上级 2082197b
......@@ -946,4 +946,9 @@ public class Functions {
}
private static final Pattern SCHEME = Pattern.compile("[a-z]+://.+");
/**
* Set to true if we are running unit tests.
*/
public static boolean isUnitTest = false;
}
......@@ -40,6 +40,10 @@
<link rel="stylesheet" href="${rootURL}${attrs.css}" type="text/css" />
</j:if>
<link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
<!-- are we running as an unit test? -->
<script>var isRunAsTest=${h.isUnitTest};</script>
<script src="${resURL}/scripts/prototype.js" type="text/javascript"></script>
<script src="${resURL}/scripts/behavior.js" type="text/javascript"></script>
<script src="${resURL}/scripts/sortable.js" type="text/javascript"></script>
......
......@@ -27,6 +27,7 @@ import hudson.util.StreamTaskListener;
import hudson.util.ProcessTreeKiller;
import hudson.maven.MavenModuleSet;
import hudson.FilePath;
import hudson.Functions;
import junit.framework.TestCase;
import org.jvnet.hudson.test.HudsonHomeLoader.CopyExisting;
import org.jvnet.hudson.test.recipes.Recipe;
......@@ -529,7 +530,7 @@ public abstract class HudsonTestCase extends TestCase {
Logger.getLogger("org.springframework").setLevel(Level.WARNING);
// hudson-behavior.js relies on this to decide whether it's running unit tests.
System.setProperty("hudson.unitTest","true");
Functions.isUnitTest = true;
}
private static final Logger LOGGER = Logger.getLogger(HudsonTestCase.class.getName());
......
......@@ -14,15 +14,6 @@ function object(o) {
// id generator
var iota = 0;
// are we run as unit tests?
var isRunAsTest = (function() {
try {
return Packages.java.lang.System.getProperty("hudson.unitTest")!=null;
} catch(e) {
return false;
}
})();
// Form check code
//========================================================
var FormChecker = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册