[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/eviction ...

Brian Stansberry brian.stansberry at jboss.com
Thu Dec 21 00:04:51 EST 2006


  User: bstansberry
  Date: 06/12/21 00:04:51

  Added:       tests/functional/org/jboss/cache/eviction 
                        StateTransferIntegrationTest.java
  Log:
  [JBCACHE-913] Add test of notifying eviction policies of nodes added via state transfer
  
  Revision  Changes    Path
  1.2       +64 -0     JBossCache/tests/functional/org/jboss/cache/eviction/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 05:04:51 -0000	1.2
  @@ -0,0 +1,64 @@
  +/*
  + * 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.Cache;
  +import org.jboss.cache.Fqn;
  +import org.jboss.cache.Region;
  +import org.jboss.cache.config.Configuration;
  +import org.jboss.cache.factories.DefaultCacheFactory;
  +import org.jboss.cache.factories.XmlConfigurationParser;
  +
  +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
  +   {
  +      XmlConfigurationParser parser = new XmlConfigurationParser();
  +      Configuration c = parser.parseFile("META-INF/replSync-eviction-service.xml");
  +      Cache cache1 = DefaultCacheFactory.createCache(c, false);  
  +      cache1.start();
  +      
  +      cache1.put(Fqn.fromString("/a/b/c"), "key", "value");
  +      
  +      c = parser.parseFile("META-INF/replSync-eviction-service.xml");
  +      Cache cache2 = DefaultCacheFactory.createCache(c, false);
  +      cache2.start();
  +      
  +      Region region = cache2.getRegion(Fqn.ROOT, false);
  +      // 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