/*
* 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.jsf.subsystem;

import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;
import org.junit.Test;

import java.io.IOException;

/**
 *
 * @author Stuart Douglas
 */
public class JSFSubsystemTestCase extends AbstractSubsystemBaseTest {
    public JSFSubsystemTestCase() {
        super(JSFExtension.SUBSYSTEM_NAME, new JSFExtension());
    }

    @Override
    protected String getSubsystemXml() throws IOException {
        return "<subsystem xmlns=\"urn:jboss:domain:jsf:1.1\" />";
    }

    @Override
    protected String getSubsystemXsdPath() throws Exception {
        return "schema/jboss-as-jsf_1_1.xsd";
    }

    @Override
    protected String[] getSubsystemTemplatePaths() throws IOException {
        return new String[] {
                "/subsystem-templates/jsf.xml"
        };
    }

    @Test
    @Override
    public void testSchemaOfSubsystemTemplates() throws Exception {
        super.testSchemaOfSubsystemTemplates();
    }
}

@@ -1053,61 +1053,336 @@
 ort 
-org.jboss.as.subsystem.test.AbstractSubsystemBaseTest
+static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.jboss.as.subsystem.test.AbstractSubsystemBaseTest;%0Aimport org.jboss.as.subsystem.test.KernelServices;%0Aimport org.jboss.as.subsystem.test.KernelServicesBuilder;%0Aimport org.jboss.dmr.ModelNode
 ;%0Aim
@@ -1781,16 +1781,178 @@
 sf:1.1%5C%22
+%22 +%0A                %22 default-jsf-impl-slot=%5C%22$%7Bexp.default-jsf-impl-slot:main%7D%5C%22%22 +%0A                %22 disallow-doctype-decl=%5C%22$%7Bexp.disallow-doctype-decl:true%7D%5C%22
  /%3E%22;%0A  
@@ -2350,32 +2350,32 @@
 ows Exception %7B%0A
-
         super.te
@@ -2411,11 +2411,662 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testAttributes() throws Exception %7B%0A        KernelServicesBuilder builder = createKernelServicesBuilder(null)%0A                .setSubsystemXml(getSubsystemXml());%0A        KernelServices kernelServices = builder.build();%0A        ModelNode rootModel = kernelServices.readWholeModel();%0A        ModelNode serverModel = rootModel.require(SUBSYSTEM).require(JSFExtension.SUBSYSTEM_NAME);%0A        assertEquals(%22main%22, serverModel.get(JSFResourceDefinition.DEFAULT_SLOT_ATTR_NAME).resolve().asString());%0A        assertEquals(true, serverModel.get(JSFResourceDefinition.DISALLOW_DOCTYPE_DECL_ATTR_NAME).resolve().asBoolean());%0A    %7D
 %0A%7D%0A

Add tests to the JSF subsystem for attributes that allow expressions