Exemplo n.º 1
0
        public static IList<FilterTestMultiStmtExecution> Executions(bool withStats)
        {
            IList<FilterTestMultiStmtPermutable> cases = new List<FilterTestMultiStmtPermutable>();

            var stats = FilterTestMultiStmtAssertStats.MakeTwoSameStat(
                "P0=(fh:1, fi:1),P1=(fh:2, fi:1),P2=(fh:1, fi:1),P3=(fh:0, fi:0, fipar:0)");

            // same equals-index, same value
            AddCase(
                cases,
                stats,
                "IntPrimitive = 0",
                "IntPrimitive = 0",
                MakeItem(MakeBean("E1", 0), true, true),
                MakeItem(MakeBean("E2", 1), false, false));

            // boolean-index
            AddCase(
                cases,
                stats,
                "TheString like 'A%'",
                "TheString like 'A%'",
                MakeItem(MakeBean("A1"), true, true),
                MakeItem(MakeBean("B1"), false, false));

            return FilterTestMultiStmtRunner.ComputePermutations(
                typeof(ExprFilterPlanTwoFilterSame),
                new PermutationSpec(0, 1),
                cases,
                withStats);
        }
Exemplo n.º 2
0
        public static IList<FilterTestMultiStmtExecution> Executions(bool withStats)
        {
            IList<FilterTestMultiStmtPermutable> cases = new List<FilterTestMultiStmtPermutable>();

            var stats = FilterTestMultiStmtAssertStats.MakeTwoSameStat(
                "P0=(fh:1, fi:2),P1=(fh:2, fi:3),P2=(fh:1, fi:2),P3=(fh:0, fi:0, fipar:0)");

            // same equals-indexes
            FilterTestMultiStmtPermutable.AddCase(
                cases,
                stats,
                "TheString != 'x' and TheString != 'y' and DoubleBoxed is not null",
                "TheString != 'x' and TheString != 'y' and LongBoxed is not null",
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBeanWBoxed("E1", -1, null, null), false, false),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBeanWBoxed("x", -1, 1d, 1L), false, false),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBeanWBoxed("x", -1, 1d, null), false, false),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBeanWBoxed("y", -1, 1d, 1L), false, false),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBeanWBoxed("E2", -1, 1d, 1L), true, true),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBeanWBoxed("E3", -1, 1d, null), true, false),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBeanWBoxed("E4", -1, null, 1L), false, true));

            // we permute only [0, 1] as all filters are the same
            return FilterTestMultiStmtRunner.ComputePermutations(
                typeof(ExprFilterPlanTwoFilterNestedTwoDiff),
                new PermutationSpec(0, 1),
                cases,
                withStats);
        }
        public static IList<FilterTestMultiStmtExecution> Executions(bool withStats)
        {
            IList<FilterTestMultiStmtPermutable> cases = new List<FilterTestMultiStmtPermutable>();

            var stats = FilterTestMultiStmtAssertStats.MakeTwoSameStat(
                "P0=(fh:1, fi:1),P1=(fh:2, fi:1),P2=(fh:1, fi:1),P3=(fh:0, fi:0, fipar:0)");

            // same equals-index, different value
            FilterTestMultiStmtPermutable.AddCase(
                cases,
                stats,
                "IntPrimitive = 0",
                "IntPrimitive = 1",
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBean("E1", 0), true, false),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBean("E2", 1), false, true),
                FilterTestMultiStmtAssertItem.MakeItem(SupportBean.MakeBean("E3", -1), false, false));

            return FilterTestMultiStmtRunner.ComputePermutations(
                typeof(ExprFilterPlanTwoFilterDifferent),
                new PermutationSpec(true),
                cases,
                withStats);
        }
