[LOGBack-dev] svn commit: r287 - logback/core/trunk/src/test/java/ch/qos/logback/core/pattern/parser

noreply.seb at qos.ch noreply.seb at qos.ch
Tue Jul 25 14:53:03 CEST 2006


Author: seb
Date: Tue Jul 25 14:53:02 2006
New Revision: 287

Modified:
   logback/core/trunk/src/test/java/ch/qos/logback/core/pattern/parser/TokenStreamTest.java
Log:
Type Safety

Modified: logback/core/trunk/src/test/java/ch/qos/logback/core/pattern/parser/TokenStreamTest.java
==============================================================================
--- logback/core/trunk/src/test/java/ch/qos/logback/core/pattern/parser/TokenStreamTest.java	(original)
+++ logback/core/trunk/src/test/java/ch/qos/logback/core/pattern/parser/TokenStreamTest.java	Tue Jul 25 14:53:02 2006
@@ -40,7 +40,7 @@
 
 	public void testSingleLiteral() throws ScanException {
 		List tl = new TokenStream("hello").tokenize();
-		List witness = new ArrayList();
+		List<Token> witness = new ArrayList<Token>();
 		witness.add(new Token(Token.LITERAL, "hello"));
 		assertEquals(witness, tl);
 	}
@@ -49,20 +49,20 @@
 		{
 			List tl = new TokenStream("hello\\%world").tokenize();
 
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "hello%world"));
 			assertEquals(witness, tl);
 		}
 		{
 			List tl = new TokenStream("hello\\%").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "hello%"));
 			assertEquals(witness, tl);
 		}
 
 		{
 			List tl = new TokenStream("\\%").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "%"));
 			assertEquals(witness, tl);
 		}
@@ -73,7 +73,7 @@
 		// test "%c"
 		{
 			List tl = new TokenStream("%c").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "c"));
 			assertEquals(witness, tl);
@@ -82,7 +82,7 @@
 		{
 			// test "xyz%-34c"
 			List tl = new TokenStream("%a%b").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "a"));
 			witness.add(Token.PERCENT_TOKEN);
@@ -93,7 +93,7 @@
 		{
 			// test "xyz%-34c"
 			List tl = new TokenStream("xyz%-34c").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "xyz"));
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.FORMAT_MODIFIER, "-34"));
@@ -104,7 +104,7 @@
 
 	public void testComplexNR() throws ScanException {
 		List tl = new TokenStream("%d{1234} [%34.-67toto] %n").tokenize();
-		List witness = new ArrayList();
+		List<Token> witness = new ArrayList<Token>();
 		witness.add(Token.PERCENT_TOKEN);
 		witness.add(new Token(Token.KEYWORD, "d"));
 		witness.add(new Token(Token.OPTION, "1234"));
@@ -120,7 +120,7 @@
 
 	public void testEmptyP() throws ScanException {
 		List tl = new TokenStream("()").tokenize();
-		List witness = new ArrayList();
+		List<Token> witness = new ArrayList<Token>();
 		witness.add(new Token(Token.LITERAL, "("));
 		witness.add(Token.RIGHT_PARENTHESIS_TOKEN);
 		assertEquals(witness, tl);
@@ -128,7 +128,7 @@
 
 	public void testEmptyP2() throws ScanException {
 		List tl = new TokenStream("%()").tokenize();
-		List witness = new ArrayList();
+		List<Token> witness = new ArrayList<Token>();
 		witness.add(Token.PERCENT_TOKEN);
 		witness.add(Token.LEFT_PARENTHESIS_TOKEN);
 		witness.add(Token.RIGHT_PARENTHESIS_TOKEN);
@@ -138,21 +138,21 @@
 	public void testEscape() throws ScanException {
 		{
 			List tl = new TokenStream("\\%").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "%"));
 			assertEquals(witness, tl);
 		}
 
 		{
 			List tl = new TokenStream("\\%\\(\\t\\)\\r\\n").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "%(\t)\r\n"));
 			assertEquals(witness, tl);
 		}
 
 		{
 			List tl = new TokenStream("\\\\%x").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "\\"));
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "x"));
@@ -161,7 +161,7 @@
 
 		{
 			List tl = new TokenStream("%x\\)").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "x"));
 			witness.add(new Token(Token.LITERAL, ")"));
