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

Manik Surtani manik at jboss.org
Fri Jul 20 08:31:49 EDT 2007


  User: msurtani
  Date: 07/07/20 08:31:49

  Modified:    tests/functional/org/jboss/cache/marshall 
                        AsyncReplTest.java
  Log:
  Removed unnecessary try catch blocks
  
  Revision  Changes    Path
  1.18      +45 -108   JBossCache/tests/functional/org/jboss/cache/marshall/AsyncReplTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AsyncReplTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/marshall/AsyncReplTest.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- AsyncReplTest.java	16 Apr 2007 17:37:12 -0000	1.17
  +++ AsyncReplTest.java	20 Jul 2007 12:31:49 -0000	1.18
  @@ -11,7 +11,6 @@
   
   import junit.framework.Test;
   import junit.framework.TestSuite;
  -import org.apache.commons.logging.LogFactory;
   import org.jboss.cache.CacheSPI;
   import org.jboss.cache.DefaultCacheFactory;
   import org.jboss.cache.Fqn;
  @@ -32,7 +31,7 @@
    * Test marshalling for async mode.
    *
    * @author Ben Wang
  - * @version $Revision: 1.17 $
  + * @version $Revision: 1.18 $
    */
   public class AsyncReplTest extends RegionBasedMarshallingTestBase
   {
  @@ -122,52 +121,30 @@
   
         TestingUtil.sleepThread(1000);
         Object ben2 = null;
  -      try
  -      {
            // Can't cast it to Person. CCE will resutl.
            ben2 = cache2.get(aop, "person");
            assertNotNull(ben2);
            assertEquals(ben_.toString(), ben2.toString());
  -      }
  -      catch (Exception ex)
  -      {
  -         LogFactory.getLog("TEST").debug("Ex:", ex);
  -         fail("Test fails with exception " + ex);
  -      }
   
         Class claz = clb.loadClass(ADDRESS_CLASSNAME);
         Object add = claz.newInstance();
  -      {
            Class[] types = {String.class};
            Method setValue = claz.getMethod("setCity", types);
            Object[] margs = {"Sunnyvale"};
            setValue.invoke(add, margs);
  -      }
  -
  -      {
            Class clasz1 = clb.loadClass(PERSON_CLASSNAME);
  -         Class[] types = {claz};
  -         Method setValue = clasz1.getMethod("setAddress", types);
  -         Object[] margs = {add};
  +      types = new Class[]{claz};
  +      setValue = clasz1.getMethod("setAddress", types);
  +      margs = new Object[]{add};
            setValue.invoke(ben2, margs);
  -      }
   
         // Set it back to the cache
  -      try
  -      {
            // Can't cast it to Person. CCE will resutl.
            cache2.put(aop, "person", ben2);
            TestingUtil.sleepThread(1000);
            Object ben3 = cache1.get(aop, "person");
            assertEquals(ben2.toString(), ben3.toString());
         }
  -      catch (Exception ex)
  -      {
  -         ex.printStackTrace();
  -         fail("Test fails with exception " + ex);
  -      }
  -
  -   }
   
      public void testPuts() throws Exception
      {
  @@ -188,8 +165,6 @@
         TestingUtil.sleepThread(1000);
   
         Object ben2 = null;
  -      try
  -      {
            // Can't cast it to Person. CCE will resutl.
            ben2 = cache2.get(Fqn.fromString("/aop/1"), "person");
            assertEquals(ben_.toString(), ben2.toString());
  @@ -199,12 +174,6 @@
            assertFalse("cache2 deserialized with cache2 classloader", scopedBen1.equals(ben2));
            assertEquals("scopedBen deserialized properly", scopedBen2, ben2);
         }
  -      catch (Exception ex)
  -      {
  -         fail("Test fails with exception " + ex);
  -      }
  -
  -   }
   
      public void testTxPut() throws Exception
      {
  @@ -233,54 +202,29 @@
         TestingUtil.sleepThread(1000);
   
         Object ben2 = null;
  -      try
  -      {
            // Can't cast it to Person. CCE will resutl.
            ben2 = cache2.get(aop, "person");
            assertEquals(ben_.toString(), ben2.toString());
  -      }
  -      catch (Exception ex)
  -      {
  -         fail("Test fails with exception " + ex);
  -      }
   
         Class claz = clb.loadClass(ADDRESS_CLASSNAME);
         Object add = claz.newInstance();
  -      {
            Class[] types = {String.class};
            Method setValue = claz.getMethod("setCity", types);
            Object[] margs = {"Sunnyvale"};
            setValue.invoke(add, margs);
  -      }
  -
  -      {
            Class clasz1 = clb.loadClass(PERSON_CLASSNAME);
  -         Class[] types = {claz};
  -         Method setValue = clasz1.getMethod("setAddress", types);
  -         Object[] margs = {add};
  +      types = new Class[]{claz};
  +      setValue = clasz1.getMethod("setAddress", types);
  +      margs = new Object[]{add};
            setValue.invoke(ben2, margs);
  -      }
   
         // Set it back to the cache
  -      try
  -      {
            // Can't cast it to Person. CCE will resutl.
            cache2.put(aop, "person", ben2);
            TestingUtil.sleepThread(1000);
            Object ben3 = cache1.get(aop, "person");
            assertEquals(ben2.toString(), ben3.toString());
         }
  -      catch (Exception ex)
  -      {
  -         fail("Test fails with exception " + ex);
  -      }
  -
  -   }
  -
  -   public void testStateTransfer() throws Exception
  -   {
  -      // Need to test out if app is not registered with beforehand??
  -   }
   
      public void testCustomFqn() throws Exception
      {
  @@ -302,16 +246,9 @@
         cache1.put(new Fqn(base, custom1), "key", "value");
         TestingUtil.sleepThread(1000);
   
  -      try
  -      {
            Object val = cache2.get(new Fqn(base, custom2), "key");
            assertEquals("value", val);
         }
  -      catch (Exception ex)
  -      {
  -         fail("Test fails with exception " + ex);
  -      }
  -   }
   
      Transaction beginTransaction() throws SystemException, NotSupportedException
      {
  
  
  



More information about the jboss-cvs-commits mailing list