mondrian.xmla
Class XmlaErrorTest

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.XmlaErrorTest
All Implemented Interfaces:
junit.framework.Test, XmlaConstants

public class XmlaErrorTest
extends XmlaBaseTestCase
implements XmlaConstants

Test of the XMLA Fault generation - errors occur/are-detected in in Mondrian XMLA and a SOAP Fault is returned.

There is a set of tests dealing with Authorization and HTTP Header Expect and Continue dialog. These are normally done at the webserver level and can be removed here if desired. (I wrote them before I realized that Mondrian XMLA would not handle any Authorization issues if it were in a webserver.)

Author:
Richard M. Emberson

Nested Class Summary
(package private) static class XmlaErrorTest.Callback
           
 
Nested classes/interfaces inherited from class mondrian.xmla.XmlaBaseTestCase
XmlaBaseTestCase.Action, XmlaBaseTestCase.CallBack, XmlaBaseTestCase.XmlaRequestCallbackImpl
 
Field Summary
(package private) static boolean doAuthorization
           
(package private) static String password
           
(package private) static String user
           
 
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
 
Fields inherited from interface mondrian.xmla.XmlaConstants
CHH_AUTHORIZATION_CODE, CHH_AUTHORIZATION_FAULT_FS, CHH_CODE, CHH_FAULT_FS, CLIENT_FAULT_FC, CONTEXT_MIME_TYPE, CONTEXT_ROLE_NAME, CONTEXT_XMLA_PASSWORD, CONTEXT_XMLA_SESSION_ID, CONTEXT_XMLA_SESSION_STATE, CONTEXT_XMLA_SESSION_STATE_BEGIN, CONTEXT_XMLA_SESSION_STATE_END, CONTEXT_XMLA_SESSION_STATE_WITHIN, CONTEXT_XMLA_USERNAME, CPOSTA_CODE, CPOSTA_FAULT_FS, CPREA_CODE, CPREA_FAULT_FS, FAULT_ACTOR, FAULT_FC_PREFIX, FAULT_FS_PREFIX, FAULT_NS_PREFIX, HSB_ACCESS_DENIED_CODE, HSB_ACCESS_DENIED_FAULT_FS, HSB_BAD_COMMAND_CODE, HSB_BAD_COMMAND_FAULT_FS, HSB_BAD_METHOD_CODE, HSB_BAD_METHOD_FAULT_FS, HSB_BAD_METHOD_NS_CODE, HSB_BAD_METHOD_NS_FAULT_FS, HSB_BAD_NON_NULLABLE_COLUMN_CODE, HSB_BAD_NON_NULLABLE_COLUMN_FAULT_FS, HSB_BAD_PROPERTIES_CODE, HSB_BAD_PROPERTIES_FAULT_FS, HSB_BAD_PROPERTIES_LIST_CODE, HSB_BAD_PROPERTIES_LIST_FAULT_FS, HSB_BAD_REQUEST_TYPE_CODE, HSB_BAD_REQUEST_TYPE_FAULT_FS, HSB_BAD_RESTRICTION_LIST_CODE, HSB_BAD_RESTRICTION_LIST_FAULT_FS, HSB_BAD_RESTRICTIONS_CODE, HSB_BAD_RESTRICTIONS_FAULT_FS, HSB_BAD_SOAP_BODY_CODE, HSB_BAD_SOAP_BODY_FAULT_FS, HSB_BAD_STATEMENT_CODE, HSB_BAD_STATEMENT_FAULT_FS, HSB_CONNECTION_DATA_SOURCE_CODE, HSB_CONNECTION_DATA_SOURCE_FAULT_FS, HSB_DISCOVER_FORMAT_CODE, HSB_DISCOVER_FORMAT_FAULT_FS, HSB_DISCOVER_UNPARSE_CODE, HSB_DISCOVER_UNPARSE_FAULT_FS, HSB_DRILL_THROUGH_FORMAT_CODE, HSB_DRILL_THROUGH_FORMAT_FAULT_FS, HSB_DRILL_THROUGH_NOT_ALLOWED_CODE, HSB_DRILL_THROUGH_NOT_ALLOWED_FAULT_FS, HSB_DRILL_THROUGH_SQL_CODE, HSB_DRILL_THROUGH_SQL_FAULT_FS, HSB_EXECUTE_QUERY_CODE, HSB_EXECUTE_QUERY_FAULT_FS, HSB_EXECUTE_UNPARSE_CODE, HSB_EXECUTE_UNPARSE_FAULT_FS, HSB_PARSE_QUERY_CODE, HSB_PARSE_QUERY_FAULT_FS, HSB_PROCESS_CODE, HSB_PROCESS_FAULT_FS, HSB_UNKNOWN_CODE, HSB_UNKNOWN_FAULT_FS, HSH_BAD_SESSION_ID_CODE, HSH_BAD_SESSION_ID_FAULT_FS, HSH_MUST_UNDERSTAND_CODE, HSH_MUST_UNDERSTAND_FAULT_FS, HSH_UNKNOWN_CODE, HSH_UNKNOWN_FAULT_FS, MONDRIAN_NAMESPACE, MSM_UNKNOWN_CODE, MSM_UNKNOWN_FAULT_FS, MUST_UNDERSTAND_FAULT_FC, NS_SOAP_ENC_1_1, NS_SOAP_ENC_1_2, NS_SOAP_ENV_1_1, NS_SOAP_ENV_1_2, NS_SOAP_SECEXT, NS_SQL, NS_XMLA, NS_XMLA_EMPTY, NS_XMLA_EX, NS_XMLA_MDDATASET, NS_XMLA_ROWSET, NS_XSD, NS_XSI, SERVER_FAULT_FC, SOAP_MUST_UNDERSTAND_ATTR, SOAP_PREFIX, UNKNOWN_ERROR_CODE, UNKNOWN_ERROR_FAULT_FS, USM_DOM_FACTORY_CODE, USM_DOM_FACTORY_FAULT_FS, USM_DOM_PARSE_CODE, USM_DOM_PARSE_FAULT_FS, USM_DOM_PARSE_IO_CODE, USM_DOM_PARSE_IO_FAULT_FS, USM_REQUEST_INPUT_CODE, USM_REQUEST_INPUT_FAULT_FS, USM_REQUEST_STATE_CODE, USM_REQUEST_STATE_FAULT_FS, USM_UNKNOWN_CODE, USM_UNKNOWN_FAULT_FS, VERSION_MISSMATCH_FAULT_FC, XMLA_BEGIN_SESSION, XMLA_END_SESSION, XMLA_SECURITY, XMLA_SESSION, XMLA_SESSION_ID
 
