// Path: strategy/src/main/java/com/msd/gin/halyard/vocab/HALYARD.java
// public final static IRI PARALLEL_SPLIT_FUNCTION = SVF.createIRI(NAMESPACE, "forkAndFilterBy");


import org.eclipse.rdf4j.model.Literal;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
import org.junit.Test;
import static org.junit.Assert.*;
import static com.msd.gin.halyard.vocab.HALYARD.PARALLEL_SPLIT_FUNCTION;
        assertEquals(5, ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(5, ?s)}", false, 0));
    }

    @Test
    public void testGetNumberOfForksFromSelectWithoutFunction() {
        assertEquals(0, ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o.}", false, 0));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksNoArgs() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">()}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksNANArg() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(\"not a number\", ?s)}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksVarArg() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(?p, ?s)}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksNegativeArg() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(-1, ?s)}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksDoubleFunction() {
// Path: strategy/src/main/java/com/msd/gin/halyard/vocab/HALYARD.java
// public final static IRI PARALLEL_SPLIT_FUNCTION = SVF.createIRI(NAMESPACE, "forkAndFilterBy");


// Path: tools/src/test/java/com/msd/gin/halyard/tools/ParallelSplitFunctionTest.java
import org.eclipse.rdf4j.model.Literal;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException;
import org.junit.Test;
import static org.junit.Assert.*;
import static com.msd.gin.halyard.vocab.HALYARD.PARALLEL_SPLIT_FUNCTION;

        assertEquals(5, ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(5, ?s)}", false, 0));
    }

    @Test
    public void testGetNumberOfForksFromSelectWithoutFunction() {
        assertEquals(0, ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o.}", false, 0));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksNoArgs() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">()}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksNANArg() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(\"not a number\", ?s)}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksVarArg() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(?p, ?s)}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksNegativeArg() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(-1, ?s)}", false, 0);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testGetNumberOfForksDoubleFunction() {
        ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(5, ?s) filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(3, ?s)}", false, 0);