KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > groovy > syntax > lexer > LexerTokenStreamTest


1 package org.codehaus.groovy.syntax.lexer;
2
3 import groovy.util.GroovyTestCase;
4
5 import org.codehaus.groovy.syntax.Token;
6
7 public class LexerTokenStreamTest
8     extends GroovyTestCase
9 {
10
11     public void testNothing()
12     {
13     }
14
15 /*
16     public void testConstruct()
17     {
18         StringCharStream chars = new StringCharStream( "()" );
19         Lexer lexer = new Lexer( chars );
20         LexerTokenStream tokens = new LexerTokenStream( lexer );
21
22         assertSame( lexer,
23                     tokens.getLexer() );
24     }
25
26     public void testNextToken()
27         throws Exception
28     {
29         StringCharStream chars = new StringCharStream( "()" );
30         Lexer lexer = new Lexer( chars );
31         LexerTokenStream tokens = new LexerTokenStream( lexer );
32
33         assertToken( tokens.nextToken(),
34                      "(",
35                      Token.LEFT_PARENTHESIS );
36
37         assertToken( tokens.nextToken(),
38                      ")",
39                      Token.RIGHT_PARENTHESIS );
40
41         assertNull( tokens.nextToken() );
42     }
43
44     protected void assertToken(Token token,
45                                String text,
46                                int type)
47     {
48         assertEquals( text,
49                       token.getText() );
50
51         assertEquals( type,
52                       token.getType() );
53     }
54
55 */

56 }
57
Popular Tags