You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/01/12 15:32:05 UTC
[commons-collections] 02/03: Sort Sort methods.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 45eee00385886461b0c0538496a9777c69637de5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 12 10:25:21 2020 -0500
Sort Sort methods.
---
.../commons/collections4/EnumerationUtilsTest.java | 66 +++++++++++-----------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/src/test/java/org/apache/commons/collections4/EnumerationUtilsTest.java b/src/test/java/org/apache/commons/collections4/EnumerationUtilsTest.java
index 057f9f9..c263c79 100644
--- a/src/test/java/org/apache/commons/collections4/EnumerationUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/EnumerationUtilsTest.java
@@ -38,21 +38,24 @@ public class EnumerationUtilsTest {
public static final String TO_LIST_FIXTURE = "this is a test";
@Test
- public void testToListWithStringTokenizer() {
- final List<String> expectedList1 = new ArrayList<>();
- final StringTokenizer st = new StringTokenizer(TO_LIST_FIXTURE);
- while (st.hasMoreTokens()) {
- expectedList1.add(st.nextToken());
- }
- final List<String> expectedList2 = new ArrayList<>();
- expectedList2.add("this");
- expectedList2.add("is");
- expectedList2.add("a");
- expectedList2.add("test");
- final List<String> actualList = EnumerationUtils.toList(new StringTokenizer(TO_LIST_FIXTURE));
- assertEquals(expectedList1, expectedList2);
- assertEquals(expectedList1, actualList);
- assertEquals(expectedList2, actualList);
+ public void getFromEnumeration() throws Exception {
+ // Enumeration, entry exists
+ final Vector<String> vector = new Vector<>();
+ vector.addElement("zero");
+ vector.addElement("one");
+ Enumeration<String> en = vector.elements();
+ assertEquals("zero", EnumerationUtils.get(en, 0));
+ en = vector.elements();
+ assertEquals("one", EnumerationUtils.get(en, 1));
+
+ // Enumerator, non-existent entry
+ try {
+ EnumerationUtils.get(en, 3);
+ fail("Expecting IndexOutOfBoundsException.");
+ } catch (final IndexOutOfBoundsException e) {
+ // expected
+ }
+ assertTrue(!en.hasMoreElements());
}
@Test
@@ -87,24 +90,21 @@ public class EnumerationUtilsTest {
}
@Test
- public void getFromEnumeration() throws Exception {
- // Enumeration, entry exists
- final Vector<String> vector = new Vector<>();
- vector.addElement("zero");
- vector.addElement("one");
- Enumeration<String> en = vector.elements();
- assertEquals("zero", EnumerationUtils.get(en, 0));
- en = vector.elements();
- assertEquals("one", EnumerationUtils.get(en, 1));
-
- // Enumerator, non-existent entry
- try {
- EnumerationUtils.get(en, 3);
- fail("Expecting IndexOutOfBoundsException.");
- } catch (final IndexOutOfBoundsException e) {
- // expected
- }
- assertTrue(!en.hasMoreElements());
+ public void testToListWithStringTokenizer() {
+ final List<String> expectedList1 = new ArrayList<>();
+ final StringTokenizer st = new StringTokenizer(TO_LIST_FIXTURE);
+ while (st.hasMoreTokens()) {
+ expectedList1.add(st.nextToken());
+ }
+ final List<String> expectedList2 = new ArrayList<>();
+ expectedList2.add("this");
+ expectedList2.add("is");
+ expectedList2.add("a");
+ expectedList2.add("test");
+ final List<String> actualList = EnumerationUtils.toList(new StringTokenizer(TO_LIST_FIXTURE));
+ assertEquals(expectedList1, expectedList2);
+ assertEquals(expectedList1, actualList);
+ assertEquals(expectedList2, actualList);
}
}