Package org.exoplatform.commons.serialization

Examples of org.exoplatform.commons.serialization.SerializationContext.clone()


      TypeDomain domain = new TypeDomain();
      domain.addTypeModel(A2.class);
      SerializationContext context = new SerializationContext(domain);
      context.addFactory(new A1());
      A2 a2 = new A2();
      assertSame(A1.instance, context.clone(a2));
   }

   public void testFactoryThrowsException() throws Exception
   {
      TypeDomain domain = new TypeDomain();
View Full Code Here


      domain.addTypeModel(B.class);
      SerializationContext context = new SerializationContext(domain);
      B b = new B(false);
      try
      {
         context.clone(b);
         fail();
      }
      catch (InvalidClassException e)
      {
      }
View Full Code Here

         {
            return new A1(output.state);
         }
      };
      SerializationContext context = new SerializationContext(domain);
      a = context.clone(a);
      assertEquals("foo", a.state);
   }

   public void testConvertSerializableType() throws Exception
   {
View Full Code Here

      domain.addTypeModel(B1.class);
      B1 b = new B1("foo");

      //
      SerializationContext context = new SerializationContext(domain);
      b = context.clone(b);
      assertEquals("foo", b.state);
   }

   public void testConverterWriteThrowsException() throws Exception
   {
View Full Code Here

         }
      };
      SerializationContext context = new SerializationContext(domain);
      try
      {
         a = context.clone(a);
         fail();
      }
      catch (InvalidObjectException ioe)
      {
         assertSame(e, ioe.getCause());
View Full Code Here

         }
      };
      SerializationContext context = new SerializationContext(domain);
      try
      {
         a = context.clone(a);
         fail();
      }
      catch (InvalidObjectException e)
      {
      }
View Full Code Here

         }
      };
      SerializationContext context = new SerializationContext(domain);
      try
      {
         a = context.clone(a);
         fail();
      }
      catch (InvalidObjectException e)
      {
      }
View Full Code Here

         }
      };
      SerializationContext context = new SerializationContext(domain);
      try
      {
         a = context.clone(a);
         fail();
      }
      catch (InvalidObjectException ioe)
      {
         assertSame(e, ioe.getCause());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.