mondrian.xmla
Class XmlaBasicTest

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

public class XmlaBasicTest
extends XmlaBaseTestCase

Test XML/A functionality.

Author:
Richard M. Emberson

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.xmla.XmlaBaseTestCase
XmlaBaseTestCase.Action, XmlaBaseTestCase.CallBack, XmlaBaseTestCase.XmlaRequestCallbackImpl
 
Field Summary
static String CONTENT_PROP
           
static String FORMAT_TABLULAR
           
static String RESTRICTION_NAME_PROP
           
static String RESTRICTION_VALUE_PROP
           
static String UNIQUE_NAME_ELEMENT
           
static String UNIQUE_NAME_PROP
           
 
Fields inherited from class mondrian.xmla.XmlaBaseTestCase
CATALOG, CATALOG_NAME_PROP, CATALOG_PROP, catalogNameUrls, CUBE_NAME_PROP, DATA_SOURCE_INFO, DATA_SOURCE_INFO_PROP, DEBUG, FORMAT_MULTI_DIMENSIONAL, FORMAT_PROP, LAST_SCHEMA_UPDATE_DATE, LOCALE_PROP, REQUEST_TYPE_PROP, ROLE_PROP, SALES_CUBE, SESSION_ID_PROP
 
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
 
Constructor Summary
XmlaBasicTest()
           
XmlaBasicTest(String name)
           
 
Method Summary
 void _testDBColumns()
           
 void _testDBProviderTypes()
           
 void _testDBTablesInfo()
           
 void doTestRT(String requestType, TestContext testContext)
           
protected  String extractSoapResponse(Document responseDoc, XmlaConstants.Content content)
           
protected  String filter(String testCaseName, String filename, String content)
          Filters the content of a test resource.
protected  DiffRepository getDiffRepos()
           
protected  Class<? extends XmlaRequestCallback> getServletCallbackClass()
           
protected  String getSessionId(XmlaBaseTestCase.Action action)
          Creates, retrieves or clears the session id for this test.
protected  void setUp()
           
 void testApproxRowCountInHierarchyOverridesCountCallsToDatabase()
           
 void testApproxRowCountOverridesCountCallsToDatabase()
           
 void testDBCatalogs()
           
 void testDBSchemata()
           
 void testDBTables()
           
 void testDDatasource()
           
 void testDEnumerators()
           
 void testDKeywords()
           
 void testDLiterals()
           
 void testDProperties()
           
 void testDrillThrough()
          Tests an 'DRILLTHROUGH SELECT' statement with no 'MAXROWS' clause.
 void testDrillThroughMaxRows()
          Tests an 'DRILLTHROUGH SELECT' statement with a 'MAXROWS' clause.
 void testDrillThroughZeroDimensionalQuery()
          Tests an 'DRILLTHROUGH SELECT' statement with a zero-dimensional query, that is, a query with 'SELECT FROM', and no axes.
 void testDSchemaRowsets()
           
 void testExecuteBugMondrian762()
           
 void testExecuteCrossjoin()
          Testcase for bug MONDRIAN-257, "Crossjoin gives 'Execute unparse results' error in XMLA".
 void testExecuteCrossjoinRole()
          This test returns the same result as testExecuteCrossjoin above except that the Role used disables accessing [Customers].[All Customers].[Mexico].
 void testExecuteEmptySlicer_ContentDataIncludeDefaultSlicer()
           
 void testExecuteEmptySlicer_ContentDataOmitDefaultSlicer()
           
 void testExecuteNoSlicer_ContentDataIncludeDefaultSlicer()
           
 void testExecuteNoSlicer_ContentDataOmitDefaultSlicer()
           
 void testExecuteSlicer_ContentDataIncludeDefaultSlicer()
           
 void testExecuteSlicer_ContentDataOmitDefaultSlicer()
           
 void testExecuteSlicer()
           
 void testExecuteSlicerJson()
           
 void testExecuteWithCellProperties()
           
 void testExecuteWithDimensionProperties()
           
 void testExecuteWithKeyDimensionProperty()
           
 void testExecuteWithMemberKeyDimensionPropertyForAllMember()
           
 void testExecuteWithMemberKeyDimensionPropertyForMemberWithKey()
           
 void testExecuteWithMemberKeyDimensionPropertyForMemberWithoutKey()
           
 void testExecuteWithoutCellProperties()
           
 void testMDActions()
           
 void testMDCubes()
           
 void testMDCubesDeep()
           
 void testMDCubesDeepJson()
           
 void testMDCubesJson()
           
 void testMDCubesLcid()
           
 void testMDCubesLocale()
           
 void testMDDimensions()
           
 void testMDDimensionsShared()
           
 void testMDFunction()
           
 void testMDFunctions()
          Tests the output of the MDSCHEMA_FUNCTIONS call in JDK 1.5 or later.
 void testMDFunctionsJdk14()
          Tests the output of the MDSCHEMA_FUNCTIONS call in JDK 1.4, which is different because metadata such as function name and description is encoded using Java annotations, and hence is not available until JDK 1.5.
 void testMDHierarchies()
           
 void testMDLevels()
           
 void testMDLevelsAccessControlled()
           
 void testMDMeasures()
           
 void testMDMembers()
           
 void testMDMembersMulti()
           
 void testMDMembersTreeop()
           
 void testMDProperties()
           
 void testMDSets()
           
 
