@@ -0,0 +1,1855 @@
+package com.ning.metrics.eventtracker;%0A%0Aimport com.google.inject.Guice;%0Aimport com.google.inject.Injector;%0Aimport com.ning.metrics.serialization.event.Event;%0Aimport com.ning.metrics.serialization.event.SmileEnvelopeEvent;%0Aimport com.ning.metrics.serialization.writer.DiskSpoolEventWriter;%0Aimport org.joda.time.DateTime;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.AfterTest;%0Aimport org.testng.annotations.BeforeTest;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0A%0Apublic class TestCollectorController%0A%7B%0A    private final File tmpDir = new File(System.getProperty(%22java.io.tmpdir%22), %22collector%22);%0A    private Event event;%0A    private CollectorController controller;%0A    private DiskSpoolEventWriter diskWriter;%0A%0A    @BeforeTest%0A    public void setUp() throws IOException%0A    %7B%0A        System.setProperty(%22eventtracker.type%22, %22NO_LOGGING%22);%0A        System.setProperty(%22eventtracker.diskspool.path%22, tmpDir.getAbsolutePath());%0A%0A        HashMap%3CString, Object%3E eventMap = new HashMap%3CString, Object%3E();%0A        eventMap.put(%22foo%22, %22bar%22);%0A        eventMap.put(%22bleh%22, 12);%0A        event = new SmileEnvelopeEvent(%22myEvent%22, new DateTime(), eventMap);%0A%0A        Injector injector = Guice.createInjector(new CollectorControllerModule());%0A        controller = injector.getInstance(CollectorController.class);%0A        diskWriter = injector.getInstance(DiskSpoolEventWriter.class); // We have only one%0A    %7D%0A%0A    @AfterTest%0A    public void cleanupTmpDir()%0A    %7B%0A        tmpDir.delete();%0A    %7D%0A%0A    @Test(groups = %22fast%22)%0A    public void testOfferEvent() throws Exception%0A    %7B%0A        controller.offerEvent(event);%0A        Assert.assertEquals(controller.getEventsReceived().get(), 1);%0A        diskWriter.commit();%0A        Assert.assertEquals(controller.getEventsLost().get(), 0);%0A    %7D%0A%7D%0A

add Test for CollectorController