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:
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.)

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

Nested Class Summary
(package private) static class XmlaErrorTest.Callback
           
(package private) static class XmlaErrorTest.Fault
           
 
Nested classes/interfaces inherited from class mondrian.xmla.XmlaBaseTestCase
XmlaBaseTestCase.Action, XmlaBaseTestCase.CallBack
 
Field Summary
(package private) static boolean doAuthorization
           
(package private) static java.lang.String password
           
(package private) static java.lang.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, 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
 
Fields inherited from interface mondrian.xmla.XmlaConstants
CHH_AUTHORIZATION_CODE, CHH_AUTHORIZATION_FAULT_FS, CHH_CODE, CHH_FAULT_FS, CLIENT_FAULT_FC, CONTENT_DEFAULT, CONTEXT_ROLE, CONTEXT_ROLE_NAME, CONTEXT_XMLA_SESSION_ID, CONTEXT_XMLA_SESSION_STATE, CONTEXT_XMLA_SESSION_STATE_BEGIN, CONTEXT_XMLA_SESSION_STATE_END, CONTEXT_XMLA_SESSION_STATE_WITHIN, 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_RESTRICTION_TYPE_CODE, HSB_BAD_RESTRICTION_TYPE_FAULT_FS, HSB_BAD_RESTRICTION_VALUE_CODE, HSB_BAD_RESTRICTION_VALUE_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_DRILLDOWN_BAD_FIRST_ROWSET_CODE, HSB_DRILLDOWN_BAD_FIRST_ROWSET_FAULT_FS, HSB_DRILLDOWN_BAD_MAXROWS_CODE, HSB_DRILLDOWN_BAD_MAXROWS_FAULT_FS, HSB_DRILLDOWN_ERROR_CODE, HSB_DRILLDOWN_ERROR_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, HSB_UNSUPPORTED_OPERATION_CODE, HSB_UNSUPPORTED_OPERATION_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, METHOD_DISCOVER, METHOD_EXECUTE, 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_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_SESSION, XMLA_SESSION_ID
 
Constructor Summary
XmlaErrorTest()
           
XmlaErrorTest(java.lang.String name)
           
 
Method Summary
 void doTest(MockHttpServletRequest req, XmlaErrorTest.Fault expectedFault)
           
 void doTest(java.lang.String reqFileName, XmlaErrorTest.Fault expectedFault)
           
protected  java.util.Map<java.lang.String,java.lang.String> getCatalogNameUrls(TestContext testContext)
           
(package private) static org.w3c.dom.CharacterData getCharacterData(org.w3c.dom.Node node)
           
(package private) static org.w3c.dom.Element[] getChildElements(org.w3c.dom.Node node)
           
protected  DiffRepository getDiffRepos()
           
(package private) static java.lang.String getNodeContent(org.w3c.dom.Node n)
           
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.
(package private) static boolean isEquals(java.lang.String s1, java.lang.String s2)
           
protected  void processResults(byte[] results, 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
clearServlet, doTest, doTest, doTestInline, doTestInline, doTests, fileToDocument, fileToString, filter, 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, 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, failNotEquals, failNotSame, failSame
 
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 java.lang.String user

password

static java.lang.String password
Constructor Detail

XmlaErrorTest

public XmlaErrorTest()

XmlaErrorTest

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

isEquals

static boolean isEquals(java.lang.String s1,
                        java.lang.String s2)

getChildElements

static org.w3c.dom.Element[] getChildElements(org.w3c.dom.Node node)

getCharacterData

static org.w3c.dom.CharacterData getCharacterData(org.w3c.dom.Node node)

getNodeContent

static java.lang.String getNodeContent(org.w3c.dom.Node n)

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class FoodMartTestCase
Throws:
java.lang.Exception

getDiffRepos

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

getServletCallbackClass

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

getCatalogNameUrls

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

testJunk

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

testBadXml01

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

testBadXml02

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

testBadAction01

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

testBadAction02

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

testBadAction03

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

testBadSoap01

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

testBadSoap02

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

testAuth01

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

testAuth02

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

testAuth03

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

testAuth04

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

testAuth05

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

testBadHeader01

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

testBadBody01

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

testBadBody02

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

testBadBody03

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

testBadBody04

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

testBadBody05

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

testBadBody06

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

testBadBody07

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

testBadBody08

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

testBadBody09

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

testBadBody10

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

testBadBody11

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

testBadBody12

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

testBadBody13

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

testBadBody14

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

testBadBody15

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

doTest

public void doTest(MockHttpServletRequest req,
                   XmlaErrorTest.Fault expectedFault)
            throws java.lang.Exception
Throws:
java.lang.Exception

doTest

public void doTest(java.lang.String reqFileName,
                   XmlaErrorTest.Fault expectedFault)
            throws java.lang.Exception
Throws:
java.lang.Exception

processResults

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