Package org.drools.guvnor.models.testscenarios.shared

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


                        getClassLoader(),
                        new FactData(
                                "SqlDateWrapper",
                                "c1",
                                Arrays.<Field>asList(
                                        new FieldData(
                                                "sqlDate",
                                                "10-Jul-2008" ) ),
                                false ) ) );

        factPopulator.populate();
View Full Code Here


                        getTypeResolver(),
                        getClassLoader(),
                        new FactData( "Cheese",
                                      "c1",
                                      Arrays.<Field>asList(
                                              new FieldData(
                                                      "type",
                                                      "cheddar" ),
                                              new FieldData(
                                                      "price",
                                                      "42" ) ),
                                      false ) ) );
        factPopulator.add(
                new NewFactPopulator(
                        populatedData,
                        getTypeResolver(),
                        getClassLoader(),
                        new FactData(
                                "Cheese",
                                "c2",
                                Arrays.<Field>asList(
                                        new FieldData(
                                                "type",
                                                "= c1.type" ) ),
                                false ) ) );

        factPopulator.populate();
View Full Code Here

                        getClassLoader(),
                        new FactData(
                                "Cheese",
                                "x",
                                Arrays.<Field>asList(
                                        new FieldData(
                                                "type",
                                                "" ),
                                        new FieldData(
                                                "price",
                                                "42" ) ),
                                false ) ) );

        factPopulator.populate();
View Full Code Here

        TypeResolver typeResolver = getTypeResolver();

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

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

        FactData fd2 = new FactData( "Cheese",
                                     "f2",
                                     Arrays.<Field>asList(
                                             new FieldData( "type",
                                                            "" ),
                                             new FieldData( "price",
                                                            "43" ) ),
                                     false );
        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, getClassLoader(), fd2 ) );

        FactData fd3 = new FactData( "Cheese",
                                     "f3",
                                     Arrays.<Field>asList(
                                             new FieldData( "type",
                                                            "" ),
                                             new FieldData( "price",
                                                            "45" ) ),
                                     false );

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

        FieldData field = new FieldData();
        field.setName( "cheeses" );
        field.setNature( FieldData.TYPE_COLLECTION );
        field.setValue( "=[f1,f2,f3]" );
        List<Field> lstField = new ArrayList<Field>();
        lstField.add( field );
        FactData lst = new FactData( "Cheesery",
                                     "listChesse",
                                     lstField,
View Full Code Here

        List<Field> fieldData = new ArrayList<Field>();
        CollectionFieldData collectionFieldData = new CollectionFieldData();
        collectionFieldData.setName( "cheeses" );
        fieldData.add( collectionFieldData );
        collectionFieldData.getCollectionFieldList().add( new FieldData( "cheeses", "=cheese1" ) );
        collectionFieldData.getCollectionFieldList().add( new FieldData( "cheeses", "=cheese2" ) );

        FactData cheeseryFactData = new FactData(
                "Cheesery",
                "cheesery",
                fieldData,
View Full Code Here

        List<Field> fieldData = new ArrayList<Field>();
        CollectionFieldData collectionFieldData = new CollectionFieldData();
        collectionFieldData.setName( "list" );
        fieldData.add( collectionFieldData );
        collectionFieldData.getCollectionFieldList().add( new FieldData( "list", "=1+3" ) );

        FactData wrapperFactData = new FactData(
                "MyCollectionWrapper",
                "wrapper",
                fieldData,
View Full Code Here

        typeResolver.addImport("org.drools.guvnor.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

TOP

Related Classes of org.drools.guvnor.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.