mondrian.rolap
Class FilterTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by mondrian.test.FoodMartTestCase
              extended by mondrian.rolap.BatchTestCase
                  extended by mondrian.rolap.FilterTest
All Implemented Interfaces:
Test

public class FilterTest
extends BatchTestCase

Tests for Filter and native Filters.

Since:
April 28, 2009
Version:
$Id: //open/mondrian/testsrc/main/mondrian/rolap/FilterTest.java#2 $
Author:
Rushan Chen

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.rolap.BatchTestCase
BatchTestCase.Bomb, BatchTestCase.CellRequestConstraint, BatchTestCase.TestCase, BatchTestCase.TestListener
 
Field Summary
 
Fields inherited from class mondrian.rolap.BatchTestCase
cubeNameSales, fieldGender, fieldProductDepartment, fieldProductFamily, fieldValueProductDepartment, fieldValuesGender, fieldValuesProductFamily, fieldValuesYear, fieldYear, measureUnitSales, tableCustomer, tableProductClass, tableTime
 
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
 
Constructor Summary
FilterTest()
           
FilterTest(java.lang.String name)
           
 
Method Summary
 void testCachedNativeSetUsingFilters()
           
 void testCmNativeFilter()
          Executes a Filter() whose condition contains a calculated member.
 void testInFilterAND()
           
 void testInFilterNonNative()
          Here the filter is above (rather than as inputs to) the NECJ.
 void testInFilterSimple()
           
 void testIsFilterSimple()
           
 void testMixedInIsFilters()
           
 void testNativeFilter()
           
 void testNativeFilterNonEmpty()
          Verify that filter with Not IsEmpty(storedMeasure) can be natively evaluated.
 void testNativeFilterWithNullMeasure()
           
 void testNonNativeFilterWithCalcMember()
           
 void testNonNativeFilterWithNullMeasure()
           
 void testNotInFilterExcludeNullMember()
          Test that if Null member is explicitly excluded, then the native filter SQL should filter out null members.
 void testNotInFilterKeepNullMember()
          Test that if Null member is not explicitly excluded, then the native filter SQL should not filter out null members.
 void testNotInFilterSimple()
           
 void testNotInMultiLevelMemberConstraintMixedNullNonNullParent()
          Test that null members are included when the filter explicitly excludes certain members that contain nulls.
 void testNotInMultiLevelMemberConstraintNonNullParent()
          Test that null members are included when the filter excludes members that contain multiple levels, but none being null.
 void testNotInMultiLevelMemberConstraintNonNullSameParent()
          Test that null members are included when the filter excludes members that contain multiple levels, but none being null.
 void testNotInMultiLevelMemberConstraintSingleNullParent()
          Test that null members are included when the filter explicitly excludes a single member that has a null.
 void testNotIsFilterSimple()
           
 void testTopCountOverInFilter()
           
 
Methods inherited from class mondrian.rolap.BatchTestCase
assertNative, assertNoQuerySql, assertNotNative, assertQuerySql, assertQuerySql, assertQuerySql, assertQuerySqlOrNot, assertRequestSql, checkNative, checkNative, checkNative, checkNotNative, checkNotNative, checkNotNative, createBatch, createBatch, createRequest, createRequest, createRequest, createRequest, dialectize, executeQuery, getCube, getFoodMartConnection, getGroupingSet, getMeasure, getRegistry, makeConstraintCountryState, makeConstraintProductFamilyDepartment, makeConstraintYearQuarterMonth
 
Methods inherited from class mondrian.test.FoodMartTestCase
allMember, assertAxisReturns, assertAxisThrows, assertBooleanExprReturns, assertExprReturns, assertExprThrows, assertQueriesReturnSimilarResults, assertQueryReturns, assertQueryThrows, assertSize, cubeByName, execute, executeExpr, executeQuery, executeSingletonAxis, genderMembersIncludingAll, getConnection, getDimensionWithName, getTestContext, getTestContext, isDefaultNullMemberRepresentation, isGroupingSetsSupported, member, productMembersPotScrubbersPotsAndPans, storeMembersCAAndOR, storeMembersUsaAndCanada, tearDown, warehouseMembersCanadaMexicoUsa
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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

FilterTest

public FilterTest()

FilterTest

public FilterTest(java.lang.String name)
Method Detail

testInFilterSimple

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

testNotInFilterSimple

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

testInFilterAND

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

testIsFilterSimple

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

testNotIsFilterSimple

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

testMixedInIsFilters

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

testInFilterNonNative

public void testInFilterNonNative()
                           throws java.lang.Exception
Here the filter is above (rather than as inputs to) the NECJ. These types of filters are currently not natively evaluated.

To expand on this case, RolapNativeFilter needs to be improved so it knows how to represent the dimension filter constraint. Currently the FilterConstraint is only used for filters on measures.

Throws:
java.lang.Exception

testTopCountOverInFilter

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

testNotInFilterKeepNullMember

public void testNotInFilterKeepNullMember()
                                   throws java.lang.Exception
Test that if Null member is not explicitly excluded, then the native filter SQL should not filter out null members.

Throws:
java.lang.Exception

testNotInFilterExcludeNullMember

public void testNotInFilterExcludeNullMember()
                                      throws java.lang.Exception
Test that if Null member is explicitly excluded, then the native filter SQL should filter out null members.

Throws:
java.lang.Exception

testNotInMultiLevelMemberConstraintNonNullParent

public void testNotInMultiLevelMemberConstraintNonNullParent()
Test that null members are included when the filter excludes members that contain multiple levels, but none being null.


testNotInMultiLevelMemberConstraintNonNullSameParent

public void testNotInMultiLevelMemberConstraintNonNullSameParent()
Test that null members are included when the filter excludes members that contain multiple levels, but none being null. The members have the same parent.


testNotInMultiLevelMemberConstraintMixedNullNonNullParent

public void testNotInMultiLevelMemberConstraintMixedNullNonNullParent()
Test that null members are included when the filter explicitly excludes certain members that contain nulls. The members span multiple levels.


testNotInMultiLevelMemberConstraintSingleNullParent

public void testNotInMultiLevelMemberConstraintSingleNullParent()
Test that null members are included when the filter explicitly excludes a single member that has a null. The members span multiple levels.


testCachedNativeSetUsingFilters

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

testNativeFilter

public void testNativeFilter()

testCmNativeFilter

public void testCmNativeFilter()
Executes a Filter() whose condition contains a calculated member.


testNonNativeFilterWithNullMeasure

public void testNonNativeFilterWithNullMeasure()

testNativeFilterWithNullMeasure

public void testNativeFilterWithNullMeasure()

testNonNativeFilterWithCalcMember

public void testNonNativeFilterWithCalcMember()

testNativeFilterNonEmpty

public void testNativeFilterNonEmpty()
Verify that filter with Not IsEmpty(storedMeasure) can be natively evaluated.


Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads