Examples of importClassicDRL()


Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

        FileManagerUtils fm = getFileManagerUtils();

        // Import package
        String drl = "package testClassicDRLImport\n import blah \n rule 'ola' \n when \n then \n end \n rule 'hola' \n when \n then \n end";
        InputStream in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             null );

        PackageItem pkg = fm.getRepository().loadPackage( "testClassicDRLImport" );
        assertNotNull( pkg );
        assertFalse( pkg.isArchived() );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

        assertNotNull( pkg );
        assertTrue( pkg.isArchived() );

        // Import it again
        InputStream in2 = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in2,
                             null );

        pkg = fm.getRepository().loadPackage( "testClassicDRLImport" );
        assertNotNull( pkg );
        assertFalse( pkg.isArchived() );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

    @Test
    public void testClassicDRLImport() throws Exception {
        FileManagerUtils fm = getFileManagerUtils();
        String drl = "package testClassicDRLImport\n import blah \n rule 'ola' \n when \n then \n end \n rule 'hola' \n when \n then \n end";
        InputStream in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             null );

        PackageItem pkg = fm.getRepository().loadPackage( "testClassicDRLImport" );
        assertNotNull( pkg );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

        assertTrue( DroolsHeader.getDroolsHeader( pkg ).indexOf( "import" ) > -1 );

        // now lets import an existing thing
        drl = "package testClassicDRLImport\n import should not see \n rule 'ola2' \n when \n then \n end \n rule 'hola' \n when \n then \n end";
        in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             null );

        pkg = fm.getRepository().loadPackage( "testClassicDRLImport" );
        assertNotNull( pkg );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

        AssetItem assetOriginal = fm.getRepository().loadPackage( "testClassicDRLImport" ).loadAsset( "ola" );
        long ver = assetOriginal.getVersionNumber();

        drl = "package testClassicDRLImport\n import blah \n rule 'ola' \n when CHANGED\n then \n end \n rule 'hola' \n when \n then \n end";
        in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             null );
        pkg = fm.getRepository().loadPackage( "testClassicDRLImport" );
        AssetItem asset = pkg.loadAsset( "ola" );

        assertTrue( asset.getContent().indexOf( "CHANGED" ) > 0 );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

        FileManagerUtils fm = getFileManagerUtils();
        String drl = "import blah \n rule 'ola' \n when \n then \n end \n rule 'hola' \n when \n then \n end";
        InputStream in = new ByteArrayInputStream( drl.getBytes() );

        try {
            fm.importClassicDRL( in,
                                 null );
        } catch ( IllegalArgumentException e ) {
            assertEquals( "Missing package name.",
                          e.getMessage() );
        }
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

            assertEquals( "Missing package name.",
                          e.getMessage() );
        }

        in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             "testDRLImportWithoutPackageName" );

        PackageItem pkg = fm.getRepository().loadPackage( "testDRLImportWithoutPackageName" );
        assertNotNull( pkg );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

        FileManagerUtils fm = getFileManagerUtils();
        String drl = "package thisIsNeverUsed \n import blah \n rule 'ola' \n when \n then \n end \n rule 'hola' \n when \n then \n end";
        InputStream in = new ByteArrayInputStream( drl.getBytes() );

        in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             "testDRLImportOverrideExistingPackageName" );

        PackageItem pkg = fm.getRepository().loadPackage( "testDRLImportOverrideExistingPackageName" );
        assertNotNull( pkg );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

    @Test
    public void testClassicDRLImportWithDSL() throws Exception {
        FileManagerUtils fm = getFileManagerUtils();
        String drl = "package testClassicDRLImportDSL\n import blah \n expander goo \n rule 'ola' \n when \n then \n end \n rule 'hola' \n when \n then \n end";
        InputStream in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             null );

        PackageItem pkg = fm.getRepository().loadPackage( "testClassicDRLImportDSL" );
        assertNotNull( pkg );
View Full Code Here

Examples of org.drools.guvnor.server.files.FileManagerUtils.importClassicDRL()

        fm.setRepository( new RulesRepository( session ) );

        // Import package
        String drl = "package testClassicDRLImport\n import blah \n rule 'ola' \n when \n then \n end \n rule 'hola' \n when \n then \n end";
        InputStream in = new ByteArrayInputStream( drl.getBytes() );
        fm.importClassicDRL( in,
                             null );

        PackageItem pkg = fm.getRepository().loadPackage( "testClassicDRLImport" );
        assertNotNull( pkg );
        assertFalse( pkg.isArchived() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.