dion 2003/07/10 23:51:13 Modified: src/test/java/org/apache/maven/util EnhancedStringTokenizerTest.java Log: Refactor duped check Revision Changes Path 1.2 +9 -15 maven/src/test/java/org/apache/maven/util/EnhancedStringTokenizerTest.java Index: EnhancedStringTokenizerTest.java =================================================================== RCS file: /home/cvs/maven/src/test/java/org/apache/maven/util/EnhancedStringTokenizerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EnhancedStringTokenizerTest.java 11 Apr 2003 18:42:53 -0000 1.1 +++ EnhancedStringTokenizerTest.java 11 Jul 2003 06:51:13 -0000 1.2 @@ -35,6 +35,14 @@ public void testSimple() { EnhancedStringTokenizer tok = new EnhancedStringTokenizer("a,b,c,d,,e,,,f,,,,,g", ","); + checkTokens(tok); + } + + /** + * @param tok The tokenizer to check + */ + private void checkTokens(EnhancedStringTokenizer tok) + { assertEquals("Token 1", "a", tok.nextToken()); assertEquals("Token 2", "b", tok.nextToken()); assertEquals("Token 3", "c", tok.nextToken()); @@ -54,21 +62,7 @@ public void testSimpleTab() { EnhancedStringTokenizer tok = new EnhancedStringTokenizer("a\tb\tc\td\t\te\t\t\tf\t\t\t\t\tg", "\t"); - assertEquals("Token 1", "a", tok.nextToken()); - assertEquals("Token 2", "b", tok.nextToken()); - assertEquals("Token 3", "c", tok.nextToken()); - assertEquals("Token 4", "d", tok.nextToken()); - assertEquals("Token 5", "", tok.nextToken()); - assertEquals("Token 6", "e", tok.nextToken()); - assertEquals("Token 7", "", tok.nextToken()); - assertEquals("Token 8", "", tok.nextToken()); - assertEquals("Token 9", "f", tok.nextToken()); - assertEquals("Token 10", "", tok.nextToken()); - assertEquals("Token 11", "", tok.nextToken()); - assertEquals("Token 12", "", tok.nextToken()); - assertEquals("Token 13", "", tok.nextToken()); - assertEquals("Token 14", "g", tok.nextToken()); - assertEquals("tok.hasMoreTokens()", false, tok.hasMoreTokens()); + checkTokens(tok); } public void testNoDelim() {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]