Examples of KernelServices


Examples of org.jboss.as.subsystem.test.KernelServices

        Assert.assertEquals(normalizeXML(subsystemXml), normalizeXML(triggered));
    }

    @Test
    public void testReadWriteNamespace10() throws Exception {
        KernelServices services = installInController(AdditionalInitialization.MANAGEMENT, SUBSYSTEM_XML_1_0);
        ModelNode model = services.readWholeModel();

        String marshalled = outputModel(model);
        Assert.assertEquals(normalizeXML(SUBSYSTEM_XML_1_2), normalizeXML(marshalled));
    }
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

        Assert.assertEquals(normalizeXML(SUBSYSTEM_XML_1_2), normalizeXML(marshalled));
    }

    @Test
    public void testReadWriteNamespace11() throws Exception {
        KernelServices services = installInController(AdditionalInitialization.MANAGEMENT, SUBSYSTEM_XML_1_1);
        ModelNode model = services.readWholeModel();

        String marshalled = outputModel(model);
        Assert.assertEquals(normalizeXML(SUBSYSTEM_XML_1_2), normalizeXML(marshalled));
    }
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

        Assert.assertEquals(normalizeXML(SUBSYSTEM_XML_1_2), normalizeXML(marshalled));
    }

    @Test
    public void testDescribeHandler() throws Exception {
        KernelServices servicesA = installInController(AdditionalInitialization.MANAGEMENT, SUBSYSTEM_XML_1_2);
        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

    public void testDatasource() throws Exception{
        // Only contain the subsystem xml, e.g.
        //  <subsystem xmlns="urn:jboss:domain:datasources:1.0"> ... </subsystem>
        String xml = readResource("datasource.xml");

        KernelServices services = super.installInController(AdditionalInitialization.MANAGEMENT, xml);

        ModelNode model = services.readWholeModel();

        //Check model..
        final String complexDs = "complexDs";
        final String complexDsJndi = "java:jboss/datasources/" + complexDs;
        Properties params=nonXaDsProperties(complexDsJndi);
        ModelNode modelDs=model.get("subsystem", "datasources","data-source",complexDs+"_Pool");
        checkModelParams(modelDs,params);
        Assert.assertEquals(modelDs.asString(),"UTF-8",modelDs.get("connection-properties","char.encoding","value").asString());
        Assert.assertEquals(modelDs.asString(),"Property2",modelDs.get("valid-connection-checker-properties","name").asString());
        Assert.assertEquals(modelDs.asString(),"Property4",modelDs.get("exception-sorter-properties","name").asString());
        Assert.assertEquals(modelDs.asString(),"Property3",modelDs.get("stale-connection-checker-properties","name").asString());
        Assert.assertEquals(modelDs.asString(),"Property1",modelDs.get("reauth-plugin-properties","name").asString());
       
        final String complexXaDs = "complexXaDs";
        final String complexXaDsJndi = "java:jboss/xa-datasources/" + complexXaDs;
        params=xaDsProperties(complexXaDsJndi);
        ModelNode modelXaDs=model.get("subsystem", "datasources","xa-data-source",complexXaDs+"_Pool");
        checkModelParams(modelXaDs,params);
        Assert.assertEquals(modelXaDs.asString(),"jdbc:h2:mem:test",modelXaDs.get("xa-datasource-properties","URL","value").asString());
        Assert.assertEquals(modelXaDs.asString(),"Property2",modelXaDs.get("valid-connection-checker-properties","name").asString());
        Assert.assertEquals(modelXaDs.asString(),"Property4",modelXaDs.get("exception-sorter-properties","name").asString());
        Assert.assertEquals(modelXaDs.asString(),"Property3",modelXaDs.get("stale-connection-checker-properties","name").asString());
        Assert.assertEquals(modelXaDs.asString(),"Property1",modelXaDs.get("reauth-plugin-properties","name").asString());
        Assert.assertEquals(modelXaDs.asString(),"Property5",modelXaDs.get("recovery-plugin-properties","name").asString());
        Assert.assertEquals(modelXaDs.asString(),"Property6",modelXaDs.get("recovery-plugin-properties","name1").asString());

        //Marshal the xml to see that it is the same as before
        String marshalled = services.getPersistedSubsystemXml();
       // Assert.assertEquals(normalizeXML(xml), normalizeXML(marshalled));

        services = super.installInController(AdditionalInitialization.MANAGEMENT, marshalled);

        //Check that the model looks the same
        ModelNode modelReloaded = services.readWholeModel();
        compare(model, modelReloaded);


        assertRemoveSubsystemResources(services);
    }
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

                controllerInitializer.addSocketBinding("jacorb", 3528);
                controllerInitializer.addSocketBinding("jacorb-ssl", 3529);
            }
        };

        KernelServices servicesA = super.installInController(additionalInit, subsystemXml);
        // get the model and the describe operations from the first controller.
        ModelNode modelA = servicesA.readWholeModel();
        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.
        KernelServices servicesB = super.installInController(additionalInit, operations);
        ModelNode modelB = servicesB.readWholeModel();
        servicesB.shutdown();

        // make sure the models from the two controllers are identical.
        super.compare(modelA, modelB);

    }
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

    public ModelNode getModel(String resourceFileName, boolean checkMarshalledXML, String archiveName) throws Exception {

        String xml = readResource(resourceFileName);

        KernelServices services = super.installInController(AdditionalInitialization.MANAGEMENT, xml);

        ModelNode model = services.readWholeModel();
        ConnectorServices.unregisterResourceIdentifiers(archiveName);

        // Marshal the xml to see that it is the same as before
        String marshalled = services.getPersistedSubsystemXml();
        if (checkMarshalledXML)
            Assert.assertEquals(normalizeXML(xml), normalizeXML(marshalled));

        services = super.installInController(AdditionalInitialization.MANAGEMENT, marshalled);

        // Check that the model looks the same
        ModelNode modelReloaded = services.readWholeModel();
        compare(model, modelReloaded);

        assertRemoveSubsystemResources(services);
        return model;
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

    @Test
    public void testSubsystemDescriptions() throws Exception {

        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());

        servicesA.shutdown();
    }
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

  @Test
  public void testInstallSubsystemWithEnginesPropertiesPlugins() throws Exception {
    String subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES_PROPERTIES_PLUGINS);

    KernelServices services = createKernelServicesBuilder(null)
        .setSubsystemXml(subsystemXml)
        .build();

    ServiceContainer container = services.getContainer();

    assertNotNull("platform service should be installed", container.getRequiredService(PLATFORM_SERVICE_NAME));
    assertNotNull("process engine service should be bound in JNDI", container.getRequiredService(processEngineServiceBindingServiceName));

    ServiceController<?> defaultEngineService = container.getService(ServiceNames.forManagedProcessEngine("__default"));
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

  @Test
  public void testInstallSubsystemXml() throws Exception {
    String subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_PROCESS_ENGINES_ELEMENT_ONLY);

    KernelServices services = createKernelServicesBuilder(null)
        .setSubsystemXml(subsystemXml)
        .build();

    ServiceContainer container = services.getContainer();
    assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
    assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

  }
View Full Code Here

Examples of org.jboss.as.subsystem.test.KernelServices

  @Test
  public void testInstallSubsystemWithEnginesXml() throws Exception {
    String subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES);

    KernelServices services = createKernelServicesBuilder(null)
        .setSubsystemXml(subsystemXml)
        .build();


    ServiceContainer container = services.getContainer();
    assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
    assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

    assertNotNull("process engine controller for engine __default is installed ", container.getService(ServiceNames.forManagedProcessEngine("__default")));
    assertNotNull("process engine controller for engine __test is installed ", container.getService(ServiceNames.forManagedProcessEngine("__test")));
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.