Package org.drools.guvnor.server

Examples of org.drools.guvnor.server.ServiceImplementation


        });
    }

    private void doRunScenarios(PackageDeploymentURIHelper helper,
                                ByteArrayOutputStream out) throws IOException {
        ServiceImplementation serv = RepositoryServiceServlet.getService();
        RepositoryPackageService packageService = RepositoryServiceServlet.getPackageService();
        PackageItem pkg;
        if ( helper.isLatest() ) {
            pkg = serv.getRulesRepository().loadPackage( helper.getPackageName() );
        } else {
            pkg = serv.getRulesRepository().loadPackageSnapshot( helper.getPackageName(),
                                                                 helper.getVersion() );
        }
        try {
            BulkTestRunResult result = packageService.runScenariosInPackage( pkg );
            out.write( result.toString().getBytes() );
View Full Code Here


public class RoleBasedPermissionStoreTest extends GuvnorTestBase {

    private RoleBasedPermissionStore getStore() throws Exception {
        RoleBasedPermissionStore store = new RoleBasedPermissionStore();

        ServiceImplementation impl = getServiceImplementation();
        RulesRepository repo = impl.getRulesRepository();
       
        store.repository = repo;
       
        return store;
    }
View Full Code Here

    }
*/
    @Test
    public void testScenariosAndChangeSet() throws Exception {

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

        RepositoryPackageService repoServiceImpl = getRepositoryPackageService();

        repo.createPackage( "testScenariosURL",
                            "" );
View Full Code Here

    }

    @Test
    public void testPNG() throws Exception {
       
        ServiceImplementation impl = getServiceImplementation();
        RulesRepository repo = impl.getRulesRepository();

        PackageItem pkg = repo.createPackage( "testPNGPackage",
                                              "" );
        AssetItem asset = pkg.addAsset( "myprocess",
                                        "" );
View Full Code Here

     * files.
     */
    @Test
    public void testPackageConfigWithErrors() throws Exception {
        //test the config, no rule assets yet
        ServiceImplementation serviceImplementation = getServiceImplementation();
        PackageItem pkg = serviceImplementation.getRulesRepository().createPackage("testBuilderPackageConfig",
                "x");
        DroolsHeader.updateDroolsHeader("import java.util.List",
                pkg);
        AssetItem func = pkg.addAsset("func1",
                "a function");
        func.updateFormat(AssetFormats.FUNCTION);
        func.updateContent("function void doSomething() { \n System.err.println(List.class.toString()); }");
        func.checkin("yeah");

        func = pkg.addAsset("func2",
                "q");
        func.updateFormat(AssetFormats.FUNCTION);
        func.updateContent("function void foo() { \nSystem.err.println(42); \n}");
        func.checkin("");

        AssetItem ass = pkg.addAsset("dsl",
                "m");
        ass.updateFormat(AssetFormats.DSL);
        ass.updateContent("[when]Foo bar=String()");
        ass.checkin("");
        serviceImplementation.getRulesRepository().save();

        //now lets light it up
        PackageAssembler assembler = new PackageAssembler(pkg);
        assembler.compile();
        assertFalse(assembler.hasErrors());
View Full Code Here

        assertNotEmpty(assembler.getErrors().get(0).getErrorReport());
    }

    @Test
    public void testLoadConfProperties() throws Exception {
        ServiceImplementation serviceImplementation = getServiceImplementation();
        RulesRepository repo = serviceImplementation.getRulesRepository();

        PackageItem pkg = repo.createPackage("testLoadConfProperties",
                "");
        AssetItem model = pkg.addAsset("model",
                "qed");
View Full Code Here

    }

    @Test
    public void testPackageWithRuleflow() throws Exception {
        ServiceImplementation serviceImplementation = getServiceImplementation();
        RulesRepository repo = serviceImplementation.getRulesRepository();

        PackageItem packageItem = repo.createPackage("testPackageWithRuleFlow",
                "");
        AssetItem model = packageItem.addAsset("model",
                "qed");
View Full Code Here

    }

    @Test
    public void testWithNoDeclaredTypes() throws Exception {

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

        PackageItem pkg = repo.createPackage("testSimplePackageWithDeclaredTypes1",
                "");
        AssetItem rule1 = pkg.addAsset("rule_1",
                "");
View Full Code Here

    }

    @Test
    public void testSimplePackageWithDeclaredTypes() throws Exception {
        ServiceImplementation serviceImplementation = getServiceImplementation();
        RulesRepository repo = serviceImplementation.getRulesRepository();

        PackageItem pkg = repo.createPackage("testSimplePackageWithDeclaredTypes2",
                "");

        DroolsHeader.updateDroolsHeader("import java.util.HashMap",
View Full Code Here

        assertTrue(bin.isValid());
    }

    @Test
    public void testSimplePackageAttributes() throws Exception {
        ServiceImplementation serviceImplementation = getServiceImplementation();
        RulesRepository repo = serviceImplementation.getRulesRepository();

        PackageItem pkg = repo.createPackage("testSimplePackageAttributes",
                "");

        DroolsHeader.updateDroolsHeader("import java.util.HashMap\nno-loop true\nagenda-group \"albums\"\ndialect \"java\"\n",
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.ServiceImplementation

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.