Package org.drools.workbench.models.testscenarios.shared

Examples of org.drools.workbench.models.testscenarios.shared.FactData


    public void onDelete() {
        boolean used = false;

        for ( Fixture fixture : definitionList ) {
            if ( fixture instanceof FactData ) {
                final FactData factData = (FactData) fixture;
                if ( scenario.isFactDataReferenced( factData ) ) {
                    used = true;
                    break;
                }
            }
View Full Code Here


    public void onDelete() {
        boolean used = false;

        for ( Fixture fixture : definitionList ) {
            if ( fixture instanceof FactData ) {
                final FactData factData = (FactData) fixture;
                if ( scenario.isFactDataReferenced( factData ) ) {
                    used = true;
                    break;
                }
            }
View Full Code Here

                    public void onClick( ClickEvent event ) {
                        String text = factTypes.getItemText( factTypes.getSelectedIndex() );
                        if ( scenario.isFactNameReserved( text ) ) {
                            Window.alert( TestScenarioConstants.INSTANCE.TheName0IsAlreadyInUsePleaseChooseAnotherName( text ) );
                        } else {
                            FactData factData = new FactData( oracle.getGlobalVariable( text ),
                                                              text,
                                                              false );
                            scenario.getGlobals().add( factData );
                            parent.renderEditor();
View Full Code Here

import org.drools.workbench.models.testscenarios.shared.FactData;

public class FactDataTest {
    @Test
    public void testAdd() {
        FactData fd = new FactData("x", "y", new ArrayList(), false );
        assertEquals(0, fd.getFieldData().size());
        fd.getFieldData().add(new FieldData("x", "y"));
        assertEquals(1, fd.getFieldData().size());
        fd.getFieldData().add(new FieldData("q", "x"));
        assertEquals(2, fd.getFieldData().size());
    }
View Full Code Here

    @Test
    public void testExecutionTrace() {
        Scenario sc = new Scenario();

        sc.getGlobals().add( new FactData( "A",
                                           "A",
                                           new ArrayList(),
                                           false ) );
        sc.getFixtures().add( new FactData( "B",
                                            "B",
                                            new ArrayList(),
                                            true ) );
        sc.getFixtures().add( new FactData( "C",
                                            "C",
                                            new ArrayList(),
                                            true ) );
        ExecutionTrace ex1 = new ExecutionTrace();
        sc.getFixtures().add( ex1 );
        sc.getFixtures().add( new VerifyFact() );
        sc.getFixtures().add( new RetractFact() );
        sc.getFixtures().add( new FactData( "D",
                                            "D",
                                            new ArrayList(),
                                            false ) );
        sc.getFixtures().add( new FactData( "E",
                                            "E",
                                            new ArrayList(),
                                            false ) );
        ExecutionTrace ex2 = new ExecutionTrace();
        sc.getFixtures().add( ex2 );
        sc.getFixtures().add( new VerifyFact() );
        sc.getFixtures().add( new FactData( "F",
                                            "F",
                                            new ArrayList(),
                                            false ) );
        ExecutionTrace ex3 = new ExecutionTrace();
        sc.getFixtures().add( ex3 );
View Full Code Here

        VerifyRuleFired vf1 = new VerifyRuleFired();
        VerifyRuleFired vf2 = new VerifyRuleFired();
        VerifyRuleFired vf3 = new VerifyRuleFired();

        FactData fd = new FactData();

        sc.getFixtures().add( vf1 );
        sc.getFixtures().add( vf2 );
        sc.getFixtures().add( vf3 );
        sc.getGlobals().add( fd );
View Full Code Here

    }

    @Test
    public void testMapFactTypes() {
        Scenario sc = new Scenario();
        sc.getFixtures().add( new FactData( "X",
                                            "q",
                                            null,
                                            false ) );
        sc.getGlobals().add( new FactData( "Q",
                                           "x",
                                           null,
                                           false ) );

        Map r = sc.getVariableTypes();
View Full Code Here

    }

    @Test
    public void testVariablesInScope() {
        Scenario sc = new Scenario();
        sc.getGlobals().add( new FactData( "X",
                                           "x",
                                           new ArrayList(),
                                           false ) );

        sc.getFixtures().add( new FactData( "Q",
                                            "q",
                                            new ArrayList(),
                                            true ) );
        sc.getFixtures().add( new FactData( "Z",
                                            "z",
                                            new ArrayList(),
                                            false ) );
        ExecutionTrace ex1 = new ExecutionTrace();

        sc.getFixtures().add( ex1 );
        sc.getFixtures().add( new RetractFact( "z" ) );
        sc.getFixtures().add( new FactData( "Y",
                                            "y",
                                            new ArrayList(),
                                            false ) );

        ExecutionTrace ex2 = new ExecutionTrace();
View Full Code Here

    @Test
    public void testAllowRemoveFact() {
        Scenario sc = new Scenario();

        FactData fd1 = new FactData( "X",
                                     "x",
                                     new ArrayList(),
                                     false );
        sc.getFixtures().add( fd1 );
        FactData fd2 = new FactData( "Q",
                                     "q",
                                     new ArrayList(),
                                     false );
        sc.getFixtures().add( fd2 );
        FactData fd3 = new FactData( "Z",
                                     "z",
                                     new ArrayList(),
                                     false );
        sc.getFixtures().add( fd3 );
        ExecutionTrace ex1 = new ExecutionTrace();
        FactData fd4 = new FactData( "I",
                                     "i",
                                     new ArrayList(),
                                     false );
        sc.getGlobals().add( fd4 );

        sc.getFixtures().add( ex1 );
        sc.getFixtures().add( new RetractFact( "z" ) );
        sc.getFixtures().add( new FactData( "Z",
                                            "z",
                                            new ArrayList(),
                                            true ) );
        sc.getFixtures().add( new VerifyFact( "q",
                                              new ArrayList() ) );
View Full Code Here

    }

    @Test
    public void testIsFactNameUsed() {
        Scenario sc = new Scenario();
        sc.getGlobals().add( new FactData( "X",
                                           "x",
                                           null,
                                           false ) );
        sc.getFixtures().add( new FactData( "Q",
                                            "q",
                                            null,
                                            false ) );
        sc.getFixtures().add( new ExecutionTrace() );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.testscenarios.shared.FactData

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.