public abstract class XmlaBaseTestCase extends FoodMartTestCase
Modifier and Type | Class and Description |
---|---|
(package private) static class |
XmlaBaseTestCase.Action |
(package private) static class |
XmlaBaseTestCase.CallBack |
protected static class |
XmlaBaseTestCase.XmlaRequestCallbackImpl |
Modifier and Type | Field and Description |
---|---|
static String |
CATALOG |
static String |
CATALOG_NAME_PROP |
static String |
CATALOG_PROP |
protected SortedMap<String,String> |
catalogNameUrls |
static String |
CUBE_NAME_PROP |
static String |
DATA_SOURCE_INFO |
static String |
DATA_SOURCE_INFO_PROP |
protected static boolean |
DEBUG |
static String |
FORMAT_MULTI_DIMENSIONAL |
static String |
FORMAT_PROP |
protected static String |
LAST_SCHEMA_UPDATE_DATE |
static String |
LOCALE_PROP |
static String |
REQUEST_TYPE_PROP |
static String |
ROLE_PROP |
static String |
SALES_CUBE |
static String |
SESSION_ID_PROP |
propSaver
Constructor and Description |
---|
XmlaBaseTestCase() |
XmlaBaseTestCase(String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
doTest(MockHttpServletRequest req,
Properties props) |
void |
doTest(Properties props) |
void |
doTest(String requestType,
Properties props,
TestContext testContext)
Executes an XMLA request, reading the text of the request and the
response from attributes in
getDiffRepos() . |
void |
doTest(String requestType,
Properties props,
TestContext testContext,
Role role) |
void |
doTestInline(String requestType,
String requestText,
String respFileName,
Properties props,
TestContext testContext) |
void |
doTestInline(String requestType,
String requestText,
String respFileName,
Properties props,
TestContext testContext,
Role role) |
protected void |
doTests(String soapRequestText,
Properties props,
TestContext testContext,
String connectString,
Map<String,String> catalogNameUrls,
Document expectedDoc,
XmlaConstants.Content content,
Role role,
boolean replace)
Executes a SOAP request.
|
protected void |
doTestsJson(String soapRequestText,
Properties props,
TestContext testContext,
String connectString,
Map<String,String> catalogNameUrls,
String expectedStr,
XmlaConstants.Content content,
Role role) |
protected Document |
fileToDocument(String filename,
Properties props) |
protected String |
fileToString(String filename) |
protected String |
filter(String testCaseName,
String filename,
String content)
Filters the content of a test resource.
|
protected String |
filterConnectString(String original) |
protected String |
generateExpectedString(Properties props) |
protected String |
generateRequestString(Properties props) |
protected Map<String,String> |
getCatalogNameUrls(TestContext testContext) |
protected Properties |
getDefaultRequestProperties(String requestType) |
protected abstract DiffRepository |
getDiffRepos() |
protected javax.servlet.Servlet |
getServlet(TestContext testContext) |
protected abstract Class<? extends XmlaRequestCallback> |
getServletCallbackClass() |
protected static String |
getSessionId(String name,
XmlaBaseTestCase.Action action) |
protected abstract String |
getSessionId(XmlaBaseTestCase.Action action)
Creates, retrieves or clears the session id for this test.
|
protected void |
helperTest(boolean doSessionId) |
protected void |
helperTestExpect(boolean doSessionId) |
static String |
maskVersion(String str)
Masks Mondrian's version number from a string.
|
protected Document |
replaceLastSchemaUpdateDate(Document doc) |
protected void |
tearDown() |
protected void |
validate(byte[] bytes,
Document expectedDoc,
TestContext testContext,
boolean replace,
boolean validate) |
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
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toString
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
protected static final String LAST_SCHEMA_UPDATE_DATE
public static final String SESSION_ID_PROP
public static final String REQUEST_TYPE_PROP
public static final String DATA_SOURCE_INFO_PROP
public static final String DATA_SOURCE_INFO
public static final String CATALOG_PROP
public static final String CATALOG_NAME_PROP
public static final String CATALOG
public static final String CUBE_NAME_PROP
public static final String SALES_CUBE
public static final String FORMAT_PROP
public static final String FORMAT_MULTI_DIMENSIONAL
public static final String ROLE_PROP
public static final String LOCALE_PROP
protected static final boolean DEBUG
public XmlaBaseTestCase()
public XmlaBaseTestCase(String name)
protected void tearDown() throws Exception
tearDown
in class FoodMartTestCase
Exception
protected String generateExpectedString(Properties props) throws Exception
Exception
protected String generateRequestString(Properties props) throws Exception
Exception
protected void validate(byte[] bytes, Document expectedDoc, TestContext testContext, boolean replace, boolean validate) throws Exception
Exception
public void doTest(Properties props) throws Exception
Exception
protected void doTest(MockHttpServletRequest req, Properties props) throws Exception
Exception
protected void helperTestExpect(boolean doSessionId)
protected void helperTest(boolean doSessionId)
protected abstract DiffRepository getDiffRepos()
protected Map<String,String> getCatalogNameUrls(TestContext testContext)
protected javax.servlet.Servlet getServlet(TestContext testContext) throws IOException, javax.servlet.ServletException, SAXException
IOException
javax.servlet.ServletException
SAXException
protected abstract Class<? extends XmlaRequestCallback> getServletCallbackClass()
protected Properties getDefaultRequestProperties(String requestType)
protected Document fileToDocument(String filename, Properties props) throws IOException, SAXException
IOException
SAXException
protected String filter(String testCaseName, String filename, String content)
testCaseName
- Name of current test case, e.g. "testFoo"filename
- Name of requested content, e.g. "${request}"content
- Contentpublic void doTest(String requestType, Properties props, TestContext testContext) throws Exception
getDiffRepos()
.requestType
- Request type: "DISCOVER_DATASOURCES", "EXECUTE", etc.props
- Properties for requesttestContext
- Test contextException
- on errorpublic void doTest(String requestType, Properties props, TestContext testContext, Role role) throws Exception
Exception
public void doTestInline(String requestType, String requestText, String respFileName, Properties props, TestContext testContext) throws Exception
Exception
public void doTestInline(String requestType, String requestText, String respFileName, Properties props, TestContext testContext, Role role) throws Exception
Exception
protected void doTests(String soapRequestText, Properties props, TestContext testContext, String connectString, Map<String,String> catalogNameUrls, Document expectedDoc, XmlaConstants.Content content, Role role, boolean replace) throws Exception
soapRequestText
- SOAP requestprops
- Name/value pairs to substitute in the requesttestContext
- Test contextconnectString
- Connect stringcatalogNameUrls
- Map from catalog names to URLexpectedDoc
- Expected SOAP outputcontent
- Content typerole
- Role in which to execute query, or nullreplace
- Whether to generate a replacement reference log into
TestName.log.xml if there is an exception. If you are running the same
request with different content types and the same reference log, you
should pass true
for the content type that has the most
information (generally
XmlaConstants.Content.SchemaData
)Exception
- on errorprotected void doTestsJson(String soapRequestText, Properties props, TestContext testContext, String connectString, Map<String,String> catalogNameUrls, String expectedStr, XmlaConstants.Content content, Role role) throws Exception
Exception
protected abstract String getSessionId(XmlaBaseTestCase.Action action)
action
- Action to performprotected static String getSessionId(String name, XmlaBaseTestCase.Action action)
public static String maskVersion(String str)
str
- String