[FIXED JENKINS-33414] Added an API to allow identification of the Jenkins JVM

- Fix the ProxyConfiguration code to not require Jenkins class to be loaded in remote JVMs
This commit is contained in:
Stephen Connolly committed 2016-03-08 23:05:00 +00:00
1 parent d1dfbd2baf
commit f68f5fb24f
4 files changed
+159 -20

No files matched your search

@@ -0,0 +1,36 @@
package jenkins.util;
import org.junit.Test;
public class JenkinsJVMTest {
@Test
public void checkNotJenkinsJVM_WhenNotInAJenkinsJVM() {
JenkinsJVM.checkNotJenkinsJVM();
}
@Test(expected = IllegalStateException.class)
public void checkJenkinsJVM_WhenNotInAJenkinsJVM() {
JenkinsJVM.checkJenkinsJVM();
}
@Test(expected = IllegalStateException.class)
public void checkNotJenkinsJVM_WhenInAJenkinsJVM() {
JenkinsJVM.setJenkinsJVM(true);
try {
JenkinsJVM.checkNotJenkinsJVM();
} finally {
JenkinsJVM.setJenkinsJVM(false);
}
}
@Test
public void checkJenkinsJVM_WhenInAJenkinsJVM() {
JenkinsJVM.setJenkinsJVM(true);
try {
JenkinsJVM.checkJenkinsJVM();
} finally {
JenkinsJVM.setJenkinsJVM(false);
}
}
}