Package org.axonframework.serializer

Examples of org.axonframework.serializer.JavaSerializer


     * @param mongoTemplate the template providing access to the collections
     */
    public MongoSagaRepository(MongoTemplate mongoTemplate) {
        Assert.notNull(mongoTemplate, "mongoTemplate may not be null");
        this.mongoTemplate = mongoTemplate;
        this.serializer = new JavaSerializer();
    }
View Full Code Here


    @Test
    public void testLoadSaga_AssociationValueRemoved() {
        String identifier = UUID.randomUUID().toString();
        MyTestSaga saga = new MyTestSaga(identifier);
        saga.registerAssociationValue(new AssociationValue("key", "value"));
        mongoTemplate.sagaCollection().save(new SagaEntry(saga, new JavaSerializer()).asDBObject());

        MyTestSaga loaded = (MyTestSaga) repository.load(identifier);
        loaded.removeAssociationValue("key", "value");
        repository.commit(loaded);
        Set<String> found = repository.find(MyTestSaga.class, new AssociationValue("key", "value"));
View Full Code Here

    @DirtiesContext
    @Test
    public void testSaveSaga() {
        String identifier = UUID.randomUUID().toString();
        MyTestSaga saga = new MyTestSaga(identifier);
        mongoTemplate.sagaCollection().save(new SagaEntry(saga, new JavaSerializer()).asDBObject());
        MyTestSaga loaded = (MyTestSaga) repository.load(identifier);
        loaded.counter = 1;
        repository.commit(loaded);

        SagaEntry entry = new SagaEntry(mongoTemplate.sagaCollection().findOne(SagaEntry
                                                                                       .queryByIdentifier(identifier)));
        MyTestSaga actualSaga = (MyTestSaga) entry.getSaga(new JavaSerializer());
        assertNotSame(loaded, actualSaga);
        assertEquals(1, actualSaga.counter);
    }
View Full Code Here

    @DirtiesContext
    @Test
    public void testEndSaga() {
        String identifier = UUID.randomUUID().toString();
        MyTestSaga saga = new MyTestSaga(identifier);
        mongoTemplate.sagaCollection().save(new SagaEntry(saga, new JavaSerializer()).asDBObject());
        MyTestSaga loaded = (MyTestSaga) repository.load(identifier);
        loaded.end();
        repository.commit(loaded);

        assertNull(mongoTemplate.sagaCollection().findOne(SagaEntry.queryByIdentifier(identifier)));
View Full Code Here

     * @param entityManagerProvider The EntityManagerProvider providing the EntityManager instance for this repository
     */
    public JpaSagaRepository(EntityManagerProvider entityManagerProvider) {
        Assert.notNull(entityManagerProvider, "entityManagerProvider may not be null");
        this.entityManagerProvider = entityManagerProvider;
        serializer = new JavaSerializer();
    }
View Full Code Here

TOP

Related Classes of org.axonframework.serializer.JavaSerializer

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.