Package com.saasovation.common.event

Examples of com.saasovation.common.event.TestableNavigableDomainEvent


        assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("occurredOn"));
        assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("/occurredOn"));
    }

    public void testReadNestedDomainEventProperties() throws Exception {
        TestableNavigableDomainEvent domainEvent = new TestableNavigableDomainEvent(100, "testing");

        Notification notification = new Notification(1, domainEvent);

        NotificationSerializer serializer = NotificationSerializer.instance();

        String serializedNotification = serializer.serialize(notification);

        NotificationReader reader = new NotificationReader(serializedNotification);

        assertEquals("" + domainEvent.eventVersion(), reader.eventStringValue("eventVersion"));
        assertEquals("" + domainEvent.eventVersion(), reader.eventStringValue("/eventVersion"));
        assertEquals(domainEvent.eventVersion(), reader.eventIntegerValue("eventVersion").intValue());
        assertEquals(domainEvent.eventVersion(), reader.eventIntegerValue("/eventVersion").intValue());
        assertEquals("" + domainEvent.nestedEvent().eventVersion(), reader.eventStringValue("nestedEvent", "eventVersion"));
        assertEquals("" + domainEvent.nestedEvent().eventVersion(), reader.eventStringValue("/nestedEvent/eventVersion"));
        assertEquals(domainEvent.nestedEvent().eventVersion(), reader.eventIntegerValue("nestedEvent", "eventVersion").intValue());
        assertEquals(domainEvent.nestedEvent().eventVersion(), reader.eventIntegerValue("/nestedEvent/eventVersion").intValue());
        assertEquals("" + domainEvent.nestedEvent().id(), reader.eventStringValue("nestedEvent", "id"));
        assertEquals("" + domainEvent.nestedEvent().id(), reader.eventStringValue("/nestedEvent/id"));
        assertEquals(domainEvent.nestedEvent().id(), reader.eventLongValue("nestedEvent", "id").longValue());
        assertEquals(domainEvent.nestedEvent().id(), reader.eventLongValue("/nestedEvent/id").longValue());
        assertEquals("" + domainEvent.nestedEvent().name(), reader.eventStringValue("nestedEvent", "name"));
        assertEquals("" + domainEvent.nestedEvent().name(), reader.eventStringValue("/nestedEvent/name"));
        assertEquals("" + domainEvent.nestedEvent().occurredOn().getTime(), reader.eventStringValue("nestedEvent", "occurredOn"));
        assertEquals("" + domainEvent.nestedEvent().occurredOn().getTime(), reader.eventStringValue("/nestedEvent/occurredOn"));
        assertEquals(domainEvent.nestedEvent().occurredOn(), reader.eventDateValue("nestedEvent", "occurredOn"));
        assertEquals(domainEvent.nestedEvent().occurredOn(), reader.eventDateValue("/nestedEvent/occurredOn"));
        assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("occurredOn"));
        assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("/occurredOn"));
        assertEquals(domainEvent.occurredOn(), reader.eventDateValue("occurredOn"));
        assertEquals(domainEvent.occurredOn(), reader.eventDateValue("/occurredOn"));
    }
View Full Code Here


        assertEquals(domainEvent.occurredOn(), reader.eventDateValue("occurredOn"));
        assertEquals(domainEvent.occurredOn(), reader.eventDateValue("/occurredOn"));
    }

    public void testDotNotation() throws Exception {
        TestableNavigableDomainEvent domainEvent = new TestableNavigableDomainEvent(100, "testing");

        Notification notification = new Notification(1, domainEvent);

        NotificationSerializer serializer = NotificationSerializer.instance();

        String serializedNotification = serializer.serialize(notification);

        NotificationReader reader = new NotificationReader(serializedNotification);

        assertEquals("" + domainEvent.nestedEvent().eventVersion(), reader.eventStringValue("nestedEvent.eventVersion"));
        assertEquals(domainEvent.nestedEvent().eventVersion(), reader.eventIntegerValue("nestedEvent.eventVersion").intValue());
    }
View Full Code Here

        assertEquals("" + domainEvent.nestedEvent().eventVersion(), reader.eventStringValue("nestedEvent.eventVersion"));
        assertEquals(domainEvent.nestedEvent().eventVersion(), reader.eventIntegerValue("nestedEvent.eventVersion").intValue());
    }

    public void testReadBogusProperties() throws Exception {
        TestableNavigableDomainEvent domainEvent = new TestableNavigableDomainEvent(100L, "testing");

        Notification notification = new Notification(1, domainEvent);

        NotificationSerializer serializer = NotificationSerializer.instance();
View Full Code Here

TOP

Related Classes of com.saasovation.common.event.TestableNavigableDomainEvent

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.