Skip to content

Commit

Permalink
Restore managed version (close #142)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhusar committed Mar 21, 2024
1 parent 78358ec commit aca69f3
Show file tree
Hide file tree
Showing 19 changed files with 1,052 additions and 14 deletions.
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,8 @@
<module>tomcat-embedded-common</module>
<module>tomcat-embedded-parent</module>
<module>tomcat-embedded-10</module>
<module>tomcat-managed-parent</module>
<module>tomcat-managed-common</module>
<module>tomcat-managed-10</module>
</modules>
</project>
25 changes: 25 additions & 0 deletions tomcat-common/src/test/resources/in-container-web-3.1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">

<env-entry>
<env-entry-name>resourceInjectionTestName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>Hello World from an evn-entry</env-entry-value>
</env-entry>

<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>

<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>org.jboss.arquillian.container.tomcat.test.TestServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>

</web-app>
15 changes: 15 additions & 0 deletions tomcat-common/src/test/resources/web-3.1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">

<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>org.jboss.arquillian.container.tomcat.test.TestServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>

</web-app>
2 changes: 1 addition & 1 deletion tomcat-embedded-10/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<properties>
<tomcat.version>10.1.19</tomcat.version>
<!-- Needs newer version because of deprecated method removal in CDI 4 and subsequent adjustments in Arq. -->
<arquillian.core.version>1.7.0.Alpha10</arquillian.core.version>
<!-- <arquillian.core.version>1.7.0.Alpha10</arquillian.core.version>-->
<ecj.version>4.6.1</ecj.version>
</properties>

Expand Down
26 changes: 13 additions & 13 deletions tomcat-embedded-10/src/test/resources/arquillian.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<container qualifier="tomcat" default="true">
<configuration>
<property name="tomcatHome">target/tomcat-embedded-10</property>
<property name="workDir">work</property>
<property name="bindHttpPort">8888</property>
<property name="unpackArchive">true</property>
</configuration>
</container>
</arquillian>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<container qualifier="tomcat" default="true">
<configuration>
<property name="tomcatHome">target/tomcat-embedded-10</property>
<property name="workDir">work</property>
<property name="bindHttpPort">8888</property>
<property name="unpackArchive">true</property>
</configuration>
</container>
</arquillian>
51 changes: 51 additions & 0 deletions tomcat-managed-10/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-tomcat-managed-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<relativePath>../tomcat-managed-parent/pom.xml</relativePath>
</parent>

<artifactId>arquillian-tomcat-managed-10</artifactId>
<name>Arquillian Container Tomcat Managed 10.x</name>

<properties>
<tomcat.major.version>10</tomcat.major.version>
<tomcat.version>${tomcat.major.version}.1.19</tomcat.version>
<test.catalina.home>${project.build.directory}/cargo/installs/apache-tomcat-${tomcat.version}/apache-tomcat-${tomcat.version}</test.catalina.home>
<test.catalina.base>${project.build.directory}/cargo/configurations/tomcat${tomcat.major.version}x</test.catalina.base>
</properties>

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>install-container</id>
<configuration>
<container>
<containerId>tomcat${tomcat.major.version}x</containerId>
<zipUrlInstaller>
<url>https://archive.apache.org/dist/tomcat/tomcat-${tomcat.major.version}/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip</url>
</zipUrlInstaller>
</container>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. 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.jboss.arquillian.container.tomcat.managed;

import org.jboss.arquillian.container.spi.client.container.DeployableContainer;
import org.jboss.arquillian.container.spi.client.protocol.ProtocolDescription;
import org.jboss.arquillian.container.tomcat.Tomcat7ManagerCommandSpec;

/**
* <p>
* Arquillian {@link DeployableContainer} implementation for an Managed Tomcat server; responsible for both lifecycle and
* deployment operations.
* </p>
*
* @author <a href="mailto:[email protected]">Karel Piwko</a>
* @author <a href="mailto:[email protected]">Juraj Huska</a>
* @author <a href="mailto:[email protected]">Ondrej Zizka</a>
* @author <a href="mailto:[email protected]">Dimitrij Drus</a>
* @version $Revision: #1 $
*/
public class Tomcat10ManagedContainer extends TomcatManagedContainer {

public Tomcat10ManagedContainer() {
super(new ProtocolDescription("Servlet 5.0"), new Tomcat7ManagerCommandSpec());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.jboss.arquillian.container.tomcat.managed;

import org.jboss.arquillian.container.spi.client.container.DeployableContainer;
import org.jboss.arquillian.core.spi.LoadableExtension;

public class Tomcat10ManagedExtension implements LoadableExtension {

@Override
public void register(final ExtensionBuilder builder) {
builder.service(DeployableContainer.class, Tomcat10ManagedContainer.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.jboss.arquillian.container.tomcat.managed.Tomcat10ManagedExtension
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2014, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. 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.jboss.arquillian.container.tomcat.managed;

import static org.jboss.arquillian.container.tomcat.test.TestDeploymentFactory.ROOT_CONTEXT;
import static org.jboss.arquillian.container.tomcat.test.TestDeploymentFactory.SERVLET_5;
import static org.jboss.arquillian.container.tomcat.test.TestDeploymentFactory.TEST_CONTEXT;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.tomcat.test.TomcatClientITBase;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.runner.RunWith;

/**
* Tests that Tomcat deployments into the Tomcat 8 server work through the Arquillian lifecycle
*
* @author <a href="mailto:[email protected]">Jean Deruelle</a>
* @author Dan Allen
* @author <a href="mailto:[email protected]">Dimitrij Drus</a>
* @version $Revision: $
*/
@RunWith(Arquillian.class)
public class Tomcat10ManagedClientIT extends TomcatClientITBase {

@Deployment(name = ROOT_CONTEXT, testable = false)
public static WebArchive createRootDeployment() {

return TEST_DEPLOYMENT_FACTORY.createWebAppClientDeployment(ROOT_CONTEXT, SERVLET_5);
}

@Deployment(name = TEST_CONTEXT, testable = false)
public static WebArchive createTestDeployment() {

return TEST_DEPLOYMENT_FACTORY.createWebAppClientDeployment(TEST_CONTEXT, SERVLET_5);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2014, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. 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.jboss.arquillian.container.tomcat.managed;

import static org.jboss.arquillian.container.tomcat.test.TestDeploymentFactory.ROOT_CONTEXT;
import static org.jboss.arquillian.container.tomcat.test.TestDeploymentFactory.SERVLET_5;
import static org.jboss.arquillian.container.tomcat.test.TestDeploymentFactory.TEST_CONTEXT;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.tomcat.test.TomcatInContainerITBase;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.runner.RunWith;

/**
* Tests that Tomcat deployments into the Tomcat 8 server work through the Arquillian lifecycle
*
* @author <a href="mailto:[email protected]">Dimitrij Drus</a>
* @version $Revision: $
*/
@RunWith(Arquillian.class)
public class Tomcat10ManagedInContainerIT extends TomcatInContainerITBase {

@Deployment(name = ROOT_CONTEXT)
public static WebArchive createRootDeployment() {

return TEST_DEPLOYMENT_FACTORY.createWebAppInContainerDeployment(ROOT_CONTEXT, SERVLET_5);
}

@Deployment(name = TEST_CONTEXT)
public static WebArchive createTestDeployment() {

return TEST_DEPLOYMENT_FACTORY.createWebAppInContainerDeployment(TEST_CONTEXT, SERVLET_5);
}
}
17 changes: 17 additions & 0 deletions tomcat-managed-10/src/test/resources/arquillian.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/schema/arquillian" xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<container qualifier="tomcat" default="true">
<configuration>
<property name="catalinaHome">${test.catalina.home}</property>
<property name="catalinaBase">${test.catalina.base}</property>
<property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=512m</property>
<property name="jmxPort">${test.jmx.port}</property>
<property name="bindHttpPort">${test.http.port}</property>
<property name="serverConfig">server.xml</property>
<property name="user">${test.manager.username}</property>
<property name="pass">${test.manager.password}</property>
</configuration>
</container>

</arquillian>
7 changes: 7 additions & 0 deletions tomcat-managed-10/src/test/resources/tomcat-users.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>

<role rolename="manager-script"/>
<user username="${test.manager.username}" password="${test.manager.password}" roles="manager-script"/>

</tomcat-users>
53 changes: 53 additions & 0 deletions tomcat-managed-common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-parent-tomcat</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>

<artifactId>arquillian-tomcat-managed-common</artifactId>
<name>Arquillian Tomcat Managed Container Common</name>

<dependencies>

<!-- Compile Scope -->

<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-tomcat-common</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Test Scope -->

<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-tomcat-common</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit aca69f3

Please sign in to comment.