Package org.drools.repository

Examples of org.drools.repository.PackageItem.checkin()


        assertTrue( DroolsHeader.getDroolsHeader( pkg ).indexOf( "import com.billasurf.Board" ) > -1 );
        assertTrue( DroolsHeader.getDroolsHeader( pkg ).indexOf( "import com.billasurf.Person" ) > -1 );

        DroolsHeader.updateDroolsHeader( "goo wee",
                                                  pkg );
        pkg.checkin( "" );

        fm.attachFileToAsset( asset.getUUID(),
                              this.getClass().getResourceAsStream( "/billasurf.jar" ),
                              "billasurf.jar" );
        pkg = repo.loadPackage( "testAttachModelImports" );
View Full Code Here


        PackageItem pkg = repo.createPackage( "testGetBinaryPackageServlet",
                                              "" );
        DroolsHeader.updateDroolsHeader( "import java.util.List",
                                                  pkg );
        pkg.updateCompiledPackage( new ByteArrayInputStream( "foo".getBytes() ) );
        pkg.checkin( "" );

        assertTrue( before < uploadHelper.getLastModified( pkg.getName(),
                                                           "LATEST" ) );

        repoPackageService.createPackageSnapshot( pkg.getName(),
View Full Code Here

        PackageItem pkg = repo.createPackage( "testHeadOOME",
                                              "" );
        DroolsHeader.updateDroolsHeader( "import java.util.List",
                                                  pkg );
        pkg.updateCompiledPackage( new ByteArrayInputStream( "foo".getBytes() ) );
        pkg.checkin( "" );
        repo.logout();

        int iterations = 0;

        int maxIteration = 250; //pick a large number to do a stress test
View Full Code Here

        ServiceImplementation impl = getServiceImplementation();
        RulesRepository repo = impl.getRulesRepository();

        PackageItem pkg = repo.loadPackage( nm );
        pkg.updateDescription( System.currentTimeMillis() + "" );
        pkg.checkin( "a change" );
        repo.logout();

    }

    private List<AssetItem> iteratorToList(Iterator<AssetItem> assets) {
View Full Code Here


        PackageItem pkg = repo.loadPackage( "com.billasurf.manufacturing.plant" );
        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board\nimport com.billasurf.Person" +
                "\n\nglobal com.billasurf.Person prs", pkg );
        pkg.checkin( "added imports" );

        SuggestionCompletionEngine eng = serv.loadSuggestionCompletionEngine( "com.billasurf.manufacturing.plant" );
        assertNotNull(eng);

        //The loader could define extra imports
View Full Code Here

        assertTrue( ServiceImplementation.getDroolsHeader( pkg ).indexOf( "import com.billasurf.Board" ) > -1 );
        assertTrue( ServiceImplementation.getDroolsHeader( pkg ).indexOf( "import com.billasurf.Person" ) > -1 );

        ServiceImplementation.updateDroolsHeader( "goo wee",
                                                  pkg );
        pkg.checkin( "" );

        fm.attachFileToAsset( asset.getUUID(),
                              this.getClass().getResourceAsStream( "/billasurf.jar" ),
                              "billasurf.jar" );
        pkg = repo.loadPackage( "testAttachModelImports" );
View Full Code Here

        PackageItem pkg = repo.createPackage( "testGetBinaryPackageServlet",
                                              "" );
        ServiceImplementation.updateDroolsHeader( "import java.util.List",
                                                  pkg );
        pkg.updateCompiledPackage( new ByteArrayInputStream( "foo".getBytes() ) );
        pkg.checkin( "" );

        assertTrue( before < uploadHelper.getLastModified( pkg.getName(),
                                                           "LATEST" ) );

        impl.createPackageSnapshot( pkg.getName(),
View Full Code Here

        PackageItem pkg = repo.createPackage( "testHeadOOME",
                                              "" );
        ServiceImplementation.updateDroolsHeader( "import java.util.List",
                                                  pkg );
        pkg.updateCompiledPackage( new ByteArrayInputStream( "foo".getBytes() ) );
        pkg.checkin( "" );
        repo.logout();

        int iterations = 0;

        while ( true ) {
View Full Code Here

    private void updatePackage(String nm) throws Exception {
        System.err.println( "---> Updating the package " );
        RulesRepository repo = new RulesRepository( session );
        PackageItem pkg = repo.loadPackage( nm );
        pkg.updateDescription( System.currentTimeMillis() + "" );
        pkg.checkin( "a change" );
        repo.logout();

    }

    private List iteratorToList(Iterator assets) {
View Full Code Here

                //updating package header
                if (lastModified != null && pkg.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The package was modified by: " + pkg.getLastContributor() + ", unable to write changes.");
                }
                pkg.updateStringProperty(readContent(in), PackageItem.HEADER_PROPERTY_NAME);
                pkg.checkin(comment);
                repo.save();
            } else {
                AssetItem as = pkg.loadAsset(a[0]);
                if (lastModified != null && as.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The asset was modified by: " + as.getLastContributor() + ", unable to write changes.");
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.