@@ -0,0 +1,1783 @@
+/*%0A * Copyright 2014 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage net.kuujo.copycat.util.serializer;%0A%0Aimport net.kuujo.copycat.util.serializer.impl.KryoSerializer;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.util.Random;%0A%0A/**%0A * Kryo serializer test.%0A *%0A * @author %3Ca href=%22http://github.com/kuujo%22%3EJordan Halterman%3C/a%3E%0A */%0A@Test%0Apublic class KryoSerializerTest %7B%0A%0A  public static class TestType1 %7B%0A    private long foo;%0A    private String bar;%0A    private boolean baz;%0A%0A    public TestType1() %7B%0A    %7D%0A%0A    public TestType1(long foo, String bar, boolean baz) %7B%0A      this.foo = foo;%0A      this.bar = bar;%0A      this.baz = baz;%0A    %7D%0A  %7D%0A%0A  public void testWriteReadObjects() %7B%0A    Random random = new Random();%0A    Serializer serializer = new KryoSerializer();%0A    for (int i = 0; i %3C 1000; i++) %7B%0A      TestType1 testInput = new TestType1(random.nextLong(), %22Hello world!%22, random.nextInt(1) == 1);%0A      byte%5B%5D bytes = serializer.writeObject(testInput);%0A      TestType1 testOutput = serializer.readObject(bytes);%0A      Assert.assertEquals(testOutput.foo, testInput.foo);%0A      Assert.assertEquals(testOutput.bar, testInput.bar);%0A      Assert.assertEquals(testOutput.baz, testInput.baz);%0A    %7D%0A  %7D%0A%0A%7D%0A

Add Kryo serializer test.