Constructor Summary
XmlaErrorTest()
           
XmlaErrorTest(String name)
           
 
Method Summary
protected  void doTest(MockHttpServletRequest req, mondrian.xmla.XmlaErrorTest.Fault expectedFault)
           
protected  void doTest(mondrian.xmla.XmlaErrorTest.Fault expectedFault)
           
protected  Map<String,String> getCatalogNameUrls(TestContext testContext)
           
(package private) static CharacterData getCharacterData(Node node)
           
(package private) static Element[] getChildElements(Node node)
           
protected  DiffRepository getDiffRepos()
           
(package private) static String getNodeContent(Node n)
           
protected  Class<? extends XmlaRequestCallback> getServletCallbackClass()
           
protected  String getSessionId(XmlaBaseTestCase.Action action)
          Creates, retrieves or clears the session id for this test.
protected  void processResults(byte[] results, mondrian.xmla.XmlaErrorTest.Fault expectedFault)
           
protected  void setUp()
           
protected  void tearDown()
           
 void testAuth01()
           
 void testAuth02()
           
 void testAuth03()
           
 void testAuth04()
           
 void testAuth05()
           
 void testBadAction01()
           
 void testBadAction02()
           
 void testBadAction03()
           
 void testBadBody01()
           
 void testBadBody02()
           
 void testBadBody03()
           
 void testBadBody04()
           
 void testBadBody05()
           
 void testBadBody06()
           
 void testBadBody07()
           
 void testBadBody08()
           
 void testBadBody09()
           
 void testBadBody10()
           
 void testBadBody11()
           
 void testBadBody12()
           
 void testBadBody13()
           
 void testBadBody14()
           
 void testBadBody15()
           
 void testBadHeader01()
           
 void testBadSoap01()
           
 void testBadSoap02()
           
 void testBadXml01()
           
 void testBadXml02()
           
 void testJunk()
           
 
