[exo-jcr-commits] exo-jcr SVN: r540 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Nov 10 05:01:37 EST 2009
Author: nzamosenchuk
Date: 2009-11-10 05:01:36 -0500 (Tue, 10 Nov 2009)
New Revision: 540
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java
Log:
EXOJCR-204: Updated test
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-10 09:03:50 UTC (rev 539)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-10 10:01:36 UTC (rev 540)
@@ -70,10 +70,12 @@
final Map<String, String> nss = new HashMap<String, String>();
- ns.put("jcr", "http:jcr");
+ ns.put("jcr", "http://jcr");
+ nss.put("http://jcr", "jcr");
ns.put("", "");
- nss.put("http:jcr", "jcr");
nss.put("", "");
+ ns.put("nt", "http://nt");
+ nss.put("http://nt", "nt");
this.lf = new LocationFactory(new NamespaceAccessor()
{
@@ -216,6 +218,29 @@
assertEquals(userId, event.getUserID());
}
+ public void testFilterByNodeType() throws Exception
+ {
+ QPath node1path = QPath.parse("[]:1[]node:1");
+ NodeData newNode =
+ new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0], 0,
+ Constants.ROOT_UUID, new AccessControlList());
+ NodeData newNode2 =
+ new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Constants.NT_RESOURCE, new InternalQName[0], 0,
+ Constants.ROOT_UUID, new AccessControlList());
+ DummyListener listener = new DummyListener();
+ // listening only to NT_RESOURCE nodes
+ registry.addEventListener(listener, new ListenerCriteria(Event.NODE_ADDED,
+ lf.parseAbsPath("/").getInternalPath(), true, null, new InternalQName[]{Constants.NT_RESOURCE}, false, "session1"));
+
+ List<Modification> modifications = new ArrayList<Modification>(setSession("session1", "admin"));
+ modifications.addAll(addNode(newNode));
+ modifications.addAll(addNode(newNode2));
+ modifications.addAll(removeSession());
+ loader.put(modifications);
+ // one event expected
+ assertEvent(Event.NODE_ADDED, node1path, listener, "admin");
+ }
+
@Override
protected void tearDown() throws Exception
{
More information about the exo-jcr-commits
mailing list