Package org.drools.ide.common.client.modeldriven.testing

Examples of org.drools.ide.common.client.modeldriven.testing.VerifyFact


        assertSame( run.getScenario(),
                    sc );

        assertFalse( sc.wasSuccessful() );

        VerifyFact vf = (VerifyFact) assertions[1];
        assertFalse( ((VerifyField) vf.getFieldValues().get( 0 )).getSuccessResult() );
        assertEquals( "XXX",
                      ((VerifyField) vf.getFieldValues().get( 0 )).getExpected() );
        assertEquals( "rule1",
                      ((VerifyField) vf.getFieldValues().get( 0 )).getActualResult() );
        assertNotNull( ((VerifyField) vf.getFieldValues().get( 0 )).getExplanation() );

        VerifyRuleFired vr = (VerifyRuleFired) assertions[4];
        assertFalse( vr.getSuccessResult() );

        assertEquals( 2,
View Full Code Here


        sc.setInclusive( true );
        sc.getFixtures().add( executionTrace );

        Expectation[] assertions = new Expectation[5];

        assertions[0] = new VerifyFact( "c1",
                                        ls( new VerifyField( "type",
                                                             "cheddar",
                                                             "==" )

                                        ) );

        assertions[1] = new VerifyFact( "p",
                                        ls( new VerifyField( "name",
                                                             "XXX",
                                                             "==" ),
                                            new VerifyField( "status",
                                                             "rule2",
View Full Code Here

        vfl.setActualResult( "bob" );
        vfl.setSuccessResult( new Boolean(true) );
        vfl.setExplanation( "Yeah !" );
        fields.add(vfl);

        VerifyFact vf = new VerifyFact("d1", fields);

        sc.getFixtures().add(vf);

        VerifyRuleFired vf1 = new VerifyRuleFired("Life unverse and everything", new Integer(42), null);
        vf1.setActualResult( new Integer(42) );
View Full Code Here

        vfl.actualResult = "bob";
        vfl.successResult = new Boolean(true);
        vfl.explanation = "Yeah !";
        fields.add(vfl);

        VerifyFact vf = new VerifyFact("d1", fields);

        sc.fixtures.add(vf);

        VerifyRuleFired vf1 = new VerifyRuleFired("Life unverse and everything", new Integer(42), null);
        vf1.actualResult = new Integer(42);
View Full Code Here

                                            "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();
View Full Code Here

        sc.getFixtures().add( new RetractFact( "z" ) );
        sc.getFixtures().add( new FactData( "Z",
                                            "z",
                                            new ArrayList(),
                                            true ) );
        sc.getFixtures().add( new VerifyFact( "q",
                                              new ArrayList() ) );

        assertFalse( sc.isFactDataReferenced( fd1 ) );
        assertTrue( sc.isFactDataReferenced( fd2 ) );
        assertTrue( sc.isFactDataReferenced( fd3 ) );
View Full Code Here

        VerifyField vf = new VerifyField();
        vf.setSuccessResult( true );
        VerifyField vf2 = new VerifyField();
        vf2.setSuccessResult( false );
        VerifyFact vfact = new VerifyFact();
        vfact.getFieldValues().add( vf );
        vfact.getFieldValues().add( vf2 );
        sc.getFixtures().add( vfact );

        int[] totals = sc.countFailuresTotal();
        assertEquals( 2,
                      totals[0] );
View Full Code Here

        vfl.setActualResult( "bob" );
        vfl.setSuccessResult( new Boolean(true) );
        vfl.setExplanation( "Yeah !" );
        fields.add(vfl);

        VerifyFact vf = new VerifyFact("d1", fields);

        sc.getFixtures().add(vf);

        VerifyRuleFired vf1 = new VerifyRuleFired("Life unverse and everything", new Integer(42), null);
        vf1.setActualResult( new Integer(42) );
View Full Code Here

                }
                panel.add( new SmallLabel( verifyRuleFired.getExplanation() ) );
                resultsDetail.add( panel );
                total++;
            } else if ( fixture instanceof VerifyFact ) {
                VerifyFact verifyFact = (VerifyFact) fixture;
                for ( Iterator<VerifyField> fieldIterator = verifyFact.getFieldValues().iterator(); fieldIterator.hasNext(); ) {
                    total++;
                    VerifyField verifyField = fieldIterator.next();
                    HorizontalPanel panel = new HorizontalPanel();
                    if ( !verifyField.getSuccessResult().booleanValue() ) {
                        panel.add( new Image( images.warning() ) );
View Full Code Here

            }

            @Override
            public Fixture getFixture() {
                String factName = valueWidget.getItemText( valueWidget.getSelectedIndex() );
                return new VerifyFact( factName,
                                       new ArrayList<VerifyField>(),
                                       true );
            }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.testing.VerifyFact

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.