public class JcrDriverIntegrationTest extends AbstractJdbcDriverIntegrationTest
ModeShapeEngine. Essentially this is an integration test, but it does test lower-level functionality of the
implementation of the JCR interfaces related to querying. (It is simply more difficult to unit test these implementations
because of the difficulty in mocking the many other components to replicate the same functionality.)
Also, because queries are read-only, the engine is set up once and used for the entire set of test methods.
The following are the SQL semantics that the tests will be covering:
To create the expected results to be used to run a test, use the test and print method: example:
DriverTestUtil.executeTestAndPrint(this.connection, "SELECT * FROM [nt:base]"); This will print the expected results like this:
String[] expected = { "jcr:primaryType[STRING]", "mode:root", "car:Car", "car:Car", "nt:unstructured" } Now copy the expected
results to the test method. Then change the test to run the executeTest method passing in the expected results:
example: DriverTestUtil.executeTest(this.connection, "SELECT * FROM [nt:base]", expected);
connection, dbmd, driver, resultsComparatorrepository, sessionprint, skipTestRule| Constructor and Description |
|---|
JcrDriverIntegrationTest() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
createConnectionUrl(JcrRepository repository) |
protected Driver |
createDriver(JcrRepository repository) |
shouldBeAbleToCreateAndExecuteSqlQueryToFindAllCarsUnderHybrid, shouldBeAbleToExecuteSqlQueryToFindAllUnstructuredNodes, shouldBeAbleToExecuteSqlQueryUsingJoinToFindAllCarsUnderHybrid, shouldBeAbleToExecuteSqlQueryWithChildAxisCriteria, shouldBeAbleToExecuteSqlQueryWithOrderByClauseAsc, shouldBeAbleToExecuteSqlQueryWithOrderByClauseUsingDefault, shouldBeAbleToExecuteSqlQueryWithOrderedByClauseDesc, shouldBeAbleToExecuteSqlSelectAllCars, shouldBeAbleToExecuteSqlSelectAllNodes, shouldGetAllColumnsFor1Table, shouldGetAllTables, shouldGetCatalogs, shouldGetNTPrefixedTables, shouldGetOnlyColumnsForCarPrefixedTables, shouldGetOnlyMSRPColumnForCarTable, shouldGetResourceSuffixedTables, shouldGetTablesThatContainNodeTpe, shouldGetTableTypesafterEach, assertResultsSetEquals, assertResultsSetEquals, assertRowCount, beforeAll, beforeEach, connect, connect, createConnectionProperties, executeQuery, executeQuery, shouldStartUpafterAll, assertNodesAreFound, assertNodesNotFound, getSession, importContent, importContent, registerNodeTypes, registerNodeTypes, repository, resourceStream, session, startRepository, startRepository, stopRepositoryacl, addMixin, addMixin, addMixinRecursively, assertChildrenInclude, assertChildrenInclude, assertHasMixins, assertJcrSql2Query, assertNode, assertNode, assertNoNode, assertSameProperties, asString, calculateTotalNumberOfNodesInTree, createSubgraph, getTotalAndAverageDuration, hasMixin, name, navigate, navigate, navigate, navigate, navigate, path, print, print, print, print, print, print, print, print, printDetails, printMessage, printResults, printResults, relativePath, traverseChildren, traverseSubgraphpublic JcrDriverIntegrationTest()
protected Driver createDriver(JcrRepository repository) throws Exception
createDriver in class AbstractJdbcDriverTestExceptionprotected String createConnectionUrl(JcrRepository repository) throws Exception
createConnectionUrl in class AbstractJdbcDriverTestExceptionCopyright © 2008–2021 JBoss, a division of Red Hat. All rights reserved.