提交 04aace98 编写于 作者: J Jesse Glick

Extracting some miscellaneous usages from core/src.

上级 e4ba41d5
......@@ -24,14 +24,12 @@
package hudson;
import hudson.FilePath.TarCompression;
import hudson.matrix.MatrixBuild;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Computer;
import hudson.model.Describable;
import hudson.model.Job;
import hudson.model.TaskListener;
import hudson.util.DirScanner.Glob;
import hudson.util.io.ArchiverFactory;
import jenkins.model.Jenkins;
import hudson.model.listeners.RunListener;
......@@ -158,7 +156,7 @@ public abstract class FileSystemProvisioner implements ExtensionPoint, Describab
* <p>
* The state of the build when this method is invoked depends on
* the project type. Most would call this at the end of the build,
* but for example {@link MatrixBuild} would call this after
* but for example {@code MatrixBuild} would call this after
* SCM check out so that the state of the fresh workspace
* can be then propagated to elsewhere.
*
......
......@@ -33,7 +33,6 @@ import hudson.Launcher;
import hudson.console.AnnotatedLargeText;
import hudson.console.ExpandableDetailsNote;
import hudson.console.ModelHyperlinkNote;
import hudson.matrix.MatrixConfiguration;
import hudson.model.Fingerprint.BuildPtr;
import hudson.model.Fingerprint.RangeSet;
import hudson.model.labels.LabelAtom;
......@@ -956,7 +955,7 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
* Provides additional variables and their values to {@link Builder}s.
*
* <p>
* This mechanism is used by {@link MatrixConfiguration} to pass
* This mechanism is used by {@code MatrixConfiguration} to pass
* the configuration values to the current build. It is up to
* {@link Builder}s to decide whether they want to recognize the values
* or how to use them.
......
......@@ -25,12 +25,11 @@ package hudson.model;
import hudson.Extension;
import hudson.ExtensionPoint;
import hudson.matrix.MatrixConfiguration;
/**
* {@link Item} that can be directly displayed under {@link jenkins.model.Jenkins} or other containers.
* (A "container" would be any {@link ItemGroup}{@code <TopLevelItem>}, such as a folder of projects.)
* Ones that don't need to be under specific parent (say, unlike {@link MatrixConfiguration}),
* Ones that don't need to be under specific parent (say, unlike {@code MatrixConfiguration}),
* and thus can be freely moved, copied, etc.
*
* <p>
......
......@@ -2,8 +2,6 @@ package jenkins.scm;
import hudson.ExtensionPoint;
import hudson.Launcher;
import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixRun;
import hudson.model.AbstractBuild;
import hudson.model.AbstractBuild.AbstractBuildExecution;
import hudson.model.AbstractDescribableImpl;
......@@ -25,9 +23,9 @@ import java.io.IOException;
* is to control the check out behaviour in matrix projects. The intended use cases include situations like:
*
* <ul>
* <li>Check out will only happen once in {@link MatrixBuild}, and its state will be then sent
* to {@link MatrixRun}s by other means such as rsync.
* <li>{@link MatrixBuild} does no check out of its own, and check out is only done on {@link MatrixRun}s
* <li>Check out will only happen once in {@code MatrixBuild}, and its state will be then sent
* to {@code MatrixRun}s by other means such as rsync.
* <li>{@code MatrixBuild} does no check out of its own, and check out is only done on {@code MatrixRun}s
* </ul>
*
* <h2>Hook Semantics</h2>
......
......@@ -3,34 +3,23 @@ package hudson.cli;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;
import hudson.matrix.MatrixConfiguration;
import hudson.matrix.MatrixProject;
import hudson.model.AbstractProject;
import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.TopLevelItem;
import hudson.model.TopLevelItemDescriptor;
import hudson.model.ViewGroup;
import hudson.model.ViewTest.CompositeView;
import hudson.model.View;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import javax.annotation.CheckForNull;
import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.model.ModifiableTopLevelItemGroup;
......@@ -40,9 +29,6 @@ import org.hamcrest.TypeSafeMatcher;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.Bug;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.mockito.Mockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
......@@ -80,6 +66,7 @@ public class ListJobsCommandTest {
assertThat(stderr.toString(), containsString("No view or item group with the given name found"));
}
/*
@Test
@Bug(18393)
public void failForMatrixProject() throws Exception {
......@@ -95,6 +82,7 @@ public class ListJobsCommandTest {
assertThat(stdout, is(empty()));
assertThat(stderr.toString(), containsString("No view or item group with the given name found"));
}
*/
@Test
public void getAllJobsFromFolders() throws Exception {
......
......@@ -27,18 +27,14 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.thoughtworks.xstream.XStreamException;
import hudson.XmlFile;
import hudson.matrix.MatrixRun;
import hudson.model.Result;
import hudson.model.Run;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.CauseOfInterruption;
import jenkins.model.InterruptedBuildAction;
import junit.framework.TestCase;
import org.apache.commons.io.FileUtils;
import org.jvnet.hudson.test.Bug;
......@@ -261,24 +257,6 @@ public class XStream2Test extends TestCase {
public int x,y;
}
/**
* Unmarshall a matrix build.xml result.
*/
@Bug(10903)
public void testUnMarshalRunMatrix() {
InputStream is = XStream2Test.class.getResourceAsStream("runMatrix.xml");
MatrixRun result = (MatrixRun) Run.XSTREAM.fromXML(is);
assertNotNull(result);
assertNotNull(result.getPersistentActions());
assertEquals(2, result.getPersistentActions().size());
InterruptedBuildAction action = (InterruptedBuildAction) result.getPersistentActions().get(1);
assertNotNull(action.getCauses());
assertEquals(1, action.getCauses().size());
CauseOfInterruption.UserInterruption cause =
(CauseOfInterruption.UserInterruption) action.getCauses().get(0);
assertNotNull(cause);
}
public static class Foo2 {
ConcurrentHashMap<String,String> m = new ConcurrentHashMap<String,String>();
}
......
<?xml version='1.0' encoding='UTF-8'?>
<matrix-run>
<actions>
<hudson.model.CauseAction>
<causes>
<hudson.model.Cause_-UpstreamCause>
<upstreamProject>MatrixProject</upstreamProject>
<upstreamUrl>job/MatrixProject/</upstreamUrl>
<upstreamBuild>8</upstreamBuild>
<upstreamCauses>
<hudson.model.Cause_-UserCause>
<authenticationName>auser</authenticationName>
</hudson.model.Cause_-UserCause>
</upstreamCauses>
</hudson.model.Cause_-UpstreamCause>
</causes>
</hudson.model.CauseAction>
<jenkins.model.InterruptedBuildAction>
<causes class="com.google.common.collect.SingletonImmutableList" resolves-to="com.google.common.collect.ImmutableList$SerializedForm">
<elements>
<jenkins.model.CauseOfInterruption_-UserInterruption>
<user>auser</user>
</jenkins.model.CauseOfInterruption_-UserInterruption>
</elements>
</causes>
</jenkins.model.InterruptedBuildAction>
</actions>
<number>8</number>
<result>ABORTED</result>
<duration>3253844</duration>
<charset>windows-1252</charset>
<keepLog>false</keepLog>
<builtOn>amachine</builtOn>
<workspace>C:\jenkins\slave\workspace\MatrixProject\blah\blah\blah</workspace>
<hudsonVersion>1.427</hudsonVersion>
<culprits>
<string>auser</string>
</culprits>
</matrix-run>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册