java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.presumo.jms.selector.SelectorTests
- All Implemented Interfaces:
- junit.framework.Test
- public class SelectorTests
- extends junit.framework.TestCase
Unit test used to exercise the sql-jms filter; This class was generated
during initial development. It should be maintained along with the
rest of the code in this package.
The class is meant to test package protected functionality and thus should
remain in this package.
| Fields inherited from class junit.framework.TestCase |
|
| 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 |
VERBOSE
private static final boolean VERBOSE
- See Also:
- Constant Field Values
VALID_MESSAGE
private static final int VALID_MESSAGE
- See Also:
- Constant Field Values
INVALID_MESSAGE
private static final int INVALID_MESSAGE
- See Also:
- Constant Field Values
message1
private javax.jms.Message message1
message2
private static javax.jms.Message message2
negativeParseTests
private java.lang.String[] negativeParseTests
filterTests
private java.lang.Object[][] filterTests
SelectorTests
public SelectorTests(java.lang.String name)
suite
public static junit.framework.Test suite()
testNegativeParseCases
public void testNegativeParseCases()
- Unit Test #1: Negative parse tests to make sure the parser detects
invalid filters properly. To add more tests modify the
array
negativeParseTest
A runtime exception will be thrown if the test fails
testBasicEvaluations
public void testBasicEvaluations()
- Unit Test #2: Tests both valid parsing and evaluations. Add
filters to
filterTests for additional test cases.
A runtime exception will be thrown if the test fails
testUnparse
public void testUnparse()
- Unit Test #3: Tests unparsing technology. Every filter in filterTests
will be parsed, then unparsed. The unparsed string is then parsed
and tested to see if it is the exact same as the original parsed filter.
The test will throw a runtime exception if it fails.
testOrTogether
public void testOrTogether()
- Unit Test #4: Test to make sure that when multiple logically
equivelant filters are or'd together the resulting filter
is the same as the original filter. Basically checking to see
if duplicates are removed.
The test will throw a runtime exception if it fails.
testDelete
public void testDelete()
- Unit Test #5: First test to see if basic delete function didn't
throw any exceptions.
testForMemoryLeaks
public void testForMemoryLeaks()
- Unit Test #6: Memory leak test. Tries to expose any memory leaks
by creating random filters and letting them go out of scope.
This is a manual test in that you must run the test for an
extended period of time and verify that memory usage does not
increase.
generateRandomFilter
private JmsOperand generateRandomFilter()
parseFilter
private JmsOperand parseFilter(java.lang.String filter,
boolean shouldParse)
evaluateFilter
private void evaluateFilter(java.lang.String filter,
JmsOperand root,
javax.jms.Message _message,
boolean shouldPass)
checkDelete
private void checkDelete()
- Convience method to check to see if all filters have been succssefully
deleted.
printTree
private void printTree(JmsOperand root)
verbose
public void verbose(java.lang.Object output)
main
public static void main(java.lang.String[] args)