Merge branch 'master' into JENKINS-26445-pagination-search

This commit is contained in:
tfennelly committed 2015-10-09 12:28:19 +01:00
commit 2ec3ffcd53
87 files changed
+2088 -249

No files matched your search

+2 -1
View File
@@ -58,6 +58,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Chmod;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeTrue;
import static org.junit.Assume.assumeFalse;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -464,7 +465,7 @@ public class FilePathTest {
}
@Test public void symlinkInTar() throws Exception {
if (Functions.isWindows()) return; // can't test on Windows
assumeFalse("can't test on Windows", Functions.isWindows());
FilePath tmp = new FilePath(temp.getRoot());
FilePath in = tmp.child("in");
+3 -4
View File
@@ -34,6 +34,8 @@ import java.io.File;
import jenkins.security.MasterToSlaveCallable;
import org.apache.commons.io.FileUtils;
import static org.junit.Assert.*;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -46,10 +48,7 @@ public class LauncherTest {
@Issue("JENKINS-4611")
@Test public void remoteKill() throws Exception {
if (File.pathSeparatorChar != ':') {
System.err.println("Skipping, currently Unix-specific test");
return;
}
Assume.assumeFalse("Skipping, currently Unix-specific test", Functions.isWindows());
File tmp = temp.newFile();
@@ -0,0 +1,80 @@
/*
* The MIT License
*
* Copyright (c) 2015, CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.util;
import org.junit.Test;
import static org.junit.Assert.*;
import hudson.Util;
/**
* Test for {@link Util.isOverridden} method.
*/
public class IsOverriddenTest {
/**
* Test that a method is found by isOverridden even when it is inherited from an intermediate class.
*/
@Test
public void isOverriddenTest() {
assertTrue(Util.isOverridden(Base.class, Derived.class, "method"));
assertTrue(Util.isOverridden(Base.class, Intermediate.class, "method"));
assertFalse(Util.isOverridden(Base.class, Base.class, "method"));
assertTrue(Util.isOverridden(Base.class, Intermediate.class, "setX", Object.class));
assertTrue(Util.isOverridden(Base.class, Intermediate.class, "getX"));
}
/**
* Negative test.
* Trying to check for a method which does not exist in the hierarchy,
*/
@Test(expected = IllegalArgumentException.class)
public void isOverriddenNegativeTest() {
Util.isOverridden(Base.class, Derived.class, "method2");
}
/**
* Do not inspect private methods.
*/
@Test(expected = IllegalArgumentException.class)
public void avoidPrivateMethodsInspection() {
Util.isOverridden(Base.class, Intermediate.class, "aPrivateMethod");
}
public abstract class Base<T> {
protected abstract void method();
private void aPrivateMethod() {}
public void setX(T t) {}
public T getX() { return null; }
}
public abstract class Intermediate extends Base<Integer> {
protected void method() {}
private void aPrivateMethod() {}
public void setX(Integer i) {}
public Integer getX() { return 0; }
}
public class Derived extends Intermediate {}
}
@@ -8,6 +8,8 @@ import java.io.IOException;
import java.io.Serializable;
import jenkins.security.MasterToSlaveCallable;
import static org.junit.Assert.*;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
@@ -26,9 +28,7 @@ public class ProcessTreeTest {
}
@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;
Assume.assumeFalse("on some platforms where we fail to list any processes", ProcessTree.get()==ProcessTree.DEFAULT);
Tag t = channels.french.call(new MyCallable());