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

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


        runner.getPopulatedData().put( "f1",
                                       f1 );

        VerifyFact vf = new VerifyFact();
        vf.setName("f1");
        vf.getFieldValues().add( new VerifyField( "type",
                                                  "boo",
                                                  "!=" ) );

        runner.verify( vf );
        VerifyField vfl = (VerifyField) vf.getFieldValues().get( 0 );
        assertEquals( "[f1] field [type] was not [boo].",
                      vfl.getExplanation() );

    }
View Full Code Here


        runner.getPopulatedData().put( "f1",
                                       f1 );

        VerifyFact vf = new VerifyFact();
        vf.setName("f1");
        vf.getFieldValues().add( new VerifyField( "type",
                                                  "boo",
                                                  "==" ) );

        runner.verify( vf );
        VerifyField vfl = (VerifyField) vf.getFieldValues().get( 0 );

        assertEquals( "[f1] field [type] was [] expected [boo].",
                      vfl.getExplanation() );
        assertEquals( "boo",
                      vfl.getExpected() );
        assertEquals( "",
                      vfl.getActualResult() );

    }
View Full Code Here

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

        VerifyFact[] assertions = new VerifyFact[]{new VerifyFact( "c1",
                                                                   ls( new VerifyField( "type",
                                                                                        "cheddar",
                                                                                        "==" ),
                                                                       new VerifyField( "price",
                                                                                        "42",
                                                                                        "==" ) ) )};

        sc.getFixtures().addAll( Arrays.asList( facts ) );
        sc.getFixtures().addAll( Arrays.asList( assertions ) );
View Full Code Here

                                           false ) );

        Expectation[] assertions = new Expectation[2];

        assertions[0] = new VerifyFact( "testList",
                                        ls( new VerifyField( "empty",
                                                             "true",
                                                             "==" ) ) );
        assertions[1] = new VerifyFact( "testList",
                                        ls( new VerifyField( "size",
                                                             "0",
                                                             "==" ) ) );

        sc.getFixtures().addAll( Arrays.asList( assertions ) );
View Full Code Here

        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",
                                                             "rule1",
                                                             "==" ),
                                            new VerifyField( "status",
                                                             "rule2",
                                                             "==" ) )

        );
View Full Code Here

        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",
                                                             "rule1",
                                                             "==" ),
                                            new VerifyField( "status",
                                                             "rule2",
                                                             "==" ) )

        );
View Full Code Here

        sc.getFixtures().add( executionTrace );

        Expectation[] assertions = new Expectation[2];

        assertions[0] = new VerifyFact( "c",
                                        ls( new VerifyField( "num",
                                                             "42",
                                                             "==" )

                                        ) );
View Full Code Here

        scenario.getFixtures().add( executionTrace );

        Expectation[] assertions = new Expectation[2];

        assertions[0] = new VerifyFact( "c",
                                        ls( new VerifyField( "num",
                                                             "42",
                                                             "==" ) ) );

        assertions[1] = new VerifyRuleFired( "rule1",
                                             1,
View Full Code Here

                                            "c2",
                                            ls( new FieldData( "price",
                                                               "2" ) ),
                                            false ) );
        sc.getFixtures().add( new VerifyFact( "c1",
                                              ls( new VerifyField( "type",
                                                                   "rule1",
                                                                   "==" ) ) ) );
        ex = new ExecutionTrace();
        sc.getFixtures().add( ex );
        sc.getFixtures().add( new VerifyFact( "c1",
                                              ls( new VerifyField( "type",
                                                                   "rule2",
                                                                   "==" ) ) ) );

        TypeResolver resolver = new ClassTypeResolver( new HashSet<String>(),
                                                       Thread.currentThread().getContextClassLoader() );
View Full Code Here

                                            false ) );

        sc.getFixtures().add( new ExecutionTrace() );

        sc.getFixtures().add( new VerifyFact( "c1",
                                              ls( new VerifyField( "type",
                                                                   "rule1",
                                                                   "==" ) ) ) );

        sc.getFixtures().add( new FactData( "Cheese",
                                            "c1",
                                            ls( new FieldData( "price",
                                                               "42" ) ),
                                            true ) );
        sc.getFixtures().add( new ExecutionTrace() );

        sc.getFixtures().add( new VerifyFact( "c1",
                                              ls( new VerifyField( "type",
                                                                   "rule3",
                                                                   "==" ) ) ) );

        TypeResolver resolver = new ClassTypeResolver( new HashSet<String>(),
                                                       Thread.currentThread().getContextClassLoader() );
View Full Code Here

TOP

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

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.