[jboss-svn-commits] JBL Code SVN: r12896 - in labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies: cache and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jun 27 14:57:31 EDT 2007
Author: beve
Date: 2007-06-27 14:57:31 -0400 (Wed, 27 Jun 2007)
New Revision: 12896
Added:
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyManual.java
Removed:
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyIntegrationTest.java
Modified:
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml
Log:
Renamed ReadOnlyRemoteFileSystemStrategyIntegrationTest -> ReadOnlyRemoteFileSystemStrategyManual as it is not possible to
run this test without a network connection, or a working loopback configured.
Updated the jgroups config to use a different multicast address just be on the save side.
Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyIntegrationTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyIntegrationTest.java 2007-06-27 13:01:10 UTC (rev 12895)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyIntegrationTest.java 2007-06-27 18:57:31 UTC (rev 12896)
@@ -1,143 +0,0 @@
-package org.jboss.soa.esb.listeners.gateway.remotestrategies;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.cache.CacheException;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheTestUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>
- *
- */
-public class ReadOnlyRemoteFileSystemStrategyIntegrationTest
-{
- private static Logger log = Logger .getLogger( ReadOnlyRemoteFileSystemStrategyIntegrationTest.class );
-
- private static ReadOnlyRemoteFileSystemStrategy strategy;
-
- private static ReadOnlyRemoteFileSystemStrategy strategy2;
-
- private String testFile1 = "testFile1";
- private String testFile2 = "testFile2";
- private String testFile3 = "testFile3";
-
- private File[] expectedFileList = new File[] { new File( testFile1 ) , new File( testFile2 ) };
- private File[] newFileList = new File[] { new File( testFile3 ) };
- private File[] emptyFileList = new File[] {};
-
- @Test
- public void listFilesNegative()
- {
- try
- {
- strategy.filterFileList( null );
- }
- catch (RemoteFileSystemStrategyException e)
- {
- fail("Should be ok to pass null as the file array!");
- }
- }
-
- @Test
- public void listFiles() throws RemoteFileSystemStrategyException
- {
- File[] filteredFileList = strategy.filterFileList( expectedFileList );
- assertEquals( expectedFileList, filteredFileList );
-
- filteredFileList = strategy.filterFileList( expectedFileList );
- assertEquals( "No files should have been returned. They should have been cached.", emptyFileList, filteredFileList );
-
- filteredFileList = strategy.filterFileList( newFileList );
- assertEquals( newFileList, filteredFileList );
- assertTrue ( filteredFileList instanceof File[] );
- }
-
- @Test
- public void listFiles_With_Two_Strategy_Instances() throws Exception
- {
-
- try
- {
- File[] filteredFileList = strategy2.filterFileList( expectedFileList );
- assertEquals( expectedFileList, filteredFileList );
-
- filteredFileList = strategy.filterFileList( expectedFileList );
- assertEquals( emptyFileList, filteredFileList );
-
- filteredFileList = strategy2.filterFileList( newFileList );
- assertEquals( newFileList, filteredFileList );
-
- filteredFileList = strategy.filterFileList( newFileList );
- assertEquals( emptyFileList, filteredFileList );
-
- }
- catch ( Exception e )
- {
- log.error(e);
- }
- finally
- {
- strategy2.stop();
- }
-
- }
-
- @Before
- public void setup() throws CacheException
- {
- strategy.removeAllData();
- }
-
- @BeforeClass
- public static void classSetup() throws Exception
- {
- registerHsqlDriver();
- HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build" + File.separator + "hsqltestdb", "ftpcache");
-
- strategy = new ReadOnlyRemoteFileSystemStrategy();
- strategy.init( FtpFileCacheTestUtil.getCacheConfigFile() );
-
- strategy2 = new ReadOnlyRemoteFileSystemStrategy();
- strategy2.init( FtpFileCacheTestUtil.getCacheConfigFile() );
- }
-
- private static void registerHsqlDriver()
- {
- try
- {
- Class.forName( "org.hsqldb.jdbcDriver" );
- }
- catch (Exception e)
- {
- fail( "ERROR: failed to load JDBC driver." + e.getMessage() );
- }
- }
-
- @AfterClass
- public static void classTearDown() throws Exception
- {
- strategy.stop();
- strategy2.stop();
- HsqldbUtil.stopHsqldb( "jdbc:hsqldb:hsql://localhost:9001/ftpcache", "sa", "" );
- }
-
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(ReadOnlyRemoteFileSystemStrategyIntegrationTest.class);
- }
-}
Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyManual.java (from rev 12895, labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyManual.java (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyManual.java 2007-06-27 18:57:31 UTC (rev 12896)
@@ -0,0 +1,146 @@
+package org.jboss.soa.esb.listeners.gateway.remotestrategies;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.cache.CacheException;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheTestUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ *
+ * The test requires a network connection to pass.<br>
+ * If you are running on linux you can use:<br>
+ * route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>
+ *
+ */
+public class ReadOnlyRemoteFileSystemStrategyManual
+{
+ private static Logger log = Logger .getLogger( ReadOnlyRemoteFileSystemStrategyManual.class );
+
+ private static ReadOnlyRemoteFileSystemStrategy strategy;
+
+ private static ReadOnlyRemoteFileSystemStrategy strategy2;
+
+ private String testFile1 = "testFile1";
+ private String testFile2 = "testFile2";
+ private String testFile3 = "testFile3";
+
+ private File[] expectedFileList = new File[] { new File( testFile1 ) , new File( testFile2 ) };
+ private File[] newFileList = new File[] { new File( testFile3 ) };
+ private File[] emptyFileList = new File[] {};
+
+ @Test
+ public void listFilesNegative()
+ {
+ try
+ {
+ strategy.filterFileList( null );
+ }
+ catch (RemoteFileSystemStrategyException e)
+ {
+ fail("Should be ok to pass null as the file array!");
+ }
+ }
+
+ @Test
+ public void listFiles() throws RemoteFileSystemStrategyException
+ {
+ File[] filteredFileList = strategy.filterFileList( expectedFileList );
+ assertEquals( expectedFileList, filteredFileList );
+
+ filteredFileList = strategy.filterFileList( expectedFileList );
+ assertEquals( "No files should have been returned. They should have been cached.", emptyFileList, filteredFileList );
+
+ filteredFileList = strategy.filterFileList( newFileList );
+ assertEquals( newFileList, filteredFileList );
+ assertTrue ( filteredFileList instanceof File[] );
+ }
+
+ @Test
+ public void listFiles_With_Two_Strategy_Instances() throws Exception
+ {
+
+ try
+ {
+ File[] filteredFileList = strategy2.filterFileList( expectedFileList );
+ assertEquals( expectedFileList, filteredFileList );
+
+ filteredFileList = strategy.filterFileList( expectedFileList );
+ assertEquals( emptyFileList, filteredFileList );
+
+ filteredFileList = strategy2.filterFileList( newFileList );
+ assertEquals( newFileList, filteredFileList );
+
+ filteredFileList = strategy.filterFileList( newFileList );
+ assertEquals( emptyFileList, filteredFileList );
+
+ }
+ catch ( Exception e )
+ {
+ log.error(e);
+ }
+ finally
+ {
+ strategy2.stop();
+ }
+
+ }
+
+ @Before
+ public void setup() throws CacheException
+ {
+ strategy.removeAllData();
+ }
+
+ @BeforeClass
+ public static void classSetup() throws Exception
+ {
+ registerHsqlDriver();
+ HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build" + File.separator + "hsqltestdb", "ftpcache");
+
+ strategy = new ReadOnlyRemoteFileSystemStrategy();
+ strategy.init( FtpFileCacheTestUtil.getCacheConfigFile() );
+
+ strategy2 = new ReadOnlyRemoteFileSystemStrategy();
+ strategy2.init( FtpFileCacheTestUtil.getCacheConfigFile() );
+ }
+
+ private static void registerHsqlDriver()
+ {
+ try
+ {
+ Class.forName( "org.hsqldb.jdbcDriver" );
+ }
+ catch (Exception e)
+ {
+ fail( "ERROR: failed to load JDBC driver." + e.getMessage() );
+ }
+ }
+
+ @AfterClass
+ public static void classTearDown() throws Exception
+ {
+ strategy.stop();
+ strategy2.stop();
+ HsqldbUtil.stopHsqldb( "jdbc:hsqldb:hsql://localhost:9001/ftpcache", "sa", "" );
+ }
+
+ public static junit.framework.Test suite()
+ {
+ return new JUnit4TestAdapter(ReadOnlyRemoteFileSystemStrategyManual.class);
+ }
+}
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml 2007-06-27 13:01:10 UTC (rev 12895)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml 2007-06-27 18:57:31 UTC (rev 12896)
@@ -36,18 +36,18 @@
<attribute name="ClusterConfig">
<config>
- <UDP mcast_addr="228.1.2.3" mcast_port="48866"
+ <UDP mcast_addr="228.5.5.5" mcast_port="48866"
bind_addr="localhost"
receive_on_all_interfaces="true"
send_on_all_interfaces="true"
ip_ttl="64" ip_mcast="true"
mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
- loopback="false"/>
- <PING timeout="2000" num_initial_members="2" up_thread="false" down_thread="false"/>
+ loopback="true"/>
+ <PING timeout="2000" up_thread="false" down_thread="false"/>
<MERGE2 min_interval="10000" max_interval="20000"/>
- <!-- <FD shun="true" up_thread="true" down_thread="true" />-->
- <FD_SOCK/>
+ <FD shun="false" up_thread="true" down_thread="true" />
+ <FD_SIMPLE/>
<VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false"/>
<pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800" max_xmit_size="8192" up_thread="false" down_thread="false"/>
<UNICAST timeout="600,1200,2400" down_thread="false"/>
More information about the jboss-svn-commits
mailing list