mondrian.test
Class Olap4jTest

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

public class Olap4jTest
extends FoodMartTestCase

Tests mondrian's olap4j API.

Test cases in this test could, in principle, be moved to olap4j's test.

Author:
jhyde

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.test.FoodMartTestCase
FoodMartTestCase.QueryAndResult
 
Field Summary
 
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
 
Constructor Summary
Olap4jTest()
           
Olap4jTest(String name)
           
 
Method Summary
(package private) static void closeOnCompletion(Object statement)
          Calls Statement.closeOnCompletion() via reflection.
(package private) static boolean isClosed(Object statement)
          Calls java.sql.Statement#isClosed() or java.sql.ResultSet#isClosed() via reflection.
 void testAnnotation()
           
 void testBugMondrian1204()
          Test case for MONDRIAN-1204, "Olap4j's method toOlap4j throws NPE if we have a function".
 void testBugMondrian1217()
          Runs a statement repeatedly, flushing cache every 10 iterations and calling cancel at random intervals.
 void testCellProperties()
           
 void testCloseOnCompletion()
           
 void testDrillThrough()
           
 void testFormatString()
           
 void testLevelProperties()
          Tests that a property that is not a standard olap4j property but is a Mondrian-builtin property (viz, "FORMAT_EXP") is included among a level's properties.
 void testLimit()
          Same case as BasicQueryTest.testQueryIterationLimit(), but this time, check that the OlapException has the required SQLstate.
 void testSameMemberByVariousMeans()
          Test case for bug MONDRIAN-920, "olap4j: inconsistent measure's member type".
 
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
 

Constructor Detail

Olap4jTest

public Olap4jTest()

Olap4jTest

public Olap4jTest(String name)
Method Detail

testSameMemberByVariousMeans

public void testSameMemberByVariousMeans()
                                  throws SQLException
Test case for bug MONDRIAN-920, "olap4j: inconsistent measure's member type".

Throws:
SQLException - on error

testAnnotation

public void testAnnotation()
                    throws SQLException
Throws:
SQLException

testFormatString

public void testFormatString()
                      throws SQLException
Throws:
SQLException

testLevelProperties

public void testLevelProperties()
                         throws SQLException
Tests that a property that is not a standard olap4j property but is a Mondrian-builtin property (viz, "FORMAT_EXP") is included among a level's properties.

Throws:
SQLException - on error

testCellProperties

public void testCellProperties()
                        throws SQLException
Throws:
SQLException

testLimit

public void testLimit()
               throws SQLException
Same case as BasicQueryTest.testQueryIterationLimit(), but this time, check that the OlapException has the required SQLstate.

Throws:
SQLException - on error

testCloseOnCompletion

public void testCloseOnCompletion()
                           throws Exception
Throws:
Exception

isClosed

static boolean isClosed(Object statement)
                 throws Exception
Calls java.sql.Statement#isClosed() or java.sql.ResultSet#isClosed() via reflection.

Parameters:
statement - Statement or result set
Returns:
Whether statement or result set is closed
Throws:
Exception - on error

closeOnCompletion

static void closeOnCompletion(Object statement)
                       throws Exception
Calls Statement.closeOnCompletion() via reflection. (It cannot be called directly because it only exists from JDK 1.7 onwards.)

Parameters:
statement - Statement or result set
Throws:
Exception - on error

testDrillThrough

public void testDrillThrough()
                      throws Exception
Throws:
Exception

testBugMondrian1204

public void testBugMondrian1204()
                         throws SQLException
Test case for MONDRIAN-1204, "Olap4j's method toOlap4j throws NPE if we have a function".

Throws:
SQLException

testBugMondrian1217

public void testBugMondrian1217()
                         throws SQLException
Runs a statement repeatedly, flushing cache every 10 iterations and calling cancel at random intervals.

Test case for

MONDRIAN-1217, "Statement.cancel() during fact query leads to permanent segment lock".

Throws:
SQLException

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