Methods inherited from class mondrian.xmla.XmlaBaseTestCase
doTest, doTest, doTest, doTest, doTestInline, doTestInline, doTests, doTestsJson, fileToDocument, fileToString, filter, filterConnectString, generateExpectedString, generateRequestString, getDefaultRequestProperties, getServlet, getSessionId, helperTest, helperTestExpect, replaceLastSchemaUpdateDate, 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

doAuthorization

static boolean doAuthorization

user

static String user

password

static String password
Constructor Detail

XmlaErrorTest

public XmlaErrorTest()

XmlaErrorTest

public XmlaErrorTest(String name)
Method Detail

getChildElements

static Element[] getChildElements(Node node)

getCharacterData

static CharacterData getCharacterData(Node node)

getNodeContent

static String getNodeContent(Node n)

setUp

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

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class XmlaBaseTestCase
Throws:
Exception

getDiffRepos

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

getServletCallbackClass

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

getCatalogNameUrls

protected Map<String,String> getCatalogNameUrls(TestContext testContext)
Overrides:
getCatalogNameUrls in class XmlaBaseTestCase

testJunk

public void testJunk()
              throws Exception
Throws:
Exception

testBadXml01

public void testBadXml01()
                  throws Exception
Throws:
Exception

testBadXml02

public void testBadXml02()
                  throws Exception
Throws:
Exception

testBadAction01

public void testBadAction01()
                     throws Exception
Throws:
Exception

testBadAction02

public void testBadAction02()
                     throws Exception
Throws:
Exception

testBadAction03

public void testBadAction03()
                     throws Exception
Throws:
Exception

testBadSoap01

public void testBadSoap01()
                   throws Exception
Throws:
Exception

testBadSoap02

public void testBadSoap02()
                   throws Exception
Throws:
Exception

testAuth01

public void testAuth01()
                throws Exception
Throws:
Exception

testAuth02

public void testAuth02()
                throws Exception
Throws:
Exception

testAuth03

public void testAuth03()
                throws Exception
Throws:
Exception

testAuth04

public void testAuth04()
                throws Exception
Throws:
Exception

testAuth05

public void testAuth05()
                throws Exception
Throws:
Exception

testBadHeader01

public void testBadHeader01()
                     throws Exception
Throws:
Exception

testBadBody01

public void testBadBody01()
                   throws Exception
Throws:
Exception

testBadBody02

public void testBadBody02()
                   throws Exception
Throws:
Exception

testBadBody03

public void testBadBody03()
                   throws Exception
Throws:
Exception

testBadBody04

public void testBadBody04()
                   throws Exception
Throws:
Exception

testBadBody05

public void testBadBody05()
                   throws Exception
Throws:
Exception

testBadBody06

public void testBadBody06()
                   throws Exception
Throws:
Exception

testBadBody07

public void testBadBody07()
                   throws Exception
Throws:
Exception

testBadBody08

public void testBadBody08()
                   throws Exception
Throws:
Exception

testBadBody09

public void testBadBody09()
                   throws Exception
Throws:
Exception

testBadBody10

public void testBadBody10()
                   throws Exception
Throws:
Exception

testBadBody11

public void testBadBody11()
                   throws Exception
Throws:
Exception

testBadBody12

public void testBadBody12()
                   throws Exception
Throws:
Exception

testBadBody13

public void testBadBody13()
                   throws Exception
Throws:
Exception

testBadBody14

public void testBadBody14()
                   throws Exception
Throws:
Exception

testBadBody15

public void testBadBody15()
                   throws Exception
Throws:
Exception

doTest

protected void doTest(MockHttpServletRequest req,
                      mondrian.xmla.XmlaErrorTest.Fault expectedFault)
               throws Exception
Throws:
Exception

doTest

protected void doTest(mondrian.xmla.XmlaErrorTest.Fault expectedFault)
               throws Exception
Throws:
Exception

processResults

protected void processResults(byte[] results,
                              mondrian.xmla.XmlaErrorTest.Fault expectedFault)
                       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