@@ -170,7 +170,7 @@
     
     {
       List tl = new TokenStream("%x\\_a").tokenize();
-      List witness = new ArrayList();
+      List<Token> witness = new ArrayList<Token>();
       witness.add(Token.PERCENT_TOKEN);
       witness.add(new Token(Token.KEYWORD, "x"));
       witness.add(new Token(Token.LITERAL, "a"));
@@ -178,7 +178,7 @@
     }
     {
       List tl = new TokenStream("%x\\_%b").tokenize();
-      List witness = new ArrayList();
+      List<Token> witness = new ArrayList<Token>();
       witness.add(Token.PERCENT_TOKEN);
       witness.add(new Token(Token.KEYWORD, "x"));
       witness.add(Token.PERCENT_TOKEN);
@@ -190,7 +190,7 @@
 	public void testOptions() throws ScanException {
 		{
 			List tl = new TokenStream("%x{t}").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "x"));
 			witness.add(new Token(Token.OPTION, "t"));
@@ -199,7 +199,7 @@
 
 		{
 			List tl = new TokenStream("%x{t,y}").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "x"));
 			witness.add(new Token(Token.OPTION, "t,y"));
@@ -208,7 +208,7 @@
 		
 		{
 			List tl = new TokenStream("%x{\"hello world.\", \"12y  \"}").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "x"));
 			witness.add(new Token(Token.OPTION, "\"hello world.\", \"12y  \""));
@@ -217,7 +217,7 @@
 		
 		{
 			List tl = new TokenStream("%x{opt\\}}").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "x"));
 			witness.add(new Token(Token.OPTION, "opt}"));
@@ -227,7 +227,7 @@
 
 	public void testSimpleP() throws ScanException {
 		List tl = new TokenStream("%(hello %class{.4?})").tokenize();
-		List witness = new ArrayList();
+		List<Token> witness = new ArrayList<Token>();
 		witness.add(Token.PERCENT_TOKEN);
 		witness.add(Token.LEFT_PARENTHESIS_TOKEN);
 		witness.add(new Token(Token.LITERAL, "hello "));
@@ -240,7 +240,7 @@
 
 	public void testSimpleP2() throws ScanException {
 		List tl =  new TokenStream("X %a %-12.550(hello %class{.4?})").tokenize();
-		List witness = new ArrayList();
+		List<Token> witness = new ArrayList<Token>();
 		witness.add(new Token(Token.LITERAL, "X "));
 		witness.add(Token.PERCENT_TOKEN);
 		witness.add(new Token(Token.KEYWORD, "a"));
@@ -258,7 +258,7 @@
 
 	public void testMultipleRecursion() throws ScanException {
 		List tl =  new TokenStream("%-1(%d %45(%class %file))").tokenize();
-		List witness = new ArrayList();
+		List<Token> witness = new ArrayList<Token>();
 		witness.add(Token.PERCENT_TOKEN);
 		witness.add(new Token(Token.FORMAT_MODIFIER, "-1"));
 		witness.add(Token.LEFT_PARENTHESIS_TOKEN);
@@ -282,7 +282,7 @@
 	public void testNested() throws ScanException {
 		{
 			List tl = new TokenStream("%(%a%(%b))").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(Token.LEFT_PARENTHESIS_TOKEN);
 			witness.add(Token.PERCENT_TOKEN);
@@ -299,7 +299,7 @@
 
 		{
 			List tl = new TokenStream("\\(%h\\)").tokenize();
-			List witness = new ArrayList();
+			List<Token> witness = new ArrayList<Token>();
 			witness.add(new Token(Token.LITERAL, "("));
 			witness.add(Token.PERCENT_TOKEN);
 			witness.add(new Token(Token.KEYWORD, "h"));



More information about the logback-dev mailing list