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

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


        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,
                                                                             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().unmarshal( drl,
                                                                                  dmo );
        assertNotNull( m2 );
        assertEquals( m.name,
                      m2.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,
                                                                            dmo );
        assertNotNull( m2 );
        assertEquals( "with composite",
                      m2.name );
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,
                                                                            dmo );
        assertEquals( 1,
                      m_.lhs.length );
        assertEquals( 1,
View Full Code Here

        return m;
    }

    @Test
    public void testLoadEmpty() {
        PackageDataModelOracle dmo = mock( PackageDataModelOracle.class );
        RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( "",
                                                                           dmo );
        assertNotNull( m );

        m = RuleModelDRLPersistenceImpl.getInstance().unmarshal( "",
View Full Code Here

    @Override
    public DrlModelContent loadContent( final Path path ) {
        try {
            final String drl = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            final String[] fullyQualifiedClassNames = DataModelOracleUtilities.getFactTypes( oracle );
            final List<DSLSentence> dslConditions = oracle.getPackageDslConditionSentences();
            final List<DSLSentence> dslActions = oracle.getPackageDslActionSentences();

            //Signal opening to interested parties
            resourceOpenedEvent.fire( new ResourceOpenedEvent( path,
                                                               sessionInfo ) );
View Full Code Here

    @Override
    public List<String> loadClassFields( final Path path,
                                         final String fullyQualifiedClassName ) {
        try {
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            final String[] fieldNames = DataModelOracleUtilities.getFieldNames( oracle,
                                                                                fullyQualifiedClassName );
            return Arrays.asList( fieldNames );

        } catch ( Exception e ) {
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

        String expected = "rule \"test expressionsNestedNumber\""
                + "\tdialect \"mvel\"\n when "
                + "     Person( favouriteCheese.age == 55 )"
                + " 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.