Repository: cxf Updated Branches: refs/heads/master 8c49fe5b3 -> faf461150
http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java ---------------------------------------------------------------------- diff --git a/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java new file mode 100644 index 0000000..7c8fb54 --- /dev/null +++ b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.cxf.systest.jaxrs.cdi.jetty; + +import org.apache.cxf.jaxrs.model.AbstractResourceInfo; +import org.apache.cxf.systests.cdi.base.AbstractCdiSingleAppTest; +import org.apache.cxf.systests.cdi.base.jetty.AbstractJettyServer; +import org.jboss.weld.environment.Container; +import org.jboss.weld.environment.jetty.JettyContainer; +import org.jboss.weld.environment.servlet.Listener; +import org.junit.BeforeClass; + +public class JettyEmbeddedTest extends AbstractCdiSingleAppTest { + public static class EmbeddedJettyServer extends AbstractJettyServer { + public static final int PORT = allocatePortAsInt(EmbeddedJettyServer.class); + + public EmbeddedJettyServer() { + super("/", PORT, new Listener()); + } + } + + @BeforeClass + public static void startServers() throws Exception { + AbstractResourceInfo.clearAllMaps(); + System.setProperty(Container.class.getName(), JettyContainer.class.getName()); + assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class, true)); + createStaticBus(); + } + + @Override + protected int getPort() { + return EmbeddedJettyServer.PORT; + } +} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java ---------------------------------------------------------------------- diff --git a/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java new file mode 100644 index 0000000..0f16e59 --- /dev/null +++ b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java @@ -0,0 +1,53 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.cxf.systest.jaxrs.cdi.jetty; + +import org.apache.cxf.jaxrs.model.AbstractResourceInfo; +import org.apache.cxf.systests.cdi.base.AbstractCdiSingleAppTest; +import org.apache.cxf.systests.cdi.base.jetty.AbstractJettyServer; +import org.jboss.weld.environment.Container; +import org.jboss.weld.environment.jetty.JettyContainer; +import org.jboss.weld.environment.servlet.Listener; +import org.junit.BeforeClass; +import org.junit.Ignore; + +public class JettyWarTest extends AbstractCdiSingleAppTest { + @Ignore + public static class EmbeddedJettyServer extends AbstractJettyServer { + public static final int PORT = allocatePortAsInt(EmbeddedJettyServer.class); + + public EmbeddedJettyServer() { + super("/jaxrs_cdi", "/", PORT, new Listener()); + } + } + + @BeforeClass + public static void startServers() throws Exception { + AbstractResourceInfo.clearAllMaps(); + System.setProperty(Container.class.getName(), JettyContainer.class.getName()); + assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class, true)); + createStaticBus(); + } + + @Override + protected int getPort() { + return EmbeddedJettyServer.PORT; + } + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java ---------------------------------------------------------------------- diff --git a/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java new file mode 100644 index 0000000..14d5480 --- /dev/null +++ b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.apache.cxf.systest.jaxrs.cdi.tomcat; + +import org.apache.cxf.jaxrs.model.AbstractResourceInfo; +import org.apache.cxf.systests.cdi.base.AbstractCdiSingleAppTest; +import org.apache.cxf.systests.cdi.base.tomcat.AbstractTomcatServer; +import org.jboss.weld.environment.Container; +import org.jboss.weld.environment.tomcat.TomcatContainer; +import org.junit.BeforeClass; + +public class TomcatWarTest extends AbstractCdiSingleAppTest { + public static class EmbeddedTomcatServer extends AbstractTomcatServer { + public static final int PORT = allocatePortAsInt(EmbeddedTomcatServer.class); + + public EmbeddedTomcatServer() { + super("/jaxrs_cdi", "/", PORT); + } + } + + @BeforeClass + public static void startServers() throws Exception { + AbstractResourceInfo.clearAllMaps(); + System.setProperty(Container.class.getName(), TomcatContainer.class.getName()); + assertTrue("server did not launch correctly", launchServer(EmbeddedTomcatServer.class, true)); + createStaticBus(); + } + + @Override + protected int getPort() { + return EmbeddedTomcatServer.PORT; + } + +} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/beans.xml ---------------------------------------------------------------------- diff --git a/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/beans.xml b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/beans.xml new file mode 100644 index 0000000..2f48c57 --- /dev/null +++ b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/beans.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<beans xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_1.xsd"> + +</beans> http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/services/org.jboss.weld.environment.Container ---------------------------------------------------------------------- diff --git a/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/services/org.jboss.weld.environment.Container b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/services/org.jboss.weld.environment.Container new file mode 100644 index 0000000..df31f74 --- /dev/null +++ b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/META-INF/services/org.jboss.weld.environment.Container @@ -0,0 +1 @@ +org.apache.cxf.systest.jaxrs.cdi.WeldDiscoverableContainer \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/jaxrs_cdi/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/jaxrs_cdi/WEB-INF/web.xml b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/jaxrs_cdi/WEB-INF/web.xml new file mode 100644 index 0000000..66cc81a --- /dev/null +++ b/systests/cdi/cdi-weld/cdi-no-apps-weld/src/test/resources/jaxrs_cdi/WEB-INF/web.xml @@ -0,0 +1,25 @@ +<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + <listener> + <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> + </listener> + + <servlet> + <servlet-name>CXFServlet</servlet-name> + <display-name>CXF Servlet</display-name> + <servlet-class>org.apache.cxf.cdi.CXFCdiServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>CXFServlet</servlet-name> + <url-pattern>/rest/*</url-pattern> + </servlet-mapping> + + <resource-env-ref> + <resource-env-ref-name>BeanManager</resource-env-ref-name> + <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager + </resource-env-ref-type> + </resource-env-ref> +</web-app> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/cdi-weld/pom.xml ---------------------------------------------------------------------- diff --git a/systests/cdi/cdi-weld/pom.xml b/systests/cdi/cdi-weld/pom.xml new file mode 100644 index 0000000..2fd36b5 --- /dev/null +++ b/systests/cdi/cdi-weld/pom.xml @@ -0,0 +1,116 @@ +<?xml version="1.0"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you 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. +--> +<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/maven-v4_0_0.xsd"> + <parent> + <groupId>org.apache.cxf.systests</groupId> + <artifactId>cxf-systests-cdi</artifactId> + <version>3.2.0-SNAPSHOT</version> + <relativePath>../</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>cxf-systests-cdi-weld</artifactId> + <packaging>pom</packaging> + <name>Apache CXF CDI Integration System Tests - Weld</name> + <description>Apache CXF CDI Integration System Tests - Weld</description> + <url>http://cxf.apache.org</url> + + <modules> + <module>cdi-multiple-apps-weld</module> + <module>cdi-no-apps-weld</module> + </modules> + + <dependencies> + <dependency> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-validator</artifactId> + </dependency> + <dependency> + <groupId>org.jboss.weld.servlet</groupId> + <artifactId>weld-servlet</artifactId> + <version>${cxf.jboss.weld.version}</version> + </dependency> + <dependency> + <groupId>org.jboss.weld</groupId> + <artifactId>weld-core</artifactId> + <version>${cxf.jboss.weld.version}</version> + </dependency> + <dependency> + <groupId>javax.el</groupId> + <artifactId>javax.el-api</artifactId> + </dependency> + <dependency> + <groupId>org.glassfish</groupId> + <artifactId>javax.el</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http-jetty</artifactId> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxrs</artifactId> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-testutils</artifactId> + </dependency> + <dependency> + <groupId>javax.annotation</groupId> + <artifactId>jsr250-api</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.jaxrs</groupId> + <artifactId>jackson-jaxrs-json-provider</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </dependency> + <dependency> + <groupId>com.ning</groupId> + <artifactId>async-http-client</artifactId> + </dependency> + <dependency> + <groupId>org.apache.cxf.systests</groupId> + <artifactId>cxf-systests-cdi-base</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/pom.xml ---------------------------------------------------------------------- diff --git a/systests/cdi/pom.xml b/systests/cdi/pom.xml index 7ebb9bf..70895aa 100644 --- a/systests/cdi/pom.xml +++ b/systests/cdi/pom.xml @@ -1,22 +1,22 @@ <?xml version="1.0"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you 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. ---> + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you 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. + --> <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/maven-v4_0_0.xsd"> <parent> <artifactId>cxf-parent</artifactId> @@ -27,6 +27,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.apache.cxf.systests</groupId> <artifactId>cxf-systests-cdi</artifactId> + <packaging>pom</packaging> <name>Apache CXF CDI Integration System Tests</name> <description>Apache CXF CDI Integration System Tests</description> <url>http://cxf.apache.org</url> @@ -36,145 +37,112 @@ <cxf.surefire.fork.vmargs>-XX:MaxPermSize=192m</cxf.surefire.fork.vmargs> <cxf.server.launcher.vmargs>-XX:MaxPermSize=192m</cxf.server.launcher.vmargs> <cxf.tomcat.version>8.0.32</cxf.tomcat.version> + <cxf.openwebbeans.version>1.7.0</cxf.openwebbeans.version> </properties> - <dependencies> - <dependency> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-validator</artifactId> - <version>${cxf.hibernate.validator.version}</version> - </dependency> - <dependency> - <groupId>org.jboss.weld.servlet</groupId> - <artifactId>weld-servlet</artifactId> - <version>${cxf.jboss.weld.version}</version> - </dependency> - <dependency> - <groupId>org.jboss.weld</groupId> - <artifactId>weld-core</artifactId> - <version>${cxf.jboss.weld.version}</version> - </dependency> - <dependency> - <groupId>javax.el</groupId> - <artifactId>javax.el-api</artifactId> - <version>${cxf.el.api.version}</version> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>javax.el</artifactId> - <version>${cxf.glassfish.el.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-plus</artifactId> - <version>${cxf.jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-webapp</artifactId> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>apache-jsp</artifactId> - <version>${cxf.jetty.version}</version> - <exclusions> - <exclusion> - <groupId>org.mortbay.jasper</groupId> - <artifactId>apache-jsp</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-core</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-transports-http-jetty</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-frontend-jaxrs</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-rt-rs-client</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-integration-cdi</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.cxf</groupId> - <artifactId>cxf-testutils</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.annotation</groupId> - <artifactId>jsr250-api</artifactId> - <version>1.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.jaxrs</groupId> - <artifactId>jackson-jaxrs-json-provider</artifactId> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.tomcat.embed</groupId> - <artifactId>tomcat-embed-core</artifactId> - <version>${cxf.tomcat.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tomcat.embed</groupId> - <artifactId>tomcat-embed-logging-juli</artifactId> - <version>${cxf.tomcat.version}</version> - </dependency> - <dependency> - <groupId>org.apache.tomcat</groupId> - <artifactId>tomcat-jasper</artifactId> - <version>${cxf.tomcat.version}</version> - </dependency> - <dependency> - <groupId>com.ning</groupId> - <artifactId>async-http-client</artifactId> - <version>${cxf.ahc.version}</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>io.netty</groupId> - <artifactId>netty</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> + <modules> + <module>base</module> + <module>cdi-weld</module> + <module>cdi-owb</module> + </modules> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-validator</artifactId> + <version>${cxf.hibernate.validator.version}</version> + </dependency> + <dependency> + <groupId>javax.el</groupId> + <artifactId>javax.el-api</artifactId> + <version>${cxf.el.api.version}</version> + </dependency> + <dependency> + <groupId>org.glassfish</groupId> + <artifactId>javax.el</artifactId> + <version>${cxf.glassfish.el.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-plus</artifactId> + <version>${cxf.jetty.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>apache-jsp</artifactId> + <version>${cxf.jetty.version}</version> + <exclusions> + <exclusion> + <groupId>org.mortbay.jasper</groupId> + <artifactId>apache-jsp</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http-jetty</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxrs</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-integration-cdi</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-testutils</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>javax.annotation</groupId> + <artifactId>jsr250-api</artifactId> + <version>1.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.tomcat.embed</groupId> + <artifactId>tomcat-embed-core</artifactId> + <version>${cxf.tomcat.version}</version> + </dependency> + <dependency> + <groupId>org.apache.tomcat.embed</groupId> + <artifactId>tomcat-embed-logging-juli</artifactId> + <version>${cxf.tomcat.version}</version> + </dependency> + <dependency> + <groupId>org.apache.tomcat</groupId> + <artifactId>tomcat-jasper</artifactId> + <version>${cxf.tomcat.version}</version> + </dependency> + <dependency> + <groupId>com.ning</groupId> + <artifactId>async-http-client</artifactId> + <version>${cxf.ahc.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>io.netty</groupId> + <artifactId>netty</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </dependencyManagement> <build> <plugins> <plugin> http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreApplication.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreApplication.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreApplication.java deleted file mode 100644 index a3e7f84..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreApplication.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs; - -import javax.enterprise.inject.Produces; -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/api") -public class BookStoreApplication extends Application { - @Produces public String version() { - return "1.0"; - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreCustomApplication.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreCustomApplication.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreCustomApplication.java deleted file mode 100644 index 0b64081..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreCustomApplication.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; - -import org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature; -import org.apache.cxf.jaxrs.validation.ValidationExceptionMapper; -import org.apache.cxf.systest.jaxrs.cdi.BookStore; - -@ApplicationPath("/custom") -public class BookStoreCustomApplication extends Application { - @Override - public Set< Object > getSingletons() { - Set<Object> singletons = new HashSet<>(); - singletons.add(new JacksonJsonProvider()); - singletons.add(new ValidationExceptionMapper()); - singletons.add(new JAXRSBeanValidationFeature()); - return singletons; - } - - @Override - public Set<Class<?>> getClasses() { - return Collections.<Class<?>>singleton(BookStore.class); - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreService.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreService.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreService.java deleted file mode 100644 index 38788eb..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreService.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import javax.inject.Named; - -import org.apache.cxf.systest.jaxrs.cdi.Book; - -@Named -public class BookStoreService { - private Map< String, Book > books = new HashMap< String, Book >(); - - public Book get(final String id) { - return books.get(id); - } - - public Collection< Book > all() { - return books.values(); - } - - public Book store(final String id, final String name) { - final Book book = new Book(name, id); - books.put(id, book); - return book; - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/AbstractCDITest.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/AbstractCDITest.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/AbstractCDITest.java deleted file mode 100644 index cba800a..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/AbstractCDITest.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi; - -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - -import javax.ws.rs.core.Form; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; - -import org.apache.cxf.jaxrs.client.WebClient; -import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; -import org.junit.Test; - - -public abstract class AbstractCDITest extends AbstractBusClientServerTestBase { - @Test - public void testInjectedVersionIsProperlyReturned() { - Response r = createWebClient("/rest/api/bookstore/version", MediaType.TEXT_PLAIN).get(); - assertEquals(Status.OK.getStatusCode(), r.getStatus()); - assertEquals("1.0", r.readEntity(String.class)); - } - - @Test - public void testResponseHasBeenReceivedWhenAddingNewBook() { - Response r = createWebClient("/rest/api/bookstore/books").post( - new Form() - .param("id", "1234") - .param("name", "Book 1234")); - assertEquals(Status.CREATED.getStatusCode(), r.getStatus()); - } - - @Test - public void testResponseHasBeenReceivedWhenQueringAllBooks() { - Response r = createWebClient("/rest/api/bookstore/books").get(); - assertEquals(Status.OK.getStatusCode(), r.getStatus()); - } - - @Test - public void testAddAndQueryOneBook() { - final String id = UUID.randomUUID().toString(); - - Response r = createWebClient("/rest/api/bookstore/books").post( - new Form() - .param("id", id) - .param("name", "Book 1234")); - assertEquals(Status.CREATED.getStatusCode(), r.getStatus()); - - r = createWebClient("/rest/api/bookstore/books").path(id).get(); - assertEquals(Status.OK.getStatusCode(), r.getStatus()); - - Book book = r.readEntity(Book.class); - assertEquals(id, book.getId()); - } - - @Test - public void testAddOneBookWithValidation() { - final String id = UUID.randomUUID().toString(); - - Response r = createWebClient("/rest/custom/bookstore/books").post( - new Form() - .param("id", id)); - assertEquals(Status.BAD_REQUEST.getStatusCode(), r.getStatus()); - } - - - protected WebClient createWebClient(final String url) { - return createWebClient(url, MediaType.APPLICATION_JSON); - } - - protected WebClient createWebClient(final String url, final String mediaType) { - final List< ? > providers = Arrays.asList(new JacksonJsonProvider()); - - final WebClient wc = WebClient - .create("http://localhost:" + getPort() + url, providers) - .accept(mediaType); - - WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000L); - return wc; - } - - protected abstract int getPort(); -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/Book.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/Book.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/Book.java deleted file mode 100644 index 7952fce..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/Book.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi; - -import javax.validation.constraints.NotNull; - -public class Book { - @NotNull private String name; - private String id; - - public Book() { - } - - public Book(String id) { - this.id = id; - } - - public Book(String name, String id) { - this.name = name; - this.id = id; - } - - public void setName(String n) { - name = n; - } - - public String getName() { - return name; - } - - public void setId(String i) { - id = i; - } - - public String getId() { - return id; - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/BookStore.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/BookStore.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/BookStore.java deleted file mode 100644 index 2b3b8d7..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/BookStore.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi; - -import java.util.Collection; - -import javax.inject.Inject; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -import org.apache.cxf.systest.jaxrs.BookStoreService; - -@Path("/bookstore/") -public class BookStore { - @Inject private BookStoreService service; - @Inject private String version; - - @GET - @Path("/version") - @Produces(MediaType.TEXT_PLAIN) - public String getVersion() { - return version; - } - - @GET - @Path("/books/{bookId}") - @NotNull - @Produces(MediaType.APPLICATION_JSON) - public Book getBook(@PathParam("bookId") String id) { - return service.get(id); - } - - @GET - @Path("/books") - @NotNull @Valid - @Produces(MediaType.APPLICATION_JSON) - public Collection< Book > getBooks() { - return service.all(); - } - - @POST - @Path("/books") - @Produces(MediaType.APPLICATION_JSON) - public Response addBook(@Context final UriInfo uriInfo, - @NotNull @Size(min = 1, max = 50) @FormParam("id") String id, - @NotNull @FormParam("name") String name) { - final Book book = service.store(id, name); - return Response.created(uriInfo.getRequestUriBuilder().path(id).build()).entity(book).build(); - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/WeldDiscoverableContainer.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/WeldDiscoverableContainer.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/WeldDiscoverableContainer.java deleted file mode 100644 index 2fabdd1..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/WeldDiscoverableContainer.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi; - -import org.jboss.weld.environment.Container; -import org.jboss.weld.environment.ContainerContext; -import org.jboss.weld.environment.jetty.JettyContainer; -import org.jboss.weld.environment.tomcat.TomcatContainer; -import org.jboss.weld.resources.spi.ResourceLoader; - -/** - * Because we are mixing several Servlet Containers in the same project, JBoss Weld - * needs some help to figure out the correct one we are running right now. - */ -public class WeldDiscoverableContainer implements Container { - private final Container delegate; - - public WeldDiscoverableContainer() { - if (JettyContainer.class.getName().equals(System.getProperty(Container.class.getName()))) { - delegate = JettyContainer.INSTANCE; - } else { - delegate = TomcatContainer.INSTANCE; - } - } - - @Override - public boolean touch(ResourceLoader loader, ContainerContext context) throws Exception { - return delegate.touch(loader, context); - } - - @Override - public void initialize(ContainerContext context) { - delegate.initialize(context); - } - - @Override - public void destroy(ContainerContext context) { - delegate.destroy(context); - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java deleted file mode 100644 index 4f8cea3..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi.jetty; - - -import org.apache.cxf.cdi.CXFCdiServlet; -import org.apache.cxf.testutil.common.AbstractBusTestServerBase; -import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerCollection; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.webapp.WebAppContext; -import org.jboss.weld.environment.Container; -import org.jboss.weld.environment.jetty.JettyContainer; -import org.jboss.weld.environment.servlet.BeanManagerResourceBindingListener; -import org.jboss.weld.environment.servlet.Listener; - -public abstract class AbstractJettyServer extends AbstractBusTestServerBase { - - private org.eclipse.jetty.server.Server server; - private final String resourcePath; - private final String contextPath; - private final int port; - - protected AbstractJettyServer(final String contextPath, int portNumber) { - this(null, contextPath, portNumber); - } - - protected AbstractJettyServer(final String resourcePath, final String contextPath, int portNumber) { - this.resourcePath = resourcePath; - this.contextPath = contextPath; - this.port = portNumber; - } - - protected void run() { - System.setProperty("java.naming.factory.url", "org.eclipse.jetty.jndi"); - System.setProperty("java.naming.factory.initial", "org.eclipse.jetty.jndi.InitialContextFactory"); - System.setProperty(Container.class.getName(), JettyContainer.class.getName()); - - server = new Server(port); - - try { - if (resourcePath == null) { - // Register and map the dispatcher servlet - final ServletHolder servletHolder = new ServletHolder(new CXFCdiServlet()); - final ServletContextHandler context = new ServletContextHandler(); - context.setContextPath(contextPath); - context.addEventListener(new Listener()); - context.addEventListener(new BeanManagerResourceBindingListener()); - context.addServlet(servletHolder, "/rest/*"); - server.setHandler(context); - } else { - final WebAppContext context = new WebAppContext(); - context.setContextPath(contextPath); - context.setWar(getClass().getResource(resourcePath).toURI().getPath()); - context.setServerClasses(new String[] { - "org.eclipse.jetty.servlet.ServletContextHandler.Decorator" - }); - - HandlerCollection handlers = new HandlerCollection(); - handlers.setHandlers(new Handler[] {context, new DefaultHandler()}); - server.setHandler(handlers); - } - - configureServer(server); - server.start(); - } catch (final Exception ex) { - ex.printStackTrace(); - fail(ex.getMessage()); - } - } - - protected void configureServer(org.eclipse.jetty.server.Server theserver) throws Exception { - - } - - public void tearDown() throws Exception { - super.tearDown(); - - if (server != null) { - server.stop(); - server.destroy(); - server = null; - } - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java deleted file mode 100644 index 3d8ef7b..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyEmbeddedTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi.jetty; - -import org.apache.cxf.jaxrs.model.AbstractResourceInfo; -import org.apache.cxf.systest.jaxrs.cdi.AbstractCDITest; -import org.junit.BeforeClass; -import org.junit.Ignore; - -public class JettyEmbeddedTest extends AbstractCDITest { - @Ignore - public static class EmbeddedJettyServer extends AbstractJettyServer { - public static final int PORT = allocatePortAsInt(EmbeddedJettyServer.class); - - public EmbeddedJettyServer() { - super("/", PORT); - } - } - - @BeforeClass - public static void startServers() throws Exception { - AbstractResourceInfo.clearAllMaps(); - //keep out of process due to stack traces testing failures - assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class, true)); - createStaticBus(); - } - - @Override - protected int getPort() { - return EmbeddedJettyServer.PORT; - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java deleted file mode 100644 index 1b62a46..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/JettyWarTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi.jetty; - -import org.apache.cxf.jaxrs.model.AbstractResourceInfo; -import org.apache.cxf.systest.jaxrs.cdi.AbstractCDITest; -import org.junit.BeforeClass; -import org.junit.Ignore; - -public class JettyWarTest extends AbstractCDITest { - @Ignore - public static class EmbeddedJettyServer extends AbstractJettyServer { - public static final int PORT = allocatePortAsInt(EmbeddedJettyServer.class); - - public EmbeddedJettyServer() { - super("/jaxrs_cdi", "/", PORT); - } - } - - @BeforeClass - public static void startServers() throws Exception { - AbstractResourceInfo.clearAllMaps(); - assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class, true)); - createStaticBus(); - } - - @Override - protected int getPort() { - return EmbeddedJettyServer.PORT; - } - -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/AbstractTomcatServer.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/AbstractTomcatServer.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/AbstractTomcatServer.java deleted file mode 100644 index 2ff0388..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/AbstractTomcatServer.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi.tomcat; - - -import java.io.File; -import java.io.IOException; - -import org.apache.catalina.startup.Tomcat; -import org.apache.cxf.testutil.common.AbstractBusTestServerBase; -import org.jboss.weld.environment.Container; -import org.jboss.weld.environment.tomcat.TomcatContainer; - -public abstract class AbstractTomcatServer extends AbstractBusTestServerBase { - - private Tomcat server; - private final String resourcePath; - private final String contextPath; - private final int port; - - protected AbstractTomcatServer(final String resourcePath, final String contextPath, int portNumber) { - this.resourcePath = resourcePath; - this.contextPath = contextPath; - this.port = portNumber; - } - - protected void run() { - System.setProperty("java.naming.factory.url", "org.eclipse.jetty.jndi"); - System.setProperty("java.naming.factory.initial", "org.eclipse.jetty.jndi.InitialContextFactory"); - System.setProperty(Container.class.getName(), TomcatContainer.class.getName()); - - server = new Tomcat(); - server.setPort(port); - - try { - final File base = createTemporaryDirectory(); - server.setBaseDir(base.getAbsolutePath()); - - server.getHost().setAppBase(base.getAbsolutePath()); - server.getHost().setAutoDeploy(true); - server.getHost().setDeployOnStartup(true); - - server.addWebapp(contextPath, getClass().getResource(resourcePath).toURI().getPath().toString()); - server.start(); - } catch (final Exception ex) { - ex.printStackTrace(); - fail(ex.getMessage()); - } - } - - protected void configureServer(org.eclipse.jetty.server.Server theserver) throws Exception { - - } - - private static File createTemporaryDirectory() throws IOException { - final File base = File.createTempFile("tmp-", ""); - - if (!base.delete()) { - throw new IOException("Cannot (re)create base folder: " + base.getAbsolutePath()); - } - - if (!base.mkdir()) { - throw new IOException("Cannot create base folder: " + base.getAbsolutePath()); - } - - base.deleteOnExit(); - return base; - } - - public void tearDown() throws Exception { - super.tearDown(); - - if (server != null) { - server.stop(); - server.destroy(); - server = null; - } - } -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java deleted file mode 100644 index 2ebe1c4..0000000 --- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/tomcat/TomcatWarTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.apache.cxf.systest.jaxrs.cdi.tomcat; - -import org.apache.cxf.jaxrs.model.AbstractResourceInfo; -import org.apache.cxf.systest.jaxrs.cdi.AbstractCDITest; -import org.junit.BeforeClass; -import org.junit.Ignore; - -public class TomcatWarTest extends AbstractCDITest { - @Ignore - public static class EmbeddedTomcatServer extends AbstractTomcatServer { - public static final int PORT = allocatePortAsInt(EmbeddedTomcatServer.class); - - public EmbeddedTomcatServer() { - super("/jaxrs_cdi", "/", PORT); - } - } - - @BeforeClass - public static void startServers() throws Exception { - AbstractResourceInfo.clearAllMaps(); - assertTrue("server did not launch correctly", launchServer(EmbeddedTomcatServer.class, true)); - createStaticBus(); - } - - @Override - protected int getPort() { - return EmbeddedTomcatServer.PORT; - } - -} http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/resources/META-INF/beans.xml ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/resources/META-INF/beans.xml b/systests/cdi/src/test/resources/META-INF/beans.xml deleted file mode 100644 index 2f48c57..0000000 --- a/systests/cdi/src/test/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0"?> -<beans xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_1.xsd"> - -</beans> http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/resources/META-INF/services/org.jboss.weld.environment.Container ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/resources/META-INF/services/org.jboss.weld.environment.Container b/systests/cdi/src/test/resources/META-INF/services/org.jboss.weld.environment.Container deleted file mode 100644 index df31f74..0000000 --- a/systests/cdi/src/test/resources/META-INF/services/org.jboss.weld.environment.Container +++ /dev/null @@ -1 +0,0 @@ -org.apache.cxf.systest.jaxrs.cdi.WeldDiscoverableContainer \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/faf46115/systests/cdi/src/test/resources/jaxrs_cdi/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/systests/cdi/src/test/resources/jaxrs_cdi/WEB-INF/web.xml b/systests/cdi/src/test/resources/jaxrs_cdi/WEB-INF/web.xml deleted file mode 100644 index 66cc81a..0000000 --- a/systests/cdi/src/test/resources/jaxrs_cdi/WEB-INF/web.xml +++ /dev/null @@ -1,25 +0,0 @@ -<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - - <listener> - <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> - </listener> - - <servlet> - <servlet-name>CXFServlet</servlet-name> - <display-name>CXF Servlet</display-name> - <servlet-class>org.apache.cxf.cdi.CXFCdiServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet-mapping> - <servlet-name>CXFServlet</servlet-name> - <url-pattern>/rest/*</url-pattern> - </servlet-mapping> - - <resource-env-ref> - <resource-env-ref-name>BeanManager</resource-env-ref-name> - <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager - </resource-env-ref-type> - </resource-env-ref> -</web-app> \ No newline at end of file
