Package org.drools.workbench.models.datamodel.oracle

Examples of org.drools.workbench.models.datamodel.oracle.PackageDataModelOracle


                "$a : Applicant( )\n" +
                "then\n" +
                "$a.addName( \"Michael\" );\n" +
                "end\n";

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 Collections.EMPTY_LIST,
                                                                                 dmo );
        assertNotNull( m );
View Full Code Here


                "Here's something typed by the user as free-format DRL\n" +
                "$b : Bananna( )\n" +
                "then\n" +
                "end\n";

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 Collections.EMPTY_LIST,
                                                                                 dmo );
        assertNotNull( m );
View Full Code Here

                "$a.setName( \"Michael\" );\n" +
                "Here's something typed by the user as free-format DRL\n" +
                "$a.setAge( 40 );\n" +
                "end\n";

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        final RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                                 Collections.EMPTY_LIST,
                                                                                 dmo );
        assertNotNull( m );
View Full Code Here

        assertTrue( drl.indexOf( "Accident( )" ) > -1 );
        assertTrue( drl.indexOf( "no-loop true" ) > -1 );
        assertTrue( drl.indexOf( "org.kie" ) == -1 );
        assertTrue( drl.indexOf( "g.add( x );" ) > -1 );

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        RuleModel rm_ = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                             Collections.EMPTY_LIST,
                                                                             dmo );
        assertEquals( 2,
                      rm_.rhs.length );
View Full Code Here

    @Test
    public void testRoundTrip() {
        final RuleModel m = getComplexModel();
        final String drl = RuleModelDRLPersistenceImpl.getInstance().marshal( m );

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        final RuleModel m2 = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL( drl,
                                                                                          Collections.EMPTY_LIST,
                                                                                          dmo );
        assertNotNull( m2 );
        assertEquals( m.name,
View Full Code Here

        ActionInsertFact ass = new ActionInsertFact( "Whee" );
        m.addRhsItem( ass );

        String drl = RuleModelDRLPersistenceImpl.getInstance().marshal( m );

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        RuleModel m2 = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                            Collections.EMPTY_LIST,
                                                                            dmo );
        assertNotNull( m2 );
        assertEquals( "with composite",
View Full Code Here

        m.rhs[ 0 ] = fr;

        String drl = RuleModelDRLPersistenceImpl.getInstance().marshal( m );
        assertNotNull( drl );

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        RuleModel m_ = RuleModelDRLPersistenceImpl.getInstance().unmarshal( drl,
                                                                            Collections.EMPTY_LIST,
                                                                            dmo );
        assertEquals( 1,
                      m_.lhs.length );
View Full Code Here

        return m;
    }

    @Test
    public void testLoadEmpty() {
        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( "",
                                                                           Collections.EMPTY_LIST,
                                                                           dmo );
        assertNotNull( m );
View Full Code Here

                "  when\n" +
                "    Customer( contact != null , contact.tel1 > 15 )\n" +
                "  then\n" +
                "end\n";

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        when(
                dmo.getProjectModelFields()
            ).thenReturn(
                new HashMap<String, ModelField[]>() {{
                    put( "Customer",
                         new ModelField[]{
                                 new ModelField(
View Full Code Here

        String expected = "rule \"test expressionsNestedString\""
                + "\tdialect \"mvel\"\n when "
                + "     Person( favouriteCheese.name == \"Cheedar\" )"
                + " then " + "end";

        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        when(
                dmo.getProjectModelFields()
            ).thenReturn(
                new HashMap<String, ModelField[]>() {{
                    put( "Person", new ModelField[]{
                            new ModelField(
                                    "favouriteCheese",
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.oracle.PackageDataModelOracle

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.