From 1dbf6b7c7667696b8ba2d080c689f5433e1c1618 Mon Sep 17 00:00:00 2001 From: Oliver Lietz Date: Sat, 1 Jun 2024 14:59:55 +0200 Subject: [PATCH] #1087 Drop outdated containers * remove Tomcat (Web) container * remove Web integration tests --- containers/pax-exam-container-tomcat/pom.xml | 105 --------- .../tomcat/FilteringWebappClassLoader.java | 83 ------- .../ops4j/pax/exam/tomcat/PaxExamTomcat.java | 84 ------- .../pax/exam/tomcat/TomcatContextConfig.java | 78 ------- .../pax/exam/tomcat/TomcatHostConfig.java | 45 ---- .../pax/exam/tomcat/TomcatTestContainer.java | 213 ------------------ .../tomcat/TomcatTestContainerFactory.java | 36 --- .../pax/exam/tomcat/TomcatLauncherTest.java | 84 ------- .../exam/tomcat/TomcatTestContainerTest.java | 63 ------ .../src/test/resources/exam.properties | 2 - .../src/test/resources/logback.xml | 40 ---- itest/web/invoker.properties | 1 - itest/web/pom.xml | 207 ----------------- .../regression-web-spring-userprobe/pom.xml | 156 ------------- .../src/main/webapp/WEB-INF/web.xml | 25 -- .../web/spring/AnotherUserProbeTest.java | 87 ------- .../regression/web/spring/UserProbeTest.java | 99 -------- .../src/test/resources/exam.properties | 1 - .../src/test/resources/logback.xml | 43 ---- .../web/src/it/regression-web-spring/pom.xml | 175 -------------- .../src/main/webapp/WEB-INF/web.xml | 25 -- .../regression/web/spring/AuthorTest.java | 62 ----- .../web/spring/TestSpringConfig.java | 61 ----- .../exam/regression/web/spring/TitleTest.java | 49 ---- .../src/test/resources/exam.properties | 1 - .../src/test/resources/logback.xml | 43 ---- itest/web/src/it/regression-web/pom.xml | 162 ------------- .../pax/exam/regression/web/AuthorTest.java | 62 ----- .../web/ParameterizedAuthorTest.java | 75 ------ .../pax/exam/regression/web/TitleTest.java | 49 ---- .../src/test/resources/META-INF/context.xml | 5 - .../src/test/resources/exam.properties | 2 - .../src/test/resources/logback.xml | 44 ---- .../src/test/resources/logging.properties | 2 - pom.xml | 1 - pom/pom.xml | 25 -- 36 files changed, 2295 deletions(-) delete mode 100644 containers/pax-exam-container-tomcat/pom.xml delete mode 100644 containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/FilteringWebappClassLoader.java delete mode 100644 containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/PaxExamTomcat.java delete mode 100644 containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatContextConfig.java delete mode 100644 containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatHostConfig.java delete mode 100644 containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainer.java delete mode 100644 containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerFactory.java delete mode 100644 containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatLauncherTest.java delete mode 100644 containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerTest.java delete mode 100644 containers/pax-exam-container-tomcat/src/test/resources/exam.properties delete mode 100644 containers/pax-exam-container-tomcat/src/test/resources/logback.xml delete mode 100644 itest/web/invoker.properties delete mode 100644 itest/web/pom.xml delete mode 100644 itest/web/src/it/regression-web-spring-userprobe/pom.xml delete mode 100644 itest/web/src/it/regression-web-spring-userprobe/src/main/webapp/WEB-INF/web.xml delete mode 100644 itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/AnotherUserProbeTest.java delete mode 100644 itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/UserProbeTest.java delete mode 100644 itest/web/src/it/regression-web-spring-userprobe/src/test/resources/exam.properties delete mode 100644 itest/web/src/it/regression-web-spring-userprobe/src/test/resources/logback.xml delete mode 100644 itest/web/src/it/regression-web-spring/pom.xml delete mode 100644 itest/web/src/it/regression-web-spring/src/main/webapp/WEB-INF/web.xml delete mode 100644 itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/AuthorTest.java delete mode 100644 itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TestSpringConfig.java delete mode 100644 itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TitleTest.java delete mode 100644 itest/web/src/it/regression-web-spring/src/test/resources/exam.properties delete mode 100644 itest/web/src/it/regression-web-spring/src/test/resources/logback.xml delete mode 100644 itest/web/src/it/regression-web/pom.xml delete mode 100644 itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/AuthorTest.java delete mode 100644 itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/ParameterizedAuthorTest.java delete mode 100644 itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/TitleTest.java delete mode 100644 itest/web/src/it/regression-web/src/test/resources/META-INF/context.xml delete mode 100644 itest/web/src/it/regression-web/src/test/resources/exam.properties delete mode 100644 itest/web/src/it/regression-web/src/test/resources/logback.xml delete mode 100644 itest/web/src/it/regression-web/src/test/resources/logging.properties diff --git a/containers/pax-exam-container-tomcat/pom.xml b/containers/pax-exam-container-tomcat/pom.xml deleted file mode 100644 index 916e7e7f4..000000000 --- a/containers/pax-exam-container-tomcat/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - 4.0.0 - - org.ops4j.pax - exam - 4.13.6-SNAPSHOT - ../../pom - - org.ops4j.pax.exam - pax-exam-container-tomcat - - OPS4J Pax Exam Tomcat Container - - - - - org.kohsuke.metainf-services - metainf-services - provided - - - - org.ops4j.pax.exam - pax-exam - ${project.version} - - - - org.ops4j.pax.exam - pax-exam-spi - ${project.version} - - - - org.ops4j.base - ops4j-base-spi - - - - org.osgi - osgi.core - provided - - - - org.apache.tomcat.embed - tomcat-embed-core - - - - org.apache.tomcat.embed - tomcat-embed-jasper - - - - org.apache.tomcat - tomcat-dbcp - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - test - - - - org.ops4j.pax.url - pax-url-aether - test - - - - junit - junit - test - - - - org.jboss.weld.servlet - weld-servlet-core - test - - - - org.jboss.weld - weld-core-impl - test - - - - ch.qos.logback - logback-classic - test - - - - ch.qos.logback - logback-core - test - - - - - - \ No newline at end of file diff --git a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/FilteringWebappClassLoader.java b/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/FilteringWebappClassLoader.java deleted file mode 100644 index e359298f8..000000000 --- a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/FilteringWebappClassLoader.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2017 OPS4J 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.ops4j.pax.exam.tomcat; - -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; -import java.util.List; - -import org.apache.catalina.loader.WebappClassLoader; - -/** - * @author Harald Wellmann - * - */ -public class FilteringWebappClassLoader extends WebappClassLoader { - - - public FilteringWebappClassLoader() { - } - - public FilteringWebappClassLoader(ClassLoader cl) { - super(); - } - - - - @Override - public URL[] getURLs() { - URL[] urls = super.getURLs(); - List filteredUrls = new ArrayList<>(); - for (URL url : urls) { - if (!url.toString().contains("/target/")) { - filteredUrls.add(url); - } - } - return filteredUrls.toArray(new URL[filteredUrls.size()]); - } - - @Override - public URL getResource(String name) { - URL url = super.getResource(name); - if (name.contains("/beans.xml")) { - if (url != null && !url.toString().contains("Pax-Exam-Probe")) { - return null; - } - } - return url; - } - - @Override - public Enumeration getResources(String name) throws IOException { - Enumeration e = super.getResources(name); - if (e == null || !name.contains("/beans.xml")) { - return e; - } - - List urls = new ArrayList<>(); - for (URL url : Collections.list(e)) { - if (url.toString().contains("Pax-Exam-Probe")) { - urls.add(url); - } - } - return Collections.enumeration(urls); - } -} diff --git a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/PaxExamTomcat.java b/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/PaxExamTomcat.java deleted file mode 100644 index 7ec212c1f..000000000 --- a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/PaxExamTomcat.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2014 Harald Wellmann - * - * 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.ops4j.pax.exam.tomcat; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; - -import org.apache.catalina.Context; -import org.apache.catalina.Host; -import org.apache.catalina.core.StandardContext; -import org.apache.catalina.startup.ContextConfig; -import org.apache.catalina.startup.Tomcat; -import org.ops4j.pax.exam.TestContainerException; - - -public class PaxExamTomcat extends Tomcat { - - - private static final String[] CONTEXT_XML = { - "src/test/resources/META-INF/context.xml", - "src/main/webapp/META-INF/context.xml" - }; - - @Override - public Context addWebapp(Host host, String contextPath, String docBase) { - - Context ctx = new StandardContext(); - ctx.setPath(contextPath); - ctx.setDocBase(docBase); - - ctx.addLifecycleListener(new DefaultWebXmlListener()); - URL configFile = getWebappConfigFile(docBase, contextPath); - ctx.setConfigFile(configFile); - - ContextConfig ctxCfg = new TomcatContextConfig(); - ctx.addLifecycleListener(ctxCfg); - - if (host == null) { - getHost().addChild(ctx); - } - else { - host.addChild(ctx); - } - - return ctx; - } - - @Override - protected URL getWebappConfigFile(String path, String contextName) { - URL configFile = super.getWebappConfigFile(path, contextName); - if (configFile == null) { - for (String fileName : CONTEXT_XML) { - File contextXml = new File(fileName); - if (contextXml.exists()) { - try { - configFile = contextXml.toURI().toURL(); - break; - } - catch (MalformedURLException exc) { - throw new TestContainerException(exc); - } - } - } - - } - return configFile; - } -} diff --git a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatContextConfig.java b/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatContextConfig.java deleted file mode 100644 index b2c71eb20..000000000 --- a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatContextConfig.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.tomcat; - -import static org.ops4j.pax.exam.spi.container.ContainerConstants.BEAN_MANAGER_NAME; -import static org.ops4j.pax.exam.spi.container.ContainerConstants.BEAN_MANAGER_TYPE; -import static org.ops4j.pax.exam.spi.container.ContainerConstants.OWB_MANAGER_FACTORY; -import static org.ops4j.pax.exam.spi.container.ContainerConstants.OWB_SERVLET_LISTENER; -import static org.ops4j.pax.exam.spi.container.ContainerConstants.WELD_MANAGER_FACTORY; -import static org.ops4j.pax.exam.spi.container.ContainerConstants.WELD_SERVLET_LISTENER; - -import org.apache.catalina.Context; -import org.apache.catalina.loader.WebappLoader; -import org.apache.catalina.startup.Constants; -import org.apache.catalina.startup.ContextConfig; -import org.apache.tomcat.util.descriptor.web.ContextResource; -import org.apache.tomcat.util.descriptor.web.ContextResourceEnvRef; -import org.ops4j.pax.exam.ConfigurationManager; - -public class TomcatContextConfig extends ContextConfig { - - private ConfigurationManager cm; - - public TomcatContextConfig() { - this.cm = new ConfigurationManager(); - setDefaultWebXml(Constants.NoDefaultWebXml); - } - - @Override - protected synchronized void beforeStart() { - super.beforeStart(); - String listenerName = cm.getProperty("pax.exam.tomcat.listener", ""); - if (listenerName.equals("weld")) { - registerBeanManager(context, WELD_MANAGER_FACTORY, WELD_SERVLET_LISTENER); - } - else if (listenerName.equals("openwebbeans")) { - registerBeanManager(context, OWB_MANAGER_FACTORY, OWB_SERVLET_LISTENER); - } - WebappLoader loader = new WebappLoader(); - loader.setLoaderClass(FilteringWebappClassLoader.class.getName()); - context.setLoader(loader); - } - - private void registerBeanManager(Context appContext, String jndiObjectFactory, - String servletListener) { - ContextResource resource = new ContextResource(); - resource.setAuth("Container"); - resource.setName(BEAN_MANAGER_NAME); - resource.setType(BEAN_MANAGER_TYPE); - resource.setProperty("factory", jndiObjectFactory); - - appContext.getNamingResources().addResource(resource); - - ContextResourceEnvRef resourceRef = new ContextResourceEnvRef(); - resourceRef.setName(BEAN_MANAGER_NAME); - resourceRef.setType(BEAN_MANAGER_TYPE); - - appContext.getNamingResources().addResourceEnvRef(resourceRef); - - appContext.addApplicationListener(servletListener); - } - -} diff --git a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatHostConfig.java b/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatHostConfig.java deleted file mode 100644 index 4cf50286a..000000000 --- a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatHostConfig.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.tomcat; - -import java.io.File; - -import org.apache.catalina.startup.HostConfig; -import org.apache.catalina.util.ContextName; - -public class TomcatHostConfig extends HostConfig { - - @Override - public void deployWAR(ContextName cn, File war) { - setCopyXML(true); - super.deployWAR(cn, war); - addServiced(cn.getName()); - } - - @Override - protected void deployDescriptor(ContextName cn, File contextXml) { - super.deployDescriptor(cn, contextXml); - addServiced(cn.getName()); - } - - @Override - public void unmanageApp(String contextName) { - super.unmanageApp(contextName); - removeServiced(contextName); - } -} diff --git a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainer.java b/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainer.java deleted file mode 100644 index d00d07cd4..000000000 --- a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainer.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.tomcat; - -import static org.ops4j.pax.exam.spi.container.ContainerConstants.EXAM_APPLICATION_NAME; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Stack; - -import org.apache.catalina.Container; -import org.apache.catalina.Host; -import org.apache.catalina.LifecycleException; -import org.apache.catalina.connector.Connector; -import org.apache.catalina.startup.Tomcat; -import org.ops4j.io.StreamUtils; -import org.ops4j.pax.exam.ExamSystem; -import org.ops4j.pax.exam.ProbeInvoker; -import org.ops4j.pax.exam.ProbeInvokerFactory; -import org.ops4j.pax.exam.TestAddress; -import org.ops4j.pax.exam.TestContainer; -import org.ops4j.pax.exam.TestContainerException; -import org.ops4j.pax.exam.TestDirectory; -import org.ops4j.pax.exam.TestInstantiationInstruction; -import org.ops4j.pax.exam.options.UrlDeploymentOption; -import org.ops4j.pax.exam.options.WarProbeOption; -import org.ops4j.spi.ServiceProviderFinder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Harald Wellmann - * @since 3.0.0 - */ -public class TomcatTestContainer implements TestContainer { - - private static final Logger LOG = LoggerFactory.getLogger(TomcatTestContainer.class); - - private Stack deployed = new Stack(); - - private String probe; - - private ExamSystem system; - - private TestDirectory testDirectory; - - private Tomcat tomcat; - - private TomcatHostConfig hostConfig; - - private File webappDir; - - private File xmlBase; - - public TomcatTestContainer(ExamSystem system) { - this.system = system; - this.testDirectory = TestDirectory.getInstance(); - } - - public synchronized void call(TestAddress address) { - TestInstantiationInstruction instruction = testDirectory.lookup(address); - ProbeInvokerFactory probeInvokerFactory = ServiceProviderFinder - .loadUniqueServiceProvider(ProbeInvokerFactory.class); - ProbeInvoker invoker = probeInvokerFactory.createProbeInvoker(null, instruction.toString()); - invoker.call(address.arguments()); - } - - public synchronized long install(String location, InputStream stream) { - // just make sure we don't get an "option not recognized" warning - system.getOptions(WarProbeOption.class); - deployModule(EXAM_APPLICATION_NAME, stream); - return -1; - } - - public synchronized long install(InputStream stream) { - return install("local", stream); - } - - public void deployModules() { - UrlDeploymentOption[] deploymentOptions = system.getOptions(UrlDeploymentOption.class); - int numModules = 0; - for (UrlDeploymentOption option : deploymentOptions) { - numModules++; - if (option.getName() == null) { - option.name("app" + numModules); - } - deployModule(option); - } - } - - private void deployModule(UrlDeploymentOption option) { - try { - URL applUrl = new URL(option.getURL()); - deployModule(option.getName(), applUrl.openStream()); - } - catch (MalformedURLException exc) { - throw new TestContainerException("Problem deploying " + option, exc); - } - catch (IOException exc) { - throw new TestContainerException("Problem deploying " + option, exc); - } - } - - private void deployModule(String applicationName, InputStream stream) { - try { - File warFile = new File(webappDir, applicationName + ".war"); - StreamUtils.copyStream(stream, new FileOutputStream(warFile), true); - tomcat.addWebapp("/" + applicationName, warFile.getAbsolutePath()); - deployed.push(applicationName); - } - catch (IOException exc) { - throw new TestContainerException("Problem deploying " + applicationName, exc); - } - } - - public void cleanup() { - undeployModules(); - LOG.info("stopping Tomcat"); - try { - tomcat.stop(); - tomcat.destroy(); - } - catch (LifecycleException exc) { - throw new TestContainerException(exc); - } - } - - private void undeployModules() { - Host host = tomcat.getHost(); - while (!deployed.isEmpty()) { - String applicationName = deployed.pop(); - Container child = host.findChild("/" + applicationName); - tomcat.getHost().removeChild(child); - } - } - - public TestContainer start() { - LOG.info("starting Tomcat"); - - File tempDir = system.getTempFolder(); - webappDir = new File(tempDir, "webapps"); - webappDir.mkdirs(); - - tomcat = new PaxExamTomcat(); - tomcat.setBaseDir(tempDir.getPath()); - tomcat.enableNaming(); - - Host host = tomcat.getHost(); - xmlBase = new File(tempDir, "conf"); - xmlBase.mkdirs(); - host.setXmlBase(xmlBase.getAbsolutePath()); - - try { - int httpPort = 9080; - Connector connector = tomcat.getConnector(); - connector.setPort(httpPort); - tomcat.start(); - testDirectory.setAccessPoint(new URI("http://localhost:" + httpPort - + "/Pax-Exam-Probe/")); - } - catch (URISyntaxException exc) { - new TestContainerException(exc); - } - catch (LifecycleException exc) { - new TestContainerException(exc); - } - return this; - } - - public TestContainer stop() { - cleanup(); - system.clear(); - return this; - } - - @Override - public String toString() { - return "Tomcat"; - } - - @Override - public long installProbe(InputStream stream) { - install("local", stream); - probe = deployed.pop(); - return -1; - } - - @Override - public void uninstallProbe() { - hostConfig.unmanageApp("/" + probe); - } -} diff --git a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerFactory.java b/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerFactory.java deleted file mode 100644 index ab0c3fd03..000000000 --- a/containers/pax-exam-container-tomcat/src/main/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.tomcat; - -import org.kohsuke.MetaInfServices; -import org.ops4j.pax.exam.ExamSystem; -import org.ops4j.pax.exam.TestContainer; -import org.ops4j.pax.exam.TestContainerFactory; - -/** - * @author Harald Wellmann - * @since 3.0.0 - */ -@MetaInfServices -public class TomcatTestContainerFactory implements TestContainerFactory { - - public TestContainer[] create(ExamSystem system) { - TomcatTestContainer container = new TomcatTestContainer(system); - return new TestContainer[] { container }; - } -} diff --git a/containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatLauncherTest.java b/containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatLauncherTest.java deleted file mode 100644 index 4bbb47c88..000000000 --- a/containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatLauncherTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.tomcat; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.nio.file.Files; - -import org.apache.catalina.Host; -import org.apache.catalina.LifecycleException; -import org.apache.catalina.connector.Connector; -import org.apache.catalina.startup.Tomcat; -import org.apache.catalina.util.ContextName; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.ops4j.io.FileUtils; -import org.ops4j.io.StreamUtils; - - -public class TomcatLauncherTest { - - private File tempDir; - - @Before - public void setUp() throws IOException { - tempDir = Files.createTempDirectory("exam").toFile(); - } - - @After - public void tearDown() { - FileUtils.delete(tempDir); - } - - @Test - public void launchTomcat() throws InterruptedException, IOException, LifecycleException { - System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url"); - String tempDir = Files.createTempDirectory("exam").toFile().getAbsolutePath(); - File baseDir = new File(tempDir, "tomcat"); - File webappDir = new File(baseDir, "webapps"); - webappDir.mkdirs(); - Tomcat tomcat = new Tomcat(); - tomcat.setBaseDir(baseDir.getPath()); - tomcat.setPort(9080); - tomcat.enableNaming(); - Connector connector = tomcat.getConnector(); - // see https://issues.apache.org/bugzilla/show_bug.cgi?id=50360 - connector.setProperty("bindOnInit", "false"); - Host host = tomcat.getHost(); - host.setDeployOnStartup(false); - host.setAutoDeploy(false); - host.setConfigClass(TomcatContextConfig.class.getName()); - TomcatHostConfig hostConfig = new TomcatHostConfig(); - host.addLifecycleListener(hostConfig); - tomcat.start(); - - File warTarget = new File(webappDir, "/wicket-examples.war"); - InputStream is = new URL("mvn:org.apache.wicket/wicket-examples/1.5.3/war").openStream(); - FileOutputStream os = new FileOutputStream(warTarget); - StreamUtils.copyStream(is, os, true); - - hostConfig.deployWAR(new ContextName("/wicket-examples", true), warTarget); - hostConfig.unmanageApp("/wicket-examples"); - tomcat.stop(); - } -} diff --git a/containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerTest.java b/containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerTest.java deleted file mode 100644 index abff2ec34..000000000 --- a/containers/pax-exam-container-tomcat/src/test/java/org/ops4j/pax/exam/tomcat/TomcatTestContainerTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.tomcat; - -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.war; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import org.junit.Test; -import org.ops4j.pax.exam.ExamSystem; -import org.ops4j.pax.exam.spi.DefaultExamSystem; - -public class TomcatTestContainerTest { - - @Test - public void launchTomcat() throws IOException { - ExamSystem system = DefaultExamSystem.create(options()); - TomcatTestContainer container = new TomcatTestContainer(system); - container.start(); - container.stop(); - } - - @Test - public void deployWebapp() throws IOException { - System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url"); - ExamSystem system = DefaultExamSystem.create(options(war( - "mvn:org.apache.wicket/wicket-examples/1.5.3/war").name("wicket-examples"))); - TomcatTestContainer container = new TomcatTestContainer(system); - container.start(); - container.deployModules(); - container.stop(); - } - - @Test - public void deployWebappFromStream() throws IOException { - System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url"); - ExamSystem system = DefaultExamSystem.create(options()); - TomcatTestContainer container = new TomcatTestContainer(system); - container.start(); - InputStream is = new URL("mvn:org.apache.wicket/wicket-examples/1.5.3/war").openStream(); - container.install(is); - is.close(); - container.stop(); - } -} diff --git a/containers/pax-exam-container-tomcat/src/test/resources/exam.properties b/containers/pax-exam-container-tomcat/src/test/resources/exam.properties deleted file mode 100644 index bb34e06c5..000000000 --- a/containers/pax-exam-container-tomcat/src/test/resources/exam.properties +++ /dev/null @@ -1,2 +0,0 @@ -pax.exam.system = javaee -pax.exam.tomcat.listener = weld diff --git a/containers/pax-exam-container-tomcat/src/test/resources/logback.xml b/containers/pax-exam-container-tomcat/src/test/resources/logback.xml deleted file mode 100644 index 4d8e1730b..000000000 --- a/containers/pax-exam-container-tomcat/src/test/resources/logback.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - target/test.log - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - \ No newline at end of file diff --git a/itest/web/invoker.properties b/itest/web/invoker.properties deleted file mode 100644 index d5a1730bb..000000000 --- a/itest/web/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals = clean test diff --git a/itest/web/pom.xml b/itest/web/pom.xml deleted file mode 100644 index 526f231ba..000000000 --- a/itest/web/pom.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - - - 4.0.0 - - - org.ops4j.pax - exam - 4.13.6-SNAPSHOT - ../../pom - - - org.ops4j.pax.exam.itest - exam-itest-web - pom - - OPS4J Pax Exam Web Container Integration Tests - - - - - matrix - - - - invoker - - true - - - - - org.apache.maven.plugins - maven-invoker-plugin - - true - - - - - tomcat-openwebbeans - - run - - - - tomcat - openwebbeans-web - - ${project.build.directory}/tomcat-openwebbeans - - - - - tomcat-weld - - run - - - - tomcat - weld-web - - ${project.build.directory}/tomcat-weld - - - - - - - - - - - - - - - tomcat - - true - - - tomcat - - - - org.ops4j.pax.exam - pax-exam-container-tomcat - ${project.version} - test - - - - - - weld-web - - - false - - - - weld - - - - src/it/regression-web - - - - - - org.jboss.weld.servlet - weld-servlet-core - test - - - - org.jboss.weld - weld-core-impl - test - - - - - - - openwebbeans-web - - - false - - - - openwebbeans - - - - src/it/regression-web - - - - - - org.apache.openwebbeans - openwebbeans-impl - test - - - - org.apache.openwebbeans - openwebbeans-spi - test - - - - org.apache.openwebbeans - openwebbeans-resource - test - - - - org.apache.openwebbeans - openwebbeans-web - test - - - - jakarta.inject - jakarta.inject-api - test - - - - - - - - spring-web - - - false - - - - src/it/regression-web-spring - src/it/regression-web-spring-userprobe - - - - - jakarta.inject - jakarta.inject-api - - - - - - - - - - - diff --git a/itest/web/src/it/regression-web-spring-userprobe/pom.xml b/itest/web/src/it/regression-web-spring-userprobe/pom.xml deleted file mode 100644 index 3d4fcea3a..000000000 --- a/itest/web/src/it/regression-web-spring-userprobe/pom.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - 4.0.0 - - - org.ops4j.pax.exam.itest - exam-itest-web - 4.13.6-SNAPSHOT - ../../.. - - - org.ops4j.pax.exam - regression-web-spring-userprobe - jar - - OPS4J Pax Exam Web-Only Container + Spring Regression Tests - - - - - jakarta.inject - jakarta.inject-api - test - - - - org.ops4j.pax.exam - pax-exam-invoker-jaxrs2 - ${project.version} - test - - - - org.jboss.resteasy - resteasy-client - test - - - - org.ops4j.pax.exam.samples - pax-exam-sample6-service - ${project.version} - test - - - - org.ops4j.pax.exam - pax-exam-junit4 - ${project.version} - test - - - - org.ops4j.pax.exam - pax-exam-link-mvn - ${project.version} - test - - - - - ch.qos.logback - logback-core - test - - - - ch.qos.logback - logback-classic - test - - - - org.slf4j - jul-to-slf4j - test - - - - org.slf4j - slf4j-api - test - - - - javax.transaction - javax.transaction-api - 1.2 - test - - - - javax.ejb - javax.ejb-api - 3.2 - test - - - - org.hibernate - hibernate-entitymanager - test - - - - org.apache.derby - derby - test - - - - org.osgi - osgi.core - test - - - - - - - - src/test/resources - true - - - - - - org.apache.servicemix.tooling - depends-maven-plugin - - - generate-depends-file - generate-resources - - generate-depends-file - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - none - - - - - - diff --git a/itest/web/src/it/regression-web-spring-userprobe/src/main/webapp/WEB-INF/web.xml b/itest/web/src/it/regression-web-spring-userprobe/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index d9f466f75..000000000 --- a/itest/web/src/it/regression-web-spring-userprobe/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - index.jsp - - - - - contextConfigLocation - org.ops4j.pax.exam.regression.web.spring.TestSpringConfig - - - - contextClass - org.springframework.web.context.support.AnnotationConfigWebApplicationContext - - - - org.springframework.web.context.ContextLoaderListener - - - \ No newline at end of file diff --git a/itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/AnotherUserProbeTest.java b/itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/AnotherUserProbeTest.java deleted file mode 100644 index f06a93ed5..000000000 --- a/itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/AnotherUserProbeTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2015 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web.spring; - -import static org.junit.Assert.assertEquals; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.warProbe; -import static org.ops4j.pax.exam.Info.getOps4jBaseVersion; -import static org.ops4j.pax.exam.Info.getPaxExamVersion; - -import java.util.List; - -import javax.inject.Inject; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.sample6.model.Book; -import org.ops4j.pax.exam.sample6.service.LibraryService; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class AnotherUserProbeTest { - - @Inject - private LibraryService service; - - @Configuration - public Option[] createConfiguration() { - System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url"); - return options( - warProbe() - .library("target/test-classes") - .overlay( - maven("org.ops4j.pax.exam.samples", "pax-exam-sample6-web", getPaxExamVersion()) - .type("war")) - .library(maven("org.ops4j.pax.exam", "pax-exam-servlet-bridge", getPaxExamVersion())) - .library(maven("org.ops4j.pax.exam", "pax-exam-spring", getPaxExamVersion())) - .library(maven("org.ops4j.pax.exam", "pax-exam", getPaxExamVersion())) - .library(maven("org.ops4j.base", "ops4j-base-spi", getOps4jBaseVersion())) - .library(maven().groupId("junit").artifactId("junit").versionAsInProject()) - ); - } - - @Before - public void setUp() { - service.fillLibrary(); - } - - @Test - public void byAuthor() { - List books = service.findBooksByAuthor("Mann"); - assertEquals(1, books.size()); - - Book book = books.get(0); - assertEquals("Buddenbrooks", book.getTitle()); - } - - @Test - public void numAuthors() { - assertEquals(2, service.getNumAuthors()); - service.createAuthor("Theodor", "Storm"); - assertEquals(3, service.getNumAuthors()); - } - -} diff --git a/itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/UserProbeTest.java b/itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/UserProbeTest.java deleted file mode 100644 index 17531c63a..000000000 --- a/itest/web/src/it/regression-web-spring-userprobe/src/test/java/org/ops4j/pax/exam/regression/web/spring/UserProbeTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web.spring; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertThat; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.CoreOptions.options; -import static org.ops4j.pax.exam.CoreOptions.warProbe; -import static org.ops4j.pax.exam.Info.getOps4jBaseVersion; -import static org.ops4j.pax.exam.Info.getPaxExamVersion; - -import javax.inject.Inject; - -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.sample6.service.LibraryService; -import org.ops4j.pax.exam.spi.container.ContainerConstants; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class UserProbeTest { - - @Inject - private LibraryService service; - - @Configuration - public Option[] createConfiguration() { - System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url"); - return options( - warProbe() - .library("target/test-classes") - .overlay( - maven("org.ops4j.pax.exam.samples", "pax-exam-sample6-web", getPaxExamVersion()) - .type("war")) - .library(maven("org.ops4j.pax.exam", "pax-exam-servlet-bridge", getPaxExamVersion())) - .library(maven("org.ops4j.pax.exam", "pax-exam-spring", getPaxExamVersion())) - .library(maven("org.ops4j.pax.exam", "pax-exam", getPaxExamVersion())) - .library(maven("org.ops4j.base", "ops4j-base-spi", getOps4jBaseVersion())) - .library(maven().groupId("org.hamcrest").artifactId("hamcrest-core").versionAsInProject()) - .library(maven().groupId("junit").artifactId("junit").versionAsInProject()) - ); - } - - @Before - public void setUp() { - service.fillLibrary(); - } - - /** - * Gets books.html which contains the list of books in a library. - *

