mirror of
https://github.com/apache/commons-lang.git
synced 2025-03-02 22:19:13 +00:00
Javadoc
- No need to FQCN in link tag to the same package - Use longer lines
This commit is contained in:
parent
b850d804ac
commit
b19c82a7ce
@ -40,7 +40,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.ArrayUtils}.
|
||||
* Unit tests {@link ArrayUtils}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // deliberate use of deprecated code
|
||||
public class ArrayUtilsTest extends AbstractLangTest {
|
||||
|
@ -32,7 +32,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.CharRange}.
|
||||
* Unit tests {@link CharRange}.
|
||||
*/
|
||||
public class CharRangeTest extends AbstractLangTest {
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.CharSet}.
|
||||
* Unit tests {@link CharSet}.
|
||||
*/
|
||||
public class CharSetTest extends AbstractLangTest {
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.CharSetUtils}.
|
||||
* Unit tests {@link CharSetUtils}.
|
||||
*/
|
||||
public class CharSetUtilsTest extends AbstractLangTest {
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.CharUtils}.
|
||||
* Unit tests {@link CharUtils}.
|
||||
*/
|
||||
public class CharUtilsTest extends AbstractLangTest {
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.ClassUtils}.
|
||||
* Unit tests {@link ClassUtils}.
|
||||
*/
|
||||
@SuppressWarnings("boxing") // JUnit4 does not support primitive equality testing apart from long
|
||||
public class ClassUtilsTest extends AbstractLangTest {
|
||||
|
@ -37,7 +37,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.JavaVersion}.
|
||||
* Unit tests {@link JavaVersion}.
|
||||
*/
|
||||
public class JavaVersionTest extends AbstractLangTest {
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.NotImplementedException}.
|
||||
* Unit tests {@link NotImplementedException}.
|
||||
*/
|
||||
public class NotImplementedExceptionTest extends AbstractLangTest {
|
||||
|
||||
|
@ -54,7 +54,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.ObjectUtils}.
|
||||
* Unit tests {@link ObjectUtils}.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // deliberate use of deprecated code
|
||||
public class ObjectUtilsTest extends AbstractLangTest {
|
||||
|
@ -38,7 +38,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Tests {@link org.apache.commons.lang3.RandomStringUtils}.
|
||||
* Tests {@link RandomStringUtils}.
|
||||
*/
|
||||
public class RandomStringUtilsTest extends AbstractLangTest {
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Tests {@link org.apache.commons.lang3.RegExUtils}.
|
||||
* Tests {@link RegExUtils}.
|
||||
*/
|
||||
public class RegExUtilsTest extends AbstractLangTest {
|
||||
|
||||
|
@ -51,7 +51,7 @@ private void readObject(final ObjectInputStream in) throws ClassNotFoundExceptio
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.SerializationUtils}.
|
||||
* Unit tests {@link SerializationUtils}.
|
||||
*/
|
||||
public class SerializationUtilsTest extends AbstractLangTest {
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
import org.junitpioneer.jupiter.DefaultLocale;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - Contains methods
|
||||
* Unit tests {@link StringUtils} - Contains methods
|
||||
*/
|
||||
public class StringUtilsContainsTest extends AbstractLangTest {
|
||||
@Test
|
||||
|
@ -24,7 +24,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - Empty/Blank methods
|
||||
* Unit tests {@link StringUtils} - Empty/Blank methods
|
||||
*/
|
||||
public class StringUtilsEmptyBlankTest extends AbstractLangTest {
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - Equals/IndexOf methods
|
||||
* Unit tests {@link StringUtils} - Equals/IndexOf methods
|
||||
*/
|
||||
public class StringUtilsEqualsIndexOfTest extends AbstractLangTest {
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - IsX methods
|
||||
* Unit tests {@link StringUtils} - IsX methods
|
||||
*/
|
||||
public class StringUtilsIsTest extends AbstractLangTest {
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - StartsWith/EndsWith methods
|
||||
* Unit tests {@link StringUtils} - StartsWith/EndsWith methods
|
||||
*/
|
||||
public class StringUtilsStartsEndsWithTest extends AbstractLangTest {
|
||||
private static final String foo = "foo";
|
||||
|
@ -23,7 +23,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - Substring methods
|
||||
* Unit tests {@link StringUtils} - Substring methods
|
||||
*/
|
||||
public class StringUtilsSubstringTest extends AbstractLangTest {
|
||||
private static final String FOO = "foo";
|
||||
|
@ -53,7 +53,7 @@
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
/**
|
||||
* Unit tests for methods of {@link org.apache.commons.lang3.StringUtils}
|
||||
* Unit tests for methods of {@link StringUtils}
|
||||
* which been moved to their own test classes.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // deliberate use of deprecated code
|
||||
|
@ -24,7 +24,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.StringUtils} - Trim/Strip methods
|
||||
* Tests {@link StringUtils} Trim/Strip methods.
|
||||
*/
|
||||
public class StringUtilsTrimStripTest extends AbstractLangTest {
|
||||
private static final String FOO = "foo";
|
||||
@ -36,7 +36,7 @@ public void testStrip_String() {
|
||||
assertEquals("", StringUtils.strip(" "));
|
||||
assertEquals("abc", StringUtils.strip(" abc "));
|
||||
assertEquals(StringUtilsTest.NON_WHITESPACE,
|
||||
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
|
||||
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -47,7 +47,7 @@ public void testStrip_StringString() {
|
||||
assertEquals("", StringUtils.strip(" ", null));
|
||||
assertEquals("abc", StringUtils.strip(" abc ", null));
|
||||
assertEquals(StringUtilsTest.NON_WHITESPACE,
|
||||
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));
|
||||
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));
|
||||
|
||||
// "" strip
|
||||
assertNull(StringUtils.strip(null, ""));
|
||||
@ -76,31 +76,24 @@ public void testStripAccents() {
|
||||
final String cue = "\u00C7\u00FA\u00EA";
|
||||
assertEquals("Cue", StringUtils.stripAccents(cue), "Failed to strip accents from " + cue);
|
||||
|
||||
final String lots = "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C7\u00C8\u00C9" +
|
||||
"\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D1\u00D2\u00D3" +
|
||||
"\u00D4\u00D5\u00D6\u00D9\u00DA\u00DB\u00DC\u00DD";
|
||||
assertEquals("AAAAAACEEEEIIIINOOOOOUUUUY",
|
||||
StringUtils.stripAccents(lots),
|
||||
"Failed to strip accents from " + lots);
|
||||
final String lots = "\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC\u00CD\u00CE\u00CF\u00D1\u00D2\u00D3"
|
||||
+ "\u00D4\u00D5\u00D6\u00D9\u00DA\u00DB\u00DC\u00DD";
|
||||
assertEquals("AAAAAACEEEEIIIINOOOOOUUUUY", StringUtils.stripAccents(lots), "Failed to strip accents from " + lots);
|
||||
|
||||
assertNull(StringUtils.stripAccents(null), "Failed null safety");
|
||||
assertEquals("", StringUtils.stripAccents(""), "Failed empty String");
|
||||
assertEquals("control", StringUtils.stripAccents("control"), "Failed to handle non-accented text");
|
||||
assertEquals("eclair", StringUtils.stripAccents("\u00E9clair"), "Failed to handle easy example");
|
||||
assertEquals("ALOSZZCN aloszzcn", StringUtils.stripAccents("\u0104\u0141\u00D3\u015A\u017B\u0179\u0106\u0143 "
|
||||
+ "\u0105\u0142\u00F3\u015B\u017C\u017A\u0107\u0144"));
|
||||
assertEquals("The cafe\u2019s pinata gave me deja vu.", StringUtils
|
||||
.stripAccents("The caf\u00e9\u2019s pi\u00f1ata gave me d\u00e9j\u00e0 vu."),
|
||||
assertEquals("ALOSZZCN aloszzcn",
|
||||
StringUtils.stripAccents("\u0104\u0141\u00D3\u015A\u017B\u0179\u0106\u0143 \u0105\u0142\u00F3\u015B\u017C\u017A\u0107\u0144"));
|
||||
assertEquals("The cafe\u2019s pinata gave me deja vu.", StringUtils.stripAccents("The caf\u00e9\u2019s pi\u00f1ata gave me d\u00e9j\u00e0 vu."),
|
||||
"Failed to handle accented text");
|
||||
assertEquals("fluid quest", StringUtils.stripAccents("\ufb02uid que\ufb06"), "Failed to handle ligatures");
|
||||
assertEquals("a b c 1 2 3", StringUtils
|
||||
.stripAccents("\u1d43 \u1d47 \u1d9c \u00b9 \u00b2 \u00b3"), "Failed to handle superscript text");
|
||||
assertEquals("math italic", StringUtils
|
||||
.stripAccents("\uD835\uDC5A\uD835\uDC4E\uD835\uDC61\u210E " +
|
||||
"\uD835\uDC56\uD835\uDC61\uD835\uDC4E\uD835\uDC59\uD835\uDC56\uD835\uDC50"),
|
||||
assertEquals("a b c 1 2 3", StringUtils.stripAccents("\u1d43 \u1d47 \u1d9c \u00b9 \u00b2 \u00b3"), "Failed to handle superscript text");
|
||||
assertEquals("math italic",
|
||||
StringUtils.stripAccents("\uD835\uDC5A\uD835\uDC4E\uD835\uDC61\u210E \uD835\uDC56\uD835\uDC61\uD835\uDC4E\uD835\uDC59\uD835\uDC56\uD835\uDC50"),
|
||||
"Failed to handle UTF32 example");
|
||||
assertEquals("\uD83D\uDF01 \uD83D\uDF02 \uD83D\uDF03 \uD83D\uDF04", StringUtils
|
||||
.stripAccents("\uD83D\uDF01 \uD83D\uDF02 \uD83D\uDF03 \uD83D\uDF04"),
|
||||
assertEquals("\uD83D\uDF01 \uD83D\uDF02 \uD83D\uDF03 \uD83D\uDF04", StringUtils.stripAccents("\uD83D\uDF01 \uD83D\uDF02 \uD83D\uDF03 \uD83D\uDF04"),
|
||||
"Failed to handle non-accented text");
|
||||
}
|
||||
|
||||
@ -108,8 +101,7 @@ public void testStripAccents() {
|
||||
@Disabled
|
||||
public void testStripAccents_Korean() {
|
||||
// LANG-1655
|
||||
final String input = "\uC78A\uC9C0\uB9C8 \uB10C \uD750\uB9B0 \uC5B4\uB460\uC0AC\uC774 " +
|
||||
"\uC67C\uC190\uC73C\uB85C \uADF8\uB9B0 \uBCC4 \uD558\uB098";
|
||||
final String input = "\uC78A\uC9C0\uB9C8 \uB10C \uD750\uB9B0 \uC5B4\uB460\uC0AC\uC774 " + "\uC67C\uC190\uC73C\uB85C \uADF8\uB9B0 \uBCC4 \uD558\uB098";
|
||||
assertEquals(input, StringUtils.stripAccents(input), "Failed to handle Korean text");
|
||||
|
||||
}
|
||||
@ -118,14 +110,14 @@ public void testStripAccents_Korean() {
|
||||
public void testStripAll() {
|
||||
// test stripAll method, merely an array version of the above strip
|
||||
final String[] empty = {};
|
||||
final String[] fooSpace = { " "+FOO+" ", " "+FOO, FOO+" " };
|
||||
final String[] fooDots = { ".."+FOO+"..", ".."+FOO, FOO+".." };
|
||||
final String[] fooSpace = { " " + FOO + " ", " " + FOO, FOO + " " };
|
||||
final String[] fooDots = { ".." + FOO + "..", ".." + FOO, FOO + ".." };
|
||||
final String[] foo = { FOO, FOO, FOO };
|
||||
|
||||
assertNull(StringUtils.stripAll((String[]) null));
|
||||
// Additional varargs tests
|
||||
assertArrayEquals(empty, StringUtils.stripAll()); // empty array
|
||||
assertArrayEquals(new String[]{null}, StringUtils.stripAll((String) null)); // == new String[]{null}
|
||||
assertArrayEquals(new String[] { null }, StringUtils.stripAll((String) null)); // == new String[]{null}
|
||||
|
||||
assertArrayEquals(empty, StringUtils.stripAll(empty));
|
||||
assertArrayEquals(foo, StringUtils.stripAll(fooSpace));
|
||||
@ -143,7 +135,7 @@ public void testStripEnd_StringString() {
|
||||
assertEquals("", StringUtils.stripEnd(" ", null));
|
||||
assertEquals(" abc", StringUtils.stripEnd(" abc ", null));
|
||||
assertEquals(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE,
|
||||
StringUtils.stripEnd(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));
|
||||
StringUtils.stripEnd(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));
|
||||
|
||||
// "" stripEnd
|
||||
assertNull(StringUtils.stripEnd(null, ""));
|
||||
@ -175,7 +167,7 @@ public void testStripStart_StringString() {
|
||||
assertEquals("", StringUtils.stripStart(" ", null));
|
||||
assertEquals("abc ", StringUtils.stripStart(" abc ", null));
|
||||
assertEquals(StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE,
|
||||
StringUtils.stripStart(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));
|
||||
StringUtils.stripStart(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));
|
||||
|
||||
// "" stripStart
|
||||
assertNull(StringUtils.stripStart(null, ""));
|
||||
@ -207,7 +199,7 @@ public void testStripToEmpty_String() {
|
||||
assertEquals("", StringUtils.stripToEmpty(StringUtilsTest.WHITESPACE));
|
||||
assertEquals("ab c", StringUtils.stripToEmpty(" ab c "));
|
||||
assertEquals(StringUtilsTest.NON_WHITESPACE,
|
||||
StringUtils.stripToEmpty(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
|
||||
StringUtils.stripToEmpty(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -218,7 +210,7 @@ public void testStripToNull_String() {
|
||||
assertNull(StringUtils.stripToNull(StringUtilsTest.WHITESPACE));
|
||||
assertEquals("ab c", StringUtils.stripToNull(" ab c "));
|
||||
assertEquals(StringUtilsTest.NON_WHITESPACE,
|
||||
StringUtils.stripToNull(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
|
||||
StringUtils.stripToNull(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -47,7 +47,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.SystemUtils}.
|
||||
* Unit tests {@link SystemUtils}.
|
||||
*
|
||||
* Only limited testing can be performed.
|
||||
*/
|
||||
|
@ -44,7 +44,7 @@
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Unit tests {@link org.apache.commons.lang3.ThreadUtils}.
|
||||
* Unit tests {@link ThreadUtils}.
|
||||
*/
|
||||
public class ThreadUtilsTest extends AbstractLangTest {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user