Examples of countStoredEvents()


Examples of com.saasovation.common.event.EventStore.countStoredEvents()

    }

    public void testAllStoredEventsBetween() throws Exception {
        EventStore eventStore = this.eventStore();

        long totalEvents = eventStore.countStoredEvents();

        assertEquals(totalEvents, eventStore.allStoredEventsBetween(1, totalEvents).size());

        assertEquals(10, eventStore.allStoredEventsBetween(totalEvents - 9, totalEvents).size());
    }
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

    }

    public void testAllStoredEventsSince() throws Exception {
        EventStore eventStore = this.eventStore();

        long totalEvents = eventStore.countStoredEvents();

        assertEquals(totalEvents, eventStore.allStoredEventsSince(0).size());

        assertEquals(0, eventStore.allStoredEventsSince(totalEvents).size());
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

    }

    public void testAppend() throws Exception {
        EventStore eventStore = this.eventStore();

        long numberOfEvents = eventStore.countStoredEvents();

        TestableDomainEvent domainEvent = new TestableDomainEvent(10001, "testDomainEvent");

        StoredEvent storedEvent = eventStore.append(domainEvent);
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

        TestableDomainEvent domainEvent = new TestableDomainEvent(10001, "testDomainEvent");

        StoredEvent storedEvent = eventStore.append(domainEvent);

        assertTrue(eventStore.countStoredEvents() > numberOfEvents);
        assertEquals(numberOfEvents + 1, eventStore.countStoredEvents());

        assertNotNull(storedEvent);

        TestableDomainEvent reconstitutedDomainEvent = storedEvent.toDomainEvent();
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

        TestableDomainEvent domainEvent = new TestableDomainEvent(10001, "testDomainEvent");

        StoredEvent storedEvent = eventStore.append(domainEvent);

        assertTrue(eventStore.countStoredEvents() > numberOfEvents);
        assertEquals(numberOfEvents + 1, eventStore.countStoredEvents());

        assertNotNull(storedEvent);

        TestableDomainEvent reconstitutedDomainEvent = storedEvent.toDomainEvent();
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

    }

    public void testCountStoredEvents() throws Exception {
        EventStore eventStore = this.eventStore();

        long numberOfEvents = eventStore.countStoredEvents();

        TestableDomainEvent lastDomainEvent = null;

        for (int idx = 0; idx < 10; ++idx) {
            TestableDomainEvent domainEvent = new TestableDomainEvent(10001 + idx, "testDomainEvent" + idx);
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

            eventStore.append(domainEvent);
        }

        LevelDBUnitOfWork.current().commit();

        assertEquals(numberOfEvents + 10, eventStore.countStoredEvents());

        numberOfEvents = eventStore.countStoredEvents();

        assertEquals(1, eventStore.allStoredEventsBetween(numberOfEvents, numberOfEvents + 1000).size());
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

        LevelDBUnitOfWork.current().commit();

        assertEquals(numberOfEvents + 10, eventStore.countStoredEvents());

        numberOfEvents = eventStore.countStoredEvents();

        assertEquals(1, eventStore.allStoredEventsBetween(numberOfEvents, numberOfEvents + 1000).size());

        StoredEvent storedEvent = eventStore.allStoredEventsBetween(numberOfEvents, numberOfEvents).get(0);
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

        EventStore eventStore = this.eventStore();
        NotificationLogFactory factory = new NotificationLogFactory(eventStore);
        NotificationLog log = factory.createCurrentNotificationLog();

        assertTrue(NotificationLogFactory.notificationsPerLog() >= log.totalNotifications());
        assertTrue(eventStore.countStoredEvents() >= log.totalNotifications());
        assertFalse(log.hasNextNotificationLog());
        assertTrue(log.hasPreviousNotificationLog());
        assertFalse(log.isArchived());
    }
View Full Code Here

Examples of com.saasovation.common.event.EventStore.countStoredEvents()

        NotificationLogId id = NotificationLogId.first(NotificationLogFactory.notificationsPerLog());
        NotificationLogFactory factory = new NotificationLogFactory(eventStore);
        NotificationLog log = factory.createNotificationLog(id);

        assertEquals(NotificationLogFactory.notificationsPerLog(), log.totalNotifications());
        assertTrue(eventStore.countStoredEvents() >= log.totalNotifications());
        assertTrue(log.hasNextNotificationLog());
        assertFalse(log.hasPreviousNotificationLog());
        assertTrue(log.isArchived());
    }
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.