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

Manik Surtani msurtani at jboss.com
Thu Jul 20 00:49:52 EDT 2006


  User: msurtani
  Date: 06/07/20 00:49:52

  Added:       tests/functional/org/jboss/cache/config  
                        ConfigurationTest.java
  Removed:     tests/functional/org/jboss/cache/config  
                        ConfigurationImplTest.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.1      date: 2006/07/20 04:49:52;  author: msurtani;  state: Exp;JBossCache/tests/functional/org/jboss/cache/config/ConfigurationTest.java
  
  Index: ConfigurationTest.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.cache.config;
  
  
  
  import junit.framework.TestCase;
  import org.jboss.cache.factories.XmlConfigurationParser;
  import org.jboss.cache.lock.IsolationLevel;
  import org.jboss.cache.xml.XmlHelper;
  
  /**
   * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
   */
  public class ConfigurationTest extends TestCase
  {
      public void testReplSyncStack() throws Exception
      {
          XmlConfigurationParser parser = new XmlConfigurationParser();
          Configuration conf = parser.parseFile("META-INF/replSync-service.xml");
  
          //now test that everything has been read in properly.
          assertEquals(Configuration.CacheMode.REPL_SYNC, conf.getCacheModeInt());
          assertEquals("org.jboss.cache.DummyTransactionManagerLookup", conf.getTransactionManagerLookupClass());
          assertEquals(IsolationLevel.REPEATABLE_READ, conf.getIsolationLevel());
          assertEquals(false, conf.isUseReplQueue());
          assertEquals(0, conf.getReplQueueInterval());
          assertEquals(0, conf.getReplQueueMaxElements());
          assertEquals("TreeCache-Cluster", conf.getClusterName());
          assertEquals(true, conf.isFetchInMemoryState());
          assertEquals(15000, conf.getInitialStateRetrievalTimeout());
          assertEquals(15000, conf.getSyncReplTimeout());
          assertEquals(10000, conf.getLockAcquisitionTimeout());
          assertNull(conf.getEvictionPolicyClass());
          assertEquals(true, conf.isUseRegionBasedMarshalling());
  
          // now test the XML block for cluster configs
  
          String actual = conf.getClusterConfig();
          String rawExpectedXml = "<config>\n" +
                  "            <!-- UDP: if you have a multihomed machine,\n" +
                  "            set the bind_addr attribute to the appropriate NIC IP address, e.g bind_addr=\"192.168.0.2\"\n" +
                  "            -->\n" +
                  "            <!-- UDP: On Windows machines, because of the media sense feature\n" +
                  "             being broken with multicast (even after disabling media sense)\n" +
                  "             set the loopback attribute to true -->\n" +
                  "            <UDP mcast_addr=\"228.1.2.3\" mcast_port=\"48866\"\n" +
                  "                ip_ttl=\"64\" ip_mcast=\"true\"\n" +
                  "                mcast_send_buf_size=\"150000\" mcast_recv_buf_size=\"80000\"\n" +
                  "                ucast_send_buf_size=\"150000\" ucast_recv_buf_size=\"80000\"\n" +
                  "                loopback=\"false\"/>\n" +
                  "            <PING timeout=\"2000\" num_initial_members=\"3\"\n" +
                  "                up_thread=\"false\" down_thread=\"false\"/>\n" +
                  "            <MERGE2 min_interval=\"10000\" max_interval=\"20000\"/>\n" +
                  "            <!--        <FD shun=\"true\" up_thread=\"true\" down_thread=\"true\" />-->\n" +
                  "            <FD_SOCK/>\n" +
                  "            <VERIFY_SUSPECT timeout=\"1500\"\n" +
                  "                up_thread=\"false\" down_thread=\"false\"/>\n" +
                  "            <pbcast.NAKACK gc_lag=\"50\" retransmit_timeout=\"600,1200,2400,4800\"\n" +
                  "                max_xmit_size=\"8192\" up_thread=\"false\" down_thread=\"false\"/>\n" +
                  "            <UNICAST timeout=\"600,1200,2400\" window_size=\"100\" min_threshold=\"10\"\n" +
                  "                down_thread=\"false\"/>\n" +
                  "            <pbcast.STABLE desired_avg_gossip=\"20000\"\n" +
                  "                up_thread=\"false\" down_thread=\"false\"/>\n" +
                  "            <FRAG frag_size=\"8192\"\n" +
                  "                down_thread=\"false\" up_thread=\"false\"/>\n" +
                  "            <pbcast.GMS join_timeout=\"5000\" join_retry_timeout=\"2000\"\n" +
                  "                shun=\"true\" print_local_addr=\"true\"/>\n" +
                  "            <pbcast.STATE_TRANSFER up_thread=\"true\" down_thread=\"true\"/>\n" +
                  "        </config>";
          String expected = conf.parseClusterConfigXml(XmlHelper.stringToElement(rawExpectedXml));
          assertEquals(expected, actual);
      }
  
  }
  
  
  



More information about the jboss-cvs-commits mailing list