Methods inherited from class mondrian.xmla.XmlaBaseTestCase
doTest, doTest, doTest, doTest, doTestInline, doTestInline, doTests, doTestsJson, fileToDocument, fileToString, filterConnectString, generateExpectedString, generateRequestString, getCatalogNameUrls, getDefaultRequestProperties, getServlet, getSessionId, helperTest, helperTestExpect, replaceLastSchemaUpdateDate, tearDown, validate
 
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, warehouseMembersCanadaMexicoUsa
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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

FORMAT_TABLULAR

public static final String FORMAT_TABLULAR
See Also:
Constant Field Values

UNIQUE_NAME_ELEMENT

public static final String UNIQUE_NAME_ELEMENT
See Also:
Constant Field Values

UNIQUE_NAME_PROP

public static final String UNIQUE_NAME_PROP
See Also:
Constant Field Values

RESTRICTION_NAME_PROP

public static final String RESTRICTION_NAME_PROP
See Also:
Constant Field Values

RESTRICTION_VALUE_PROP

public static final String RESTRICTION_VALUE_PROP
See Also:
Constant Field Values

CONTENT_PROP

public static final String CONTENT_PROP
See Also:
Constant Field Values
Constructor Detail

XmlaBasicTest

public XmlaBasicTest()

XmlaBasicTest

public XmlaBasicTest(String name)
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

getDiffRepos

protected DiffRepository getDiffRepos()
Specified by:
getDiffRepos in class XmlaBaseTestCase

getServletCallbackClass

protected Class<? extends XmlaRequestCallback> getServletCallbackClass()
Specified by:
getServletCallbackClass in class XmlaBaseTestCase

extractSoapResponse

protected String extractSoapResponse(Document responseDoc,
                                     XmlaConstants.Content content)

testDDatasource

public void testDDatasource()
                     throws Exception
Throws:
Exception

testDEnumerators

public void testDEnumerators()
                      throws Exception
Throws:
Exception

testDKeywords

public void testDKeywords()
                   throws Exception
Throws:
Exception

testDLiterals

public void testDLiterals()
                   throws Exception
Throws:
Exception

testDProperties

public void testDProperties()
                     throws Exception
Throws:
Exception

testDSchemaRowsets

public void testDSchemaRowsets()
                        throws Exception
Throws:
Exception

testDBCatalogs

public void testDBCatalogs()
                    throws Exception
Throws:
Exception

testDBSchemata

public void testDBSchemata()
                    throws Exception
Throws:
Exception

_testDBColumns

public void _testDBColumns()
                    throws Exception
