Package org.drools.base

Examples of org.drools.base.ClassTypeResolver


                "ls",
                new ArrayList(),
                false));
        sc.getFixtures().addAll(facts);
        sc.getGlobals().addAll(globals);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("java.util.List");

        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());
View Full Code Here


                                new FieldData("age",
                                        "=30 + 3")),
                        false));

        sc.getFixtures().addAll(facts);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("org.drools.Cheese");
        resolver.addImport("org.drools.Person");
        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());

        assertTrue(runner.getPopulatedData().containsKey("c1"));
View Full Code Here

                "c1",
                ls(fd),
                false));

        sc.getFixtures().addAll(facts);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("org.drools.Cheese");
        resolver.addImport("org.drools.CheeseType");
        try {
            ScenarioRunner runner = new ScenarioRunner(sc, resolver,
                    new MockWorkingMemory());

            assertTrue(runner.getPopulatedData().containsKey("c1"));
View Full Code Here

                                new FieldData("innerFact",
                                        "=c1")),
                        false));

        sc.getFixtures().addAll(facts);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("org.drools.Cheese");
        resolver.addImport("org.drools.OuterFact");
        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());

        assertTrue(runner.getPopulatedData().containsKey("c1"));
View Full Code Here

                                new FieldData("price",
                                        "42")),
                        false));

        sc.getFixtures().addAll(facts);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("org.drools.Cheese");
        resolver.addImport("org.drools.OuterFact");
        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());

        assertTrue(runner.getPopulatedData().containsKey("c1"));
View Full Code Here

        List facts = ls(new FactData("Cheese",
                "c1",
                new ArrayList(),
                false));
        sc.getFixtures().addAll(facts);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        sc.getFixtures().addAll(facts);
        resolver.addImport("org.drools.Cheese");
        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());

        assertTrue(runner.getPopulatedData().containsKey("c1"));
View Full Code Here

                                new FieldData("innerFact",
                                        "=c1")),
                        false));

        sc.getFixtures().addAll(facts);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("org.drools.Cheese");
        resolver.addImport("org.drools.OuterFact");
        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());

        assertTrue(runner.getPopulatedData().containsKey("c1"));
View Full Code Here

                        ls(new FieldData("type",
                                "= c1.type")),
                        false));

        sc.getFixtures().addAll(facts);
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("org.drools.Cheese");

        ScenarioRunner runner = new ScenarioRunner(sc,
                resolver,
                new MockWorkingMemory());
View Full Code Here

    }

    @Test
    public void testPopulateNoData() throws Exception {
        TypeResolver resolver = new ClassTypeResolver(new HashSet<String>(),
                Thread.currentThread().getContextClassLoader());
        resolver.addImport("org.drools.Cheese");
        ScenarioRunner run = new ScenarioRunner(new Scenario(),
                resolver,
                new MockWorkingMemory());
        run.getPopulatedData().clear();
        Cheese c = new Cheese();
View Full Code Here

                c.getPrice());
    }

    @Test
    public void testPopulateEmptyString() throws Exception {
        TypeResolver resolver = new ClassTypeResolver( new HashSet<String>(),
                                                       Thread.currentThread().getContextClassLoader() );
        resolver.addImport( "org.drools.Cheese" );
        ScenarioRunner run = new ScenarioRunner( new Scenario(),
                                                 resolver,
                                                 new MockWorkingMemory() );
        run.getPopulatedData().clear();
        Cheese c = new Cheese();
View Full Code Here

TOP

Related Classes of org.drools.base.ClassTypeResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.