<commit_before>package com.splicemachine.stats.test;

import com.splicemachine.stats.estimate.ActualUniformLongDistribution;
import com.splicemachine.stats.estimate.LongDistribution;
import com.splicemachine.stats.random.Generators;
import com.splicemachine.stats.random.LongEmpiricalRejectionGenerator;
import com.splicemachine.stats.random.RandomGenerator;
import com.splicemachine.stats.random.UniformGenerator;
import org.apache.commons.math3.distribution.RealDistribution;
import org.apache.commons.math3.distribution.UniformRealDistribution;
import org.apache.commons.math3.exception.NumberIsTooLargeException;
import org.apache.commons.math3.exception.OutOfRangeException;
import org.apache.commons.math3.random.JDKRandomGenerator;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
import org.junit.runner.RunWith;

import java.util.Random;

/**
 * Tests to make sure that the Kolmogorov-Smirnov test is correctly implemented.
 *
 * @author <NAME>
 *         Date: 6/30/15
 */
@RunWith(Theories.class)
public class KolmogorovSmirnovTestTest{

    @DataPoint public static LongDistribution uniform = new ActualUniformLongDistribution(0,10,2);
    @DataPoint public static LongDistribution uniform2 = new ActualUniformLongDistribution(-10,10,2);

    @Theory
    public void passesWhenTestingItself(LongDistribution dist) throws Exception{
        KolmogorovSmirnovTest tester=new KolmogorovSmirnovTest(10,Generators.uniform(new Random(0)));
        Assert.assertTrue("Does not pass when referring to itself!",tester.test(dist,dist,0d));
    }

    @Theory
    public void failsWhenTestingEmptyDistribution(LongDistribution dist) throws Exception{
        LongDistribution empty = new ActualUniformLongDistribution(0,10,0);
        Assume.assumeTrue("Don't consider the empty distribution",dist.totalCount()>0l);

        KolmogorovSmirnovTest tester=new KolmogorovSmirnovTest(10,Generators.uniform(new Random(0)));
        Assert.assertFalse("Passes against an empty distribution!",tester.test(dist,empty,0d));
    }

    @Theory
    public void matchesCommonsMath(LongDistribution test,final LongDistribution reference){

        int sampleSize=10000;<commit_msg>Ignoring an accidental test inclusion<commit_after>package com.splicemachine.stats.test;

import com.splicemachine.stats.estimate.ActualUniformLongDistribution;
import com.splicemachine.stats.estimate.LongDistribution;
import com.splicemachine.stats.random.Generators;
import com.splicemachine.stats.random.LongEmpiricalRejectionGenerator;
import com.splicemachine.stats.random.RandomGenerator;
import com.splicemachine.stats.random.UniformGenerator;
import org.apache.commons.math3.distribution.RealDistribution;
import org.apache.commons.math3.distribution.UniformRealDistribution;
import org.apache.commons.math3.exception.NumberIsTooLargeException;
import org.apache.commons.math3.exception.OutOfRangeException;
import org.apache.commons.math3.random.JDKRandomGenerator;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Ignore;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
import org.junit.runner.RunWith;

import java.util.Random;

/**
 * Tests to make sure that the Kolmogorov-Smirnov test is correctly implemented.
 *
 * @author <NAME>
 *         Date: 6/30/15
 */
//@RunWith(Theories.class)
    @Ignore
public class KolmogorovSmirnovTestTest{

    @DataPoint public static LongDistribution uniform = new ActualUniformLongDistribution(0,10,2);
    @DataPoint public static LongDistribution uniform2 = new ActualUniformLongDistribution(-10,10,2);

    @Theory
    public void passesWhenTestingItself(LongDistribution dist) throws Exception{
        KolmogorovSmirnovTest tester=new KolmogorovSmirnovTest(10,Generators.uniform(new Random(0)));
        Assert.assertTrue("Does not pass when referring to itself!",tester.test(dist,dist,0d));
    }

    @Theory
    public void failsWhenTestingEmptyDistribution(LongDistribution dist) throws Exception{
        LongDistribution empty = new ActualUniformLongDistribution(0,10,0);
        Assume.assumeTrue("Don't consider the empty distribution",dist.totalCount()>0l);

        KolmogorovSmirnovTest tester=new KolmogorovSmirnovTest(10,Generators.uniform(new Random(0)));
        Assert.assertFalse("Passes against an empty distribution!",tester.test(dist,empty,0d));
    }

    @Theory
    public void matchesCommonsMath(LongDistribution test,final LongDistribution reference){

        int sampleSize=10000;
{'fraction_non_alphanumeric': 0.09201277955271565, 'fraction_numerical': 0.016187433439829604, 'mean_word_length': 5.747126436781609, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7061475', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1321, 'n_words': 252}