- * The html content is based on the defined books.jsp in the sample web module. - */ - @Test - public void testGetBooksHttpContent() throws Exception { - - HttpGet httpGet = new HttpGet("http://localhost:9080" + ContainerConstants.EXAM_CONTEXT_ROOT + "/books.html"); - - try (CloseableHttpClient httpclient = HttpClients.createDefault(); - CloseableHttpResponse response = httpclient.execute(httpGet)) { - assertThat("Status code must be 200 - OK", - response.getStatusLine().getStatusCode(), is(200)); - - // verify html content - String content = EntityUtils.toString(response.getEntity()); - assertThat(content, is(notNullValue())); - // TODO Why does CoreMatchers.containsString() not work? - assertThat(content.contains("Steinbeck"), is(true)); - } - } -} diff --git a/itest/web/src/it/regression-web-spring-userprobe/src/test/resources/exam.properties b/itest/web/src/it/regression-web-spring-userprobe/src/test/resources/exam.properties deleted file mode 100644 index 5839663a3..000000000 --- a/itest/web/src/it/regression-web-spring-userprobe/src/test/resources/exam.properties +++ /dev/null @@ -1 +0,0 @@ -pax.exam.system = javaee diff --git a/itest/web/src/it/regression-web-spring-userprobe/src/test/resources/logback.xml b/itest/web/src/it/regression-web-spring-userprobe/src/test/resources/logback.xml deleted file mode 100644 index 6803a64b9..000000000 --- a/itest/web/src/it/regression-web-spring-userprobe/src/test/resources/logback.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - target/test.log - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - \ No newline at end of file diff --git a/itest/web/src/it/regression-web-spring/pom.xml b/itest/web/src/it/regression-web-spring/pom.xml deleted file mode 100644 index d03ad4220..000000000 --- a/itest/web/src/it/regression-web-spring/pom.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - 4.0.0 - - - org.ops4j.pax.exam.itest - exam-itest-web - 4.13.6-SNAPSHOT - ../../.. - - - org.ops4j.pax.exam - regression-web-spring - jar - - OPS4J Pax Exam Web-Only Container + Spring Regression Tests - - - - - jakarta.inject - jakarta.inject-api - test - - - - org.ops4j.pax.exam - pax-exam-invoker-jaxrs2 - ${project.version} - test - - - - org.jboss.resteasy - resteasy-client - test - - - - org.ops4j.pax.exam - pax-exam-servlet-bridge - ${project.version} - test - - - - org.ops4j.pax.exam.samples - pax-exam-sample6-service - ${project.version} - test - - - - org.ops4j.pax.exam - pax-exam-junit4 - ${project.version} - test - - - - org.ops4j.pax.exam - pax-exam-spring - ${project.version} - test - - - - org.ops4j.pax.exam - pax-exam-link-mvn - ${project.version} - test - - - - - ch.qos.logback - logback-core - test - - - - ch.qos.logback - logback-classic - test - - - - org.slf4j - jul-to-slf4j - test - - - - org.slf4j - jcl-over-slf4j - test - - - - org.slf4j - slf4j-api - test - - - - org.slf4j - slf4j-ext - test - - - - javax.transaction - javax.transaction-api - 1.2 - test - - - - javax.ejb - javax.ejb-api - 3.2 - test - - - - org.hibernate - hibernate-entitymanager - test - - - - org.apache.derby - derby - test - - - - org.osgi - osgi.core - test - - - - org.springframework - spring-web - test - - - - - - - - - src/test/resources - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - none - - - - - - diff --git a/itest/web/src/it/regression-web-spring/src/main/webapp/WEB-INF/web.xml b/itest/web/src/it/regression-web-spring/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index d9f466f75..000000000 --- a/itest/web/src/it/regression-web-spring/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - index.jsp - - - - - contextConfigLocation - org.ops4j.pax.exam.regression.web.spring.TestSpringConfig - - - - contextClass - org.springframework.web.context.support.AnnotationConfigWebApplicationContext - - - - org.springframework.web.context.ContextLoaderListener - - - \ No newline at end of file diff --git a/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/AuthorTest.java b/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/AuthorTest.java deleted file mode 100644 index 836ed6986..000000000 --- a/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/AuthorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2010 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web.spring; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import javax.inject.Inject; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.sample6.model.Book; -import org.ops4j.pax.exam.sample6.service.LibraryService; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerSuite; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerSuite.class) -public class AuthorTest { - - @Inject - private LibraryService service; - - @Before - public void setUp() { - service.fillLibrary(); - } - - @Test - public void byAuthor() { - List books = service.findBooksByAuthor("Mann"); - assertEquals(1, books.size()); - - Book book = books.get(0); - assertEquals("Buddenbrooks", book.getTitle()); - } - - @Test - public void numAuthors() { - assertEquals(2, service.getNumAuthors()); - service.createAuthor("Theodor", "Storm"); - assertEquals(3, service.getNumAuthors()); - } -} diff --git a/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TestSpringConfig.java b/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TestSpringConfig.java deleted file mode 100644 index 37f619f58..000000000 --- a/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TestSpringConfig.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web.spring; - -import javax.persistence.EntityManagerFactory; -import javax.sql.DataSource; - -import org.apache.derby.jdbc.EmbeddedDataSource; -import org.ops4j.pax.exam.sample6.service.LibraryService; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.orm.jpa.JpaTransactionManager; -import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; -import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -@Configuration -@EnableTransactionManagement(proxyTargetClass = true) -public class TestSpringConfig { - - @Bean - public DataSource dataSource() { - EmbeddedDataSource dataSource = new EmbeddedDataSource(); - dataSource.setDatabaseName("memory:library"); - dataSource.setCreateDatabase("create"); - return dataSource; - } - - @Bean - public PlatformTransactionManager transactionManager() { - return new JpaTransactionManager(entityManagerFactory()); - } - - @Bean - public EntityManagerFactory entityManagerFactory() { - LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean(); - bean.setDataSource(dataSource()); - bean.setPersistenceXmlLocation("classpath:META-INF/persistence.xml"); - bean.afterPropertiesSet(); - return bean.getObject(); - } - - @Bean - public LibraryService libraryService() { - return new LibraryService(); - } -} diff --git a/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TitleTest.java b/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TitleTest.java deleted file mode 100644 index ccbcf94b0..000000000 --- a/itest/web/src/it/regression-web-spring/src/test/java/org/ops4j/pax/exam/regression/web/spring/TitleTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web.spring; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import javax.inject.Inject; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.sample6.model.Book; -import org.ops4j.pax.exam.sample6.service.LibraryService; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerSuite; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerSuite.class) -public class TitleTest { - - @Inject - private LibraryService service; - - @Test - public void byTitle() { - service.fillLibrary(); - List books = service.findBooksByTitle("East of Eden"); - assertEquals(1, books.size()); - - Book book = books.get(0); - assertEquals("Steinbeck", book.getAuthor().getLastName()); - } -} diff --git a/itest/web/src/it/regression-web-spring/src/test/resources/exam.properties b/itest/web/src/it/regression-web-spring/src/test/resources/exam.properties deleted file mode 100644 index 5839663a3..000000000 --- a/itest/web/src/it/regression-web-spring/src/test/resources/exam.properties +++ /dev/null @@ -1 +0,0 @@ -pax.exam.system = javaee diff --git a/itest/web/src/it/regression-web-spring/src/test/resources/logback.xml b/itest/web/src/it/regression-web-spring/src/test/resources/logback.xml deleted file mode 100644 index 6803a64b9..000000000 --- a/itest/web/src/it/regression-web-spring/src/test/resources/logback.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - target/test.log - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - \ No newline at end of file diff --git a/itest/web/src/it/regression-web/pom.xml b/itest/web/src/it/regression-web/pom.xml deleted file mode 100644 index 6cfdb954f..000000000 --- a/itest/web/src/it/regression-web/pom.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - 4.0.0 - - - org.ops4j.pax.exam.itest - exam-itest-web - 4.13.6-SNAPSHOT - ../../.. - - - org.ops4j.pax.exam - regression-web - jar - - OPS4J Pax Exam Web-Only Container Regression Tests - - - - - org.ops4j.pax.exam - pax-exam-invoker-jaxrs2 - ${project.version} - test - - - - org.jboss.resteasy - resteasy-client - test - - - - org.ops4j.pax.exam - pax-exam-servlet-bridge - ${project.version} - test - - - - org.ops4j.pax.exam.samples - pax-exam-sample4-service - ${project.version} - test - - - - org.ops4j.pax.exam - pax-exam-junit4 - ${project.version} - test - - - - org.ops4j.pax.exam - pax-exam-cdi - ${project.version} - test - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - test - - - - jakarta.inject - jakarta.inject-api - test - - - - org.ops4j.pax.exam - pax-exam-link-assembly - ${project.version} - test - - - - - ch.qos.logback - logback-core - test - - - - ch.qos.logback - logback-classic - test - - - - org.slf4j - jul-to-slf4j - test - - - - org.slf4j - jcl-over-slf4j - test - - - - org.slf4j - slf4j-api - test - - - - org.slf4j - slf4j-ext - test - - - - org.hibernate - hibernate-entitymanager - test - - - - org.glassfish - javax.el - 3.0.0 - test - - - - org.apache.derby - derby - test - - - - - - - - - src/test/resources - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - none - - - - - - diff --git a/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/AuthorTest.java b/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/AuthorTest.java deleted file mode 100644 index 4590f7d45..000000000 --- a/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/AuthorTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2010 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import javax.inject.Inject; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.sample4.model.Book; -import org.ops4j.pax.exam.sample4.service.LibraryService; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerSuite; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerSuite.class) -public class AuthorTest { - - @Inject - private LibraryService service; - - @Before - public void setUp() { - service.fillLibrary(); - } - - @Test - public void byAuthor() { - List books = service.findBooksByAuthor("Mann"); - assertEquals(1, books.size()); - - Book book = books.get(0); - assertEquals("Buddenbrooks", book.getTitle()); - } - - @Test - public void numAuthors() { - assertEquals(2, service.getNumAuthors()); - service.createAuthor("Theodor", "Storm"); - assertEquals(3, service.getNumAuthors()); - } -} diff --git a/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/ParameterizedAuthorTest.java b/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/ParameterizedAuthorTest.java deleted file mode 100644 index dcdb178a0..000000000 --- a/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/ParameterizedAuthorTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2013 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web; - -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.List; - -import javax.inject.Inject; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized.Parameters; -import org.ops4j.pax.exam.junit.PaxExamParameterized; -import org.ops4j.pax.exam.sample4.model.Book; -import org.ops4j.pax.exam.sample4.service.LibraryService; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerSuite; - -@RunWith(PaxExamParameterized.class) -@ExamReactorStrategy(PerSuite.class) -public class ParameterizedAuthorTest { - - @Inject - private LibraryService service; - - private String authorLastName; - private String bookTitle; - - - public ParameterizedAuthorTest(String authorLastName, String bookTitle) { - this.authorLastName = authorLastName; - this.bookTitle = bookTitle; - } - - - @Parameters - public static List getParameters() { - return Arrays.asList(new Object[][] { - {"Mann", "Buddenbrooks"}, - {"Steinbeck", "East of Eden"} - }); - } - - @Before - public void setUp() { - service.fillLibrary(); - } - - @Test - public void byAuthor() { - List books = service.findBooksByAuthor(authorLastName); - assertEquals(1, books.size()); - - Book book = books.get(0); - assertEquals(bookTitle, book.getTitle()); - } -} diff --git a/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/TitleTest.java b/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/TitleTest.java deleted file mode 100644 index cfe502d9e..000000000 --- a/itest/web/src/it/regression-web/src/test/java/org/ops4j/pax/exam/regression/web/TitleTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012 Harald Wellmann - * - * 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.ops4j.pax.exam.regression.web; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import javax.inject.Inject; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.sample4.model.Book; -import org.ops4j.pax.exam.sample4.service.LibraryService; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerSuite; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerSuite.class) -public class TitleTest { - - @Inject - private LibraryService service; - - @Test - public void byTitle() { - service.fillLibrary(); - List books = service.findBooksByTitle("East of Eden"); - assertEquals(1, books.size()); - - Book book = books.get(0); - assertEquals("Steinbeck", book.getAuthor().getLastName()); - } -} diff --git a/itest/web/src/it/regression-web/src/test/resources/META-INF/context.xml b/itest/web/src/it/regression-web/src/test/resources/META-INF/context.xml deleted file mode 100644 index ec1fb7a1c..000000000 --- a/itest/web/src/it/regression-web/src/test/resources/META-INF/context.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/itest/web/src/it/regression-web/src/test/resources/exam.properties b/itest/web/src/it/regression-web/src/test/resources/exam.properties deleted file mode 100644 index a340a12a3..000000000 --- a/itest/web/src/it/regression-web/src/test/resources/exam.properties +++ /dev/null @@ -1,2 +0,0 @@ -pax.exam.system = javaee -pax.exam.tomcat.listener = ${pax.exam.cdi.provider} diff --git a/itest/web/src/it/regression-web/src/test/resources/logback.xml b/itest/web/src/it/regression-web/src/test/resources/logback.xml deleted file mode 100644 index 37a133a43..000000000 --- a/itest/web/src/it/regression-web/src/test/resources/logback.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - target/test.log - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - \ No newline at end of file diff --git a/itest/web/src/it/regression-web/src/test/resources/logging.properties b/itest/web/src/it/regression-web/src/test/resources/logging.properties deleted file mode 100644 index e683f2d3b..000000000 --- a/itest/web/src/it/regression-web/src/test/resources/logging.properties +++ /dev/null @@ -1,2 +0,0 @@ -handlers = org.slf4j.bridge.SLF4JBridgeHandler -.level = FINEST diff --git a/pom.xml b/pom.xml index 2bbab9672..8ca122f4a 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,6 @@ containers/pax-exam-container-native containers/pax-exam-container-remote containers/pax-exam-container-forked - containers/pax-exam-container-tomcat containers/pax-exam-container-karaf maven/exam-maven-plugin diff --git a/pom/pom.xml b/pom/pom.xml index 239774649..08f494d11 100644 --- a/pom/pom.xml +++ b/pom/pom.xml @@ -37,7 +37,6 @@ 7.9.0 1.3_1 4.13.2_1 - 9.0.87 3.16 @@ -563,30 +562,6 @@ 1.2.2.GA - - org.apache.tomcat.embed - tomcat-embed-core - ${dependency.tomcat.version} - - - - org.apache.tomcat.embed - tomcat-embed-logging-juli - ${dependency.tomcat.version} - - - - org.apache.tomcat.embed - tomcat-embed-jasper - ${dependency.tomcat.version} - - - - org.apache.tomcat - tomcat-dbcp - ${dependency.tomcat.version} - - org.hibernate hibernate-entitymanager