@Test public void testSerDeserPerf() throws Exception { Kryo kryo = new Kryo(); String outputPath = temporaryFolder.newFile().toString(); Output output = new Output(new FileOutputStream(outputPath)); for (int i = 0; i < 1000; i++) { kryo.writeObject(output, constructPE()); } output.close(); Input input = new Input(new FileInputStream(outputPath)); PartitionedEvent someObject = kryo.readObject(input, PartitionedEvent.class); input.close(); Assert.assertTrue(someObject.getData().length == 1); }
Assert.assertArrayEquals("Should sort 3 events in ASC order", new String[] {"value2", "value1", "value3"}, orderCollected.stream().map((d) -> d.getData()[0]).toArray()); Assert.assertArrayEquals("Should sort 4 events in ASC-ordered timestamp", new String[] {"value2", "value1", "value3", "value4"}, orderCollected.stream().map((d) -> d.getData()[0]).toArray());