// Path: arquillian-chameleon-extension/src/test/java/org/arquillian/container/chameleon/Deployments.java
// static void enrichTomcatWithCdi(WebArchive archive) {
//     String contextXml = "<Context>\n" +
//         "   <Resource name=\"BeanManager\" \n" +
//         "      auth=\"Container\"\n" +
//         "      type=\"javax.enterprise.inject.spi.BeanManager\"\n" +
//         "      factory=\"org.jboss.weld.resources.ManagerObjectFactory\"/>\n" +
//         "</Context>\n";
// 
//     String webXml = "<web-app version=\"3.0\">\n" +
//         "<listener>\n" +
//         "      <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>\n" +
//         "   </listener>" +
//         "  <resource-env-ref>\n" +
//         "    <resource-env-ref-name>BeanManager</resource-env-ref-name>\n" +
//         "    <resource-env-ref-type>\n" +
//         "            javax.enterprise.inject.spi.BeanManager\n" +
//         "    </resource-env-ref-type>\n" +
//         "  </resource-env-ref>\n" +
//         "</web-app>";
// 
//     archive.addAsLibraries(WELD_SERVLET);
//     archive.addAsManifestResource(new StringAsset(contextXml), "context.xml");
//     archive.setWebXML(new StringAsset(webXml));
// }


import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.arquillian.container.chameleon.Deployments.enrichTomcatWithCdi;
/*
 * JBoss, Home of Professional Open Source
 * Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors
 * as indicated by the @authors tag. All rights reserved.
 * See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.arquillian.container.chameleon;



@RunWith(Arquillian.class)
public class SimpleDeploymentTestCase {

    @Inject
    private SimpleBean bean;

    @Deployment
    public static WebArchive deploy() {
        final String container =
            System.getProperty("arq.container.chameleon.configuration.chameleonTarget", "chameleon/default");
        final WebArchive archive = ShrinkWrap.create(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addClass(SimpleBean.class);

        if (container.contains("tomcat")) {
// Path: arquillian-chameleon-extension/src/test/java/org/arquillian/container/chameleon/Deployments.java
// static void enrichTomcatWithCdi(WebArchive archive) {
//     String contextXml = "<Context>\n" +
//         "   <Resource name=\"BeanManager\" \n" +
//         "      auth=\"Container\"\n" +
//         "      type=\"javax.enterprise.inject.spi.BeanManager\"\n" +
//         "      factory=\"org.jboss.weld.resources.ManagerObjectFactory\"/>\n" +
//         "</Context>\n";
// 
//     String webXml = "<web-app version=\"3.0\">\n" +
//         "<listener>\n" +
//         "      <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>\n" +
//         "   </listener>" +
//         "  <resource-env-ref>\n" +
//         "    <resource-env-ref-name>BeanManager</resource-env-ref-name>\n" +
//         "    <resource-env-ref-type>\n" +
//         "            javax.enterprise.inject.spi.BeanManager\n" +
//         "    </resource-env-ref-type>\n" +
//         "  </resource-env-ref>\n" +
//         "</web-app>";
// 
//     archive.addAsLibraries(WELD_SERVLET);
//     archive.addAsManifestResource(new StringAsset(contextXml), "context.xml");
//     archive.setWebXML(new StringAsset(webXml));
// }


// Path: arquillian-chameleon-extension/src/test/java/org/arquillian/container/chameleon/SimpleDeploymentTestCase.java
import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.arquillian.container.chameleon.Deployments.enrichTomcatWithCdi;

/*
 * JBoss, Home of Professional Open Source
 * Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors
 * as indicated by the @authors tag. All rights reserved.
 * See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.arquillian.container.chameleon;



@RunWith(Arquillian.class)
public class SimpleDeploymentTestCase {

    @Inject
    private SimpleBean bean;

    @Deployment
    public static WebArchive deploy() {
        final String container =
            System.getProperty("arq.container.chameleon.configuration.chameleonTarget", "chameleon/default");
        final WebArchive archive = ShrinkWrap.create(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addClass(SimpleBean.class);

        if (container.contains("tomcat")) {
            enrichTomcatWithCdi(archive);