Package com.nokia.dempsy.serialization.kryo

Examples of com.nokia.dempsy.serialization.kryo.Registration


   public void testKryoSerializeDeserializeWithRegister() throws Throwable
   {
      KryoSerializer<MockClass> ser1 = new KryoSerializer<MockClass>();
      runSerializer(ser1);
      KryoSerializer<MockClass> ser2 =
            new KryoSerializer<MockClass>(new Registration(MockClass.class.getName(),10));
      runSerializer(ser2);
     
      byte[] d1 = ser1.serialize(o1);
      byte[] d2 = ser2.serialize(o1);
      assertTrue(d2.length < d1.length);
View Full Code Here


   @Test
   public void testChildClassSerializationWithRegistration() throws Throwable
   {
      KryoSerializer<Object> ser = new KryoSerializer<Object>(defaultMock3Optimizer);
      JavaSerializer<Object> serJ = new JavaSerializer<Object>();
      KryoSerializer<Object> serR = new KryoSerializer<Object>(defaultMock3Optimizer,new Registration(MockClass.class.getName(),10));
      KryoSerializer<Object> serRR = new KryoSerializer<Object>(defaultMock3Optimizer,new Registration(MockClass.class.getName(),10),new Registration(Mock3.class.getName(), 11));
      KryoSerializer<Object> serRROb = new KryoSerializer<Object>(defaultMock3Optimizer,new Registration(MockClass.class.getName()),new Registration(Mock3.class.getName()),new Registration(UUID.class.getName()));
      Mock2 o = new Mock3(1, new MockClass(2, "Hello"));
      byte[] data = ser.serialize(o);
      byte[] dataJ = serJ.serialize(o);
      byte[] dataR = serR.serialize(o);
      byte[] dataRR = serRR.serialize(o);
View Full Code Here

   @Test
   public void testChildClassSerializationWithRegistrationAndOptimization() throws Throwable
   {
      KryoSerializer<Object> ser = new KryoSerializer<Object>(defaultMock3Optimizer);
      JavaSerializer<Object> serJ = new JavaSerializer<Object>();
      KryoSerializer<Object> serR = new KryoSerializer<Object>(defaultMock3Optimizer,new Registration(MockClass.class.getName(),10));
      KryoSerializer<Object> serRR = new KryoSerializer<Object>(defaultMock3Optimizer,new Registration(MockClass.class.getName(),10),new Registration(Mock3.class.getName(), 11));
      KryoSerializer<Object> serRROb = new KryoSerializer<Object>(defaultMock3Optimizer,new Registration(MockClass.class.getName()),new Registration(Mock3.class.getName()));
      KryoSerializer<Object> serRRO  = new KryoSerializer<Object>(new Registration(MockClass.class.getName(),10),
            new Registration(Mock3.class.getName(), 11), new Registration(UUID.class.getName(),12));
      serRRO.setKryoOptimizer(new KryoOptimizer()
      {
         @Override
         public void preRegister(Kryo kryo)
         {
View Full Code Here

      Thread[] threads = new Thread[numThreads];
     
      final Object latch = new Object();
      final AtomicBoolean done = new AtomicBoolean(false);
      final AtomicBoolean failed = new AtomicBoolean(false);
      final KryoSerializer<MockClass> ser = new KryoSerializer<MockClass>(new Registration(MockClass.class.getName(),10));
      final AtomicBoolean[] finished = new AtomicBoolean[numThreads];
      final AtomicLong[] counts = new AtomicLong[numThreads];
      final long maxSerialize = 100000;
     
      try
View Full Code Here

  
   @Test
   public void testEnumWithNoDefaultConstructor() throws Throwable
   {
      Mock4 o = new Mock4(MockEnum.BOTH);
      KryoSerializer<Mock4> ser = new KryoSerializer<Mock4>(new Registration(Mock4.class.getName()), new Registration(MockEnum.class.getName()));
      byte[] data = ser.serialize(o);
      Mock4 dser = ser.deserialize(data);
      assertTrue(o.get() == dser.get());
      assertEquals(o.get().toString(),dser.get().toString());
   }
View Full Code Here

TOP

Related Classes of com.nokia.dempsy.serialization.kryo.Registration

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.