Package com.voyagegames.java.tracking

Examples of com.voyagegames.java.tracking.BasicAccumulator


    assertTrue(!disp.dispatch());
  }

  @Test
  public void testDispatchIAccumulator() {
    final BasicAccumulator acc = new BasicAccumulator();
    final JsonDispatcherConfig config = new JsonDispatcherConfig();
    final TestDispatchCallback callback = new TestDispatchCallback();
    final AppEvent event = new AppEvent("testkey", "testvalue");

    acc.trackAppEvent(event);
    config.callback = callback;
    config.url = "testurl";
    config.debugMode = true;
   
    final JsonDispatcher disp = new JsonDispatcher(config);
View Full Code Here


    assertTrue(output.length() > callback.output.length);
  }

  @Test
  public void testDispatchIAccumulator_noCompression() {
    final BasicAccumulator acc = new BasicAccumulator();
    final JsonDispatcherConfig config = new JsonDispatcherConfig();
    final TestDispatchCallback callback = new TestDispatchCallback();
    final AppEvent event = new AppEvent("testkey", "testvalue");

    acc.trackAppEvent(event);
    config.callback = callback;
    config.url = "testurl";
    config.debugMode = true;
    config.useCompression = false;
   
View Full Code Here

    }
  }

  @Test
  public void testDispatchIAccumulator_withHeader() {
    final BasicAccumulator acc = new BasicAccumulator();
    final JsonDispatcherConfig config = new JsonDispatcherConfig();
    final TestDispatchCallback callback = new TestDispatchCallback();
    final AppEvent header = new AppEvent("testheader", "testheadervalue");
    final AppEvent event = new AppEvent("testkey", "testvalue");

    acc.trackAppEvent(event);
    config.callback = callback;
    config.url = "testurl";
    config.debugMode = true;
    config.useCompression = false;
    config.trackingHeader.add(header);
View Full Code Here

    }
  }

  @Test
  public void testDispatchIAccumulator_noUrl() {
    final BasicAccumulator acc = new BasicAccumulator();
    final JsonDispatcherConfig config = new JsonDispatcherConfig();
    final TestDispatchCallback callback = new TestDispatchCallback();

    acc.trackAppEvent(new AppEvent("testkey", "testvalue"));
    config.callback = callback;
   
    final JsonDispatcher disp = new JsonDispatcher(config);
   
    assertTrue(!callback.errorCalled);
View Full Code Here

    assertTrue(callback.errorCalled);
  }

  @Test
  public void testDispatchIAccumulator_maxUploadSize() {
    final BasicAccumulator acc = new BasicAccumulator();
    final JsonDispatcherConfig config = new JsonDispatcherConfig();
    final TestDispatchCallback callback = new TestDispatchCallback();

    acc.trackAppEvent(new AppEvent("testkey", "testvalue"));
    config.callback = callback;
    config.url = "testurl";
    config.maxUploadSize = 1;
   
    final JsonDispatcher disp = new JsonDispatcher(config);
View Full Code Here

public class BasicAccumulatorTest {

  @Test
  public void testBasicAccumulator() {
    final BasicAccumulator acc = new BasicAccumulator();
   
    assertTrue(0 == acc.getTrackingData().size());
  }
View Full Code Here

    assertTrue(0 == acc.getTrackingData().size());
  }

  @Test
  public void testGetTrackingData() {
    final BasicAccumulator acc = new BasicAccumulator();
   
    assertTrue(0 == acc.getTrackingData().size());
    acc.trackAppEvent(new AppEvent("testkey", "testvalue"));
    assertTrue(1 == acc.getTrackingData().size());
  }
View Full Code Here

    assertTrue(1 == acc.getTrackingData().size());
  }

  @Test
  public void testResetTrackingData() {
    final BasicAccumulator acc = new BasicAccumulator();
   
    assertTrue(0 == acc.getTrackingData().size());
    acc.trackAppEvent(new AppEvent("testkey", "testvalue"));
    assertTrue(1 == acc.getTrackingData().size());
    acc.resetTrackingData();
    assertTrue(0 == acc.getTrackingData().size());
  }
View Full Code Here

    assertTrue(0 == acc.getTrackingData().size());
  }

  @Test
  public void testTrackAppEvent() {
    final BasicAccumulator acc = new BasicAccumulator();
    final AppEvent data = new AppEvent("testkey", "testvalue");
   
    assertTrue(0 == acc.getTrackingData().size());
    acc.trackAppEvent(data);
    assertTrue(1 == acc.getTrackingData().size());
    assertTrue(data == acc.getTrackingData().get(0));
  }
View Full Code Here

    assertTrue(data == acc.getTrackingData().get(0));
  }

  @Test
  public void testTrackAppSetting() {
    final BasicAccumulator acc = new BasicAccumulator();
    final AppSetting data = new AppSetting("testkey", "testvalue");
   
    assertTrue(0 == acc.getTrackingData().size());
    acc.trackAppSetting(data);
    assertTrue(1 == acc.getTrackingData().size());
    assertTrue(data == acc.getTrackingData().get(0));
  }
View Full Code Here

TOP

Related Classes of com.voyagegames.java.tracking.BasicAccumulator

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.