<commit_before>package com.contentful.java;

import com.contentful.java.lib.MockClient;
import com.contentful.java.lib.NyanCat;
import com.contentful.java.lib.TestCallback;
import com.contentful.java.model.CDAClient;
import com.contentful.java.model.CDAListResult;
import retrofit.RetrofitError;
import retrofit.client.Response;

import java.util.Date;
import java.util.concurrent.CountDownLatch;

/**
 * Created by tomxor on 30/07/14.
 */
public class ClientTest extends AbsTestCase {
    private RetrofitError retrofitError;

    public void testClientProvider() throws Exception {
        final CountDownLatch cdl = new CountDownLatch(1);
        final CDAListResult[] result = {null};

        CDAClient client = new CDAClient.Builder()
                .setSpaceKey("NON EXISTING")
                .setAccessToken("NON EXISTING")
                .setClient(new MockClient("result_test_client_provider.json"))
                .build();

        client.registerCustomClass("cat", NyanCat.class);

        client.fetchEntries(new TestCallback<CDAListResult>(cdl) {
            @Override
            protected void onSuccess(CDAListResult cdaListResult, Response response) {
                result[0] = cdaListResult;
                super.onSuccess(cdaListResult, response);
            }
        });

        cdl.await();

        assertTrue(result[0].getItems().size() == 1);
        NyanCat cat = (NyanCat) result[0].getItems().get(0);

        assertEquals("Nyan Cat", cat.fields.name);
        assertEquals(2, cat.fields.likes.size());<commit_msg>Removed unused fields from ClientTest.java<commit_after>package com.contentful.java;

import com.contentful.java.lib.MockClient;
import com.contentful.java.lib.NyanCat;
import com.contentful.java.lib.TestCallback;
import com.contentful.java.model.CDAClient;
import com.contentful.java.model.CDAListResult;
import retrofit.client.Response;

import java.util.Date;
import java.util.concurrent.CountDownLatch;

/**
 * Created by tomxor on 30/07/14.
 */
public class ClientTest extends AbsTestCase {
    public void testClientProvider() throws Exception {
        final CountDownLatch cdl = new CountDownLatch(1);
        final CDAListResult[] result = {null};

        CDAClient client = new CDAClient.Builder()
                .setSpaceKey("NON EXISTING")
                .setAccessToken("NON EXISTING")
                .setClient(new MockClient("result_test_client_provider.json"))
                .build();

        client.registerCustomClass("cat", NyanCat.class);

        client.fetchEntries(new TestCallback<CDAListResult>(cdl) {
            @Override
            protected void onSuccess(CDAListResult cdaListResult, Response response) {
                result[0] = cdaListResult;
                super.onSuccess(cdaListResult, response);
            }
        });

        cdl.await();

        assertTrue(result[0].getItems().size() == 1);
        NyanCat cat = (NyanCat) result[0].getItems().get(0);

        assertEquals("Nyan Cat", cat.fields.name);
        assertEquals(2, cat.fields.likes.size());
{'fraction_non_alphanumeric': 0.11169170476812541, 'fraction_numerical': 0.008491182233834096, 'mean_word_length': 2.9118773946360155, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '819777', 'n_tokens_mistral': 909, 'n_tokens_neox': 881, 'n_words': 168}