Package org.drools.core.reteoo.test.dsl.NodeTestCaseResult

Examples of org.drools.core.reteoo.test.dsl.NodeTestCaseResult.NodeTestResult


        }
        this.reteTesterHelper.addImports( testCase.getImports() );
        NodeTestCaseResult result = new NodeTestCaseResult( testCase );
        for ( NodeTestDef test : testCase.getTests() ) {
            notifier.fireTestStarted( test.getDescription() );
            NodeTestResult testResult = createTestResult( test,
                                                          null );

            try {
                testResult = run( testCase,
                                  test );
View Full Code Here


    }

    private NodeTestResult run(NodeTestCase testCase,
                               NodeTestDef test) {
        Map<String, Object> context = createContext( testCase );
        NodeTestResult result = createTestResult( test,
                                                  context );

        try {
            // run setup
            run( context,
View Full Code Here

    }
   
    private NodeTestResult createTestResult(NodeTestDef test,
                                            Map<String, Object> context) {
       
        NodeTestResult result = new NodeTestResult( test,
                                                    Result.NOT_EXECUTED,
                                                    context,
                                                    new LinkedList<String>() );
        return result;
    }
View Full Code Here

    public void testObjectTypeNodeStep() throws Exception {
        String str = "TestCase 'testOTN'\nTest 'dummy'\n";
        str += "ObjectTypeNode :\n";
        str += "otn1, java.lang.Integer;\n";

        NodeTestResult result = executeTest( str );

        ObjectTypeNode otn1 = (ObjectTypeNode) result.context.get( "otn1" );
        assertNotNull( otn1 );

        assertEquals( new ClassObjectType( Integer.class ),
View Full Code Here

        str += "ObjectTypeNode:\n";
        str += "    otn1, java.lang.Integer;\n";
        str += "LeftInputAdapterNode:\n";
        str += "    lian0, otn1;";

        NodeTestResult result = executeTest( str );

        ObjectTypeNode otn1 = (ObjectTypeNode) result.context.get( "otn1" );
        LeftInputAdapterNode lian0 = (LeftInputAdapterNode) result.context.get( "lian0" );
        assertNotNull( lian0 );
View Full Code Here

    public void testBindingStep() throws Exception {
        String str = "TestCase 'testOTN'\nTest 'dummy'\n";
        str += "Binding:\n";
        str += "     p1, 0, java.lang.Integer, intValue;\n";

        NodeTestResult result = executeTest( str );
        Declaration p1 = (Declaration) result.context.get( "p1" );
        assertNotNull( p1 );
    }
View Full Code Here

        str += "     p1, 0, java.lang.Integer, intValue;\n";
        str += "JoinNode:\n";
        str += "    join1, lian0, otn2;\n";
        str += "    intValue, !=, p1;\n";

        NodeTestResult result = executeTest( str );
        Map<String, Object> map = result.context;

        JoinNode join1 = (JoinNode) map.get( "join1" );
        assertNotNull( join1 );
View Full Code Here

        String str = "TestCase 'testOTN'\nTest 'dummy'\n";
        str += "Facts:\n";
        str += "    1, 2, 'hello',\n";
        str += "    'good bye', new java.util.ArrayList();\n";

        NodeTestResult result = executeTest( str );
        Map<String, Object> map = result.context;

        WorkingMemory wm = (WorkingMemory) map.get( "WorkingMemory" );
        List<InternalFactHandle> handles = (List<InternalFactHandle>) map.get( "Handles" );
View Full Code Here

        str += "With:\n";
        str += "    h2, age = 36, city = 'la',\n";
        str += "       state = 'ca';\n";
        str += "    h4, add( 2 );\n";

        NodeTestResult result = executeTest( str );
        Map<String, Object> map = result.context;

        WorkingMemory wm = (WorkingMemory) map.get( "WorkingMemory" );
        List<InternalFactHandle> handles = (List<InternalFactHandle>) map.get( "Handles" );
View Full Code Here

        str += "    0, 1, 2, 3;\n";
        str += "assert:\n";
        str += "    otn2,[h0, h2];\n";
        str += "    otn1,[h1, h3];\n";

        NodeTestResult result = executeTest( str );
        Map<String, Object> map = result.context;

        InternalWorkingMemory wm = (InternalWorkingMemory) map.get( "WorkingMemory" );

        JoinNode join1 = (JoinNode) map.get( "join1" );
View Full Code Here

TOP

Related Classes of org.drools.core.reteoo.test.dsl.NodeTestCaseResult.NodeTestResult

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.