Package org.drools.guvnor.server.util

Examples of org.drools.guvnor.server.util.BRMSSuggestionCompletionLoader


                                                                            Mockito.anyList() );

    }

    private void initSpyingAndMockingOnSuggestionCompletionLoader(RepositoryPackageOperations localRepositoryPackageOperations) {
        BRMSSuggestionCompletionLoader suggestionCompletionLoader = mock( BRMSSuggestionCompletionLoader.class );
        doReturn( suggestionCompletionLoader ).when( localRepositoryPackageOperations ).createBRMSSuggestionCompletionLoader();
    }
View Full Code Here


                Mockito.anyList());

    }

    private void initSpyingAndMockingOnSuggestionCompletionLoader(DroolsServiceImplementation droolsServiceImplementation) {
        BRMSSuggestionCompletionLoader suggestionCompletionLoader = mock(BRMSSuggestionCompletionLoader.class);
        doReturn(suggestionCompletionLoader).when(droolsServiceImplementation).createBRMSSuggestionCompletionLoader();
    }
View Full Code Here

                                                                            Mockito.anyList() );

    }

    private void initSpyingAndMockingOnSuggestionCompletionLoader(RepositoryPackageOperations localRepositoryPackageOperations) {
        BRMSSuggestionCompletionLoader suggestionCompletionLoader = mock( BRMSSuggestionCompletionLoader.class );
        doReturn( suggestionCompletionLoader ).when( localRepositoryPackageOperations ).createBRMSSuggestionCompletionLoader();
    }
View Full Code Here

            handleArchivedForSavePackage( data, item );
        } else if ( unarchived ) {
            handleUnarchivedForSavePackage( data, item, packageLastModified );
        }

        BRMSSuggestionCompletionLoader loader = new BRMSSuggestionCompletionLoader();
        loader.getSuggestionEngine( item );

        return validateBRMSSuggestionCompletionLoaderResponse( loader );
    }
View Full Code Here

        SuggestionCompletionEngine result = null;
        ClassLoader originalCL = Thread.currentThread().getContextClassLoader();
        try {
            PackageItem pkg = repository.loadPackage( packageName );
            BRMSSuggestionCompletionLoader loader = null;
            List<JarInputStream> jars = BRMSPackageBuilder.getJars( pkg );
            if ( jars != null && !jars.isEmpty() ) {
                ClassLoader cl = BRMSPackageBuilder.createClassLoader( jars );

                Thread.currentThread().setContextClassLoader( cl );

                loader = new BRMSSuggestionCompletionLoader( cl );
            } else {
                loader = new BRMSSuggestionCompletionLoader();
            }

            result = loader.getSuggestionEngine( pkg );

        } catch ( RulesRepositoryException e ) {
            log.error( "An error occurred loadSuggestionCompletionEngine: " + e.getMessage() );
            throw new SerializationException( e.getMessage() );
        } finally {
View Full Code Here

                                                                            Mockito.anyList() );

    }

    private void initSpyingAndMockingOnSuggestionCompletionLoader(RepositoryPackageOperations localRepositoryPackageOperations) {
        BRMSSuggestionCompletionLoader suggestionCompletionLoader = mock( BRMSSuggestionCompletionLoader.class );
        doReturn( suggestionCompletionLoader ).when( localRepositoryPackageOperations ).createBRMSSuggestionCompletionLoader();
    }
View Full Code Here

    protected SuggestionCompletionEngine loadFor(final PackageItem packageItem) {
        SuggestionCompletionEngine result = null;
        ClassLoader originalCL = Thread.currentThread().getContextClassLoader();
        try {
            BRMSSuggestionCompletionLoader loader = null;
            ClassLoaderBuilder classLoaderBuilder = new ClassLoaderBuilder(packageItem.listAssetsWithVersionsSpecifiedByDependenciesByFormat(AssetFormats.MODEL));
            if (classLoaderBuilder.hasJars()) {
                ClassLoader classLoader = classLoaderBuilder.buildClassLoader();

                Thread.currentThread().setContextClassLoader(classLoader);

                loader = new BRMSSuggestionCompletionLoader(classLoader);
            } else {
                loader = new BRMSSuggestionCompletionLoader();
            }

            result = loader.getSuggestionEngine(packageItem);

        } finally {
            Thread.currentThread().setContextClassLoader(originalCL);
        }
        return result;
View Full Code Here

                assetItem.archiveItem( true );
                assetItem.checkin( data.description );
            }
        }

        BRMSSuggestionCompletionLoader loader = new BRMSSuggestionCompletionLoader();
        loader.getSuggestionEngine( item );

        ValidatedResponse res = new ValidatedResponse();
        if ( loader.hasErrors() ) {
            res.hasErrors = true;
            String err = "";
            for ( Iterator iter = loader.getErrors().iterator(); iter.hasNext(); ) {
                err += (String) iter.next();
                if ( iter.hasNext() ) err += "\n";
            }
            res.errorHeader = "Package validation errors";
            res.errorMessage = err;
View Full Code Here

                                                 RoleTypes.PACKAGE_READONLY );
        }
        try {

            PackageItem pkg = repository.loadPackage( packageName );
            BRMSSuggestionCompletionLoader loader = new BRMSSuggestionCompletionLoader();
            return loader.getSuggestionEngine( pkg );
        } catch ( RulesRepositoryException e ) {
            log.error( e );
            throw new SerializableException( e.getMessage() );
        }
View Full Code Here

        PackageItem item = getRulesRepository().loadPackage( data.name );

        RuleBaseCache.getInstance().remove( data.uuid );

        BRMSSuggestionCompletionLoader loader = createBRMSSuggestionCompletionLoader();
        loader.getSuggestionEngine( item,
                                    data.header );

        return validateBRMSSuggestionCompletionLoaderResponse(loader);
    }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.util.BRMSSuggestionCompletionLoader

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.