Package org.axonframework.serializer.xml

Examples of org.axonframework.serializer.xml.XStreamSerializer.deserialize()


        assertEquals(1, deserialized2.getUncommittedEventCount());
    }

    private AggregateRoot deserialized(ByteArrayOutputStream baos) {
        XStreamSerializer serializer = new XStreamSerializer();
        return (AggregateRoot) serializer.deserialize(new SimpleSerializedObject<byte[]>(baos.toByteArray(),
                                                                                         byte[].class,
                                                                                         "ignored",
                                                                                         "0"));
    }
View Full Code Here


        StubAnnotatedAggregate aggregateRoot = new StubAnnotatedAggregate(UUID.randomUUID());
        aggregateRoot.doSomething();
        String xml = new String(serializer.serialize(aggregateRoot, byte[].class).getData(), UTF8);
        assertNotNull(xml);

        StubAnnotatedAggregate unmarshalled = (StubAnnotatedAggregate) serializer.deserialize(
                new SimpleSerializedObject<byte[]>(xml.getBytes(UTF8), byte[].class, "ignored", "0"));

        validateAggregateCondition(aggregateRoot, unmarshalled);
    }
View Full Code Here

        aggregateRoot.doSomething();
        byte[] data = serializer.serialize(aggregateRoot, byte[].class).getData();
        String xml = new String(data, UTF8);
        assertNotNull(xml);

        StubAnnotatedAggregate unmarshalled = (StubAnnotatedAggregate) serializer.deserialize(
                new SimpleSerializedObject<byte[]>(data, byte[].class, "ignored", "0"));

        validateAggregateCondition(aggregateRoot, unmarshalled);
    }
View Full Code Here

        LateIdentifiedAggregate aggregate = new LateIdentifiedAggregate();
        aggregate.commitEvents();
        final XStreamSerializer serializer = new XStreamSerializer();
        SerializedObject<String> serialized = serializer.serialize(aggregate, String.class);

        LateIdentifiedAggregate deserializedAggregate = serializer.deserialize(serialized);
        assertTrue(deserializedAggregate.isLive());
    }

    @Test
    public void testAggregateRetrievesParameterResolverFactoryFromUnitOfWork() {
View Full Code Here

        assertEquals(2, aggregateRoot.getInvocations());
        assertEquals(2, aggregateRoot.getEntity().getInvocations());
        aggregateRoot.commitEvents();
        XStreamSerializer serializer = new XStreamSerializer();
        SerializedObject<byte[]> serialized = serializer.serialize(aggregateRoot, byte[].class);
        StructuredAggregateRoot deserializedAggregate = (StructuredAggregateRoot) serializer.deserialize(serialized);

        deserializedAggregate.invoke();
        assertEquals(3, deserializedAggregate.getInvocations());
        assertEquals(3, deserializedAggregate.getEntity().getInvocations());
    }
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.