Throws:
Exception

_testDBProviderTypes

public void _testDBProviderTypes()
                          throws Exception
Throws:
Exception

_testDBTablesInfo

public void _testDBTablesInfo()
                       throws Exception
Throws:
Exception

testDBTables

public void testDBTables()
                  throws Exception
Throws:
Exception

testMDActions

public void testMDActions()
                   throws Exception
Throws:
Exception

testMDCubes

public void testMDCubes()
                 throws Exception
Throws:
Exception

testMDCubesJson

public void testMDCubesJson()
                     throws Exception
Throws:
Exception

testMDCubesDeep

public void testMDCubesDeep()
                     throws Exception
Throws:
Exception

testMDCubesDeepJson

public void testMDCubesDeepJson()
                         throws Exception
Throws:
Exception

testMDCubesLocale

public void testMDCubesLocale()
                       throws Exception
Throws:
Exception

testMDCubesLcid

public void testMDCubesLcid()
                     throws Exception
Throws:
Exception

testMDSets

public void testMDSets()
                throws Exception
Throws:
Exception

testMDDimensions

public void testMDDimensions()
                      throws Exception
Throws:
Exception

testMDDimensionsShared

public void testMDDimensionsShared()
                            throws Exception
Throws:
Exception

testMDFunction

public void testMDFunction()
                    throws Exception
Throws:
Exception

testMDFunctions

public void testMDFunctions()
                     throws Exception
Tests the output of the MDSCHEMA_FUNCTIONS call in JDK 1.5 or later. In JDK 1.4, does nothing and trivially succeeds. See testMDFunctionsJdk14().

Throws:
Exception - on error

testMDFunctionsJdk14

public void testMDFunctionsJdk14()
                          throws Exception
Tests the output of the MDSCHEMA_FUNCTIONS call in JDK 1.4, which is different because metadata such as function name and description is encoded using Java annotations, and hence is not available until JDK 1.5. In JDK 1.5 and later, does nothing and trivially succeeds. See testMDFunctions().

Throws:
Exception - on error

testMDHierarchies

public void testMDHierarchies()
                       throws Exception
Throws:
Exception

testMDLevels

public void testMDLevels()
                  throws Exception
Throws:
Exception

testMDLevelsAccessControlled

public void testMDLevelsAccessControlled()
                                  throws Exception
Throws:
Exception

testMDMeasures

public void testMDMeasures()
                    throws Exception
Throws:
Exception

testMDMembers

public void testMDMembers()
                   throws Exception
Throws:
Exception

testMDMembersMulti

public void testMDMembersMulti()
                        throws Exception
Throws:
Exception

testMDMembersTreeop

public void testMDMembersTreeop()
                         throws Exception
Throws:
Exception

testMDProperties

public void testMDProperties()
                      throws Exception
Throws:
Exception

testApproxRowCountOverridesCountCallsToDatabase

public void testApproxRowCountOverridesCountCallsToDatabase()
                                                     throws Exception
Throws:
Exception

testApproxRowCountInHierarchyOverridesCountCallsToDatabase

public void testApproxRowCountInHierarchyOverridesCountCallsToDatabase()
                                                                throws Exception
Throws:
Exception

testDrillThroughMaxRows

public void testDrillThroughMaxRows()
                             throws Exception
Tests an 'DRILLTHROUGH SELECT' statement with a 'MAXROWS' clause.

Throws:
Exception - on error

testDrillThrough

public void testDrillThrough()
                      throws Exception
Tests an 'DRILLTHROUGH SELECT' statement with no 'MAXROWS' clause.

Throws:
Exception - on error

testDrillThroughZeroDimensionalQuery

public void testDrillThroughZeroDimensionalQuery()
                                          throws Exception
Tests an 'DRILLTHROUGH SELECT' statement with a zero-dimensional query, that is, a query with 'SELECT FROM', and no axes.

Throws:
Exception - on error

filter

protected String filter(String testCaseName,
                        String filename,
                        String content)
