Examples of executeForResult()


Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

        final SimpleClient client = SimpleClient.create(channels);

        //Don't set the operation handler here
        SimpleHandlers.Request request = new SimpleHandlers.Request(SimpleHandlers.REQUEST_WITH_NO_HANDLER, 600);
        try {
            client.executeForResult(request);
            Assert.fail("Should have failed");
        } catch (ExecutionException expected) {
            Assert.assertTrue(expected.getCause() instanceof IOException);
        }
    }
View Full Code Here

Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

    public void testMissingRequestHandler() throws Exception {
        final SimpleClient client = SimpleClient.create(channels);

        SimpleHandlers.Request request = new SimpleHandlers.Request(SimpleHandlers.REQUEST_WITH_NO_HANDLER, 600);
        try {
            client.executeForResult(request);
            Assert.fail("Should have failed");
        } catch (ExecutionException expected) {
            Assert.assertTrue(expected.getCause() instanceof IOException);
        }
    }
View Full Code Here

Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

    public void testExceptionInRequestHandlerRead() throws Exception {
        final SimpleClient client = SimpleClient.create(channels);

        SimpleHandlers.Request request = new SimpleHandlers.Request(SimpleHandlers.REQUEST_WITH_BAD_READ, 600);
        try {
            client.executeForResult(request);
            Assert.fail("Should have failed");
        } catch (ExecutionException expected) {
            Assert.assertTrue(expected.getCause() instanceof IOException);
        }
    }
View Full Code Here

Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

    public void testExceptionInRequestHandlerWrite() throws Exception {
        final SimpleClient client = SimpleClient.create(channels);

        SimpleHandlers.Request request = new SimpleHandlers.Request(SimpleHandlers.REQUEST_WITH_BAD_WRITE, 600);
        try {
            client.executeForResult(request);
            Assert.fail("Should have failed");
        } catch (ExecutionException expected) {
            Assert.assertTrue(expected.getCause() instanceof IOException);
        }
    }
View Full Code Here

Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

                throw new RuntimeException("Oh no!!!!");
            }

        };
        try {
            client.executeForResult(request);
            Assert.fail("Should have failed");
        } catch (ExecutionException expected) {
            // TODO intermitted failures instanceof RuntimeException
            // Assert.assertTrue(expected.getClass().toString(), expected.getCause() instanceof RuntimeException);
        }
View Full Code Here

Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

    public void testSimpleRequest() throws Exception {

        final SimpleClient client = SimpleClient.create(channels);

        SimpleHandlers.Request request = new SimpleHandlers.Request(SimpleHandlers.SIMPLE_REQUEST, 600);
        Assert.assertEquals(Integer.valueOf(1200), client.executeForResult(request));
    }

    @Test
    public void testTwoSimpleRequests() throws Exception {
        final SimpleClient client = SimpleClient.create(channels);
View Full Code Here

Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

    @Test
    public void testTwoSimpleRequests() throws Exception {
        final SimpleClient client = SimpleClient.create(channels);

        SimpleHandlers.Request request = new SimpleHandlers.Request(SimpleHandlers.SIMPLE_REQUEST, 600);
        Assert.assertEquals(Integer.valueOf(1200), client.executeForResult(request));

        request = new SimpleHandlers.Request(SimpleHandlers.SIMPLE_REQUEST, 700);
        Assert.assertEquals(Integer.valueOf(1400), client.executeForResult(request));
    }
View Full Code Here

Examples of org.jboss.as.protocol.mgmt.support.SimpleHandlers.SimpleClient.executeForResult()

        SimpleHandlers.Request request = new SimpleHandlers.Request(SimpleHandlers.SIMPLE_REQUEST, 600);
        Assert.assertEquals(Integer.valueOf(1200), client.executeForResult(request));

        request = new SimpleHandlers.Request(SimpleHandlers.SIMPLE_REQUEST, 700);
        Assert.assertEquals(Integer.valueOf(1400), client.executeForResult(request));
    }

    @Test
    public void testSeveralConcurrentSimpleRequests() throws Exception {
        final SimpleClient client = SimpleClient.create(channels);
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices.executeForResult()

        }
        service.executeOperation(writeOp);
        ModelNode readOp = Util.createOperation("read-attribute", address);
        readOp.get("name").set("login-modules");
        ModelNode result = service.executeForResult(readOp);
        List<ModelNode> modules = result.asList();
        Assert.assertEquals("There should be exactly 6 modules but there are not", 6, modules.size());
        for (int i = 1; i <= 6; i++) {
            ModelNode module = modules.get(i - 1);
            Assert.assertEquals(module.get("code").asString(), "module-" + i);
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices.executeForResult()

            final ModelNode remove = Util.createRemoveOperation(parentAddress.append(PathElement.pathElement(resourceType, childName)));
            ModelTestUtils.checkOutcome(mainServices.executeOperation(remove));
            ModelTestUtils.checkOutcome(mainServices.executeOperation(modelVersion, mainServices.transformOperation(modelVersion, remove)));
            if (--i > 0) {
                //There are still xxx-module so we work fine
                legacyServices.executeForResult(Util.createOperation(ReadResourceHandler.DEFINITION, parentAddress));
                attributes = getLegacyAttribute(legacyServices, parentAddress, attributeName);
                Assert.assertEquals(i, attributes.size());
            } else {
                //Here the read-resource should fail since the resource no longer exists, removal of
                //the last xxx-module resource becomes a remove of the parent
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.