Package org.jboss.cache.aop.test

Examples of org.jboss.cache.aop.test.SerializedAddress


    * Test replication with classloaders.
    * @throws Exception
    */
   public void testCLLeakageBasic() throws Exception
   {
      SerializedAddress add = new SerializedAddress();
      add.setCity("Taipei");

      ClassLoader cla = getClassLoader();
      WeakReference refa = new WeakReference(cla);
      cache_.registerClassLoader("/aop", cla);
      ClassLoader clb = getClassLoader();
      WeakReference refb = new WeakReference(clb);
      cache1_.registerClassLoader("/aop", clb);

      cache_.put("/aop", "add", add);

      TestingUtil.sleepThread(100);
      try
      {
         Object ben = cache1_.get("/aop", "add");
         assertEquals(add.toString(), ben.toString());
         ben = null;
      } catch (Exception ex)
      {
         fail("Test fails with exception " +ex);
      }
View Full Code Here


   }

   public void testPutSerializable() throws Exception
   {
      log_.info("testPutSerializable() ....");
      SerializedAddress test = new SerializedAddress();
      test.setCity("Sunnyvale");
      test.setZip(94086);
      cache_.putObject("/a", test);
      SerializedAddress result = (SerializedAddress)cache_.getObject("/a");
      assertEquals("test SerializedAddress ", test, result);
      cache_.removeObject("/a");
      assertNull("Object should be null ", cache_.getObject("/a"));
   }
View Full Code Here

TOP

Related Classes of org.jboss.cache.aop.test.SerializedAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.