<commit_before>package com.treasure_data.client;

import java.util.Properties;

import org.junit.Ignore;
import org.junit.Test;
import org.msgpack.unpacker.Unpacker;
import org.msgpack.unpacker.UnpackerIterator;

import com.treasure_data.auth.TreasureDataCredentials;
import com.treasure_data.model.GetJobResultRequest;
import com.treasure_data.model.GetJobResultResult;
import com.treasure_data.model.Job;
import com.treasure_data.model.JobResult;
import com.treasure_data.model.JobResult2;

public class TestGetJobResult {
    // TODO #MN need test more

    @Test @Ignore
    public void testGetJobResult00() throws Exception {
        Properties props = System.getProperties();
        props.load(this.getClass().getClassLoader().getResourceAsStream("treasure-data.properties"));
        Config conf = new Config();
        conf.setCredentials(new TreasureDataCredentials(props));
        DefaultClientAdaptorImpl clientAdaptor = new DefaultClientAdaptorImpl(conf);

        GetJobResultRequest request = new GetJobResultRequest(
                //new JobResult(new Job("1515829")));
                new JobResult2(new Job("1515829"), 1));
        GetJobResultResult result = clientAdaptor.getJobResult(request);
        System.out.println(result.getJob().getJobID());
        Unpacker unpacker = result.getJobResult().getResult();
        UnpackerIterator iter = unpacker.iterator();
        int cnt = 0;
        while (iter.hasNext()) {
            cnt++;
            System.out.println(iter.next());
        }
        unpacker.close();
        System.out.println(cnt);
    }

}<commit_msg>changed TestGetJobResult class -- added debug code<commit_after>package com.treasure_data.client;

import java.util.Properties;
import java.util.zip.GZIPInputStream;

import org.junit.Ignore;
import org.junit.Test;
import org.msgpack.MessagePack;
import org.msgpack.unpacker.Unpacker;
import org.msgpack.unpacker.UnpackerIterator;

import com.treasure_data.auth.TreasureDataCredentials;
import com.treasure_data.model.GetJobResultRequest;
import com.treasure_data.model.GetJobResultResult;
import com.treasure_data.model.Job;
import com.treasure_data.model.JobResult;
import com.treasure_data.model.JobResult2;
import com.treasure_data.model.JobSummary;
import com.treasure_data.model.ShowJobRequest;

public class TestGetJobResult {
    // TODO #MN need test more

    @Test @Ignore
    public void testGetJobResult00() throws Exception {
        Properties props = System.getProperties();
        props.load(this.getClass().getClassLoader().getResourceAsStream("treasure-data.properties"));
        Config conf = new Config();
        conf.setCredentials(new TreasureDataCredentials(props));
        DefaultClientAdaptorImpl clientAdaptor = new DefaultClientAdaptorImpl(conf);

        GetJobResultRequest request = new GetJobResultRequest(
                new JobResult(new Job("1515829")));
        GetJobResultResult result = clientAdaptor.getJobResult(request);
        System.out.println(result.getJob().getJobID());
        Unpacker unpacker = result.getJobResult().getResult();
        UnpackerIterator iter = unpacker.iterator();
        int cnt = 0;
        while (iter.hasNext()) {
            cnt++;
            System.out.println(iter.next());
        }
        unpacker.close();
        System.out.println(cnt);
    }

    @Test @Ignore
    public void testGetJobResult02() throws Exception {
        Properties props = System.getProperties();
        props.load(this.getClass().getClassLoader().getResourceAsStream("treasure-data.properties"));
        Config conf = new Config();
        conf.setCredentials(new TreasureDataCredentials(props));
        DefaultClientAdaptorImpl clientAdaptor = new DefaultClientAdaptorImpl(conf);

        JobResult2 jr = (JobResult2) clientAdaptor.getJobResult(
                new GetJobResultRequest(new JobResult2(new Job("1515829")))).getJobResult();
        System.out.println(jr.getJob().getJobID());

        GZIPInputStream gzin = new GZIPInputStream(jr.getResultInputStream());
        Unpacker unpacker = new MessagePack().createUnpacker(gzin);
        UnpackerIterator iter = unpacker.iterator();
        int cnt = 0;
        while (iter.hasNext()) {
            cnt++;
            System.out.println(iter.next());
        }
        unpacker.close();

        jr.close();
        System.out.println("fin");
    }
}
{'fraction_non_alphanumeric': 0.10910338517840805, 'fraction_numerical': 0.010064043915827997, 'mean_word_length': 3.430597771023303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4822055', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1250, 'n_words': 226}