Description copied from class: XmlaBaseTestCase
Filters the content of a test resource. The default implementation returns the content unchanged, but a derived class might override this method to change the content.

Overrides:
filter in class XmlaBaseTestCase
Parameters:
testCaseName - Name of current test case, e.g. "testFoo"
filename - Name of requested content, e.g. "${request}"
content - Content
Returns:
Modified content

testExecuteSlicer

public void testExecuteSlicer()
                       throws Exception
Throws:
Exception

testExecuteSlicerJson

public void testExecuteSlicerJson()
                           throws Exception
Throws:
Exception

testExecuteSlicer_ContentDataOmitDefaultSlicer

public void testExecuteSlicer_ContentDataOmitDefaultSlicer()
                                                    throws Exception
Throws:
Exception

testExecuteNoSlicer_ContentDataOmitDefaultSlicer

public void testExecuteNoSlicer_ContentDataOmitDefaultSlicer()
                                                      throws Exception
Throws:
Exception

testExecuteSlicer_ContentDataIncludeDefaultSlicer

public void testExecuteSlicer_ContentDataIncludeDefaultSlicer()
                                                       throws Exception
Throws:
Exception

testExecuteNoSlicer_ContentDataIncludeDefaultSlicer

public void testExecuteNoSlicer_ContentDataIncludeDefaultSlicer()
                                                         throws Exception
Throws:
Exception

testExecuteEmptySlicer_ContentDataIncludeDefaultSlicer

public void testExecuteEmptySlicer_ContentDataIncludeDefaultSlicer()
                                                            throws Exception
Throws:
Exception

testExecuteEmptySlicer_ContentDataOmitDefaultSlicer

public void testExecuteEmptySlicer_ContentDataOmitDefaultSlicer()
                                                         throws Exception
Throws:
Exception

testExecuteWithoutCellProperties

public void testExecuteWithoutCellProperties()
                                      throws Exception
Throws:
Exception

testExecuteWithCellProperties

public void testExecuteWithCellProperties()
                                   throws Exception
Throws:
Exception

testExecuteWithMemberKeyDimensionPropertyForMemberWithoutKey

public void testExecuteWithMemberKeyDimensionPropertyForMemberWithoutKey()
                                                                  throws Exception
Throws:
Exception

testExecuteWithMemberKeyDimensionPropertyForMemberWithKey

public void testExecuteWithMemberKeyDimensionPropertyForMemberWithKey()
                                                               throws Exception
Throws:
Exception

testExecuteWithMemberKeyDimensionPropertyForAllMember

public void testExecuteWithMemberKeyDimensionPropertyForAllMember()
                                                           throws Exception
Throws:
Exception

testExecuteWithKeyDimensionProperty

public void testExecuteWithKeyDimensionProperty()
                                         throws Exception
Throws:
Exception

testExecuteWithDimensionProperties

public void testExecuteWithDimensionProperties()
                                        throws Exception
Throws:
Exception

testExecuteCrossjoin

public void testExecuteCrossjoin()
                          throws Exception
Testcase for bug MONDRIAN-257, "Crossjoin gives 'Execute unparse results' error in XMLA".

Throws:
Exception

testExecuteCrossjoinRole

public void testExecuteCrossjoinRole()
                              throws Exception
This test returns the same result as testExecuteCrossjoin above except that the Role used disables accessing [Customers].[All Customers].[Mexico].

Throws:
Exception

testExecuteBugMondrian762

public void testExecuteBugMondrian762()
                               throws Exception
Throws:
Exception

doTestRT

public void doTestRT(String requestType,
                     TestContext testContext)
              throws Exception
Throws:
Exception

getSessionId

protected String getSessionId(XmlaBaseTestCase.Action action)
Description copied from class: XmlaBaseTestCase
Creates, retrieves or clears the session id for this test.

Specified by:
getSessionId in class XmlaBaseTestCase
Parameters:
action - Action to perform
Returns:
Session id for create, query; null for clear

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