org.antlr.test
Class TestUnBufferedTreeNodeStream

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.antlr.test.BaseTest
              extended by org.antlr.test.TestTreeNodeStream
                  extended by org.antlr.test.TestUnBufferedTreeNodeStream
All Implemented Interfaces:
junit.framework.Test

public class TestUnBufferedTreeNodeStream
extends TestTreeNodeStream

Created by IntelliJ IDEA. User: parrt Date: Dec 22, 2006 Time: 11:47:55 AM To change this template use File | Settings | File Templates.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.antlr.test.BaseTest
BaseTest.StreamVacuum
 
Field Summary
 
Fields inherited from class org.antlr.test.BaseTest
CLASSPATH, jikes, pathSep, stderr, tmpdir
 
Constructor Summary
TestUnBufferedTreeNodeStream()
           
 
Method Summary
 TreeNodeStream newStream(java.lang.Object t)
          Build new stream; let's us override to test other streams.
 void testBufferOverflow()
           
 void testBufferWrap()
          Test what happens when tail hits the end of the buffer, but there is more room left.
 
Methods inherited from class org.antlr.test.TestTreeNodeStream
test4Nodes, testAoverB, testFlatList, testList, testListWithOneNode, testLT, testMarkRewindEntire, testMarkRewindInMiddle, testMarkRewindNested, testSeek, testSeekFromStart, testSingleNode, toNodesOnlyString
 
Methods inherited from class org.antlr.test.BaseTest
antlr, compile, eraseFiles, execParser, execTreeParser, execTreeParser, getFirstLineOfException, mkdir, newTool, rawExecRecognizer, rawGenerateAndBuildRecognizer, writeFile, writeTemplateTestFile, writeTestFile, writeTreeTestFile
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestUnBufferedTreeNodeStream

public TestUnBufferedTreeNodeStream()
Method Detail

newStream

public TreeNodeStream newStream(java.lang.Object t)
Description copied from class: TestTreeNodeStream
Build new stream; let's us override to test other streams.

Overrides:
newStream in class TestTreeNodeStream

testBufferOverflow

public void testBufferOverflow()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testBufferWrap

public void testBufferWrap()
                    throws java.lang.Exception
Test what happens when tail hits the end of the buffer, but there is more room left. Specifically that would mean that head is not at 0 but has advanced somewhere to the middle of the lookahead buffer. Use consume() to advance N nodes into lookahead. Then use LT() to load at least INITIAL_LOOKAHEAD_BUFFER_SIZE-N nodes so the buffer has to wrap.

Throws:
java.lang.Exception