Author: areshetnyak
Date: 2009-11-12 05:02:31 -0500 (Thu, 12 Nov 2009)
New Revision: 589
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
Log:
EXOJCR-201 : The JDBCCacheLoaderTest was changed.
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12
09:49:39 UTC (rev 588)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12
10:02:31 UTC (rev 589)
@@ -44,6 +44,7 @@
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
import org.exoplatform.services.jcr.util.IdGenerator;
+import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
import java.io.InputStream;
@@ -52,6 +53,7 @@
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
import javax.naming.Context;
@@ -283,9 +285,9 @@
InternalQName propertyName, Object propertyValue, boolean multiValued) throws
Exception
{
String propId = IdGenerator.generate();
- QPath propPath = QPath.makeChildPath(Constants.ROOT_PATH,
Constants.JCR_MIXINTYPES);
+ QPath propPath = QPath.makeChildPath(nodePath, propertyName);
TransientPropertyData propData =
- new TransientPropertyData(propPath, propId, 1, 1, Constants.ROOT_UUID,
multiValued);
+ new TransientPropertyData(propPath, propId, 1, 1, nodeId, multiValued);
List<Object> values = new ArrayList<Object>();
if (multiValued)
@@ -337,22 +339,21 @@
// prepare
initJCRRoot();
- String propId = IdGenerator.generate();
- QPath propPath = QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_DATA);
- TransientPropertyData propData = new TransientPropertyData(propPath, propId, 1, 1,
Constants.ROOT_UUID, false);
- String propValue = "JCR DATA VALUE";
- propData.setValue(new TransientValueData(propValue));
+ WorkspaceStorageConnection connection = persistentContainer.openConnection();
+ TransientPropertyData propData = addDbProperty(connection, Constants.ROOT_PATH,
Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", false);
+ connection.commit();
+
List<Modification> modifications = new ArrayList<Modification>();
modifications.addAll(addProperty(propData));
loader.put(modifications);
- // tests
- WorkspaceStorageConnection connection = persistentContainer.openConnection();
+ // tests it
+ connection = persistentContainer.openConnection();
- PropertyData destPropData = (PropertyData) connection.getItemData(propId);
+ PropertyData destPropData = (PropertyData)
connection.getItemData(propData.getIdentifier());
assertNotNull(destPropData);
assertEquals(propData.getIdentifier(), destPropData.getIdentifier());
@@ -435,9 +436,30 @@
{
// prepare
+ initJCRRoot();
+
+ String propId = IdGenerator.generate();
+ QPath propPath = QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_DATA);
+ TransientPropertyData propData = new TransientPropertyData(propPath, propId, 1, 1,
Constants.ROOT_UUID, false);
+ String propValue = "JCR DATA VALUE";
+ propData.setValue(new TransientValueData(propValue));
+
+ List<Modification> modifications = new ArrayList<Modification>();
+
+ modifications.addAll(addProperty(propData));
+
+ loader.put(modifications);
// tests it
+ WorkspaceStorageConnection connection = persistentContainer.openConnection();
+
+ PropertyData destPropData = (PropertyData) connection.getItemData(propId);
+
+ Map<Object, Object> attrebutes =
loader.get(Fqn.fromString("/"+JBossCacheStorage.PROPS + "/" +
propId));
+
+ assertNotNull(attrebutes);
+
}
public void testGetPropertyByName() throws Exception
Show replies by date