[infinispan-commits] Infinispan SVN: r327 - in trunk/core/src: main/resources and 4 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Wed May 20 10:59:54 EDT 2009


Author: mircea.markus
Date: 2009-05-20 10:59:54 -0400 (Wed, 20 May 2009)
New Revision: 327

Added:
   trunk/core/src/test/java/org/infinispan/config/parsing/Jbc2InfinispanTransformerTest.java
   trunk/core/src/test/resources/configs/jbosscache3x/
   trunk/core/src/test/resources/configs/jbosscache3x/all.xml
   trunk/core/src/test/resources/configs/jbosscache3x/buddy-replication.xml
   trunk/core/src/test/resources/configs/jbosscache3x/cacheloader-enabled.xml
   trunk/core/src/test/resources/configs/jbosscache3x/eviction-enabled.xml
   trunk/core/src/test/resources/configs/jbosscache3x/external-jgroups-file.xml
   trunk/core/src/test/resources/configs/jbosscache3x/invalidation-async.xml
   trunk/core/src/test/resources/configs/jbosscache3x/total-replication.xml
Modified:
   trunk/core/src/main/java/org/infinispan/config/parsing/ConfigFilesConvertor.java
   trunk/core/src/main/resources/importConfig.sh
   trunk/core/src/main/resources/xslt/jbc3x2infinispan4x.xslt
Log:
finished config inport work

Modified: trunk/core/src/main/java/org/infinispan/config/parsing/ConfigFilesConvertor.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/parsing/ConfigFilesConvertor.java	2009-05-20 13:53:40 UTC (rev 326)
+++ trunk/core/src/main/java/org/infinispan/config/parsing/ConfigFilesConvertor.java	2009-05-20 14:59:54 UTC (rev 327)
@@ -83,7 +83,7 @@
    }
 
    /**
-    * Writes to the <b>os</b> the 3.x configuration file resulted by transforming the 2.x configuration file passed in
+    * Writes to the <b>os</b> the infinispan 4.x configuration file resulted by transforming configuration file passed in
     * as <b>inputFile</b>. Transformation is performed according to the <b>xsltFile</b>. Both <b>inputFile</b> and he
     * xslt file are looked up using a {@link org.jboss.cache.util.FileLookup}
     */
@@ -158,7 +158,6 @@
       is.close();
       fos.close();
 
