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

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


            return fieldData;

        } else if (reader.getNodeName().equals("fact")) {

            FactAssignmentField factAssignmentField = new FactAssignmentField();
            factAssignmentField.setName(name);

            factAssignmentField.setFact((Fact) context.convertAnother(factAssignmentField, Fact.class));
            reader.moveUp();

            return factAssignmentField;
        }
View Full Code Here


        typeChoiceForm.show();
    }

    private Field createField(SelectionEvent<Integer> selectionEvent) {
        if (selectionEvent.getSelectedItem() == FieldData.TYPE_FACT) {
            return new FactAssignmentField(field.getName(), helper.getFieldType());
        } else {
            if (selectionEvent.getSelectedItem() == FieldData.TYPE_COLLECTION) {
                CollectionFieldData collectionFieldData = new CollectionFieldData();
                collectionFieldData.setName(field.getName());
                return collectionFieldData;
View Full Code Here

        typeChoiceForm.show();
    }

    private Field createField(SelectionEvent<Integer> selectionEvent) {
        if (selectionEvent.getSelectedItem() == FieldData.TYPE_FACT) {
            return new FactAssignmentField(field.getName(), helper.getFieldType());
        } else {
            if (selectionEvent.getSelectedItem() == FieldData.TYPE_COLLECTION) {
                CollectionFieldData collectionFieldData = new CollectionFieldData();
                collectionFieldData.setName(field.getName());
                return collectionFieldData;
View Full Code Here

        typeChoiceForm.show();
    }

    private Field createField(SelectionEvent<Integer> selectionEvent) {
        if (selectionEvent.getSelectedItem() == FieldData.TYPE_FACT) {
            return new FactAssignmentField(field.getName(), helper.getFieldType());
        } else {
            FieldData fieldData = new FieldData(field.getName(), "");
            applyFieldDataNature(
                    fieldData,
                    selectionEvent.getSelectedItem());
View Full Code Here

    }

    @Test
    public void testFactAssignmentField() throws Exception {

        FactAssignmentField field = new FactAssignmentField();
        field.setFact(new Fact());


        when(
                typeResolver.resolveType(Matchers.<String>any())
        ).thenReturn(
View Full Code Here

        TypeResolver typeResolver = new ClassTypeResolver(new HashSet<String>(),classLoader );
        typeResolver.addImport("org.drools.ide.common.server.testscenarios.Cheese");

        Mouse mouse = new Mouse();

        FactAssignmentField factAssignmentField = new FactAssignmentField("cheese", "Cheese");

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

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

        TypeResolver typeResolver = new ClassTypeResolver(new HashSet<String>(),classLoader );
        typeResolver.addImport("org.drools.ide.common.server.testscenarios.Cheese");

        Mouse mouse = new Mouse();

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

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

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

        TypeResolver typeResolver = new ClassTypeResolver(new HashSet<String>(),classLoader );
        typeResolver.addImport("org.drools.ide.common.server.testscenarios.MatryoshkaDoll");

        MatryoshkaDoll matryoshkaDoll = new MatryoshkaDoll();

        FactAssignmentField factAssignmentField = createFactAssignmentField();
        addFactAssignmentFieldIntoFactAssignmentField(factAssignmentField, 5);

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

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

        assertNull(matryoshkaDoll.getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll().getMatryoshkaDoll());
    }

    private void addFactAssignmentFieldIntoFactAssignmentField(FactAssignmentField factAssignmentField, int times) {
        if (times > 0) {
            FactAssignmentField innerFactAssignmentField = createFactAssignmentField();

            factAssignmentField.getFact().getFieldData().add(innerFactAssignmentField);

            addFactAssignmentFieldIntoFactAssignmentField(innerFactAssignmentField, --times);
        }
View Full Code Here

            addFactAssignmentFieldIntoFactAssignmentField(innerFactAssignmentField, --times);
        }
    }

    private FactAssignmentField createFactAssignmentField() {
        return new FactAssignmentField("matryoshkaDoll", "MatryoshkaDoll");
    }
View Full Code Here

TOP

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

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.