<commit_before>package com.snowplowanalytics.snowplow.tracker;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class TrackerCTest extends TestCase {

    @Before
    public void setUp() throws Exception {
//        Tracker t1 = new TrackerC("d3rkrsqld9gmqf.cloudfront.net", "com.snowplowanalytics.snowplow.tracker.Tracker Test", "JavaPlow", "com.saggezza", true, true);
////        t1.track();
//        t1.setUserID("User1");
//        t1.setLanguage("ital");
//        t1.setPlatform("mob");
//        t1.setScreenResolution(760, 610);
//        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";
//
//        ///// E COMMERCE TEST
//        Map<String,String> items = new HashMap<String, String>();
//        items.put("sku", "SKUVAL"); items.put("quantity","2"); items.put("price","19.99");
//        List<Map<String,String>> lst = new LinkedList<Map<String, String>>();
//        lst.add(items);
//        TrackerC.debug=true;
//
//        /////TRACK TEST
//        for (int i = 0; i < 2; i++) {
//            t1.track();
//            try { Thread.sleep(2000); }
//            catch (InterruptedException e){}
//            System.out.println("Loop " + i);
//            Map<String, Object> dict = new LinkedHashMap<String, Object>();
//            dict.put("Iteration", i);
//            t1.trackUnstructEvent("Lube Insights", "Data Loop", dict, context);
//            t1.trackStructEvent("Items", "Stuff", "Pants", "Green Blue", 3, DEFAULT_VENDOR, context);
//            t1.trackPageView("www.saggezza.com", "Saggezza Home", "KG", null);
//            t1.trackEcommerceTransactionItem("IT1023", "SKUVAL", 29.99, 2, "boots", "Shoes","USD",null,null);
//            t1.trackEcommerceTransaction("OID", 19.99, "Kohls", 2.50, 1.99, "Chagrin", "OH", "USA", "USD", lst, context);
//        }

    }

    @After
    public void tearDown() throws Exception {

    }

    @Test
    public void testTrackEcommerceTransactionItem() throws Exception {
//        Tracker t1 = new TrackerC("d3rkrsqld9gmqf.cloudfront.net", "com.snowplowanalytics.snowplow.tracker", "JavaPlow", "com.snowplow", true, true);
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker", "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";
        t1.trackEcommerceTransactionItem("IT1023", "SKUVAL", 29.99, 2, "boots", "Shoes", "USD", null, context);
    }

    @Test
    public void testTrackEcommerceTransactionItem2() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker", "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";
        t1.trackEcommerceTransactionItem("IT1023", "SKUVAL", 29.99, 2, "boots", "Shoes", "USD", null, null);
    }

    @Test
    public void testTrackEcommerceTransaction() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker", "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";

        Map<String,String> items = new HashMap<String, String>();
        items.put("sku", "SKUVAL"); items.put("quantity","2"); items.put("price","19.99");
        List<Map<String,String>> lst = new LinkedList<Map<String, String>>();
        lst.add(items);

        t1.trackEcommerceTransaction("OID", 19.99, "Kohls", 2.50, 1.99, "Chagrin", "OH", "USA", "USD", lst, context);
    }

    @Test
    public void testTrackUnstructEvent() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker", "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";

        Map<String, Object> dict = new LinkedHashMap<String, Object>();
        dict.put("Iteration", 1);

        t1.trackUnstructEvent("Lube Insights", "Data Loop", dict, context);
    }
}<commit_msg>All TrackerC tests separated  - Fixes #5<commit_after>package com.snowplowanalytics.snowplow.tracker;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class TrackerCTest extends TestCase {

    @Test
    public void testTrackEcommerceTransactionItem() throws Exception {
//        Tracker t1 = new TrackerC("d3rkrsqld9gmqf.cloudfront.net",
//                "com.snowplowanalytics.snowplow.tracker", "JavaPlow", "com.snowplow", true, true);
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker",
                "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";

        t1.trackEcommerceTransactionItem("IT1023", "SKUVAL",
                29.99, 2, "boots",
                "Shoes", "USD",
                null, context);
    }

    @Test
    public void testTrackEcommerceTransactionItem2() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker",
                "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";

        t1.trackEcommerceTransactionItem("IT1023", "SKUVAL",
                29.99, 2, "boots",
                "Shoes", "USD",
                null, null);
    }

    @Test
    public void testTrackEcommerceTransaction() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker",
                "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";

        Map<String,String> items = new HashMap<String, String>();
        items.put("sku", "SKUVAL"); items.put("quantity","2"); items.put("price","19.99");
        List<Map<String,String>> lst = new LinkedList<Map<String, String>>();
        lst.add(items);

        t1.trackEcommerceTransaction("OID", 19.99,
                "Kohls", 2.50,
                1.99, "Chagrin",
                "OH", "USA",
                "USD", lst, context);
    }

    @Test
    public void testTrackUnstructEvent() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker",
                "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";

        Map<String, Object> dict = new LinkedHashMap<String, Object>();
        dict.put("Iteration", 1);

        t1.trackUnstructEvent("Lube Insights", "Data Loop", dict, context);
    }

    @Test
    public void testTrackStructEvent() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker",
                "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";
        t1.trackStructEvent("Items", "Stuff", "Pants", "Green Blue", 3, "com.snowplow", context);
    }

    @Test
    public void testTrackPageView() throws Exception {
        Tracker t1 = new TrackerC("segfault.ngrok.com", "com.snowplowanalytics.snowplow.tracker",
                "JavaPlow", "com.snowplow", true, true);
        t1.setUserID("User1");
        t1.setLanguage("ital");
        t1.setPlatform("mob");
        t1.setScreenResolution(760, 610);
        String context = "{'Zone':'USA', 'Phone':'Droid', 'Time':'2pm'}";

        t1.trackPageView("www.saggezza.com", "Saggezza Home", "KG", null);
    }
}
{'fraction_non_alphanumeric': 0.1730263157894737, 'fraction_numerical': 0.029714912280701753, 'mean_word_length': 2.933160845191893, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4231545', 'n_tokens_mistral': 3250, 'n_tokens_neox': 3036, 'n_words': 565}