-      System.out.println("jgroupsConfigFile.length() = " + jgroupsConfigFile.length());
       //now this means that the generated file is basically empty, so delete ie
       if (jgroupsConfigFile.length() < 5) {
          jgroupsConfigFile.delete();

Modified: trunk/core/src/main/resources/importConfig.sh
===================================================================
--- trunk/core/src/main/resources/importConfig.sh	2009-05-20 13:53:40 UTC (rev 326)
+++ trunk/core/src/main/resources/importConfig.sh	2009-05-20 14:59:54 UTC (rev 327)
@@ -13,6 +13,6 @@
       CLASSPATH=$CLASSPATH:$JAR
    done
 fi
-CLASSPATH=../modules/core/infinispan-core.jar:$CLASSPATH
+CLASSPATH=../modules/core/infinispan-core.jar$CLASSPATH
 echo classpath is $CLASSPATH
-java -classpath $CLASSPATH -Dsource=$1 -Ddestination=$2 org.jboss.cache.config.parsing.ConfigFilesConvertor
\ No newline at end of file
+java -classpath $CLASSPATH -Dsource=$1 -Ddestination=$2 -Dtype=$3 org.infinispan.config.parsing.ConfigFilesConvertor
\ No newline at end of file

Modified: trunk/core/src/main/resources/xslt/jbc3x2infinispan4x.xslt
===================================================================
--- trunk/core/src/main/resources/xslt/jbc3x2infinispan4x.xslt	2009-05-20 13:53:40 UTC (rev 326)
+++ trunk/core/src/main/resources/xslt/jbc3x2infinispan4x.xslt	2009-05-20 14:59:54 UTC (rev 327)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:stylesheet xmlns="urn:infinispan:config:4.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes" version="1.0" encoding="UTF-8" omit-xml-declaration="no"/>
 
    <xsl:template match="/jbosscache">
@@ -153,10 +153,8 @@
                   <xsl:if test="transaction[@transactionManagerLookupClass]">
                      <xsl:if
                            test="not(starts-with(transaction/@transactionManagerLookupClass,'org.jboss.cache'))">
-                        <xsl:message terminate="no">WARNING!!! Custom 'transactionManagerLookupClass' is being used.
-                           This cannot
-                           be automatically transformed.
-                        </xsl:message>
+                        <xsl:message terminate="no">WARNING! Custom 'transactionManagerLookupClass' is being used. This cannot be automatically transformed.</xsl:message>
+                        <!-- TODO Custom 'transactionManagerLookupClass' is being used. This cannot be automatically transformed. -->
                      </xsl:if>
                      <xsl:attribute name="transactionManagerLookupClass">
                         <xsl:value-of
@@ -230,139 +228,204 @@
                         </xsl:if>
                      </xsl:element>
                   </xsl:if>
-                  <xsl:element name="async">
-                     <xsl:if test="clustering/async[@useReplQueue]">
-                        <xsl:attribute name="useReplQueue">
-                           <xsl:value-of select="clustering/async/@useReplQueue"/>
-                        </xsl:attribute>
-                     </xsl:if>
-                     <xsl:if test="clustering/async[@replQueueInterval]">
-                        <xsl:attribute name="replQueueInterval">
-                           <xsl:value-of select="clustering/async/@replQueueInterval"/>
-                        </xsl:attribute>
-                     </xsl:if>
-                     <xsl:if test="clustering/async[@replQueueMaxElements]">
-                        <xsl:attribute name="replQueueMaxElements">
-                           <xsl:value-of select="clustering/async/@replQueueMaxElements"/>
-                        </xsl:attribute>
-                     </xsl:if>
-                     <xsl:if test="clustering/async[@serializationExecutorPoolSize > 1]">
-                        <xsl:attribute name="asyncMarshalling">true</xsl:attribute>
-                     </xsl:if>
-                  </xsl:element>
-               </xsl:element>
-            </xsl:if>
-
-            <xsl:if test="loaders">
-               <xsl:element name="loaders">
-                  <xsl:if test="loaders[@passivation]">
-                     <xsl:attribute name="passivation">
-                        <xsl:value-of select="loaders/@passivation"/>
-                     </xsl:attribute>
-                  </xsl:if>
-                  <xsl:if test="loaders[@shared]">
-                     <xsl:attribute name="shared">
-                        <xsl:value-of select="loaders/@shared"/>
-                     </xsl:attribute>
-                  </xsl:if>
-                  <xsl:if test="loaders/preload">
-                     <xsl:message terminate="no">WARNING!!! Preload elements cannot be automatically transformed, please
-                        do it manually!
-                     </xsl:message>
-                  </xsl:if>
-                  <xsl:for-each select="loaders/loader">
-                     <xsl:element name="loader">
-                        <xsl:attribute name="class">
-                           <xsl:value-of select="@class"/>
-                        </xsl:attribute>
-                        <xsl:if test="@fetchPersistentState">
-                           <xsl:attribute name="fetchPersistentState">
-                              <xsl:value-of select="@fetchPersistentState"/>
+                  <xsl:if test="clustering/async">
+                     <xsl:element name="async">
+                        <xsl:if test="clustering/async[@useReplQueue]">
+                           <xsl:attribute name="useReplQueue">
+                              <xsl:value-of select="clustering/async/@useReplQueue"/>
                            </xsl:attribute>
                         </xsl:if>
-                        <xsl:if test="@ignoreModifications">
-                           <xsl:attribute name="ignoreModifications">
-                              <xsl:value-of select="@ignoreModifications"/>
+                        <xsl:if test="clustering/async[@replQueueInterval]">
+                           <xsl:attribute name="replQueueInterval">
+                              <xsl:value-of select="clustering/async/@replQueueInterval"/>
                            </xsl:attribute>
                         </xsl:if>
-                        <xsl:if test="@purgeOnStartup">
-                           <xsl:attribute name="purgeOnStartup">
-                              <xsl:value-of select="@purgeOnStartup"/>
+                        <xsl:if test="clustering/async[@replQueueMaxElements]">
+                           <xsl:attribute name="replQueueMaxElements">
+                              <xsl:value-of select="clustering/async/@replQueueMaxElements"/>
                            </xsl:attribute>
                         </xsl:if>
-                        <xsl:if test="properties">
-                           <xsl:message terminate="no">INFO: Please configure cache loader props manually!</xsl:message>
-                           <properties>
-                              <property name="...set name here..." value="...set value here..."/>
-                              <property name="...set name here..." value="...set value here..."/>
-                           </properties>
+                        <xsl:if test="clustering/async[@serializationExecutorPoolSize > 1]">
+                           <xsl:attribute name="asyncMarshalling">true</xsl:attribute>
                         </xsl:if>
-                        <xsl:if test="singletonStore">
-                           <xsl:element name="singletonStore">
-                              <xsl:if test="singletonStore[@enabled]">
-                                 <xsl:attribute name="enabled">
-                                    <xsl:value-of select="singletonStore/@enabled"/>
-                                 </xsl:attribute>
-                                 <xsl:if test="singletonStore/properties">
-                                    <xsl:message terminate="no">WARNING!!! Singleton store was changed and needs to be
-                                       configured manually!!!!
-                                    </xsl:message>
-                                 </xsl:if>
-                              </xsl:if>
-                           </xsl:element>
-
-                        </xsl:if>
                      </xsl:element>
-                  </xsl:for-each>
+                  </xsl:if>
                </xsl:element>
             </xsl:if>
+
+            <xsl:call-template name="generateLoaders"/>
          </default>
 
-         <xsl:for-each select="eviction/*">
+         <xsl:for-each select="eviction/region">
             <xsl:element name="namedCache">
-               <xsl:attribute name="name">
-                  <xsl:choose>
-                     <xsl:when test="@name">
-                        <xsl:value-of select="@name"/>
-                     </xsl:when>
-                     <xsl:otherwise>default</xsl:otherwise>
-                  </xsl:choose>
+               <xsl:call-template name="evictionAttributes"/>
+               <xsl:call-template name="generateLoaders"/>
+            </xsl:element>
+         </xsl:for-each>
+      </xsl:element>
+
+      <xsl:message terminate="no">IMPORTANT: Please take a look at the generated file for (possible) TODOs about the elements that couldn't be converted automatically!</xsl:message>
+   </xsl:template>
+
+   <xsl:template name="generateLoaders">
+      <xsl:if test="loaders">
+         <xsl:element name="loaders">
+            <xsl:if test="loaders[@passivation]">
+               <xsl:attribute name="passivation">
+                  <xsl:value-of select="loaders/@passivation"/>
                </xsl:attribute>
-               <xsl:element name="eviction">
-                  <xsl:if test="/jbosscache/eviction[@wakeUpInterval]">
-                     <xsl:attribute name="wakeUpInterval">
-                        <xsl:value-of select="/jbosscache/eviction/@wakeUpInterval"/>
+            </xsl:if>
+            <xsl:if test="loaders[@shared]">
+               <xsl:attribute name="shared">
+                  <xsl:value-of select="loaders/@shared"/>
+               </xsl:attribute>
+            </xsl:if>
+            <xsl:if test="loaders/preload">
+               <xsl:message terminate="no">WARNING! Preload elements cannot be automatically transformed, please do it manually!</xsl:message>
+               <!-- TODO - Preload elements cannot be automatically transformed, please do it manually!-->
+            </xsl:if>
+            <xsl:for-each select="loaders/loader">
+               <xsl:element name="loader">
+                  <xsl:attribute name="class">
+                     <xsl:choose>
+                        <xsl:when test="@class='org.jboss.cache.loader.JDBCCacheLoader'">
+                           <xsl:text>org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore</xsl:text>
+                        </xsl:when>
+                        <xsl:otherwise>
+                           <xsl:choose>
+                              <xsl:when test="@class='org.jboss.cache.loader.FileCacheLoader'">
+                                 <xsl:text>org.infinispan.loaders.file.FileCacheStore</xsl:text>
+                              </xsl:when>
+                              <xsl:otherwise>
+                                 <xsl:choose>
+                                    <xsl:when test="@class='org.jboss.cache.loader.bdbje.BdbjeCacheLoader'">
+                                       <xsl:text>org.infinispan.loaders.bdbje.BdbjeCacheStore</xsl:text>
+                                    </xsl:when>
+                                    <xsl:otherwise>
+                                       <xsl:choose>
+                                          <xsl:when
+                                                test="@class='org.jboss.cache.loader.jdbm.JdbmCacheLoader' or @class='org.jboss.cache.loader.jdbm.JdbmCacheLoader2'">
+                                             <xsl:text>org.infinispan.loaders.jdbm.JdbmCacheStore</xsl:text>
+                                          </xsl:when>
+                                          <xsl:otherwise>
+                                             <xsl:choose>
+                                                <xsl:when test="@class='org.jboss.cache.loader.s3.S3CacheLoader'">
+                                                   <xsl:text>org.infinispan.loaders.s3.S3CacheStore</xsl:text>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                   <xsl:message terminate="no">WARNING! Cannot convert classloader's class, please do it manually!</xsl:message>
+                                                   <!--TODO Cannot convert classloader's class, please do it manually!-->
+                                                </xsl:otherwise>
+                                             </xsl:choose>
+                                          </xsl:otherwise>
+                                       </xsl:choose>
+                                    </xsl:otherwise>
+                                 </xsl:choose>
+                              </xsl:otherwise>
+                           </xsl:choose>
+                        </xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:attribute>
+                  <xsl:if test="@fetchPersistentState">
+                     <xsl:attribute name="fetchPersistentState">
+                        <xsl:value-of select="@fetchPersistentState"/>
                      </xsl:attribute>
                   </xsl:if>
-                  <xsl:if test="property[@name='maxNodes']">
-                     <xsl:attribute name="maxEntries">
-                        <xsl:value-of select="normalize-space(property[@name='maxNodes']/@value)"/>
+                  <xsl:if test="@ignoreModifications">
+                     <xsl:attribute name="ignoreModifications">
+                        <xsl:value-of select="@ignoreModifications"/>
                      </xsl:attribute>
                   </xsl:if>
-                  <xsl:if test="@algorithmClass and not(starts-with(@algorithmClass,'org.jboss.cache'))">
-                     <xsl:message terminate="no">WARNING!!! Custom eviction 'algorithmClass' is being used.
-                        This cannot be automatically transformed. Plese do this manually.
-                     </xsl:message>
+                  <xsl:if test="@purgeOnStartup">
+                     <xsl:attribute name="purgeOnStartup">
+                        <xsl:value-of select="@purgeOnStartup"/>
+                     </xsl:attribute>
                   </xsl:if>
-                  <xsl:choose>
-                     <xsl:when test="@algorithmClass">
-                        <xsl:attribute name="strategy">
-                           <xsl:value-of
-                                 select="substring-before(substring-after(@algorithmClass,'org.jboss.cache.eviction.'),'Algorithm')"/>
-                        </xsl:attribute>
-                     </xsl:when>
-                     <xsl:otherwise>
-                        <xsl:attribute name="strategy">
-                           <xsl:value-of
-                                 select="substring-before(substring-after(/jbosscache/eviction/default/@algorithmClass,'org.jboss.cache.eviction.'),'Algorithm')"/>
-                        </xsl:attribute>
-                     </xsl:otherwise>
-                  </xsl:choose>
+                  <xsl:if test="@async">
+                     <async enabled="true"/>
+                  </xsl:if>
+                  <xsl:if test="properties">
+                     <xsl:message terminate="no">WARNING! Please configure cache loader props manually!</xsl:message>
+                     <properties>
+                        <!--<property name="TODO set name here..." value="...set value here..."/>-->
+                        <!--<property name="TODO set name here..." value="...set value here..."/>-->
+                     </properties>
+                  </xsl:if>
+                  <xsl:if test="singletonStore">
+                     <xsl:element name="singletonStore">
+                        <xsl:if test="singletonStore[@enabled]">
+                           <xsl:attribute name="enabled">
+                              <xsl:value-of select="singletonStore/@enabled"/>
+                           </xsl:attribute>
+                           <xsl:if test="singletonStore/properties">
+                              <xsl:message terminate="no">WARNING! Singleton store was changed and needs to be configured manually!</xsl:message>
+                              <!-- TODO Singleton store was changed and needs to be configured manually-->
+                           </xsl:if>
+                        </xsl:if>
+                     </xsl:element>
 
+                  </xsl:if>
                </xsl:element>
+            </xsl:for-each>
+         </xsl:element>
+         <xsl:if test="/jbosscache/eviction/default">
+            <xsl:for-each select="/jbosscache/eviction/default">
+               <xsl:call-template name="evictionAttributes"/>
+            </xsl:for-each>
+         </xsl:if>
+      </xsl:if>
+   </xsl:template>
 
-            </xsl:element>
-         </xsl:for-each>
+   <xsl:template name="evictionAttributes">
+
+      <xsl:if test="@name">
+         <xsl:attribute name="name">
+            <xsl:value-of select="@name"/>
+         </xsl:attribute>
+      </xsl:if>
+      <xsl:element name="eviction">
+         <xsl:if test="/jbosscache/eviction[@wakeUpInterval]">
+            <xsl:attribute name="wakeUpInterval">
+               <xsl:value-of select="/jbosscache/eviction/@wakeUpInterval"/>
+            </xsl:attribute>
+         </xsl:if>
+         <xsl:if test="property[@name='maxNodes']">
+            <xsl:attribute name="maxEntries">
+               <xsl:value-of select="normalize-space(property[@name='maxNodes']/@value)"/>
+            </xsl:attribute>
+         </xsl:if>
+         <xsl:if test="@algorithmClass and not(starts-with(@algorithmClass,'org.jboss.cache'))">
+            <xsl:message terminate="no">WARNING! Custom eviction 'algorithmClass' is being used. This cannot be automatically transformed. Plese do this manually. </xsl:message>
+            <!--TODO Custom eviction 'algorithmClass' is being used. This cannot be automatically transformed. Plese do this manually.-->
+         </xsl:if>
+         <xsl:choose>
+            <xsl:when test="@algorithmClass">
+               <xsl:attribute name="strategy">
+                  <xsl:value-of
+                        select="substring-before(substring-after(@algorithmClass,'org.jboss.cache.eviction.'),'Algorithm')"/>
+               </xsl:attribute>
+            </xsl:when>
+            <xsl:otherwise>
+               <xsl:attribute name="strategy">
+                  <xsl:value-of
+                        select="substring-before(substring-after(/jbosscache/eviction/default/@algorithmClass,'org.jboss.cache.eviction.'),'Algorithm')"/>
+               </xsl:attribute>
+            </xsl:otherwise>
+         </xsl:choose>
       </xsl:element>
+      <xsl:if test="property[@name='timeToLive'] or property[@name='maxAge']">
+         <xsl:element name="expiration">
+            <xsl:if test="property[@name='timeToLive']">
+               <xsl:attribute name="maxIdle">
+                  <xsl:value-of select="property[@name='timeToLive']/@value"/>
+               </xsl:attribute>
+            </xsl:if>
+            <xsl:if test="property[@name='maxAge']">
+               <xsl:attribute name="lifespan">
+                  <xsl:value-of select="property[@name='maxAge']/@value"/>
+               </xsl:attribute>
+            </xsl:if>
+         </xsl:element>
+      </xsl:if>
    </xsl:template>
 </xsl:stylesheet>

Added: trunk/core/src/test/java/org/infinispan/config/parsing/Jbc2InfinispanTransformerTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/parsing/Jbc2InfinispanTransformerTest.java	                        (rev 0)
+++ trunk/core/src/test/java/org/infinispan/config/parsing/Jbc2InfinispanTransformerTest.java	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,151 @@
+package org.infinispan.config.parsing;
+
+import org.infinispan.config.CacheLoaderManagerConfig;
+import org.infinispan.config.Configuration;
+import org.infinispan.config.GlobalConfiguration;
+import org.infinispan.eviction.EvictionStrategy;
+import org.infinispan.loaders.CacheStoreConfig;
+import org.infinispan.loaders.decorators.AsyncStoreConfig;
+import org.infinispan.loaders.decorators.SingletonStoreConfig;
+import org.infinispan.loaders.dummy.DummyInMemoryCacheStore;
+import org.infinispan.marshall.VersionAwareMarshaller;
+import org.infinispan.util.concurrent.IsolationLevel;
+import org.testng.annotations.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.util.Map;
+
+/**
+ * @author Mircea.Markus at jboss.com
+ * @since 4.0
+ */
+ at Test(groups = "unit", testName = "config.Jbc2InfinispanTransformerTest")
+public class Jbc2InfinispanTransformerTest {
+   public static final String XSLT_FILE = "xslt/jbc3x2infinispan4x.xslt";
+   private static final String BASE_DIR = "configs/jbosscache3x";
+   ConfigFilesConvertor convertor = new ConfigFilesConvertor();
+
+   /**
+    * Transforms and tests the transformation of a complex file.
+    */
+   public void testAllFile() throws Exception {
+      ClassLoader existingCl = Thread.currentThread().getContextClassLoader();
+      try {
+         ClassLoader delegatingCl = new TestClassLoader(existingCl);
+         Thread.currentThread().setContextClassLoader(delegatingCl);
+         String fileName = getFileName("/all.xml");
+         ByteArrayOutputStream baos = new ByteArrayOutputStream();
+         convertor.parse(fileName, baos, XSLT_FILE);
+
+         String baosStr = new String(baos.toByteArray());
+
+         XmlConfigurationParser newParser = new XmlConfigurationParserImpl();
+         newParser.initialize(new ByteArrayInputStream(baos.toByteArray()));
+         GlobalConfiguration globalConfig = newParser.parseGlobalConfiguration();
+         Map<String, Configuration> map = newParser.parseNamedConfigurations();
+         Configuration defaultConfig = globalConfig.getDefaultConfiguration();
+         assert defaultConfig.getIsolationLevel().equals(IsolationLevel.READ_COMMITTED);
+         assert defaultConfig.getLockAcquisitionTimeout() == 234000;
+         assert defaultConfig.isWriteSkewCheck();
+         assert defaultConfig.getConcurrencyLevel() == 510;
+         assert defaultConfig.getTransactionManagerLookupClass().equals("org.infinispan.transaction.lookup.GenericTransactionManagerLookup");
+         assert !defaultConfig.isSyncCommitPhase();
+         assert defaultConfig.isSyncRollbackPhase();
+         assert defaultConfig.isExposeJmxStatistics();
+         assert globalConfig.getShutdownHookBehavior().equals(GlobalConfiguration.ShutdownHookBehavior.DONT_REGISTER);
+         assert globalConfig.getAsyncListenerExecutorProperties().get("maxThreads").equals("123");
+         assert globalConfig.getAsyncListenerExecutorProperties().get("queueSize").equals("1020000");
+         assert !defaultConfig.isInvocationBatchingEnabled();
+         assert globalConfig.getObjectInputStreamPoolSize() == 12;
+         assert globalConfig.getObjectOutputStreamPoolSize() == 14;
+         assert globalConfig.getMarshallerClass().equals(VersionAwareMarshaller.class.getName());
+         assert defaultConfig.isUseLazyDeserialization();
+         assert globalConfig.getClusterName().equals("JBossCache-cluster");
+         assert defaultConfig.getCacheMode().equals(Configuration.CacheMode.INVALIDATION_SYNC);
+         assert defaultConfig.getStateRetrievalTimeout() == 2120000;
+         assert defaultConfig.getSyncReplTimeout() == 22220000;
+         assert defaultConfig.getEvictionStrategy().equals(EvictionStrategy.LRU);
+         assert defaultConfig.getEvictionMaxEntries() == 5001;
+         assert defaultConfig.getExpirationMaxIdle() == 1001 : "Received " + defaultConfig.getExpirationLifespan();
+         assert defaultConfig.getEvictionWakeUpInterval() == 50015;
+
+         Configuration regionOne = map.get("/org/jboss/data1");
+         assert regionOne != null;
+         assert regionOne.getEvictionStrategy().equals(EvictionStrategy.LRU);
+         assert regionOne.getExpirationMaxIdle() == 2002;
+         assert regionOne.getEvictionWakeUpInterval() == 50015;
+
+         Configuration regionTwo = map.get("/org/jboss/data2");
+         assert regionTwo != null;
+         assert regionTwo.getEvictionStrategy().equals(EvictionStrategy.FIFO);
+         assert regionTwo.getEvictionMaxEntries() == 3003;
+         assert regionTwo.getEvictionWakeUpInterval() == 50015;
+
+
+         CacheLoaderManagerConfig loaderManagerConfig = defaultConfig.getCacheLoaderManagerConfig();
+         assert loaderManagerConfig.isPassivation();
+         assert loaderManagerConfig.isShared();
+
+         assert loaderManagerConfig.getCacheLoaderConfigs().size() == 1;
+         CacheStoreConfig config = (CacheStoreConfig) loaderManagerConfig.getCacheLoaderConfigs().get(0);
+         assert config.getCacheLoaderClassName().equals("org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore");
+         AsyncStoreConfig asyncStoreConfig = config.getAsyncStoreConfig();
+         assert asyncStoreConfig != null;
+         assert asyncStoreConfig.isEnabled();
+         assert config.isFetchPersistentState();
+         assert config.isIgnoreModifications();
+         assert config.isPurgeOnStartup();
+         SingletonStoreConfig singletonStoreConfig = config.getSingletonStoreConfig();
+         assert singletonStoreConfig != null;
+         assert singletonStoreConfig.isSingletonStoreEnabled();
+      } finally {
+         Thread.currentThread().setContextClassLoader(existingCl);
+      }
+   }
+
+   /**
+    * Just to make sure that the transformer won't transforming exiting configs.
+    */
+   public void testCanTransformExistingFiles() throws Exception {
+      ClassLoader existingCl = Thread.currentThread().getContextClassLoader();
+      try {
+         ClassLoader delegatingCl = new TestClassLoader(existingCl);
+         Thread.currentThread().setContextClassLoader(delegatingCl);
+         String[] testFiles = {"buddy-replication.xml", "cacheloader-enabled.xml", "eviction-enabled.xml",
+                               "external-jgroups-file.xml",
+                               "invalidation-async.xml","total-replication.xml"};
+         for (String name : testFiles) {
+            String fileName = getFileName(name);
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            convertor.parse(fileName, baos, XSLT_FILE);
+
+            String baosStr = new String(baos.toByteArray());
+         }
+      } finally {
+         Thread.currentThread().setContextClassLoader(existingCl);
+      }
+   }
+
+   private String getFileName(String s) {
+      return BASE_DIR + File.separator + s;
+   }
+
+   static class TestClassLoader extends ClassLoader {
+      private ClassLoader existing;
+
+      TestClassLoader(ClassLoader existing) {
+         super(existing);
+         this.existing = existing;
+      }
+
+      @Override
+      public Class<?> loadClass(String name) throws ClassNotFoundException {
+         if (name.equals("org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore")) {
+            return DummyInMemoryCacheStore.class;
+         }
+         return existing.loadClass(name);
+      }
+   }
+}


Property changes on: trunk/core/src/test/java/org/infinispan/config/parsing/Jbc2InfinispanTransformerTest.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/core/src/test/resources/configs/jbosscache3x/all.xml
===================================================================
--- trunk/core/src/test/resources/configs/jbosscache3x/all.xml	                        (rev 0)
+++ trunk/core/src/test/resources/configs/jbosscache3x/all.xml	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+
+    <!--
+       isolation levels supported: READ_COMMITTED and REPEATABLE_READ
+       nodeLockingSchemes: mvcc, pessimistic (deprecated), optimistic (deprecated)
+    -->
+    <locking
+            isolationLevel="READ_COMMITTED"
+            lockParentForChildInsertRemove="false"
+            lockAcquisitionTimeout="234000"
+            nodeLockingScheme="mvcc"
+            writeSkewCheck="true"
+            concurrencyLevel="510"/>
+
+    <!--
+    Used to register a transaction manager and participate in ongoing transactions.
+    -->
+    <transaction
+            transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
+            syncRollbackPhase="true"
+            syncCommitPhase="false"/>
+
+    <!--
+    Used to register JMX statistics in any available MBean server
+    -->
+    <jmxStatistics
+            enabled="true"/>
+
+    <!--
+       If region based marshalling is used, defines whether new regions are inactive on startup.
+    -->
+    <startup
+            regionsInactiveOnStartup="true"/>
+
+    <!--
+       Used to register JVM shutdown hooks.
+       hookBehavior: DEFAULT, REGISTER, DONT_REGISTER
+    -->
+    <shutdown
+            hookBehavior="DONT_REGISTER"/>
+
+    <!--
+       Used to define async listener notification thread pool size
+    -->
+    <listeners
+            asyncPoolSize="123"
+            asyncQueueSize="1020000"/>
+
+    <!--
+       Used to enable invocation batching and allow the use of Cache.startBatch()/endBatch() methods.
+    -->
+    <invocationBatching
+            enabled="false"/>
+
+    <!--
+       serialization related configuration, used for replication and cache loading
+    -->
+    <serialization
+            objectInputStreamPoolSize="12"
+            objectOutputStreamPoolSize="14"
+            version="3.0.0"
+            marshallerClass="org.jboss.cache.marshall.VersionAwareMarshaller"
+            useLazyDeserialization="true"
+            useRegionBasedMarshalling="false"/>
+
+    <!--
+       This element specifies that the cache is clustered.
+       modes supported: replication (r) or invalidation (i).
+    -->
+    <clustering mode="invalidation" clusterName="JBossCache-cluster">
+
+        <!--
+           Defines whether to retrieve state on startup
+        -->
+        <stateRetrieval timeout="2120000" fetchInMemoryState="false"/>
+
+        <!--
+           Network calls are synchronous.
+        -->
+        <sync replTimeout="22220000"/>
+        <!--
+           Uncomment this for async replication.
+        -->
+        <!--<async useReplQueue="true" replQueueInterval="10000" replQueueMaxElements="500" serializationExecutorPoolSize="20" serializationExecutorQueueSize="5000000"/>-->
+
+        <!-- Uncomment to use Buddy Replication -->
+        <!--
+        <buddy enabled="true" poolName="myBuddyPoolReplicationGroup" communicationTimeout="2000">
+           <dataGravitation auto="true" removeOnFind="true" searchBackupTrees="true"/>
+           <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+              <properties>
+                 numBuddies = 1
+                 ignoreColocatedBuddies = true
+              </properties>
+           </locator>
+        </buddy>
+        -->
+
+        <!--
+           Configures the JGroups channel.  Looks up a JGroups config file on the classpath or filesystem.  udp.xml
+           ships with jgroups.jar and will be picked up by the class loader.
+        -->
+        <jgroupsConfig>
+
+            <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
+                 loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
+                 mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
+                 oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
+                 oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
+                 thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
+                 thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+                 tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
+                 use_incoming_packet_handler="true"/>
+            <PING num_initial_members="3" timeout="2000"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <FD max_tries="5" shun="true" timeout="10000"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                           use_mcast_xmit="false"/>
+            <UNICAST timeout="300,600,1200,2400,3600"/>
+            <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+            <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
+                        view_bundling="true"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER/>
+            <pbcast.FLUSH timeout="0"/>
+
+        </jgroupsConfig>
+    </clustering>
+
+    <!--
+       Eviction configuration.  WakeupInterval defines how often the eviction thread runs, in milliseconds.  0 means
+       the eviction thread will never run.
+    -->
+    <eviction wakeUpInterval="50015">
+        <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
+            <property name="maxNodes" value="5001"/>
+            <property name="timeToLive" value="1001"/>
+        </default>
+        <region name="/org/jboss/data1">
+            <property name="timeToLive" value="2002"/>
+        </region>
+        <region name="/org/jboss/data2" algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" eventQueueSize="100000">
+            <property name="maxNodes" value="3003"/>
+            <property name="minTimeToLive" value="4003"/>
+        </region>
+    </eviction>
+
+    <!--
+       Cache loaders.
+
+       If passivation is enabled, state is offloaded to the cache loaders ONLY when evicted.  Similarly, when the state
+       is accessed again, it is removed from the cache loader and loaded into memory.
+
+       Otherwise, state is always maintained in the cache loader as well as in memory.
+
+       Set 'shared' to true if all instances in the cluster use the same cache loader instance, e.g., are talking to the
+       same database.
+    -->
+    <loaders passivation="true" shared="true">
+        <preload>
+            <node fqn="/org/jboss"/>
+            <node fqn="/org/tempdata"/>
+        </preload>
+
+        <!--
+           we can have multiple cache loaders, which get chained
+        -->
+        <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="true" fetchPersistentState="true"
+                ignoreModifications="true" purgeOnStartup="true">
+
+            <properties>
+                cache.jdbc.table.name=jbosscache
+                cache.jdbc.table.create=true
+                cache.jdbc.table.drop=true
+                cache.jdbc.table.primarykey=jbosscache_pk
+                cache.jdbc.fqn.column=fqn
+                cache.jdbc.fqn.type=VARCHAR(255)
+                cache.jdbc.node.column=node
+                cache.jdbc.node.type=BINARY
+                cache.jdbc.parent.column=parent
+                cache.jdbc.driver=org.hsqldb.jdbcDriver
+                cache.jdbc.url=jdbc:hsqldb:mem:jbosscache
+                cache.jdbc.user=sa
+                cache.jdbc.password=
+            </properties>
+            <!-- alternatively use a connection from a datasource, as per the code sample below-->
+            <!--<properties>-->
+            <!--cache.jdbc.datasource=AllSampleDS-->
+            <!--cache.jdbc.table.name=jbosscache-->
+            <!--cache.jdbc.table.create=true-->
+            <!--cache.jdbc.table.drop=true-->
+            <!--</properties>-->
+            <singletonStore enabled="true" class="org.jboss.cache.loader.SingletonStoreCacheLoader">
+                <properties>
+                    pushStateWhenCoordinator=true
+                    pushStateWhenCoordinatorTimeout=20000
+                </properties>
+            </singletonStore>
+        </loader>
+    </loaders>
+
+    <!--
+       Define custom interceptors.  All custom interceptors need to extend org.jboss.cache.interceptors.base.CommandInterceptor
+    -->
+    <!--
+    <customInterceptors>
+       <interceptor position="first" class="org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor">
+          <property name="attrOne" value="value1" />
+          <property name="attrTwo" value="value2" />
+       </interceptor>
+       <interceptor position="last" class="org.jboss.cache.config.parsing.custominterceptors.BbbCustomInterceptor"/>
+       <interceptor index="3" class="org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor"/>
+       <interceptor before="org.jboss.cache.interceptors.CallInterceptor"
+                    class="org.jboss.cache.config.parsing.custominterceptors.BbbCustomInterceptor"/>
+       <interceptor after="org.jboss.cache.interceptors.CallInterceptor"
+                    class="org.jboss.cache.config.parsing.custominterceptors.AaaCustomInterceptor"/>
+    </customInterceptors>
+    -->
+</jbosscache>


Property changes on: trunk/core/src/test/resources/configs/jbosscache3x/all.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/core/src/test/resources/configs/jbosscache3x/buddy-replication.xml
===================================================================
--- trunk/core/src/test/resources/configs/jbosscache3x/buddy-replication.xml	                        (rev 0)
+++ trunk/core/src/test/resources/configs/jbosscache3x/buddy-replication.xml	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+
+   <clustering mode="replication">
+      <!--
+         timeout: The max amount of time (in milliseconds) we wait until the state (i.e. the contents of the cache) is
+             retrieved from existing members in a clustered environment
+      -->
+      <stateRetrieval timeout="20000"/>
+
+
+      <!-- JGroups protocol stack properties. -->
+      <jgroupsConfig>
+         <TCP start_port="7800" discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="true"
+              enable_unicast_bundling="false" loopback="false" max_bundle_size="64000" max_bundle_timeout="30"
+              oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="8"
+              oob_thread_pool.min_threads="2" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="10"
+              oob_thread_pool.rejection_policy="Run" recv_buf_size="20000000" thread_naming_pattern="pl"
+              thread_pool.enabled="true" thread_pool.keep_alive_time="30000" thread_pool.max_threads="4"
+              thread_pool.min_threads="1" thread_pool.queue_enabled="true" thread_pool.queue_max_size="10000"
+              thread_pool.rejection_policy="discard" use_concurrent_stack="true"
+              use_send_queues="false"/>
+         <MPING mcast_addr="232.1.2.3" num_initial_members="3" timeout="2000"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD max_tries="5" shun="true" timeout="10000"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        use_mcast_xmit="false"/>
+         <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+         <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false"
+                     view_ack_collection_timeout="5000" view_bundling="true"/>
+         <FC max_credits="1000000" min_threshold="0.20"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER/>
+         <pbcast.FLUSH timeout="0"/>
+      </jgroupsConfig>
+
+
+      <!-- Number of milliseconds to wait until all responses for a synchronous call have been received -->
+      <sync replTimeout="15000"/>
+
+      <!--
+        poolName: A way to specify a preferred replication group.  If specified, we try and pick a buddy why shares
+                     the same pool name (falling back to other buddies if not available).  This allows the sysdmin
+                     to hint at backup buddies are picked, so for example, nodes may be hinted to pick buddies
+                     on a different physical rack or power supply for added fault tolerance.
+        communicationTimeout : communication timeout for inter-buddy group organisation messages (such as assigning
+                              to and removing from groups
+                       -->
+      <buddy enabled="true" poolName="myBuddyPoolReplicationGroup" communicationTimeout="2000">
+
+         <!--
+         auto : Should data gravitation be attempted whenever there is a cache miss on finding a node?
+                If false, data will only be gravitated if an Option is set enabling it
+         removeOnFind: removes data on remote caches' trees and backup subtrees when gravitated to a
+                       new data owner
+         searchBackupTrees: search backup subtrees as well for data when gravitating.  Results in backup nodes
+                            being able to answer data gravitation requests.-->
+         <dataGravitation auto="false" removeOnFind="true" searchBackupTrees="true"/>
+
+         <locator class="org.jboss.cache.buddyreplication.NextMemberBuddyLocator">
+            <!-- numBuddies is the number of backup nodes each node maintains.  ignoreColocatedBuddies means that
+           each node will *try* to select a buddy on a different physical host.  If not able to do so though,
+            it will fall back to colocated nodes. -->
+            <properties>
+               numBuddies = 1
+               ignoreColocatedBuddies = true
+            </properties>
+         </locator>
+      </buddy>
+   </clustering>
+</jbosscache>


Property changes on: trunk/core/src/test/resources/configs/jbosscache3x/buddy-replication.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/core/src/test/resources/configs/jbosscache3x/cacheloader-enabled.xml
===================================================================
--- trunk/core/src/test/resources/configs/jbosscache3x/cacheloader-enabled.xml	                        (rev 0)
+++ trunk/core/src/test/resources/configs/jbosscache3x/cacheloader-enabled.xml	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+    <!-- Configure the TransactionManager -->
+    <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+
+    <!-- Specific eviction policy configurations -->
+    <eviction wakeUpInterval="5000">
+        <!-- Cache wide default -->
+        <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
+            <property name="maxNodes" value="5000"/>
+            <property name="timeToLive" value="3000"/>
+        </default>
+        <region name="/org/jboss/test/data">
+            <property name="maxNodes" value="100"/>
+            <property name="timeToLive" value="3000"/>
+        </region>
+    </eviction>
+
+    <!-- Cache Passivation for Tree Cache
+On passivation, The objects are written to the backend store on eviction if passivation
+is true, otherwise the objects are persisted. On activation, the objects are restored in
+the memory cache and removed from the cache loader if 'passivation' attribute is true,
+otherwise the objects are only loaded from the cache loader -->
+    <loaders passivation="false" shared="false">
+        <preload>
+            <node fqn="/"/>
+        </preload>
+        <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+        <loader
+                class="org.jboss.cache.loader.JDBCCacheLoader"
+                async="false"
+                fetchPersistentState="true"
+                ignoreModifications="false"
+                purgeOnStartup="false">
+            <properties>
+                cache.jdbc.table.name=jbosscache
+                cache.jdbc.table.create=true
+                cache.jdbc.table.drop=true
+                cache.jdbc.table.primarykey=jbosscache_pk
+                cache.jdbc.fqn.column=fqn
+                cache.jdbc.fqn.type=VARCHAR(255)
+                cache.jdbc.node.column=node
+                cache.jdbc.node.type=BINARY
+                cache.jdbc.parent.column=parent
+                cache.jdbc.driver=org.hsqldb.jdbcDriver
+                cache.jdbc.url=jdbc:hsqldb:mem:jbosscache
+                cache.jdbc.user=sa
+                cache.jdbc.password=
+            </properties>
+        </loader>
+    </loaders>
+</jbosscache>


Property changes on: trunk/core/src/test/resources/configs/jbosscache3x/cacheloader-enabled.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/core/src/test/resources/configs/jbosscache3x/eviction-enabled.xml
===================================================================
--- trunk/core/src/test/resources/configs/jbosscache3x/eviction-enabled.xml	                        (rev 0)
+++ trunk/core/src/test/resources/configs/jbosscache3x/eviction-enabled.xml	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+   <!-- Configure the TransactionManager -->
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+
+   <!--
+      wakeUpInterval: time interval (millis) when the eviction thread kicks in.
+   -->
+   <eviction wakeUpInterval="5000">
+      <!--
+         Cache wide defaults
+         default algorithmClass: if an algorithm class is not specified for a region, this one is used by default.
+         default eventQueueSize  if an event queue size is not specified for a region, this one is used by default.
+      -->
+      <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
+         <property name="maxNodes" value="5000" />
+         <property name="timeToLive" value="1000000" />
+      </default>
+
+      <!-- configurations for various regions--> 
+      <region name="/org/jboss/data1">
+         <property name="maxNodes" value="5000" />
+         <property name="timeToLive" value="1000000" />
+      </region>
+      <region name="/org/jboss/data2" actionPolicyClass="org.jboss.cache.eviction.RemoveOnEvictActionPolicy">
+         <property name="maxNodes" value="5" />
+         <property name="timeToLive" value="4000" />
+      </region>
+      <region name="/org/jboss/data3" algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm">
+         <property name="maxNodes" value="10000" />
+         <property name="minTimeToLive" value="4000" />
+      </region>
+      <region name="/org/jboss/data1/otherstuff" eventQueueSize="100000">
+         <property name="maxNodes" value="10000" />
+         <property name="timeToLive" value="8000" />
+         <property name="maxAge" value="10000" />
+      </region>
+      <region name="/org/jboss/data1/inherit"/>      
+   </eviction>
+</jbosscache>


Property changes on: trunk/core/src/test/resources/configs/jbosscache3x/eviction-enabled.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/core/src/test/resources/configs/jbosscache3x/external-jgroups-file.xml
===================================================================
--- trunk/core/src/test/resources/configs/jbosscache3x/external-jgroups-file.xml	                        (rev 0)
+++ trunk/core/src/test/resources/configs/jbosscache3x/external-jgroups-file.xml	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+   <!-- Configure the TransactionManager -->
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+
+   <clustering>
+      <async />
+      <!--
+         Here we specify a path to an external JGroups configuration file.  First the classpath is scanned, and then
+         the filesystem for the file.  In this case, "udp.xml" ships with jgroups.jar and will be picked up by the
+         classloader.
+      -->
+      <jgroupsConfig configFile="udp.xml"/>
+   </clustering>
+</jbosscache>


Property changes on: trunk/core/src/test/resources/configs/jbosscache3x/external-jgroups-file.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/core/src/test/resources/configs/jbosscache3x/invalidation-async.xml
===================================================================
--- trunk/core/src/test/resources/configs/jbosscache3x/invalidation-async.xml	                        (rev 0)
+++ trunk/core/src/test/resources/configs/jbosscache3x/invalidation-async.xml	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+   <!-- Configure the TransactionManager -->
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+
+   <clustering mode="invalidation">
+      <!--
+       timeout: The max amount of time (in milliseconds) we wait until the
+             state (i.e. the contents of the cache) are retrieved from
+             existing members in a clustered environment
+      -->
+      <stateRetrieval timeout="20000"/>
+
+      <!-- JGroups protocol stack properties. -->
+      <jgroupsConfig>
+         <UDP discard_incompatible_packets="true" enable_bundling="true" enable_diagnostics="false" ip_ttl="2"
+              loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
+              mcast_port="45588" mcast_recv_buf_size="100000000" mcast_send_buf_size="640000"
+              oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="20"
+              oob_thread_pool.min_threads="8" oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="10"
+              oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.keep_alive_time="10000" thread_pool.max_threads="15" thread_pool.min_threads="8"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="100000"
+              thread_pool.rejection_policy="Discard"
+              tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
+              use_incoming_packet_handler="true"/>
+         <PING num_initial_members="3" timeout="2000"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD max_tries="5" shun="true" timeout="10000"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        use_mcast_xmit="true"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+         <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
+                     view_bundling="true"/>
+         <FC max_credits="500000" min_threshold="0.2"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER/>
+         <pbcast.FLUSH timeout="0"/>
+      </jgroupsConfig>
+
+      <async />
+      <!-- Alternatively, to use sync replication, comment out the element above and uncomment the element below.  -->
+      <!-- <sync /> -->
+      
+   </clustering>
+</jbosscache>


Property changes on: trunk/core/src/test/resources/configs/jbosscache3x/invalidation-async.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: trunk/core/src/test/resources/configs/jbosscache3x/total-replication.xml
===================================================================
--- trunk/core/src/test/resources/configs/jbosscache3x/total-replication.xml	                        (rev 0)
+++ trunk/core/src/test/resources/configs/jbosscache3x/total-replication.xml	2009-05-20 14:59:54 UTC (rev 327)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.0">
+
+   <!-- Configure the TransactionManager -->
+   <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+
+   <clustering mode="replication">
+      <!-- JGroups protocol stack properties. -->
+      <jgroupsConfig>
+         <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
+              loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
+              mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
+              oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
+              oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
+              oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
+              use_incoming_packet_handler="true"/>
+         <PING num_initial_members="3" timeout="2000"/>
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD max_tries="5" shun="true" timeout="10000"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        use_mcast_xmit="false"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+         <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
+                     view_bundling="true"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER/>
+         <pbcast.FLUSH timeout="0"/>
+
+      </jgroupsConfig>
+
+      <sync />
+      <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below.  -->
+      <!-- <async /> -->
+
+   </clustering>
+</jbosscache>


Property changes on: trunk/core/src/test/resources/configs/jbosscache3x/total-replication.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the infinispan-commits mailing list