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

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


        Scenario sc = new Scenario();
        sc.getImports().addImport(new Import("org.drools.workbench.models.testscenarios.backend.Cheese"));

        sc.getFixtures().add(new FactData("Cheese",
                "c1",
                Arrays.<Field>asList(new FieldData("price",
                        "46"),
                        new FieldData("type",
                                "XXX")),
                false));
        sc.getFixtures().add(new FactData("Cheese",
                "c2",
                Arrays.<Field>asList(new FieldData("price",
                        "42")),
                false));
        sc.getFixtures().add(new ExecutionTrace());

        sc.getFixtures().add(new VerifyFact("c1",
View Full Code Here


    }

    private Expectation[] populateScenarioForFailure(Scenario sc) {
        FactData[] facts = new FactData[]{new FactData("Cheese",
                "c1",
                Arrays.<Field>asList(new FieldData("type",
                        "cheddar"),
                        new FieldData("price",
                                "42")),
                false)

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

        typeResolver.addImport("org.drools.workbench.models.testscenarios.backend.Cheese");

        Mouse mouse = new Mouse();

        FactAssignmentField factAssignmentField = new FactAssignmentField("cheese", "Cheese");
        factAssignmentField.getFact().getFieldData().add(new FieldData("type", "Best cheddar EVER! (tm)"));

        FactAssignmentFieldPopulator factAssignmentFieldPopulator = new FactAssignmentFieldPopulator(mouse, factAssignmentField, typeResolver, classLoader);

        factAssignmentFieldPopulator.populate(new HashMap<String, Object>());
View Full Code Here

    @Test
    public void testWithGlobals() throws Exception {

        FactData global = new FactData( "Cheese",
                                        "c",
                                        Arrays.<Field>asList( new FieldData( "type",
                                                                             "cheddar" ) ),
                                        false );

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

    @Test
    public void testDummyRunNoRules() throws Exception {
        typeResolver.addImport( "org.drools.workbench.models.testscenarios.backend.Cheese" );

        List<Field> fieldData = new ArrayList<Field>();
        fieldData.add( new FieldData( "type",
                                      "cheddar" ) );
        fieldData.add( new FieldData( "price",
                                      "42" ) );
        FactData fact = new FactData( "Cheese",
                                      "c1",
                                      fieldData,
                                      false );
View Full Code Here

    public void testPopulateFacts() throws Exception {
        FactData factData = new FactData(
                "Person",
                "p1",
                Arrays.<Field>asList(
                        new FieldData(
                                "name",
                                "mic" ),
                        new FieldData(
                                "age",
                                "=30 + 3" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, getTypeResolver(), getClassLoader(), factData ) );
View Full Code Here

    }

    @Test
    public void testPopulateEnum() throws Exception {

        FieldData fieldData = new FieldData(
                "cheeseType",
                "CheeseType.CHEDDAR" );
        fieldData.setNature( FieldData.TYPE_ENUM );
        FactData factData = new FactData( "Cheese",
                                          "c1",
                                          asList( (Field) fieldData ),
                                          false );
View Full Code Here

        FactData cheeseFactData = new FactData(
                "Cheese",
                "c1",
                Arrays.<Field>asList(
                        new FieldData(
                                "type",
                                "cheddar" ),
                        new FieldData(
                                "price",
                                "42" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, getClassLoader(), cheeseFactData ) );

        FactData outerFactData = new FactData(
                "OuterFact",
                "p1",
                Arrays.<Field>asList(
                        new FieldData(
                                "name",
                                "mic" ),
                        new FieldData(
                                "innerFact",
                                "=c1" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, getClassLoader(), outerFactData ) );
View Full Code Here

        FactData outerFactData = new FactData(
                "OuterFact",
                "p1",
                Arrays.<Field>asList(
                        new FieldData(
                                "name",
                                "mic" ),
                        new FieldData(
                                "innerFact",
                                "=c1" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, getClassLoader(), outerFactData ) );

        FactData cheeseFactData = new FactData(
                "Cheese",
                "c1",
                Arrays.<Field>asList(
                        new FieldData(
                                "type",
                                "cheddar" ),
                        new FieldData(
                                "price",
                                "42" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, getClassLoader(), cheeseFactData ) );
View Full Code Here

                        getTypeResolver(),
                        getClassLoader(),
                        new FactData( "Cheese",
                                      "c1",
                                      Arrays.<Field>asList(
                                              new FieldData(
                                                      "price",
                                                      "" ) ),
                                      false ) ) );

        factPopulator.populate();
View Full Code Here

TOP

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

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.