Package org.drools.workbench.models.testscenarios.backend

Examples of org.drools.workbench.models.testscenarios.backend.Cheese


        assertEquals( c.getType(), c2.getType() );
    }

    @Test
    public void testPopulateEmptyString() throws Exception {
        Cheese cheese = new Cheese();
        cheese.setType( "whee" );
        cheese.setPrice( 1 );
        populatedData.put( "x", cheese );

        assertEquals( 1, cheese.getPrice() );

        //An empty String is a 'value' as opposed to null
        factPopulator.add(
                new ExistingFactPopulator(
                        populatedData,
                        getTypeResolver(),
                        getClassLoader(),
                        new FactData(
                                "Cheese",
                                "x",
                                Arrays.<Field>asList(
                                        new FieldData(
                                                "type",
                                                "" ),
                                        new FieldData(
                                                "price",
                                                "42" ) ),
                                false ) ) );

        factPopulator.populate();

        assertEquals( "", cheese.getType() );
        assertEquals( 42, cheese.getPrice() );
    }
View Full Code Here


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

        factPopulator.populate();

        Cheesery listChesse = (Cheesery) populatedData.get( "listChesse" );
        Cheese f1 = (Cheese) populatedData.get( "f1" );
        Cheese f2 = (Cheese) populatedData.get( "f2" );
        Cheese f3 = (Cheese) populatedData.get( "f3" );

        assertEquals( 3, listChesse.getCheeses().size() );
        assertTrue( listChesse.getCheeses().contains( f1 ) );
        assertTrue( listChesse.getCheeses().contains( f2 ) );
        assertTrue( listChesse.getCheeses().contains( f3 ) );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.testscenarios.backend.Cheese

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.