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:
Test

public class XmlaBasicTest
extends XmlaBaseTestCase

Test XML/A functionality.

Version:
$Id: //open/mondrian/testsrc/main/mondrian/xmla/XmlaBasicTest.java#58 $
Author:
Richard M. Emberson

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.xmla.XmlaBaseTestCase
XmlaBaseTestCase.Action, XmlaBaseTestCase.CallBack
 
Field Summary
static java.lang.String CONTENT_DATA
           
static java.lang.String CONTENT_DATAOMITDEFAULTSLICER
           
static java.lang.String CONTENT_NONE
           
static java.lang.String CONTENT_PROP
           
static java.lang.String CONTENT_SCHEMA
           
static java.lang.String CONTENT_SCHEMADATA
           
static java.lang.String FORMAT_TABLULAR
           
static java.lang.String RESTRICTION_NAME_PROP
           
static java.lang.String RESTRICTION_VALUE_PROP
           
static java.lang.String UNIQUE_NAME_ELEMENT
           
static java.lang.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, FORMAT_MULTI_DIMENSIONAL, FORMAT_PROP, HR_CUBE, LAST_SCHEMA_UPDATE_DATE, LAST_SCHEMA_UPDATE_DATE_PROP, REQUEST_TYPE_PROP, SALES_CUBE, SESSION_ID_PROP
 
Fields inherited from class mondrian.test.FoodMartTestCase
propSaver
 
Constructor Summary
XmlaBasicTest()
           
XmlaBasicTest(java.lang.String name)
           
 
Method Summary
 void _testDBColumns()
           
 void _testDBProviderTypes()
           
 void _testDBTablesInfo()
           
 void doTestRT(java.lang.String requestType, TestContext testContext)
           
protected  java.lang.String extractSoapResponse(org.w3c.dom.Document responseDoc, Enumeration.Content content)
           
protected  java.lang.String filter(java.lang.String testCaseName, java.lang.String filename, java.lang.String content)
          Filters the content of a test resource.
protected  DiffRepository getDiffRepos()
           
protected  java.lang.Class<? extends XmlaRequestCallback> getServletCallbackClass()
           
protected  java.lang.String getSessionId(XmlaBaseTestCase.Action action)
          Creates, retrieves or clears the session id for this test.
 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 testExecuteCrossjoin()
           
 void testExecuteCrossjoinRole()
          This test returns the same result as testExecuteCrossjoin above except that the Role used disables accessing [Customers].[All Customers].[Mexico].
 void testExecuteNoSlicerContentDataOmitDefaultSlicer()
           
 void testExecuteSlicer()
           
 void testExecuteSlicerContentDataOmitDefaultSlicer()
           
 void testExecuteWithCellProperties()
           
 void testExecuteWithDimensionProperties()
           
 void testExecuteWithKeyDimensionProperty()
           
 void testExecuteWithMemberKeyDimensionPropertyForAllMember()
           
 void testExecuteWithMemberKeyDimensionPropertyForMemberWithKey()
           
 void testExecuteWithMemberKeyDimensionPropertyForMemberWithoutKey()
           
 void testExecuteWithoutCellProperties()
           
 void testMDActions()
           
 void testMDCubes()
           
 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 testMDimensions()
           
 void testMDLevels()
           
 void testMDLevelsAccessControlled()
           
 void testMDMeasures()
           
 void testMDMembers()
           
 void testMDMembersMulti()
           
 void testMDMembersTreeop()
           
 void testMDProperties()
           
 void testMDSets()
           
 
Methods inherited from class mondrian.xmla.XmlaBaseTestCase
clearServlet, doTest, doTest, doTestInline, doTestInline, doTests, fileToDocument, fileToString, getCatalogNameUrls, getDefaultRequestProperties, getServlet, getSessionId, replaceLastSchemaUpdateDate
 
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
 

Field Detail

FORMAT_TABLULAR

public static final java.lang.String FORMAT_TABLULAR
See Also:
Constant Field Values

UNIQUE_NAME_ELEMENT

public static final java.lang.String UNIQUE_NAME_ELEMENT
See Also:
Constant Field Values

UNIQUE_NAME_PROP

public static final java.lang.String UNIQUE_NAME_PROP
See Also:
Constant Field Values

RESTRICTION_NAME_PROP

public static final java.lang.String RESTRICTION_NAME_PROP
See Also:
Constant Field Values

RESTRICTION_VALUE_PROP

public static final java.lang.String RESTRICTION_VALUE_PROP
See Also:
Constant Field Values

CONTENT_PROP

public static final java.lang.String CONTENT_PROP
See Also:
Constant Field Values

CONTENT_NONE

public static final java.lang.String CONTENT_NONE

CONTENT_DATA

public static final java.lang.String CONTENT_DATA

CONTENT_SCHEMA

public static final java.lang.String CONTENT_SCHEMA

CONTENT_SCHEMADATA

public static final java.lang.String CONTENT_SCHEMADATA

CONTENT_DATAOMITDEFAULTSLICER

public static final java.lang.String CONTENT_DATAOMITDEFAULTSLICER
Constructor Detail

XmlaBasicTest

public XmlaBasicTest()

XmlaBasicTest

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

getDiffRepos

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

getServletCallbackClass

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

extractSoapResponse

protected java.lang.String extractSoapResponse(org.w3c.dom.Document responseDoc,
                                               Enumeration.Content content)

testDDatasource

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

testDEnumerators

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

testDKeywords

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

testDLiterals

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

testDProperties

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

testDSchemaRowsets

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

testDBCatalogs

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

testDBSchemata

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

_testDBColumns

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

_testDBProviderTypes

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

_testDBTablesInfo

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

testDBTables

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

testMDActions

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

testMDCubes

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

testMDSets

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

testMDimensions

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

testMDFunction

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

testMDFunctions

public void testMDFunctions()
                     throws java.lang.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:
java.lang.Exception - on error

testMDFunctionsJdk14

public void testMDFunctionsJdk14()
                          throws java.lang.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:
java.lang.Exception - on error

testMDHierarchies

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

testMDLevels

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

testMDLevelsAccessControlled

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

testMDMeasures

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

testMDMembers

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

testMDMembersMulti

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

testMDMembersTreeop

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

testMDProperties

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

testApproxRowCountOverridesCountCallsToDatabase

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

testApproxRowCountInHierarchyOverridesCountCallsToDatabase

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

testDrillThroughMaxRows

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

Throws:
java.lang.Exception - on error

testDrillThrough

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

Throws:
java.lang.Exception - on error

testDrillThroughZeroDimensionalQuery

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

Throws:
java.lang.Exception - on error

filter

protected java.lang.String filter(java.lang.String testCaseName,
                                  java.lang.String filename,
                                  java.lang.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 java.lang.Exception
Throws:
java.lang.Exception

testExecuteSlicerContentDataOmitDefaultSlicer

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

testExecuteNoSlicerContentDataOmitDefaultSlicer

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

testExecuteWithoutCellProperties

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

testExecuteWithCellProperties

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

testExecuteWithMemberKeyDimensionPropertyForMemberWithoutKey

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

testExecuteWithMemberKeyDimensionPropertyForMemberWithKey

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

testExecuteWithMemberKeyDimensionPropertyForAllMember

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

testExecuteWithKeyDimensionProperty

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

testExecuteWithDimensionProperties

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

testExecuteCrossjoin

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

testExecuteCrossjoinRole

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

Throws:
java.lang.Exception

doTestRT

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

getSessionId

protected java.lang.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