[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...
Brian Stansberry
brian.stansberry at jboss.com
Wed Dec 20 23:40:07 EST 2006
User: bstansberry
Date: 06/12/20 23:40:07
Added: tests/functional/org/jboss/cache/eviction Tag:
Branch_JBossCache_1_4_0
StateTransferIntegrationTest.java
Log:
[JBCACHE-913] Notify eviction policies of nodes added via state transfer
Revision Changes Path
No revision
No revision
1.1.2.1 +62 -0 JBossCache/tests/functional/org/jboss/cache/eviction/Attic/StateTransferIntegrationTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StateTransferIntegrationTest.java
===================================================================
RCS file: StateTransferIntegrationTest.java
diff -N StateTransferIntegrationTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ StateTransferIntegrationTest.java 21 Dec 2006 04:40:07 -0000 1.1.2.1
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.cache.eviction;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCache;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests that eviction policies are aware of events related to state transfer.
+ *
+ * @author Brian Stansberry
+ */
+public class StateTransferIntegrationTest extends TestCase
+{
+
+ /**
+ * Test for JBCACHE-913
+ *
+ * @throws Exception
+ */
+ public void testEvictionSeesStateTransfer() throws Exception
+ {
+ TreeCache cache1 = new TreeCache();
+ PropertyConfigurator config = new PropertyConfigurator();
+ config.configure(cache1, "META-INF/replSync-eviction-service.xml");
+ cache1.startService();
+
+ cache1.put("/a/b/c", "key", "value");
+
+ TreeCache cache2 = new TreeCache();
+ config.configure(cache2, "META-INF/replSync-eviction-service.xml");
+ cache2.startService();
+
+ RegionManager erm = cache2.getEvictionRegionManager();
+ Region region = erm.getRegion(Fqn.ROOT);
+ // We expect events for ROOT , /a, /a/b and /a/b/c
+ assertEquals("Saw the expected number of node events", 4, region.nodeEventQueueSize());
+ }
+}
More information about the jboss-cvs-commits
mailing list