org.eigenbase.test
Class SargTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eigenbase.test.SargTest
All Implemented Interfaces:
Test

public class SargTest
extends TestCase

SargTest tests the org.eigenbase.sarg class library.

NOTE jvs 17-Jan-2006: This class lives in org.eigenbase.test rather than org.eigenbase.sarg by design: we want to make sure we're only testing via the public interface.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/test/SargTest.java#15 $
Author:
John V. Sichi

Nested Class Summary
(package private) static class SargTest.Zodiac
           
 
Field Summary
private  SargIntervalExpr[] exprs
           
private  RexNode intLiteral490
           
private  RexNode intLiteral7
           
private  RexNode intLiteral8point5
           
private  RelDataType intType
           
private  RexBuilder rexBuilder
           
private  SargFactory sargFactory
           
private  RelDataType stringType
           
 
Constructor Summary
SargTest(String testCaseName)
          Initializes a new SargTest.
 
Method Summary
private  void assertRange(SargIntervalExpr interval)
           
private  void checkIntersection(int i1, int i2, int i3, String expected)
           
private  void checkSetOp(SargSetOperator setOp, int i1, int i2, int i3, String expected)
           
private  void checkUnion(int i1, int i2, int i3, String expected)
           
private  RexNode createCoordinate(SargTest.Zodiac z)
           
 void setUp()
           
 void testComplement()
           
 void testDefaultEndpoint()
           
 void testDefaultIntervalExpr()
           
 void testEmptyExpr()
           
 void testFiniteEndpoint()
           
 void testInfiniteEndpoint()
           
 void testIntersection()
           
 void testNullEndpoint()
           
 void testNullExpr()
           
 void testPointExpr()
           
 void testRangeIntervalExpr()
           
 void testRexAnalyzer()
           
 void testSetExpr()
           
 void testTouchingEndpoint()
           
 void testUnconstrainedExpr()
           
 void testUnion()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sargFactory

private SargFactory sargFactory

rexBuilder

private RexBuilder rexBuilder

intType

private RelDataType intType

stringType

private RelDataType stringType

intLiteral7

private RexNode intLiteral7

intLiteral8point5

private RexNode intLiteral8point5

intLiteral490

private RexNode intLiteral490

exprs

private SargIntervalExpr[] exprs
Constructor Detail

SargTest

public SargTest(String testCaseName)
         throws Exception
Initializes a new SargTest.

Parameters:
testCaseName - JUnit test case name
Throws:
Exception
Method Detail

setUp

public void setUp()
Overrides:
setUp in class TestCase

testDefaultEndpoint

public void testDefaultEndpoint()

testInfiniteEndpoint

public void testInfiniteEndpoint()

testFiniteEndpoint

public void testFiniteEndpoint()

testNullEndpoint

public void testNullEndpoint()

testTouchingEndpoint

public void testTouchingEndpoint()

testDefaultIntervalExpr

public void testDefaultIntervalExpr()

testPointExpr

public void testPointExpr()

testRangeIntervalExpr

public void testRangeIntervalExpr()

assertRange

private void assertRange(SargIntervalExpr interval)

testNullExpr

public void testNullExpr()

testEmptyExpr

public void testEmptyExpr()

testUnconstrainedExpr

public void testUnconstrainedExpr()

testSetExpr

public void testSetExpr()

testComplement

public void testComplement()

testUnion

public void testUnion()

testIntersection

public void testIntersection()

checkUnion

private void checkUnion(int i1,
                        int i2,
                        int i3,
                        String expected)

checkIntersection

private void checkIntersection(int i1,
                               int i2,
                               int i3,
                               String expected)

checkSetOp

private void checkSetOp(SargSetOperator setOp,
                        int i1,
                        int i2,
                        int i3,
                        String expected)

createCoordinate

private RexNode createCoordinate(SargTest.Zodiac z)

testRexAnalyzer

public void testRexAnalyzer()