Package org.drools.spi

Examples of org.drools.spi.MockCondition


    {
        MockTupleSource source = new MockTupleSource( 12 );

        TestNode node = new TestNode( 18,
                                      source,
                                      new MockCondition( null,
                                                         true ) );

        assertEquals( 18,
                      node.getId() );
View Full Code Here


    {

        /* Create a test node that always returns true */
        TestNode node = new TestNode( 1,
                                      new MockTupleSource( 15 ),
                                      new MockCondition( null,
                                                         true ) );

        MockTupleSink sink = new MockTupleSink();
        node.addTupleSink( sink );

View Full Code Here

    public void testNotAllowed() throws FactException
    {
        /* Create a test node that always returns false */
        TestNode node = new TestNode( 1,
                                      new MockTupleSource( 15 ),
                                      new MockCondition( null,
                                                         false ) );

        MockTupleSink sink = new MockTupleSink();
        node.addTupleSink( sink );

View Full Code Here

        /*
         * Create a test node that always returns false Although as we are retracting it doesn't matter what it returns
         */
        TestNode node = new TestNode( 1,
                                      new MockTupleSource( 15 ),
                                      new MockCondition( null,
                                                         false ) );

        MockTupleSink sink = new MockTupleSink();
        node.addTupleSink( sink );

View Full Code Here

    }

    public void testException() throws FactException
    {
        /* Create a condition that will always throw an exception */
        MockCondition condition = new MockCondition( null,
                                                     true );
        condition.setTestException( true );

        /* Create the TestNode */
        TestNode node = new TestNode( 1,
                                      new MockTupleSource( 15 ),
                                      condition );
View Full Code Here

TOP

Related Classes of org.drools.spi.MockCondition

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.