Package org.axonframework.eventhandling.scheduling

Examples of org.axonframework.eventhandling.scheduling.SimpleTimingSaga


        // the event is scheduled in 50ms, which is generally enough to get the saga committed
        Thread.sleep(150);
        Set<String> actualResult = repository.find(SimpleTimingSaga.class,
                                                   new AssociationValue("association", someAssociationValue));
        assertEquals(1, actualResult.size());
        SimpleTimingSaga saga = (SimpleTimingSaga) repository.load(actualResult.iterator().next());
        assertTrue("Expected saga to be triggered", saga.isTriggered());
        // we make sure all submitted jobs are executed successfully. get() will throw an exception if a job had failed
        for (Future<?> future : executorService.getResults()) {
            future.get();
        }
    }
View Full Code Here


                                                new AssociationValue("association", randomAssociationValue));
                        assertEquals(1, actualResult.size());
                    }
                });

        SimpleTimingSaga saga = null;
        long t1 = System.currentTimeMillis();
        while (saga == null || !saga.isTriggered()) {
            if (System.currentTimeMillis() - t1 > 1000) {
                fail("Saga not triggered within 1000 milliseconds");
            }
            Set<String> actualResult;
            actualResult = repository.find(SimpleTimingSaga.class,
                                           new AssociationValue("association", randomAssociationValue));
            assertEquals(1, actualResult.size());
            saga = (SimpleTimingSaga) repository.load(actualResult.iterator().next());
        }
        assertTrue("Expected saga to be triggered", saga.isTriggered());
        assertTrue("Job did not complete within 10 seconds", jobExecutionLatch.await(10, TimeUnit.SECONDS));
        JobExecutionException jobExecutionException = jobExecutionResult.get();
        if (jobExecutionException != null) {
            throw jobExecutionException;
        }
View Full Code Here

TOP

Related Classes of org.axonframework.eventhandling.scheduling.SimpleTimingSaga

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.