org.apache.velocity.test
Class StrictReferenceTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.velocity.test.BaseEvalTestCase
              extended by org.apache.velocity.test.StrictReferenceTestCase
All Implemented Interfaces:
junit.framework.Test

public class StrictReferenceTestCase
extends BaseEvalTestCase

Test strict reference mode turned on by the velocity property runtime.references.strict


Nested Class Summary
static class StrictReferenceTestCase.Fargo
           
 
Field Summary
 
Fields inherited from class org.apache.velocity.test.BaseEvalTestCase
context, DEBUG, engine, log
 
Constructor Summary
StrictReferenceTestCase(String name)
           
 
Method Summary
 void assertMethodEx(String template)
          Assert that we get a MethodInvocationException when calling evaluate
 void assertParseEx(String template)
          Assert that we get a MethodInvocationException when calling evaluate
 void assertVelocityEx(String template)
          Assert that we get a VelocityException when calling evaluate
 void setUp()
           
 void testAllowNullValues()
          We make sure that variables can actuall hold null values.
 void testIfStatement()
          Test the modified behavior of #if in strict mode.
 void testMacros()
          Make sure undefined macros throw exceptions
 void testStrictMethodOnNull()
          Make sure exceptions are thrown when when we attempt to call methods on null values.
 void testStrictMethodRef()
          Test that exceptions are thrown when methods are called on references that contains objects that do not contains those methods.
 void testStrictVariableRef()
          Test that variables references that have not been defined throw exceptions
 
Methods inherited from class org.apache.velocity.test.BaseEvalTestCase
assertContextValue, assertEvalEquals, assertEvalException, assertEvalException, assertEvalExceptionAt, assertEvalExceptionAt, evaluate, setContext, setProperties, tearDown, testBase
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StrictReferenceTestCase

public StrictReferenceTestCase(String name)
Method Detail

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class BaseEvalTestCase
Throws:
Exception

testIfStatement

public void testIfStatement()
Test the modified behavior of #if in strict mode. Mainly, that single variables references in #if statements use non strict rules


testAllowNullValues

public void testAllowNullValues()
                         throws Exception
We make sure that variables can actuall hold null values.

Throws:
Exception

testStrictVariableRef

public void testStrictVariableRef()
                           throws Exception
Test that variables references that have not been defined throw exceptions

Throws:
Exception

testStrictMethodRef

public void testStrictMethodRef()
Test that exceptions are thrown when methods are called on references that contains objects that do not contains those methods.


testStrictMethodOnNull

public void testStrictMethodOnNull()
Make sure exceptions are thrown when when we attempt to call methods on null values.


testMacros

public void testMacros()
Make sure undefined macros throw exceptions


assertMethodEx

public void assertMethodEx(String template)
Assert that we get a MethodInvocationException when calling evaluate


assertVelocityEx

public void assertVelocityEx(String template)
Assert that we get a VelocityException when calling evaluate


assertParseEx

public void assertParseEx(String template)
Assert that we get a MethodInvocationException when calling evaluate



Copyright © 2000-2008 The Apache Software Foundation. All Rights Reserved.