|
| 1 | +/* |
| 2 | + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH |
| 3 | + * under one or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information regarding copyright |
| 5 | + * ownership. Camunda licenses this file to you under the Apache License, |
| 6 | + * Version 2.0; you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | +package org.camunda.bpm.integrationtest.util; |
| 18 | + |
| 19 | +import org.jboss.shrinkwrap.api.spec.WebArchive; |
| 20 | + |
| 21 | +/** |
| 22 | + * Tomcat test container. |
| 23 | + * |
| 24 | + * @author Daniel Meyer |
| 25 | + */ |
| 26 | +public class TestContainer { |
| 27 | + |
| 28 | + /** |
| 29 | + * In some scenarios, Tomcat 10 and Weld 5 have issues when the Weld library is embedded into the WAR. |
| 30 | + * To solve these issues, Weld is added to the Tomcat server libs folder. |
| 31 | + */ |
| 32 | + public static void addContainerSpecificResourcesEmbedCdiLib(WebArchive webArchive) { |
| 33 | + addContainerSpecificResources(webArchive); |
| 34 | + } |
| 35 | + |
| 36 | + public static void addContainerSpecificResources(WebArchive webArchive) { |
| 37 | + webArchive |
| 38 | + .addAsManifestResource("context.xml") |
| 39 | + .addClass(TestProcessApplication.class) |
| 40 | + .addAsWebInfResource("web.xml") |
| 41 | + .addAsLibraries(DeploymentHelper.getWeld()); |
| 42 | + } |
| 43 | + |
| 44 | + public static void addContainerSpecificResourcesWithoutWeld(WebArchive webArchive) { |
| 45 | + webArchive |
| 46 | + .addAsManifestResource("context.xml") |
| 47 | + .addClass(TestProcessApplication.class) |
| 48 | + .addAsWebInfResource("web-without-weld.xml", "web.xml"); |
| 49 | + } |
| 50 | + |
| 51 | + /** |
| 52 | + * In some scenarios, Tomcat 10 and Weld 5 have issues when the Weld library is embedded into the WAR. |
| 53 | + * To solve these issues, Weld is added to the Tomcat server libs folder. |
| 54 | + */ |
| 55 | + public static void addContainerSpecificResourcesForNonPaEmbedCdiLib(WebArchive webArchive) { |
| 56 | + addContainerSpecificResourcesForNonPa(webArchive); |
| 57 | + } |
| 58 | + |
| 59 | + public static void addContainerSpecificResourcesForNonPa(WebArchive webArchive) { |
| 60 | + webArchive |
| 61 | + .addAsManifestResource("context.xml") |
| 62 | + .addAsWebInfResource("web.xml") |
| 63 | + .addAsLibraries(DeploymentHelper.getWeld()); |
| 64 | + } |
| 65 | + |
| 66 | + public static void addContainerSpecificResourcesForNonPaWithoutWeld(WebArchive webArchive) { |
| 67 | + webArchive |
| 68 | + .addAsManifestResource("context.xml") |
| 69 | + .addAsWebInfResource("web-without-weld.xml", "web.xml"); |
| 70 | + } |
| 71 | + |
| 72 | + public static void addContainerSpecificProcessEngineConfigurationClass(WebArchive deployment) { |
| 73 | + // nothing to do |
| 74 | + } |
| 75 | + |
| 76 | + public static void addSpinJacksonJsonDataFormat(WebArchive webArchive) { |
| 77 | + webArchive.addAsLibraries(DeploymentHelper.getSpinJacksonJsonDataFormatForServer("tomcat")); |
| 78 | + } |
| 79 | + |
| 80 | + public static void addJodaTimeJacksonModule(WebArchive webArchive) { |
| 81 | + webArchive.addAsLibraries(DeploymentHelper.getJodaTimeModuleForServer("tomcat")); |
| 82 | + } |
| 83 | + |
| 84 | + public static void addCommonLoggingDependency(WebArchive webArchive) { |
| 85 | + // nothing to do |
| 86 | + } |
| 87 | + |
| 88 | +} |
0 commit comments