Examples of executeOperation()


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

        kernelServices.executeOperation(op);

        // check it is not listed in root-logger
        op = createOpNode("subsystem=logging/root-logger=ROOT", "read-attribute");
        op.get("name").set("handlers");
        handlers = kernelServices.executeOperation(op);
        loggers = modelNodeAsStringList(handlers);
        assertFalse(loggers.contains("test-fh"));

        // remove handler
        op = createOpNode("subsystem=logging/file-handler=test-fh", "remove");
View Full Code Here

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

        loggers = modelNodeAsStringList(handlers);
        assertFalse(loggers.contains("test-fh"));

        // remove handler
        op = createOpNode("subsystem=logging/file-handler=test-fh", "remove");
        kernelServices.executeOperation(op);

        // check generated log file
        assertTrue(FileUtils.readFileToString(logFile).contains("Test123"));

        // verify that the logger is stopped, no more logs are comming to the file
View Full Code Here

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

        // log messages on all levels with different root logger level settings
        for(Level level : levels) {
            // change root log level
            ModelNode op = createOpNode("subsystem=logging/root-logger=ROOT", "change-root-log-level");
            op.get("level").set(level.name());
            ModelNode ret = kernelServices.executeOperation(op);

            // log a message
            for (Logger.Level lvl : Logger.Level.values()) {
                log.log(lvl, "RootLoggerTestCaseTST " + level);
            }
View Full Code Here

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

        addFileHandler(kernelServices, "test-logger", "TRACE", logFile, false);

        // read root logger
        ModelNode op = createOpNode("subsystem=logging", "read-attribute");
        op.get("name").set("root-logger");
        ModelNode rootLogger = kernelServices.executeOperation(op);
        List<String> handlers = modelNodeAsStringList(rootLogger.get("handlers"));

        // set new root logger
        op = createOpNode("subsystem=logging", "set-root-logger");
        op.get("level").set(rootLogger.get("level"));
View Full Code Here

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

        ModelNode modelA = servicesA.readWholeModel();
        ModelNode describeOp = new ModelNode();
        describeOp.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.DESCRIBE);
        describeOp.get(ModelDescriptionConstants.OP_ADDR).set(
                PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, OSGiExtension.SUBSYSTEM_NAME)).toModelNode());
        List<ModelNode> operations = checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList();

        KernelServices servicesB = installInController(AdditionalInitialization.MANAGEMENT, operations);
        ModelNode modelB = servicesB.readWholeModel();

        compare(modelA, modelB);
View Full Code Here

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

        ModelNode describeOp = new ModelNode();
        describeOp.get(OP).set(DESCRIBE);
        describeOp.get(OP_ADDR).set(
                PathAddress.pathAddress(
                        PathElement.pathElement(SUBSYSTEM, JacORBExtension.SUBSYSTEM_NAME)).toModelNode());
        List<ModelNode> operations = super.checkResultAndGetContents(servicesA.executeOperation(describeOp)).asList();
        servicesA.shutdown();

        Assert.assertEquals(1, operations.size());

        // install the describe options from the first controller into a second controller.
View Full Code Here

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

        List<ModelNode> empty = Collections.emptyList();
        KernelServices servicesA = super.installInController(empty);

        final ModelNode operation = createReadResourceDescriptionOperation();
        final ModelNode result = servicesA.executeOperation(operation);

        Assert.assertEquals(ModelDescriptionConstants.SUCCESS, result.get(ModelDescriptionConstants.OUTCOME).asString());
        final ModelNode description = result.get("result");

        System.out.println(description.toString());
View Full Code Here

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

        ModelNode describeOp = new ModelNode();
        describeOp.get(OP).set(DESCRIBE);
        describeOp.get(OP_ADDR).set(
            PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, AgentSubsystemExtension.SUBSYSTEM_NAME))
                .toModelNode());
        ModelNode executeOperation = servicesA.executeOperation(describeOp);
        List<ModelNode> operations = super.checkResultAndGetContents(executeOperation).asList();

        // Install the describe options from the first controller into a second controller
        KernelServices servicesB = super.installInController(operations);
        ModelNode modelB = servicesB.readWholeModel();
View Full Code Here

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

        // ask for resource description: /subsystem=embeddedagent:read-resource-description
        ModelNode resourceDescriptionOp = new ModelNode();
        resourceDescriptionOp.get(OP).set(READ_RESOURCE_DESCRIPTION_OPERATION);
        resourceDescriptionOp.get(OP_ADDR).set(agentSubsystemPath.toModelNode());
        resourceDescriptionOp.get("operations").set(true); // we want to see the operations also
        ModelNode result = services.executeOperation(resourceDescriptionOp);
        ModelNode content = checkResultAndGetContents(result);

        // check the attributes
        Assert.assertTrue(content.get("attributes").isDefined());
        List<Property> attributes = content.get("attributes").asPropertyList();
View Full Code Here

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

        ModelNode addOp = new ModelNode();
        addOp.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
        addOp.get(OP_ADDR).set(agentSubsystemPath.toModelNode());
        addOp.get(NAME).set(AgentSubsystemExtension.PLUGINS_ELEMENT);
        addOp.get(VALUE).set(pluginsNode);
        ModelNode result = services.executeOperation(addOp);
        Assert.assertEquals(result.get(OUTCOME).asString(), SUCCESS);

        // now test that things are as they should be
        model = services.readWholeModel();
        Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(AgentSubsystemExtension.SUBSYSTEM_NAME));
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.