Package org.kie.server.api.model

Examples of org.kie.server.api.model.KieContainerResource


        buildAndDeployMavenProject(ClassLoader.class.getResource("/kjars-sources/state-is-kept-for-stateful-session").getFile());
    }

    @Test
    public void testStateIsKeptBetweenCalls() {
        client.createContainer("stateful-session1", new KieContainerResource("stateful-session1", releaseId));
        String payload1 = "<batch-execution lookup=\"kbase1.stateful\">\n" +
                "  <insert out-identifier=\"person1\">\n" +
                "    <org.kie.server.testing.Person>\n" +
                "      <firstname>Darth</firstname>\n" +
                "    </org.kie.server.testing.Person>\n" +
View Full Code Here


                result2.contains("<duplicated>true</duplicated>"));
    }

    @Test
    public void testErrorHandlingWhenContainerIsDisposedBetweenCalls() {
        client.createContainer("stateful-session2", new KieContainerResource("stateful-session2", releaseId));
        String payload = "<batch-execution lookup=\"kbase1.stateful\">\n" +
                "  <insert out-identifier=\"person\">\n" +
                "    <org.kie.server.testing.Person>\n" +
                "      <firstname>Darth</firstname>\n" +
                "    </org.kie.server.testing.Person>\n" +
View Full Code Here

        buildAndDeployMavenProject(ClassLoader.class.getResource("/kjars-sources/stateless-session-kjar").getFile());
    }

    @Test
    public void testStatelessCall() {
        client.createContainer("stateless-kjar1", new KieContainerResource("stateless-kjar1", releaseId));
        String payload1 = "<batch-execution lookup=\"kbase1.stateless\">\n" +
                "  <insert out-identifier=\"person1\">\n" +
                "    <org.kie.server.testing.Person>\n" +
                "      <firstname>Darth</firstname>\n" +
                "    </org.kie.server.testing.Person>\n" +
View Full Code Here

        buildAndDeployMavenProject(ClassLoader.class.getResource("/kjars-sources/multimodule-project").getFile());
    }

    @Test
    public void testCreateMultipleContainersAndExecuteRules() {
        assertSuccess(client.createContainer("multimodule-rules1", new KieContainerResource("multimodule-rules1", releaseIdRules1)));
        assertSuccess(client.createContainer("multimodule-rules2", new KieContainerResource("multimodule-rules2", releaseIdRules2)));
        String payload1 = "<batch-execution lookup=\"kbase.session\">\n" +
                "   <insert out-identifier=\"car\">" +
                "    <org.kie.server.testing.multimodule.domain.Car/>\n" +
                "  </insert>\n" +
                "  <fire-all-rules />\n" +
View Full Code Here

        System.out.println(reply.getResult());
    }

    @Test
    public void testCallContainer() throws Exception {
        client.createContainer("kie1", new KieContainerResource("kie1", releaseId1));

        String payload = "<batch-execution lookup=\"defaultKieSession\">\n" +
                "  <insert out-identifier=\"message\">\n" +
                "    <org.pkg1.Message>\n" +
                "      <text>Hello World</text>\n" +
View Full Code Here

        Assert.assertEquals(ServiceResponse.ResponseType.SUCCESS, reply.getType());
    }

    @Test
    public void testCallContainerMarshallCommands() throws Exception {
        client.createContainer("kie1", new KieContainerResource("kie1", releaseId1));

        KieServices ks = KieServices.Factory.get();
        File jar = MavenRepository.getMavenRepository().resolveArtifact(releaseId1).getFile();
        URLClassLoader cl = new URLClassLoader(new URL[]{jar.toURI().toURL()});
        Class<?> messageClass = cl.loadClass("org.pkg1.Message");
View Full Code Here

        BatchExecutionCommand batch = kcmd.newBatchExecution(Arrays.asList(insert, fire), "defaultKieSession");

        String payload = BatchExecutionHelper.newXStreamMarshaller().toXML(batch);

        String containerId = "command-script-container";
        KieServerCommand create = new CreateContainerCommand(new KieContainerResource( containerId, releaseId1, null));
        KieServerCommand call = new CallContainerCommand(containerId, payload);
        KieServerCommand dispose = new DisposeContainerCommand(containerId);

        List<KieServerCommand> cmds = Arrays.asList(create, call, dispose);
        CommandScript script = new CommandScript(cmds);
View Full Code Here

        }
    }

    @Test
    public void testCallContainerLookupError() throws Exception {
        client.createContainer("kie1", new KieContainerResource("kie1", releaseId1));

        String payload = "<batch-execution lookup=\"xyz\">\n" +
                "  <insert out-identifier=\"message\">\n" +
                "    <org.pkg1.Message>\n" +
                "      <text>Hello World</text>\n" +
View Full Code Here

        Assert.assertEquals(ServiceResponse.ResponseType.FAILURE, reply.getType());
    }

    @Test
    public void testScanner() throws Exception {
        client.createContainer("kie1", new KieContainerResource("kie1", releaseId1));
        ServiceResponse<KieContainerResource> reply = client.getContainerInfo("kie1");
        Assert.assertEquals(ServiceResponse.ResponseType.SUCCESS, reply.getType());
       
        ServiceResponse<KieScannerResource> si = client.getScannerInfo("kie1");
        Assert.assertEquals( ResponseType.SUCCESS, si.getType() );
View Full Code Here

        buildAndDeployMavenProject(ClassLoader.class.getResource("/kjars-sources/ruleflow-group").getFile());
    }

    @Test
    public void testExecuteSimpleRuleFlowProcess() {
        assertSuccess(client.createContainer("ruleflow", new KieContainerResource("ruleflow", releaseId)));
        String payload = "<batch-execution lookup=\"defaultKieSession\">\n" +
                "  <set-global identifier=\"list\" out-identifier=\"output-list\">\n" +
                "    <java.util.ArrayList/>\n" +
                "  </set-global>\n" +
                "  <start-process processId=\"simple-ruleflow\"/>\n" +
View Full Code Here

TOP

Related Classes of org.kie.server.api.model.KieContainerResource

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.