Search in sources :

Example 26 with ParameterizedTest

use of org.junit.jupiter.params.ParameterizedTest in project solution-finder by knewjade.

the class CheckerUsingHoldInvokerTest method testSearch7.

@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch7(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
    PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p5");
    int maxClearLine = 4;
    int maxDepth = 4;
    String marks = "" + "XXXXX_____" + "XXXXXX____" + "XXXXXXX___" + "XXXXXX____" + "";
    ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
    AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
    // Source: twitter by @???
    assertThat(tree.getSuccessPercent()).isEqualTo(1672 / 2520.0);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) AnalyzeTree(common.tree.AnalyzeTree) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 27 with ParameterizedTest

use of org.junit.jupiter.params.ParameterizedTest in project solution-finder by knewjade.

the class CheckerUsingHoldInvokerTest method testSearch8.

@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch8(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
    PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p5");
    int maxClearLine = 4;
    int maxDepth = 4;
    String marks = "" + "XXXXXX____" + "XXXXX_____" + "XXXXXX____" + "XXXXXXX___" + "";
    ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
    AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
    // Source: twitter by @???
    assertThat(tree.getSuccessPercent()).isEqualTo(1928 / 2520.0);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) AnalyzeTree(common.tree.AnalyzeTree) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 28 with ParameterizedTest

use of org.junit.jupiter.params.ParameterizedTest in project solution-finder by knewjade.

the class CheckerUsingHoldInvokerTest method testSearch10.

@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch10(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
    PatternGenerator blocksGenerator = new LoadedPatternGenerator("T, *p4");
    int maxClearLine = 4;
    int maxDepth = 4;
    String marks = "" + "XXXXXX____" + "XXXXXX____" + "XXXXXX____" + "XXXXXX____" + "";
    ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
    AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
    // Source: Nilgiri: https://docs.google.com/spreadsheets/d/1bVY3t_X96xRmUL0qdgB9tViSIGenu6RMKX4RW7qWg8Y/edit#gid=0
    assertThat(tree.getSuccessPercent()).isEqualTo(744 / 840.0);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) AnalyzeTree(common.tree.AnalyzeTree) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 29 with ParameterizedTest

use of org.junit.jupiter.params.ParameterizedTest in project solution-finder by knewjade.

the class CheckerUsingHoldInvokerTest method testSearch5.

@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch5(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
    PatternGenerator blocksGenerator = new LoadedPatternGenerator("J, I, Z, *p4");
    int maxClearLine = 4;
    int maxDepth = 6;
    String marks = "" + "________XX" + "XX_____XXX" + "XXX_____XX" + "XXX______X" + "";
    ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
    AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
    // Source: myself 20170415
    assertThat(tree.getSuccessPercent()).isEqualTo(771 / 840.0);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) AnalyzeTree(common.tree.AnalyzeTree) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Example 30 with ParameterizedTest

use of org.junit.jupiter.params.ParameterizedTest in project solution-finder by knewjade.

the class CheckerUsingHoldInvokerTest method testSearch4.

@ParameterizedTest
@ArgumentsSource(InvokerTestCase.class)
void testSearch4(IntFunction<ConcurrentCheckerInvoker> invokerGenerator) throws Exception {
    PatternGenerator blocksGenerator = new LoadedPatternGenerator("*p4");
    int maxClearLine = 3;
    int maxDepth = 3;
    String marks = "" + "XXX____XXX" + "XXX_____XX" + "XXXX___XXX" + "";
    ConcurrentCheckerInvoker invoker = invokerGenerator.apply(maxClearLine);
    AnalyzeTree tree = runTestCase(invoker, marks, blocksGenerator, maxClearLine, maxDepth);
    // Source: myself 20170415
    assertThat(tree.getSuccessPercent()).isEqualTo(434 / 840.0);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) AnalyzeTree(common.tree.AnalyzeTree) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) ArgumentsSource(org.junit.jupiter.params.provider.ArgumentsSource)

Aggregations

ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1880 MethodSource (org.junit.jupiter.params.provider.MethodSource)1020 EnumSource (org.junit.jupiter.params.provider.EnumSource)321 ValueSource (org.junit.jupiter.params.provider.ValueSource)270 ArgumentsSource (org.junit.jupiter.params.provider.ArgumentsSource)181 Transaction (org.neo4j.graphdb.Transaction)117 ArrayList (java.util.ArrayList)97 ByteBuffer (java.nio.ByteBuffer)78 CsvSource (org.junit.jupiter.params.provider.CsvSource)78 Path (java.nio.file.Path)71 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)67 IOException (java.io.IOException)65 List (java.util.List)59 Test (org.junit.jupiter.api.Test)58 HashMap (java.util.HashMap)55 Map (java.util.Map)54 HashSet (java.util.HashSet)52 lombok.val (lombok.val)52 SelfSignedCertificate (io.netty.handler.ssl.util.SelfSignedCertificate)50 TimeUnit (java.util.concurrent.TimeUnit)48