Package org.ff4j.audit

Examples of org.ff4j.audit.EventPublisher.publish()


    @Test
    public void testAudit() throws InterruptedException {
        int nb = 500;
        EventPublisher pub = new EventPublisher();
        for (int i = 0; i < nb; i++) {
            pub.publish(new Event("aer", EventType.HIT_FLIPPED));
            Thread.sleep(2);
        }
        Assert.assertEquals(nb, pub.getRepository().getTotalEventCount());
    }
View Full Code Here


        int nb = 500;
        int limit = 25;
        EventPublisher pub = new EventPublisher();
        pub.setRepository(new InMemoryEventRepository(limit));
        for (int i = 0; i < nb; i++) {
            pub.publish(new Event("aer", EventType.HIT_FLIPPED));
            Thread.sleep(2);
        }
        Assert.assertEquals(limit, pub.getRepository().getTotalEventCount());
    }
View Full Code Here

        // Events to generate
        int nbEvent = 100;

        EventPublisher pub = new EventPublisher();
        for (int i = 0; i < nbEvent; i++) {
            pub.publish(new Event("aer", EventType.HIT_FLIPPED));
            Thread.sleep(2);
        }
        Assert.assertEquals(nbEvent, pub.getRepository().getTotalEventCount());
        long now = System.currentTimeMillis();
        pub.getRepository().getFeatureHitsCurve("aer", now - 3 * nbEvent, now, 10);
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.