@@ -0,0 +1,2378 @@
+package com.rackspacecloud.blueflood.eventemitter;%0A%0Aimport com.github.nkzawa.emitter.Emitter;%0Aimport com.rackspacecloud.blueflood.types.BasicRollup;%0Aimport com.rackspacecloud.blueflood.types.Locator;%0Aimport junit.framework.Assert;%0Aimport org.codehaus.jackson.JsonNode;%0Aimport org.codehaus.jackson.map.ObjectMapper;%0Aimport org.junit.Test;%0Aimport java.io.IOException;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport static org.mockito.Mockito.*;%0A%0A%0A%0Apublic class RollupEventEmitterTest %7B%0A%0A    String testEventName = %22test%22;%0A    List%3CObject%3E capturedTestEvents;%0A%0A    BasicRollup roll = new BasicRollup();%0A    Locator loc = new Locator();%0A    String testUnitsString = %22testUnits%22;%0A%0A    EventListener elistener = new EventListener();%0A    EventListener mockListener = spy(elistener);%0A%0A    @Test%0A    public void testSubscribe() %7B%0A      RollupEventEmitter.getEmitterInstance().on(testEventName,mockListener);%0A      Assert.assertEquals(true, RollupEventEmitter.getEmitterInstance().listeners(testEventName).contains(mockListener));%0A    %7D%0A%0A    @Test%0A    public void testRollupEmit() %7B%0A      RollupEventEmitter.emitAsJSON(testEventName, loc, roll, testUnitsString);%0A    %7D%0A%0A    @Test%0A    public void testUnsubscribe() %7B%0A      RollupEventEmitter.getEmitterInstance().off(testEventName, elistener);%0A      Assert.assertEquals(false, RollupEventEmitter.getEmitterInstance().listeners(testEventName).contains(mockListener));%0A    %7D%0A%0A    private class EventListener implements Emitter.Listener %7B%0A        @Override%0A        public void call(Object... objects) %7B%0A            //This is stupidity. I know.%0A            verify(mockListener, atLeastOnce()).call(anyVararg());%0A            capturedTestEvents = Arrays.asList(objects);%0A            Assert.assertNotNull(capturedTestEvents);%0A            ObjectMapper mapper = new ObjectMapper();%0A            JsonNode df = null;%0A            try %7B%0A                df = mapper.readValue((String)capturedTestEvents.get(0),JsonNode.class);%0A            %7D catch (IOException e) %7B%0A                e.printStackTrace();%0A            %7D%0A            Assert.assertEquals(df.get(%22metadata%22).get(%22units%22).get(%22name%22).getTextValue(), testUnitsString);%0A            Assert.assertNotNull(df.get(%22rollup%22).get(%22maxValue%22).getDoubleValue());%0A            Assert.assertEquals(df.get(%22rollup%22).get(%22maxValue%22).getDoubleValue(), roll.getMaxValue().toDouble());%0A        %7D%0A    %7D%0A%0A%7D%0A

Add EventEmitter test