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

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


    }

    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


    public FieldPopulator getFieldPopulator(Field field) throws ClassNotFoundException,
            InstantiationException,
            IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        if (field instanceof FieldData) {
            FieldData fieldData = (FieldData) field;
            if (fieldData.getValue() == null) {
                throw new IllegalArgumentException("Field value can not be null");
            } else {
                return getFieldDataPopulator(factObject,
                        fieldData);
            }
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);

        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

                    fact.getType() );
            widget.setWidget( fieldRowIndex,
                              col,
                              editableCell );
            if ( field instanceof FieldData ) {
                FieldData fieldData = (FieldData) field;
                if ( fieldData.getNature() == FieldData.TYPE_ENUM ) {
                    enumEditorMap.put( fieldData, (FieldDataConstraintEditor) editableCell );
                }
            }
        }
        for ( FieldDataConstraintEditor outerEnumEditor : enumEditorMap.values() ) {
View Full Code Here

        model.setName( name );

        model.getFixtures().add( new FactData( "Applicant",
                                               "$a",
                                               new ArrayList<Field>() {{
                                                   add( new FieldData( "age",
                                                                       "33" ) );
                                               }},
                                               false ) );
        model.getFixtures().add( new VerifyFact( "Mortgage",
                                                 new ArrayList<VerifyField>() {{
View Full Code Here

        model.setName( name );

        model.getFixtures().add( new FactData( "Applicant",
                                               "$a",
                                               new ArrayList<Field>() {{
                                                   add( new FieldData( "age",
                                                                       "33" ) );
                                               }},
                                               false ) );

        return model;
View Full Code Here

    DropDownData getEnums() {
        Map<String, String> currentValueMap = new HashMap<String, String>();
        for ( Field f : fact.getFieldData() ) {
            if ( f instanceof FieldData ) {
                FieldData otherFieldData = (FieldData) f;
                currentValueMap.put( otherFieldData.getName(),
                                     otherFieldData.getValue() );
            }
        }
        return oracle.getEnums(
                factType,
                field.getName(),
View Full Code Here

        scenario.getFixtures().add(
                new FactData(
                        "Cheese",
                        "f1",
                        Arrays.<Field>asList(
                                new FieldData(
                                        "type",
                                        "cheddar"),
                                new FieldData(
                                        "price",
                                        "42")),
                        false
                ));

        scenario.getFixtures().add(
                new FactData(
                        "Person",
                        "f2",
                        Arrays.<Field>asList(
                                new FieldData(
                                        "name",
                                        "michael"),
                                new FieldData(
                                        "age",
                                        "33")),
                        false
                ));
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.