/*
* JBoss, Home of Professional Open Source.
* Copyright 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.modcluster.test;

import org.jboss.as.modcluster.ModClusterExtension;
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.jboss.as.subsystem.test.AdditionalInitialization;
import org.junit.Test;

import java.io.IOException;

/**
 * @author <a href="kabir.khan@jboss.com">Kabir Khan</a>
 * @author Jean-Frederic Clere.
 */
public class ModClusterSubsystemTestCase extends AbstractSubsystemBaseTest {

    public ModClusterSubsystemTestCase() {
        super(ModClusterExtension.SUBSYSTEM_NAME, new ModClusterExtension());
    }

    @Test
    public void testXsd10() throws Exception {
        standardSubsystemTest("subsystem_1_0.xml");
    }


    @Override
    protected String getSubsystemXml() throws IOException {
        return readResource("subsystem.xml");
    }

    @Override
    protected String getSubsystemXml(String configId) throws IOException {
        return readResource(configId);
    }


    @Override
    protected AdditionalInitialization createAdditionalInitialization() {
        return AdditionalInitialization.MANAGEMENT;
    }

    @Override
    protected void compareXml(String configId, String original, String marshalled) throws Exception {
        if (configId != null && configId.equals("subsystem_1_0.xml")) {
            return;
        }

        super.compareXml(configId, original, marshalled, true);
    }


}

@@ -1040,24 +1040,69 @@
 ster.test;%0A%0A
+import org.jboss.as.controller.ModelVersion;%0A
 import org.j
@@ -1137,24 +1137,24 @@
 rExtension;%0A
-
 import org.j
@@ -1260,24 +1260,133 @@
 ialization;%0A
+import org.jboss.as.subsystem.test.KernelServices;%0Aimport org.jboss.as.subsystem.test.KernelServicesBuilder;%0A
 import org.j
@@ -1426,16 +1426,48 @@
 ption;%0A%0A
+import junit.framework.Assert;%0A%0A
 /**%0A * @
@@ -1869,32 +1869,951 @@
 0.xml%22);%0A    %7D%0A%0A
+    @Test%0A    public void testTransformers_1_1_0() throws Exception %7B%0A        String subsystemXml = readResource(%22subsystem_1_0.xml%22);%0A        ModelVersion modelVersion = ModelVersion.create(1, 1, 0);%0A        KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT)%0A                .setSubsystemXml(subsystemXml);%0A%0A        builder.createLegacyKernelServicesBuilder(null, modelVersion)%0A        .addMavenResourceURL(%22org.jboss.as:jboss-as-modcluster:7.1.2.Final%22)%0A        .addMavenResourceURL(%22org.jboss.as:jboss-as-controller:7.1.2.Final%22)%0A        .addParentFirstClassPattern(%22org.jboss.as.controller.*%22);%0A%0A        KernelServices mainServices = builder.build();%0A        KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);%0A        Assert.assertNotNull(legacyServices);%0A        %0A        checkSubsystemModelTransformation(mainServices, modelVersion);%0A    %7D%0A
 %0A    @Override%0A 

Add a Transformers test.