[jbosscache-commits] JBoss Cache SVN: r5251 - in core/trunk/src/test: java/org/jboss/cache/config and 3 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Jan 28 19:15:28 EST 2008


Author: mircea.markus
Date: 2008-01-28 19:15:28 -0500 (Mon, 28 Jan 2008)
New Revision: 5251

Added:
   core/trunk/src/test/resources/META-INF/conf-test/local-passivation-service.xml
Modified:
   core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
   core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java
   core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java
   core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java
   core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
   core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java
Log:
fixed tests

Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java	2008-01-28 23:55:57 UTC (rev 5250)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java	2008-01-29 00:15:28 UTC (rev 5251)
@@ -46,7 +46,7 @@
    public void setUp() throws Exception
    {
       // start a single cache instance
-      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("/META-INF/news/local-cache-service.xml", false);
+      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("META-INF/conf-test/local-tx-service.xml", false);
       cache.getConfiguration().setNodeLockingScheme(optimistic ? Configuration.NodeLockingScheme.OPTIMISTIC : Configuration.NodeLockingScheme.PESSIMISTIC);
       cache.start();
       rootNode = cache.getRoot();

Modified: core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java	2008-01-28 23:55:57 UTC (rev 5250)
+++ core/trunk/src/test/java/org/jboss/cache/config/ConfigurationCloningTest.java	2008-01-29 00:15:28 UTC (rev 5251)
@@ -36,7 +36,7 @@
 public class ConfigurationCloningTest
 {
    /** A file that includes every configuration element I could think of */
-   public static final String DEFAULT_CONFIGURATION_FILE = "META-INF/clonable-config-service.xml";
+   public static final String DEFAULT_CONFIGURATION_FILE = "META-INF/conf-test/clonable-config-service.xml";
    
    private static final Log log = LogFactory.getLog(ConfigurationCloningTest.class);
    

Modified: core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java	2008-01-28 23:55:57 UTC (rev 5250)
+++ core/trunk/src/test/java/org/jboss/cache/invocationcontext/TransactionTest.java	2008-01-29 00:15:28 UTC (rev 5251)
@@ -25,7 +25,7 @@
    @BeforeMethod(alwaysRun = true)
    public void setUp()
    {
-      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("/META-INF/news/local-cache-service.xml");
+      cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache("META-INF/conf-test/local-tx-service.xml");
       tm = cache.getTransactionManager();
    }
 

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java	2008-01-28 23:55:57 UTC (rev 5250)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/BasicPassivationTest.java	2008-01-29 00:15:28 UTC (rev 5251)
@@ -12,6 +12,7 @@
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.factories.XmlConfigurationParser;
+import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 import org.jboss.cache.loader.DummyInMemoryCacheLoader;
 import org.jboss.cache.misc.TestingUtil;
 import org.jboss.cache.notifications.annotation.CacheListener;
@@ -59,7 +60,7 @@
    private void initCaches()
    {
       CacheFactory<String, String> instance = new DefaultCacheFactory();
-      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/jdbCacheLoader-passivation-service.xml"), false);
+      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       Object listener = new TestCacheListener();
       cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java	2008-01-28 23:55:57 UTC (rev 5250)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/ConcurrentPassivationTest.java	2008-01-29 00:15:28 UTC (rev 5251)
@@ -47,7 +47,7 @@
    private void initCaches()
    {
       CacheFactory<Integer, String> instance = new DefaultCacheFactory();
-      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/jdbCacheLoader-passivation-service.xml"), false);
+      cache = (CacheSPI) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
       cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
       cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
       cache.start();

Modified: core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java	2008-01-28 23:55:57 UTC (rev 5250)
+++ core/trunk/src/test/java/org/jboss/cache/passivation/LocalPassivationIntegrationTest.java	2008-01-29 00:15:28 UTC (rev 5251)
@@ -44,7 +44,7 @@
    public void setUp() throws Exception
    {
       CacheFactory<String, String> instance = new DefaultCacheFactory();
-      cache = (CacheSPI<String, String>) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/jdbCacheLoader-passivation-service.xml"), false);
+      cache = (CacheSPI<String, String>) instance.createCache(new XmlConfigurationParser().parseFile("META-INF/conf-test/local-passivation-service.xml"), false);
       cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
       cache.getConfiguration().getCacheLoaderConfig().getFirstCacheLoaderConfig().setClassName(DummyInMemoryCacheLoader.class.getName());
       cache.getConfiguration().setUseRegionBasedMarshalling(true);

Added: core/trunk/src/test/resources/META-INF/conf-test/local-passivation-service.xml
===================================================================
--- core/trunk/src/test/resources/META-INF/conf-test/local-passivation-service.xml	                        (rev 0)
+++ core/trunk/src/test/resources/META-INF/conf-test/local-passivation-service.xml	2008-01-29 00:15:28 UTC (rev 5251)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking level : SERIALIZABLE
+                               REPEATABLE_READ (default)
+                               READ_COMMITTED
+                               READ_UNCOMMITTED
+                               NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+      -->
+      <attribute name="CacheMode">LOCAL</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+           cluster in order to find each other.
+      -->
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+      <!--Uncomment next three statements to enable JGroups multiplexer.
+This configuration is dependent on the JGroups multiplexer being
+registered in an MBean server such as JBossAS.  -->
+      <!--
+      <depends>jgroups.mux:name=Multiplexer</depends>
+      <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+      <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+      -->
+
+
+      <!-- JGroups protocol stack properties NOT NEEDED since CacheMode is LOCAL -->
+
+
+      <!--
+          The max amount of time (in milliseconds) we wait until the
+          state (ie. the contents of the cache) are retrieved from
+          existing members in a clustered environment
+      -->
+      <attribute name="StateRetrievalTimeout">20000</attribute>
+
+      <!--
+          Number of milliseconds to wait until all responses for a
+          synchronous call have been received.
+      -->
+      <attribute name="SyncReplTimeout">20000</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+
+      <!-- Specific eviction policy configurations. This is LRU -->
+      <attribute name="EvictionPolicyConfig">
+         <config>
+            <attribute name="wakeUpIntervalSeconds">5</attribute>
+            <!-- This defaults to 200000 if not specified -->
+            <attribute name="eventQueueSize">200000</attribute>
+            <!-- Name of the DEFAULT eviction policy class. -->
+            <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+
+
+            <!-- Cache wide default -->
+            <region name="/_default_">
+               <attribute name="maxNodes">5000</attribute>
+               <attribute name="timeToLiveSeconds">3</attribute>
+            </region>
+            <region name="/org/jboss/test/data">
+               <attribute name="maxNodes">100</attribute>
+               <attribute name="timeToLiveSeconds">3</attribute>
+            </region>
+         </config>
+      </attribute>
+
+      <!-- New 1.3.x cache loader config block -->
+      <attribute name="CacheLoaderConfig">
+         <config>
+            <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+            <passivation>true</passivation>
+            <preload>/</preload>
+            <shared>false</shared>
+
+            <!-- we can now have multiple cache loaders, which get chained -->
+            <cacheloader>
+               <class>org.jboss.cache.loader.FileCacheLoader</class>
+               <!-- same as the old CacheLoaderConfig attribute
+                  location=/tmp this can be part of the properties.
+                  location=/tmp/JBossCacheFileCacheLoader
+               -->
+               <properties>
+               </properties>
+               <!-- whether the cache loader writes are asynchronous -->
+               <async>false</async>
+               <!-- only one cache loader in the chain may set fetchPersistentState to true.
+ An exception is thrown if more than one cache loader sets this to true. -->
+               <fetchPersistentState>true</fetchPersistentState>
+               <!-- determines whether this cache loader ignores writes - defaults to false. -->
+               <ignoreModifications>false</ignoreModifications>
+            </cacheloader>
+
+         </config>
+      </attribute>
+
+   </mbean>
+
+
+</server>




More information about the jbosscache-commits mailing list