Search in sources :

Example 6 with Containers

use of net.morimekta.test.providence.core.Containers in project providence by morimekta.

the class PrettySerializerTest method testConfig.

@Test
public void testConfig() throws IOException {
    PrettySerializer serializer = new PrettySerializer().config();
    Containers containers = generator.generate(Containers.kDescriptor);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    serializer.serialize(out, containers);
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    Containers res = serializer.deserialize(in, Containers.kDescriptor);
    assertThat(res, is(containers));
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) Containers(net.morimekta.test.providence.core.Containers) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Aggregations

Containers (net.morimekta.test.providence.core.Containers)6 ByteArrayInputStream (java.io.ByteArrayInputStream)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)5 Test (org.junit.Test)3 File (java.io.File)2 InputStream (java.io.InputStream)2 TokenizerException (net.morimekta.providence.serializer.pretty.TokenizerException)2 EqualToMessage (net.morimekta.providence.util_internal.EqualToMessage)2 ConsumeAll (net.morimekta.test.providence.core.ConsumeAll)2 Operation (net.morimekta.test.providence.core.calculator.Operation)2 Binary (net.morimekta.util.Binary)2 IOException (java.io.IOException)1 UTF_8 (java.nio.charset.StandardCharsets.UTF_8)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 PApplicationException (net.morimekta.providence.PApplicationException)1 PApplicationExceptionType (net.morimekta.providence.PApplicationExceptionType)1 PMessage (net.morimekta.providence.PMessage)1