Android Open Source - snowplow-android-tracker Emitter Test






From Project

Back to project page snowplow-android-tracker.

License

The source code is released under:

Apache License

If you think the Android project snowplow-android-tracker listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.snowplowanalytics.snowplow.tracker.android.emitter;
/*from  w  ww. j  a va  2 s.c  om*/
import com.snowplowanalytics.snowplow.tracker.android.Subject;
import com.snowplowanalytics.snowplow.tracker.android.Tracker;
import com.snowplowanalytics.snowplow.tracker.core.emitter.BufferOption;
import com.snowplowanalytics.snowplow.tracker.core.emitter.HttpMethod;
import com.snowplowanalytics.snowplow.tracker.core.emitter.RequestMethod;

import android.test.AndroidTestCase;

public class EmitterTest extends AndroidTestCase {

//    private static String testURL = "segfault.ngrok.com";
    private static String testURL = "d3rkrsqld9gmqf.cloudfront.net";

    public void testSendGetData() throws Exception {
        Emitter emitter = new Emitter(testURL, getContext());
        Subject subject = new Subject(getContext());
        emitter.setBufferOption(BufferOption.Instant);
        Tracker tracker = new Tracker(emitter, subject, "myNamespace", "myAppId", false);
        tracker.trackScreenView("Screen 1", null);
    }

    public void testSetRequestMethod() throws Exception {
        Emitter emitter = new Emitter(testURL, getContext());
        emitter.setRequestMethod(RequestMethod.Synchronous);
    }

    public void testSendPostData() throws Exception {
        Emitter emitter = new Emitter(testURL, getContext(), HttpMethod.POST);
        Subject subject = new Subject(getContext());
        emitter.setBufferOption(BufferOption.Instant);
        Tracker tracker = new Tracker(emitter, subject, "myNamespace", "myAppId", false);
        tracker.trackScreenView("Screen 1", null);
    }
}




Java Source Code List

com.snowplowanalytics.snowplow.tracker.android.ApplicationTest.java
com.snowplowanalytics.snowplow.tracker.android.Constants.java
com.snowplowanalytics.snowplow.tracker.android.EventStoreHelper.java
com.snowplowanalytics.snowplow.tracker.android.EventStoreTest.java
com.snowplowanalytics.snowplow.tracker.android.EventStore.java
com.snowplowanalytics.snowplow.tracker.android.Parameter.java
com.snowplowanalytics.snowplow.tracker.android.Subject.java
com.snowplowanalytics.snowplow.tracker.android.Tracker.java
com.snowplowanalytics.snowplow.tracker.android.Util.java
com.snowplowanalytics.snowplow.tracker.android.Version.java
com.snowplowanalytics.snowplow.tracker.android.emitter.EmitterTest.java
com.snowplowanalytics.snowplow.tracker.android.emitter.Emitter.java
com.snowplowanalytics.snowplow.tracker.android.payload.SchemaPayload.java
com.snowplowanalytics.snowplow.tracker.android.payload.TrackerPayload.java