mondrian.olap
Class ParserTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by mondrian.test.FoodMartTestCase
              extended by mondrian.olap.ParserTest
All Implemented Interfaces:
junit.framework.Test

public class ParserTest
extends FoodMartTestCase

Tests the MDX parser.

Author:
gjohnson

Nested Class Summary
static class ParserTest.TestParser
           
 
Field Summary
(package private) static BuiltinFunTable funTable
           
 
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
 
Constructor Summary
ParserTest(String name)
           
 
Method Summary
 void _testInnerSelect()
          Test case for SELECT in the FROM clause.
protected  ParserTest.TestParser createParser()
           
 void testAsPrecedence()
          Test case for bug MONDRIAN-648, "AS operator has lower precedence than required by MDX specification".
 void testAxisParsing()
           
 void testBangFunction()
           
 void testCaseSwitch()
           
 void testCaseTest()
           
 void testCast()
           
 void testCellProperties()
           
 void testChildren()
          Test case for olap4j bug 3515404, "Inconsistent parsing behavior('.CHILDREN' and '.Children')".
 void testCloneQuery()
           
 void testDimensionProperties()
           
 void testDrillThrough()
           
 void testDrillThroughExtended()
           
 void testDrillThroughExtended1()
           
 void testDrillThroughExtended3()
           
 void testEmptyExpr()
          Test case for empty expressions.
 void testExplain()
           
 void testId()
           
 void testIdComplex()
           
 void testIdentifier()
           
 void testIdWithKey()
           
 void testIs()
           
 void testIsEmpty()
           
 void testIsNull()
           
 void testLargePrecision()
          Testcase for bug MONDRIAN-272, "High precision number in MDX causes overflow".
 void testMemberOnAxis()
          If an axis expression is a member, implicitly convert it to a set.
 void testMultipleAxes()
           
 void testMultipleSpaces()
          Test case for bug MONDRIAN-924, "Parsing fails with multiple spaces between words".
 void testMultiplication()
          Verifies that calculated measures made of several '*' operators can resolve them correctly.
 void testNegativeCases()
           
 void testNull()
           
 void testNumbers()
          Tests parsing of numbers.
 void testScannerPunc()
          Test case for bug MONDRIAN-831, "Failure parsing queries with member identifiers beginning with '_' and not expressed between brackets".
 void testSetExpr()
          Test case for bug MONDRIAN-306, "Parser should not require braces around range op in WITH SET".
 void testUnderscore()
           
 void testUnparse()
           
 
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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

funTable

static final BuiltinFunTable funTable
Constructor Detail

ParserTest

public ParserTest(String name)
Method Detail

createParser

protected ParserTest.TestParser createParser()

testAxisParsing

public void testAxisParsing()
                     throws Exception
Throws:
Exception

testNegativeCases

public void testNegativeCases()
                       throws Exception
Throws:
Exception

testScannerPunc

public void testScannerPunc()
Test case for bug MONDRIAN-831, "Failure parsing queries with member identifiers beginning with '_' and not expressed between brackets".

According to the spec Identifiers (MDX), the first character of a regular identifier must be a letter (per the unicode standard 2.0) or underscore. Subsequent characters must be a letter, and underscore, or a digit.


testUnderscore

public void testUnderscore()

testUnparse

public void testUnparse()

testMultipleAxes

public void testMultipleAxes()
                      throws Exception
Throws:
Exception

testMemberOnAxis

public void testMemberOnAxis()
If an axis expression is a member, implicitly convert it to a set.


testCaseTest

public void testCaseTest()

testCaseSwitch

public void testCaseSwitch()

testSetExpr

public void testSetExpr()
Test case for bug MONDRIAN-306, "Parser should not require braces around range op in WITH SET".


testDimensionProperties

public void testDimensionProperties()

testCellProperties

public void testCellProperties()

testIsEmpty

public void testIsEmpty()

testIs

public void testIs()

testIsNull

public void testIsNull()

testNull

public void testNull()

testCast

public void testCast()

testMultiplication

public void testMultiplication()
Verifies that calculated measures made of several '*' operators can resolve them correctly.


testBangFunction

public void testBangFunction()

testId

public void testId()

testIdWithKey

public void testIdWithKey()

testIdComplex

public void testIdComplex()

testCloneQuery

public void testCloneQuery()

testNumbers

public void testNumbers()
Tests parsing of numbers.


testLargePrecision

public void testLargePrecision()
Testcase for bug MONDRIAN-272, "High precision number in MDX causes overflow". The problem was that "5000001234" exceeded the precision of the int being used to gather the mantissa.


testIdentifier

public void testIdentifier()

testEmptyExpr

public void testEmptyExpr()
Test case for empty expressions. Test case for bug 3030772, "DrilldownLevelTop parser error".


_testInnerSelect

public void _testInnerSelect()
Test case for SELECT in the FROM clause.


testAsPrecedence

public void testAsPrecedence()
Test case for bug MONDRIAN-648, "AS operator has lower precedence than required by MDX specification".

Currently that bug is not fixed. We give the AS operator low precedence, so CAST works as it should but 'expr AS namedSet' does not.


testDrillThrough

public void testDrillThrough()

testDrillThroughExtended1

public void testDrillThroughExtended1()

testDrillThroughExtended

public void testDrillThroughExtended()

testDrillThroughExtended3

public void testDrillThroughExtended3()

testExplain

public void testExplain()

testMultipleSpaces

public void testMultipleSpaces()
Test case for bug MONDRIAN-924, "Parsing fails with multiple spaces between words".


testChildren

public void testChildren()
Test case for olap4j bug 3515404, "Inconsistent parsing behavior('.CHILDREN' and '.Children')".


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