Exemplo n.º 4
0
        public static IList<FilterTestMultiStmtExecution> Executions(bool withStats)
        {
            IList<FilterTestMultiStmtPermutable> cases = new List<FilterTestMultiStmtPermutable>();

            var stats = FilterTestMultiStmtAssertStats.MakeTwoSameStat(
                "P0=(fh:1, fi:3),P1=(fh:2, fi:3),P2=(fh:1, fi:3),P3=(fh:0, fi:0, fipar:0)");

            AddCase(
                cases,
                stats,
                "TheString = 'A' and (IntPrimitive = 0 or LongPrimitive = 0)",
                "TheString = 'A' and (IntPrimitive = 0 or LongPrimitive = 0)",
                MakeItem(MakeBean("A", 0, 1), true, true),
                MakeItem(MakeBean("A", 1, 0), true, true),
                MakeItem(MakeBean("A", 1, 1), false, false),
                MakeItem(MakeBean("B", 0, 0), false, false));

            // we permute only [0, 1] as all filters are the same
            return FilterTestMultiStmtRunner.ComputePermutations(
                typeof(ExprFilterPlanTwoFilterTwoPathNestedSame),
                new PermutationSpec(0, 1),
                cases,
                withStats);
        }
Exemplo n.º 5
0
        public static IList<FilterTestMultiStmtExecution> Executions(bool withStats)
        {
            IList<FilterTestMultiStmtPermutable> cases = new List<FilterTestMultiStmtPermutable>();

            var stats = FilterTestMultiStmtAssertStats.MakeTwoSameStat(
                "P0=(fh:1, fi:2),P1=(fh:2, fi:2),P2=(fh:1, fi:2),P3=(fh:0, fi:0, fipar:0)");

            // same equals-indexes
            AddCase(
                cases,
                stats,
                "IntPrimitive = 0 and LongPrimitive = 0",
                "IntPrimitive = 0 and LongPrimitive = 0",
                MakeItem(MakeBean("E1", 0, 0), true, true),
                MakeItem(MakeBean("E2", 1, 0), false, false),
                MakeItem(MakeBean("E3", 0, 1), false, false));

            // same not-equals-index
            AddCase(
                cases,
                stats,
                "IntPrimitive != 1 and LongPrimitive != 2",
                "IntPrimitive != 1 and LongPrimitive != 2",
                MakeItem(MakeBean("E1", 1, 2), false, false),
                MakeItem(MakeBean("E2", 2, 3), true, true),
                MakeItem(MakeBean("E3", 1, -1), false, false),
                MakeItem(MakeBean("E4", -1, 2), false, false));

            // same greater-indexes
            AddCase(
                cases,
                stats,
                "IntPrimitive > 0 and LongPrimitive > 0",
                "IntPrimitive > 0 and LongPrimitive > 0",
                MakeItem(MakeBean("E1", 1, 1), true, true),
                MakeItem(MakeBean("E2", 1, 0), false, false),
                MakeItem(MakeBean("E3", 0, 1), false, false));

            // same range-index
            AddCase(
                cases,
                stats,
                "IntPrimitive between 0 and 10 and LongPrimitive between 0 and 10",
                "IntPrimitive between 0 and 10 and LongPrimitive between 0 and 10",
                MakeItem(MakeBean("E1", 1, 1), true, true),
                MakeItem(MakeBean("E2", 1, -1), false, false),
                MakeItem(MakeBean("E3", -1, 1), false, false));

            // same in-index
            AddCase(
                cases,
                stats,
                "IntPrimitive in (1, 2) and LongPrimitive in (2, 3)",
                "IntPrimitive in (1, 2) and LongPrimitive in (2, 3)",
                MakeItem(MakeBean("E1", 1, 2), true, true),
                MakeItem(MakeBean("E2", 2, 3), true, true),
                MakeItem(MakeBean("E3", 1, -1), false, false),
                MakeItem(MakeBean("E4", -1, 1), false, false));

            // same not-in-index
            AddCase(
                cases,
                stats,
                "IntPrimitive not in (1, 2) and LongPrimitive not in (2, 3)",
                "IntPrimitive not in (1, 2) and LongPrimitive not in (2, 3)",
                MakeItem(MakeBean("E1", 1, 2), false, false),
                MakeItem(MakeBean("E2", 2, 3), false, false),
                MakeItem(MakeBean("E3", -1, -1), true, true),
                MakeItem(MakeBean("E4", -1, 2), false, false));

            // we permute only [0, 1] as all filters are the same
            return FilterTestMultiStmtRunner.ComputePermutations(
                typeof(ExprFilterPlanTwoFilterNestedTwoSame),
                new PermutationSpec(0, 1),
                cases,
                withStats);
        }