Author: pnedonosko
Date: 2009-11-06 11:55:26 -0500 (Fri, 06 Nov 2009)
New Revision: 495
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
Log:
EXOJCR-200: new impl testing fixes
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-06
16:41:20 UTC (rev 494)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-06
16:55:26 UTC (rev 495)
@@ -88,7 +88,7 @@
if (data.getParentIdentifier() != null)
{
// check if parent is cached
- Node<Serializable, Object> parent =
cache.getNode(makeNodeFqn(data.getParentIdentifier()));
+ Node<Serializable, Object> parent =
nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
if (parent == null)
{
throw new RepositoryException("Node parent doesn't exist " +
data.getQPath().getAsString());
@@ -116,7 +116,7 @@
startBatch();
// check if parent is cached
- Node<Serializable, Object> parent =
cache.getNode(makeNodeFqn(data.getParentIdentifier()));
+ Node<Serializable, Object> parent =
nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
if (parent == null)
{
throw new RepositoryException("Property parent doesn't exist " +
data.getQPath().getAsString());
@@ -141,7 +141,7 @@
if (data.getParentIdentifier() != null)
{
// check if parent is cached
- Node<Serializable, Object> parent =
cache.getNode(makeNodeFqn(data.getParentIdentifier()));
+ Node<Serializable, Object> parent =
nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
if (parent == null)
{
throw new RepositoryException("Node parent doesn't exist " +
data.getQPath().getAsString());
@@ -165,7 +165,7 @@
startBatch();
// check if parent is cached
- Node<Serializable, Object> parent =
cache.getNode(makeNodeFqn(data.getParentIdentifier()));
+ Node<Serializable, Object> parent =
nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
if (parent == null)
{
throw new RepositoryException("Property parent doesn't exist " +
data.getQPath().getAsString());
@@ -387,9 +387,7 @@
if (data.getParentIdentifier() != null)
{
// check if parent is cached
- Fqn<String> parentFqn = makeNodeFqn(data.getParentIdentifier());
-
- Node<Serializable, Object> parent = cache.getNode(parentFqn);
+ Node<Serializable, Object> parent =
nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
if (parent == null)
{
throw new RepositoryException("Node parent doesn't exist " +
data.getQPath().getAsString());
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 2009-11-06
16:41:20 UTC (rev 494)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 2009-11-06
16:55:26 UTC (rev 495)
@@ -141,7 +141,7 @@
{
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add node (/node)
String node1id = "1";
@@ -208,7 +208,7 @@
{
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add property (/jcr:primaryType)
String propId1 = "1";
@@ -280,7 +280,7 @@
{
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add node (/node)
String node1id = "1";
@@ -332,7 +332,7 @@
{
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add property (/jcr:primaryType)
String propId1 = "1";
@@ -369,7 +369,7 @@
{
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add node (/node)
String node1id = "1";
@@ -412,7 +412,7 @@
{
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add property (/prop1)
String propId1 = "1";
@@ -458,7 +458,7 @@
// TODO prepare using JCR WDC API (not a right way, JBC API better... but read
assumes the write works)
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add node (/node)
String node1id = "1";
@@ -473,7 +473,7 @@
// check
ItemData nodeItem =
conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID,
1, Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new
AccessControlList()),
+ new InternalQName[0], 0, null, new AccessControlList()),
node1path.getEntries()[node1path.getEntries().length - 1]);
assertTrue("Node expected", nodeItem.isNode());
@@ -486,7 +486,7 @@
// TODO prepare using JCR WDC API (not a right way, JBC API better... but read
assumes the write works)
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add property (/jcr:primaryType)
String propId1 = "1";
@@ -501,7 +501,7 @@
// check
ItemData propItem =
conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID,
1, Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new
AccessControlList()),
+ new InternalQName[0], 0, null, new AccessControlList()),
propPath1.getEntries()[propPath1.getEntries().length - 1]);
assertFalse("Proeprty expected", propItem.isNode());
@@ -514,7 +514,7 @@
// TODO prepare using JCR WDC API (not a right way, JBC API better... but read
assumes the write works)
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add node (/node)
String node1id = "1";
@@ -539,7 +539,7 @@
// TODO prepare using JCR WDC API (not a right way, JBC API better... but read
assumes the write works)
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add property (/jcr:primaryType)
String propId1 = "1";
@@ -564,7 +564,7 @@
// TODO prepare using JCR WDC API (not a right way, JBC API better... but read
assumes the write works)
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add node (/node)
String node1id = "1";
@@ -581,7 +581,7 @@
List<NodeData> childs =
conn.getChildNodesData(new TransientNodeData(Constants.ROOT_PATH,
Constants.ROOT_UUID, 1,
- Constants.NT_UNSTRUCTURED, new InternalQName[0], 0,
Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new
AccessControlList()));
assertEquals("Childs amount wrong", 2, childs.size());
@@ -607,7 +607,7 @@
// TODO prepare using JCR WDC API (not a right way, JBC API better... but read
assumes the write works)
// add root (/)
conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1,
Constants.NT_UNSTRUCTURED,
- new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ new InternalQName[0], 0, null, new AccessControlList()));
// add property (/jcr:primaryType)
String propId1 = "1";
@@ -636,7 +636,7 @@
List<PropertyData> childs =
conn.getChildPropertiesData(new TransientNodeData(Constants.ROOT_PATH,
Constants.ROOT_UUID, 1,
- Constants.NT_UNSTRUCTURED, new InternalQName[0], 0,
Constants.ROOT_PARENT_UUID, new AccessControlList()));
+ Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new
AccessControlList()));
assertEquals("Childs amount wrong", 4, childs.size());