Remove test wildcard imports
This patch applies the de-facto project's coding standard on the test files and replaces wildcard static imports with series of single method imports.
This commit is contained in:
parent
bf80b9e280
commit
6bc8650ed4
|
@ -17,7 +17,10 @@
|
|||
|
||||
package org.apache.commons.lang3;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
|
@ -16,13 +16,16 @@
|
|||
*/
|
||||
package org.apache.commons.lang3;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
|
@ -47,27 +50,27 @@ public class CharSequenceUtilsTest {
|
|||
//
|
||||
// null input
|
||||
//
|
||||
Assert.assertEquals(null, CharSequenceUtils.subSequence(null, -1));
|
||||
Assert.assertEquals(null, CharSequenceUtils.subSequence(null, 0));
|
||||
Assert.assertEquals(null, CharSequenceUtils.subSequence(null, 1));
|
||||
assertEquals(null, CharSequenceUtils.subSequence(null, -1));
|
||||
assertEquals(null, CharSequenceUtils.subSequence(null, 0));
|
||||
assertEquals(null, CharSequenceUtils.subSequence(null, 1));
|
||||
//
|
||||
// non-null input
|
||||
//
|
||||
Assert.assertEquals(StringUtils.EMPTY, CharSequenceUtils.subSequence(StringUtils.EMPTY, 0));
|
||||
Assert.assertEquals("012", CharSequenceUtils.subSequence("012", 0));
|
||||
Assert.assertEquals("12", CharSequenceUtils.subSequence("012", 1));
|
||||
Assert.assertEquals("2", CharSequenceUtils.subSequence("012", 2));
|
||||
Assert.assertEquals(StringUtils.EMPTY, CharSequenceUtils.subSequence("012", 3));
|
||||
assertEquals(StringUtils.EMPTY, CharSequenceUtils.subSequence(StringUtils.EMPTY, 0));
|
||||
assertEquals("012", CharSequenceUtils.subSequence("012", 0));
|
||||
assertEquals("12", CharSequenceUtils.subSequence("012", 1));
|
||||
assertEquals("2", CharSequenceUtils.subSequence("012", 2));
|
||||
assertEquals(StringUtils.EMPTY, CharSequenceUtils.subSequence("012", 3));
|
||||
}
|
||||
|
||||
@Test(expected=IndexOutOfBoundsException.class)
|
||||
public void testSubSequenceNegativeStart() {
|
||||
Assert.assertEquals(null, CharSequenceUtils.subSequence(StringUtils.EMPTY, -1));
|
||||
assertEquals(null, CharSequenceUtils.subSequence(StringUtils.EMPTY, -1));
|
||||
}
|
||||
|
||||
@Test(expected=IndexOutOfBoundsException.class)
|
||||
public void testSubSequenceTooLong() {
|
||||
Assert.assertEquals(null, CharSequenceUtils.subSequence(StringUtils.EMPTY, 1));
|
||||
assertEquals(null, CharSequenceUtils.subSequence(StringUtils.EMPTY, 1));
|
||||
}
|
||||
|
||||
static class TestData{
|
||||
|
@ -142,15 +145,15 @@ public class CharSequenceUtilsTest {
|
|||
if (data.throwable != null) {
|
||||
try {
|
||||
invoke();
|
||||
Assert.fail(id + " Expected " + data.throwable);
|
||||
fail(id + " Expected " + data.throwable);
|
||||
} catch (final Exception e) {
|
||||
if (!e.getClass().equals(data.throwable)) {
|
||||
Assert.fail(id + " Expected " + data.throwable + " got " + e.getClass());
|
||||
fail(id + " Expected " + data.throwable + " got " + e.getClass());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final boolean stringCheck = invoke();
|
||||
Assert.assertEquals(id + " Failed test " + data, data.expected, stringCheck);
|
||||
assertEquals(id + " Failed test " + data, data.expected, stringCheck);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@ package org.apache.commons.lang3;
|
|||
import org.junit.Test;
|
||||
|
||||
import static org.apache.commons.lang3.JavaVersion.JAVA_RECENT;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.apache.commons.lang3.JavaVersion.JAVA_0_9;
|
||||
import static org.apache.commons.lang3.JavaVersion.JAVA_1_1;
|
||||
import static org.apache.commons.lang3.JavaVersion.JAVA_1_2;
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
package org.apache.commons.lang3;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.apache.commons.lang3.text.StrBuilder;
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,14 @@
|
|||
*/
|
||||
package org.apache.commons.lang3;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
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.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Constructor;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.lang3.builder;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
|
@ -18,7 +18,13 @@ package org.apache.commons.lang3.concurrent;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
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.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
|
|
@ -19,7 +19,8 @@ package org.apache.commons.lang3.exception;
|
|||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -16,8 +16,13 @@
|
|||
*/
|
||||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -17,7 +17,11 @@
|
|||
package org.apache.commons.lang3.mutable;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* JUnit tests.
|
||||
|
|
|
@ -17,7 +17,15 @@
|
|||
package org.apache.commons.lang3.reflect;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.reflect.testbed.*;
|
||||
|
||||
import org.apache.commons.lang3.reflect.testbed.Ambig;
|
||||
import org.apache.commons.lang3.reflect.testbed.Annotated;
|
||||
import org.apache.commons.lang3.reflect.testbed.Foo;
|
||||
import org.apache.commons.lang3.reflect.testbed.PrivatelyShadowedChild;
|
||||
import org.apache.commons.lang3.reflect.testbed.PublicChild;
|
||||
import org.apache.commons.lang3.reflect.testbed.PubliclyShadowedChild;
|
||||
import org.apache.commons.lang3.reflect.testbed.StaticContainer;
|
||||
import org.apache.commons.lang3.reflect.testbed.StaticContainerChild;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -28,7 +36,13 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
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 static org.junit.Assume.assumeNotNull;
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
package org.apache.commons.lang3.text;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.text.FieldPosition;
|
||||
import java.text.Format;
|
||||
import java.text.ParsePosition;
|
||||
|
|
|
@ -18,7 +18,10 @@ package org.apache.commons.lang3.text;
|
|||
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.FieldPosition;
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
package org.apache.commons.lang3.text;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -18,7 +18,14 @@
|
|||
package org.apache.commons.lang3.text;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
|
|
@ -19,7 +19,11 @@ package org.apache.commons.lang3.text;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -16,7 +16,10 @@
|
|||
*/
|
||||
package org.apache.commons.lang3.text;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.lang3.text.translate;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link org.apache.commons.lang3.text.translate.OctalUnescaper}.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.apache.commons.lang3.text.translate;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.CharArrayWriter;
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -18,7 +18,9 @@ package org.apache.commons.lang3.time;
|
|||
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
|
@ -18,7 +18,10 @@ package org.apache.commons.lang3.time;
|
|||
|
||||
import org.junit.Test;
|
||||
import org.junit.Before;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
|
Loading…
Reference in New Issue