Sort imports (#5732)

This commit is contained in:
Basil Crow authored and GitHub committed 2021-09-18 09:39:42 +01:00
1 parent 2cf5a80da0
commit 632033d6ad
1284 files changed
+6318 -7600

No files matched your search

@@ -26,9 +26,8 @@ package hudson;
import static org.junit.Assert.assertEquals;
import hudson.model.Saveable;
import org.junit.Test;
import java.io.IOException;
import org.junit.Test;
/**
* Tests {@link BulkChange}.
@@ -23,17 +23,16 @@
*/
package hudson;
import hudson.util.VersionNumber;
import jenkins.plugins.DetachedPluginsUtil;
import org.junit.jupiter.api.Test;
import java.util.List;
import static jenkins.plugins.DetachedPluginsUtil.DetachedPlugin;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import hudson.util.VersionNumber;
import java.util.List;
import jenkins.plugins.DetachedPluginsUtil;
import org.junit.jupiter.api.Test;
/**
* @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
*/
+7 -10
View File
@@ -23,22 +23,19 @@
*/
package hudson;
import hudson.EnvVars.OverrideOrderCalculator;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.TreeMap;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import hudson.EnvVars.OverrideOrderCalculator;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.TreeMap;
import org.junit.jupiter.api.Test;
/**
* @author Kohsuke Kawaguchi
+25 -26
View File
@@ -23,6 +23,20 @@
*/
package hudson;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import hudson.FilePath.TarCompression;
import hudson.model.TaskListener;
import hudson.os.PosixAPI;
@@ -31,18 +45,6 @@ import hudson.remoting.VirtualChannel;
import hudson.slaves.WorkspaceList;
import hudson.util.NullStream;
import hudson.util.StreamTaskListener;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Chmod;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;
import org.mockito.Mockito;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -71,22 +73,19 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Chmod;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;
import org.mockito.Mockito;
/**
* @author Kohsuke Kawaguchi
+10 -13
View File
@@ -23,6 +23,15 @@
*/
package hudson;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
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.model.Action;
import hudson.model.Computer;
import hudson.model.Item;
@@ -30,6 +39,7 @@ import hudson.model.ItemGroup;
import hudson.model.TopLevelItem;
import hudson.model.View;
import hudson.model.ViewGroup;
import hudson.util.VersionNumber;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Arrays;
@@ -40,16 +50,7 @@ import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import hudson.util.VersionNumber;
import jenkins.model.Jenkins;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -57,10 +58,6 @@ import org.jvnet.hudson.test.Issue;
import org.kohsuke.stapler.Ancestor;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
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 org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
+6 -7
View File
@@ -24,6 +24,12 @@
package hudson;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import hudson.model.StreamBuildListener;
import hudson.model.TaskListener;
import hudson.util.ProcessTree;
@@ -31,15 +37,8 @@ import hudson.util.StreamTaskListener;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.nio.charset.Charset;
import jenkins.security.MasterToSlaveCallable;
import org.apache.commons.io.FileUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
@@ -23,13 +23,12 @@
*/
package hudson;
import hudson.MarkupText.SubText;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import hudson.MarkupText.SubText;
import java.util.List;
import java.util.regex.Pattern;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
/**
* @author Kohsuke Kawaguchi
@@ -24,24 +24,6 @@
package hudson;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import org.apache.tools.ant.filters.StringInputStream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Path;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.apache.commons.io.FileUtils;
import org.jvnet.hudson.test.Issue;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -50,6 +32,24 @@ import static org.hamcrest.core.StringContains.containsString;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.apache.commons.io.FileUtils;
import org.apache.tools.ant.filters.StringInputStream;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.jvnet.hudson.test.Issue;
import org.xml.sax.SAXException;
/**
* Tests of {@link PluginManager}.
*/
@@ -1,26 +1,5 @@
package hudson;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import jenkins.model.Jenkins;
import jenkins.util.AntClassLoader;
import jenkins.util.URLClassLoader2;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.stubbing.Answer;
import hudson.remoting.Which;
import org.jvnet.hudson.test.Issue;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
@@ -32,6 +11,26 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import hudson.remoting.Which;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import jenkins.model.Jenkins;
import jenkins.util.AntClassLoader;
import jenkins.util.URLClassLoader2;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.jvnet.hudson.test.Issue;
import org.mockito.stubbing.Answer;
public class PluginWrapperTest {
private static Locale loc;
@@ -23,11 +23,10 @@
*/
package hudson;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.net.Proxy;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
public class ProxyConfigurationTest {
@@ -7,9 +7,8 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import java.io.File;
import hudson.os.WindowsUtil;
import java.io.File;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+19 -20
View File
@@ -24,19 +24,19 @@
*/
package hudson;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import hudson.model.TaskListener;
import hudson.os.WindowsUtil;
import hudson.util.StreamTaskListener;
import org.apache.commons.io.FileUtils;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -51,16 +51,15 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.apache.commons.io.FileUtils;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;
/**
* @author Kohsuke Kawaguchi
+4 -5
View File
@@ -1,20 +1,19 @@
package hudson;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertThrows;
import hudson.model.Node;
import hudson.util.XStream2;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import jenkins.model.Jenkins;
import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.SAXParseException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertThrows;
public class XmlFileTest {
@Test
@@ -1,17 +1,17 @@
package hudson.cli;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertThrows;
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.model.TopLevelItem;
import hudson.model.ViewTest.CompositeView;
import hudson.model.View;
import hudson.model.TopLevelItem;
import hudson.model.View;
import hudson.model.ViewTest.CompositeView;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Arrays;
@@ -19,9 +19,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import jenkins.model.Jenkins;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.junit.Before;
@@ -31,12 +31,13 @@ import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import hudson.model.ViewGroup;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.model.View;
import hudson.model.ViewGroup;
import hudson.security.ACL;
import hudson.security.Permission;
import jenkins.model.Jenkins;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -53,8 +54,6 @@ import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.Authentication;
import edu.umd.cs.findbugs.annotations.NonNull;
@PrepareForTest(Jenkins.class)
@RunWith(PowerMockRunner.class)
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
@@ -23,13 +23,12 @@
*/
package hudson.console;
import hudson.MarkupText;
import static org.junit.jupiter.api.Assertions.assertEquals;
import hudson.MarkupText;
import org.junit.jupiter.api.Test;
import org.jvnet.hudson.test.Issue;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author Alan Harder
*/
@@ -24,14 +24,6 @@
package hudson.logging;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import jenkins.model.Jenkins;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
@@ -40,6 +32,14 @@ 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 java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import jenkins.model.Jenkins;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.Issue;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
@@ -6,7 +6,6 @@ import static org.junit.Assert.assertThrows;
import java.io.IOException;
import java.util.Collection;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
@@ -24,20 +24,18 @@
package hudson.model;
import java.util.ArrayList;
import java.util.Arrays;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import edu.umd.cs.findbugs.annotations.NonNull;
import org.junit.Assert;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
@@ -5,8 +5,8 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import hudson.model.Run.Summary;
import hudson.model.Run.Summary;
import org.junit.Before;
import org.junit.Test;
@@ -1,9 +1,5 @@
package hudson.model;
import hudson.util.FormValidation;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
@@ -12,6 +8,10 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import hudson.util.FormValidation;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
public class ChoiceParameterDefinitionTest {
@Test
public void shouldValidateChoices(){
@@ -1,20 +1,18 @@
package hudson.model;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import hudson.FilePath;
import hudson.security.ACL;
import jenkins.model.Jenkins;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import java.io.File;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import jenkins.model.Jenkins;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.springframework.security.core.Authentication;
/**
@@ -23,11 +23,11 @@
*/
package hudson.model;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
public class DisplayNameListenerTest {
@Test
@@ -1,16 +1,14 @@
package hudson.model;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.EnvVars;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class EnvironmentContributingActionTest {
static class OverrideRun extends InvisibleAction implements EnvironmentContributingAction {
private boolean wasCalled = false;
@@ -23,19 +23,18 @@
*/
package hudson.model;
import hudson.model.Fingerprint.RangeSet;
import java.io.File;
import jenkins.fingerprints.FileFingerprintStorage;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import hudson.model.Fingerprint.RangeSet;
import java.io.File;
import jenkins.fingerprints.FileFingerprintStorage;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -1,14 +1,13 @@
package hudson.model;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
*/
+3 -5
View File
@@ -1,9 +1,10 @@
package hudson.model;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import hudson.EnvVars;
import hudson.Platform;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -16,9 +17,6 @@ import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import hudson.EnvVars;
import hudson.Platform;
@RunWith(PowerMockRunner.class)
@PrepareForTest({ Node.class, Platform.class })
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
@@ -23,22 +23,20 @@
*/
package hudson.model;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import hudson.model.MultiStageTimeSeries.TimeScale;
import hudson.model.queue.SubTask;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import org.jfree.chart.JFreeChart;
import org.junit.Test;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import javax.imageio.ImageIO;
import org.jfree.chart.JFreeChart;
import org.junit.Test;
/**
* @author Kohsuke Kawaguchi
@@ -24,7 +24,6 @@
package hudson.model;
import hudson.model.queue.CauseOfBlockage;
import java.util.Collections;
import java.util.List;
@@ -1,11 +1,11 @@
package hudson.model;
import hudson.util.Secret;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import hudson.util.Secret;
import org.junit.Test;
public class ParameterDefinitionTest {
@Test
@@ -1,5 +1,10 @@
package hudson.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.powermock.api.mockito.PowerMockito.mock;
import hudson.EnvVars;
import hudson.model.queue.SubTask;
import hudson.tasks.BuildWrapper;
@@ -7,14 +12,8 @@ import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.Issue;
import static org.powermock.api.mockito.PowerMockito.mock;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
@@ -1,5 +1,12 @@
package hudson.model;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -9,14 +16,6 @@ import org.kohsuke.stapler.StaplerResponse;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class QueueTest {
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Random;
import org.junit.Before;
import org.junit.Test;
@@ -24,11 +24,12 @@
package hudson.model;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import org.junit.Test;
public class RunParameterValueTest {
@SuppressWarnings("ResultOfObjectAllocationIgnored")
+7 -9
View File
@@ -24,6 +24,13 @@
package hudson.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.console.AnnotatedLargeText;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -39,14 +46,6 @@ import java.util.TreeSet;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.console.AnnotatedLargeText;
import jenkins.model.Jenkins;
import org.apache.commons.jelly.XMLOutput;
import org.junit.Rule;
@@ -57,7 +56,6 @@ import org.jvnet.localizer.LocaleProvider;
import org.kohsuke.stapler.framework.io.ByteBuffer;
import org.mockito.Mockito;
public class RunTest {
private static final String SAMPLE_BUILD_OUTPUT = "Sample build output abc123.\n";
@@ -2,11 +2,10 @@ package hudson.model;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import hudson.console.AnnotatedLargeText;
import hudson.security.ACL;
import hudson.security.Permission;
import java.io.ByteArrayOutputStream;
import org.junit.Test;
/**
@@ -1,8 +1,7 @@
package hudson.model;
import jenkins.model.IdStrategy;
import java.io.File;
import jenkins.model.IdStrategy;
class TestUserIdMapper extends UserIdMapper {
@@ -1,17 +1,16 @@
package hudson.model;
import net.sf.json.JSONObject;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import net.sf.json.JSONObject;
import org.junit.Test;
public class UpdateCenterTest {
@@ -23,14 +23,6 @@
*/
package hudson.model;
import jenkins.model.IdStrategy;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import java.io.File;
import java.io.IOException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.hasItems;
@@ -41,6 +33,13 @@ import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertThrows;
import java.io.File;
import java.io.IOException;
import jenkins.model.IdStrategy;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
public class UserIdMapperTest {
@Rule
@@ -23,23 +23,22 @@
*/
package hudson.model;
import jenkins.model.IdStrategy;
import org.apache.commons.io.FileUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import jenkins.model.IdStrategy;
import org.apache.commons.io.FileUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
public class UserIdMigratorTest {
@@ -2,6 +2,7 @@ package hudson.model;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
@@ -8,16 +8,13 @@ import hudson.search.SearchIndex;
import hudson.search.SearchIndexBuilder;
import hudson.search.SearchItem;
import hudson.views.ViewsTabBar;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.servlet.ServletException;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.kohsuke.stapler.StaplerRequest;
@@ -24,6 +24,8 @@
package hudson.model.listeners;
import static org.junit.Assert.assertEquals;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
@@ -32,7 +34,6 @@ import hudson.model.TaskListener;
import hudson.scm.ChangeLogSet;
import hudson.scm.SCM;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import org.jvnet.hudson.test.Issue;
import org.mockito.Mockito;
@@ -24,11 +24,12 @@
package hudson.model.queue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import hudson.model.Queue;
import java.io.IOException;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import org.jvnet.hudson.test.Issue;
@SuppressWarnings("deprecation")
@@ -1,13 +1,12 @@
package hudson.os;
import java.util.Properties;
import ndr.NdrObject;
import ndr.NetworkDataRepresentation;
import org.jinterop.dcom.transport.JIComTransportFactory;
import rpc.Endpoint;
import rpc.Stub;
import java.util.Properties;
/**
* My attempt to see if ServerAlive calls can be used to detect an authentication failure
* (so that I can differentiate authentication problem against authorization problem in
@@ -24,11 +24,10 @@
package hudson.os;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/**
* Test the test utility code, too!
@@ -8,13 +8,12 @@ import java.util.Calendar;
import java.util.Collection;
import java.util.GregorianCalendar;
import java.util.Locale;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.For;
import org.jvnet.hudson.test.Issue;
/**
* A collection of unit tests focused around crontabs restricted to particular
@@ -1,19 +1,18 @@
package hudson.scheduler;
import antlr.ANTLRException;
import static org.junit.Assert.fail;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.For;
import antlr.ANTLRException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.GregorianCalendar;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.jvnet.hudson.test.For;
import org.jvnet.hudson.test.Issue;
@RunWith(Parameterized.class)
@For({CronTab.class, Hash.class})
@@ -23,23 +23,22 @@
*/
package hudson.scheduler;
import static java.util.Calendar.MONDAY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import antlr.ANTLRException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThrows;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import static java.util.Calendar.MONDAY;
import java.util.List;
/**
* @author Kohsuke Kawaguchi
*/
@@ -27,10 +27,8 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import hudson.Util;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
/**
@@ -7,6 +7,10 @@ import static org.mockito.Mockito.verify;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.verifyStatic;
import hudson.remoting.Channel;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -16,11 +20,6 @@ import org.mockito.MockitoAnnotations;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import hudson.remoting.Channel;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
@RunWith(PowerMockRunner.class)
@PrepareForTest(ChannelPinger.class)
@@ -1,13 +1,13 @@
package hudson.slaves;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import hudson.model.Messages;
import hudson.model.queue.CauseOfBlockage;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
public class CloudProvisioningListenerTest {
public static class CloudProvisioningListenerNoOverride extends CloudProvisioningListener {}
@@ -24,19 +24,18 @@
package hudson.slaves;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.StringReader;
import org.apache.commons.io.output.NullOutputStream;
import org.junit.jupiter.api.Test;
import org.jvnet.hudson.test.Issue;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class ComputerLauncherTest {
@Test public void jdk7() {
@@ -1,7 +1,14 @@
package hudson.slaves;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;
import hudson.DescriptorExtensionList;
import hudson.model.Descriptor;
import java.util.ArrayList;
import jenkins.model.Jenkins;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -10,14 +17,6 @@ import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.util.ArrayList;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.when;
/**
* @author peppelan
*/
@@ -30,13 +30,11 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.withSettings;
import jenkins.model.Jenkins;
import hudson.model.Node;
import hudson.XmlFile;
import hudson.model.Node;
import java.io.File;
import java.nio.charset.Charset;
import jenkins.model.Jenkins;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Test;
@@ -2,13 +2,12 @@ package hudson.tasks;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.FreeStyleBuild;
import java.io.IOException;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.mockito.Mockito;
@@ -2,8 +2,8 @@ package hudson.tasks._maven;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import hudson.MarkupText;
import hudson.MarkupText;
import org.junit.Test;
public class Maven3MojoNoteTest {
@@ -26,12 +26,11 @@ package hudson.triggers;
import antlr.ANTLRException;
import hudson.scheduler.CronTabList;
import hudson.scheduler.Hash;
import java.util.TimeZone;
import org.junit.Assert;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import java.util.TimeZone;
/**
* @author Kanstantsin Shautsou
*/
@@ -23,9 +23,9 @@
*/
package hudson.util;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@@ -37,7 +37,6 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import org.junit.Ignore;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
@@ -1,12 +1,14 @@
package hudson.util;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeThat;
import edu.umd.cs.findbugs.annotations.Nullable;
import java.io.File;
@@ -18,16 +20,13 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.PosixFilePermission;
import java.util.Set;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.StringContains.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeThat;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;
public class AtomicFileWriterTest {
private static final String PREVIOUS = "previous value \n blah";
@@ -30,16 +30,15 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import org.junit.Ignore;
import org.junit.Test;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.HashSet;
/**
* @author Kohsuke Kawaguchi
*/
@@ -28,13 +28,12 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.xmlunit.matchers.CompareMatcher.isSimilarTo;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.xmlunit.diff.DefaultNodeMatcher;
import org.xmlunit.diff.ElementSelectors;
import java.util.ArrayList;
import java.util.List;
/**
* @author Kohsuke Kawaguchi, Alan Harder
*/
@@ -23,12 +23,13 @@
*/
package hudson.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
@@ -4,12 +4,11 @@ import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import hudson.util.CyclicGraphDetector.CycleDetectedException;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;
import org.junit.Test;
/**
* @author Kohsuke Kawaguchi
@@ -24,11 +24,12 @@
package hudson.util;
import static org.junit.Assert.assertEquals;
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
import hudson.model.Describable;
import hudson.model.Descriptor;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import org.jvnet.hudson.test.Issue;
public class DescribableListTest {
@@ -23,11 +23,12 @@
*/
package hudson.util;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import hudson.FilePath;
import java.io.File;
import java.io.IOException;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -1,20 +1,19 @@
package hudson.util;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThrows;
import java.io.File;
import java.io.IOException;
import java.nio.channels.ClosedChannelException;
import java.nio.charset.StandardCharsets;
import java.nio.file.StandardOpenOption;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertThrows;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class FileChannelWriterTest {
@Rule
@@ -23,16 +23,15 @@
*/
package hudson.util;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author sogabe
@@ -23,11 +23,10 @@
*/
package hudson.util;
import java.awt.Dimension;
import org.junit.Assert;
import org.junit.Test;
import java.awt.Dimension;
public class GraphTest {
public static final int DEFAULT_W = 400;
@@ -23,16 +23,15 @@
*/
package hudson.util;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import hudson.Util;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ErrorCollector;
import org.jvnet.hudson.test.Issue;
@@ -29,10 +29,8 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import hudson.util.Iterators.CountingPredicate;
import java.util.Iterator;
import java.util.List;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
@@ -23,13 +23,12 @@
*/
package hudson.util;
import java.util.HashMap;
import java.util.Map;
import net.sf.json.JSONObject;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
/**
* @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
*/
@@ -4,7 +4,6 @@ import static org.junit.Assert.assertEquals;
import java.util.Map;
import java.util.TreeMap;
import org.junit.Test;
/**
@@ -1,5 +1,9 @@
package hudson.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import hudson.ChannelRule;
import hudson.remoting.VirtualChannel;
import hudson.util.ProcessTree.OSProcess;
@@ -7,10 +11,6 @@ import hudson.util.ProcessTree.ProcessCallable;
import java.io.IOException;
import java.io.Serializable;
import jenkins.security.MasterToSlaveCallable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
@@ -1,7 +1,7 @@
package hudson.util;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.time.Duration;
@@ -9,9 +9,8 @@ import java.time.Instant;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.Logger;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import org.junit.Assert;
import org.junit.Test;
public class RetrierTest {
private static final Logger LOG = Logger.getLogger(RetrierTest.class.getName());
@@ -30,12 +30,10 @@ import static org.junit.Assert.assertThrows;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.ConversionException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Test;
/**
@@ -26,9 +26,8 @@ package hudson.util;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import hudson.model.Run;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.Issue;
@@ -1,5 +1,9 @@
package hudson.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import hudson.FilePath;
import hudson.Functions;
import hudson.model.TaskListener;
@@ -13,9 +17,6 @@ import java.util.regex.Pattern;
import javax.crypto.Cipher;
import jenkins.security.ConfidentialStoreRule;
import org.apache.commons.io.FileUtils;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -24,6 +24,14 @@
package hudson.util;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Random;
@@ -33,13 +41,6 @@ import javax.crypto.SecretKey;
import jenkins.model.Jenkins;
import jenkins.security.ConfidentialStoreRule;
import org.apache.commons.lang.RandomStringUtils;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import org.junit.Rule;
import org.junit.Test;
@@ -1,12 +1,13 @@
package hudson.util;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import static org.junit.Assert.assertEquals;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -24,18 +24,18 @@
package hudson.util;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assume.assumeNoException;
import static org.junit.Assume.assumeThat;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Field;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import org.junit.After;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assume.assumeNoException;
import static org.junit.Assume.assumeThat;
import org.junit.Before;
import org.junit.Test;
@@ -24,10 +24,11 @@
package hudson.util;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
@@ -47,7 +48,6 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import static org.hamcrest.Matchers.instanceOf;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
@@ -2,21 +2,19 @@ package hudson.util.io;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assume.assumeFalse;
import hudson.FilePath;
import hudson.Functions;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import org.apache.commons.io.FileUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.test.Issue;
import static org.junit.Assume.assumeFalse;
public class RewindableRotatingFileOutputStreamTest {
@Rule
@@ -23,6 +23,9 @@
*/
package hudson.util.io;
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeTrue;
import hudson.FilePath;
import hudson.Functions;
import hudson.Launcher.LocalLauncher;
@@ -35,9 +38,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.util.Arrays;
import static org.junit.Assert.assertEquals;
import org.junit.Assume;
import static org.junit.Assume.assumeTrue;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -9,7 +9,6 @@ import java.nio.file.Path;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
@@ -4,14 +4,13 @@ import static org.junit.Assert.assertNotNull;
import hudson.remoting.Channel;
import hudson.remoting.Which;
import org.apache.commons.io.output.NullOutputStream;
import org.junit.Test;
import java.io.File;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.NullOutputStream;
import org.junit.Test;
/**
* @author Kohsuke Kawaguchi
@@ -3,14 +3,13 @@ package jenkins.model;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.verifyStatic;
import hudson.EnvVars;
import hudson.model.Computer;
import hudson.model.Job;
import hudson.model.TaskListener;
import java.io.File;
import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -1,13 +1,13 @@
package jenkins.model;
import org.junit.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class IdStrategyTest {
@SuppressWarnings("deprecation")
@@ -25,8 +25,8 @@ package jenkins.model;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import hudson.model.JDK;
import hudson.model.JDK;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.modules.junit4.PowerMockRunner;
@@ -25,19 +25,18 @@ package jenkins.model;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.ArgumentMatchers.anyString;
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 java.net.URL;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.Issue;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import static org.mockito.ArgumentMatchers.anyString;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -24,13 +24,14 @@
package jenkins.model;
import static org.junit.Assert.assertEquals;
import static org.powermock.api.mockito.PowerMockito.mock;
import org.junit.Before;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import static org.powermock.api.mockito.PowerMockito.mock;
/**
* Tests for {@link JenkinsLocationConfiguration}.
@@ -1,20 +1,21 @@
package jenkins.model;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import hudson.model.Action;
import hudson.model.ModifiableViewGroup;
import hudson.model.View;
import hudson.model.ViewGroup;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import hudson.model.Action;
import hudson.model.ModifiableViewGroup;
import hudson.model.View;
import hudson.model.ViewGroup;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
public class NewViewLinkTest {
private NewViewLink newViewLink;
@@ -24,6 +24,12 @@
package jenkins.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import hudson.Functions;
import hudson.Util;
import hudson.util.StreamTaskListener;
@@ -38,16 +44,10 @@ import java.util.logging.Handler;
import java.util.logging.Level;
import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class RunIdMigratorTest {
@@ -24,17 +24,15 @@
package jenkins.model.labels;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
*
* @author dty
@@ -23,7 +23,6 @@
*/
package jenkins.model.lazy;
import java.io.File;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
@@ -33,11 +32,7 @@ import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import jenkins.model.lazy.AbstractLazyLoadRunMap.Direction;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
@@ -49,8 +44,12 @@ import java.util.concurrent.Future;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import jenkins.model.lazy.AbstractLazyLoadRunMap.Direction;
import jenkins.util.Timer;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
/**
@@ -23,11 +23,10 @@
*/
package jenkins.model.lazy;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import org.apache.commons.io.FileUtils;
/**
* @author Kohsuke Kawaguchi
@@ -23,15 +23,14 @@
*/
package jenkins.model.lazy;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import org.apache.commons.io.FileUtils;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
/**
* Builder for creating a {@link FakeMap}
*
@@ -3,6 +3,7 @@ package jenkins.model.lazy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
@@ -27,10 +27,9 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import org.junit.Test;
/**
* @author Kohsuke Kawaguchi
@@ -1,15 +1,5 @@
package jenkins.plugins;
import hudson.util.VersionNumber;
import jenkins.util.java.JavaUtils;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.stream.Collectors;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasItems;
@@ -18,6 +8,15 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import hudson.util.VersionNumber;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.stream.Collectors;
import jenkins.util.java.JavaUtils;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
public class DetachedPluginsUtilTest {
@Test
public void checkJaxb() {
Loaded 100 of 1284 files, more files were not shown because too many files have changed in this diff. Show more