Skip to content

Commit

Permalink
[#1803] Work in progress (136/138 tests pass)
Browse files Browse the repository at this point in the history
  • Loading branch information
grgrzybek committed Apr 6, 2023
1 parent 09738d3 commit 83c8b39
Show file tree
Hide file tree
Showing 11 changed files with 642 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,11 @@ public void destroy() throws Exception {
return;
}

List<Bundle> awaiting = webApplicationQueue.get(webApp.getContextPath());
if (awaiting != null) {
awaiting.remove(bundle);
}

// Pax Web before 8 interacted here with dependency manager in order to tell the WebApp to unregister
// a WebAppDependencyHolder registration. But we're handling the lifecycle in different way now.
webApp.stop();
Expand Down Expand Up @@ -851,8 +856,8 @@ public void run() {
// (at least attempted to be deployed)
BundleWebApplication app = webApplications.get(awaitingWab);
LOG.info("Redeploying {}, because {} is now available", app, contextPath);
app.deploy();
it.remove();
app.deploy();
break;
}
}
Expand Down
329 changes: 329 additions & 0 deletions pax-web-itest/pax-web-tck/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,329 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2021 OPS4J.
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.
-->
<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">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-itest</artifactId>
<version>8.0.19-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.ops4j.pax.web.itest</groupId>
<artifactId>pax-web-tck</artifactId>

<name>OPS4J Pax Web - Container Tests - TCK</name>

<description>Integration tests for TCK</description>

<!--
https://aries.apache.org/documentation/development/compliancetesting.html
to debug the TCK tests when running in canonical way, add `-runvm="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"`
to $GITHUB_PROJECTS/osgi/osgi/osgi.tck/generated/osgi.tck.cmpn/org.osgi.test.cases.webcontainer.bnd
and run the test with (for example):
15:16 $ pwd
$GITHUB_PROJECTS/osgi/osgi/osgi.tck/generated/osgi.tck.cmpn
$ bnd runtests -t 'org.osgi.test.cases.webcontainer.junit.BundleManifestHeadersTest#testManifestHeaders001' org.osgi.test.cases.webcontainer.bnd
-->

<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
<testResource>
<directory>src/test/resources-binary</directory>
<filtering>false</filtering>
</testResource>
</testResources>

<plugins>

<!-- Core plugins -->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
<systemPropertyVariables>
<!-- to configure pax-exam with pax.exam.system=default which gives us more control over installed bundles -->
<pax.exam.configuration>file:./src/test/resources/controlled-exam.properties</pax.exam.configuration>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<runOrder>alphabetical</runOrder>
<classpathDependencyScopeExclude>runtime</classpathDependencyScopeExclude>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<trimStackTrace>false</trimStackTrace>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<!-- ServiceMix plugins -->

<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-depends-file</id>
<goals>
<goal>generate-depends-file</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>

<!-- pax-web own artifacts -->

<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-api</artifactId>
<!-- <scope>runtime</scope>-->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-spi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-runtime</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-tomcat</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-tomcat-common</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.ops4j.pax.web.itest</groupId>
<artifactId>pax-web-itest-common</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-compatibility-annotation13</artifactId>
</dependency>

<!-- OPS4J dependencies -->

<dependency>
<!-- required by pax-exam -->
<groupId>org.ops4j.base</groupId>
<artifactId>ops4j-base-lang</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<!-- required by pax-exam -->
<groupId>org.ops4j.base</groupId>
<artifactId>ops4j-base-util-property</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-log4j2</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-junit4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-container-native</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-link-mvn</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-extender-service</artifactId>
<scope>test</scope>
</dependency>

<!-- OSGi -->

<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
</dependency>

<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.configadmin</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.metatype</artifactId>
<!-- this has to be test scope, because it's related to how pax-exam analyzes the test classes -->
<scope>test</scope>
</dependency>

<dependency>
<!-- `gradle :org.osgi.test.cases.webcontainer:release` installs the suite into local Maven repo -->
<groupId>org.osgi</groupId>
<artifactId>org.osgi.test.cases.webcontainer</artifactId>
<version>8.1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<groupId>org.apache.geronimo.specs</groupId>
</exclusion>
<exclusion>
<artifactId>junit-jupiter-api</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
<exclusion>
<artifactId>junit-jupiter-engine</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
<exclusion>
<artifactId>junit-jupiter-params</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
<exclusion>
<artifactId>junit-platform-commons</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
<exclusion>
<artifactId>junit-platform-engine</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
<exclusion>
<artifactId>junit-platform-launcher</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
<exclusion>
<artifactId>junit-vintage-engine</artifactId>
<groupId>org.junit.vintage</groupId>
</exclusion>
<exclusion>
<artifactId>mockito-core</artifactId>
<groupId>org.mockito</groupId>
</exclusion>
</exclusions>
</dependency>

<!-- JavaEE -->

<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<!-- it has to be "test" - Pax Exam needs javax.servlet classes when loading @Test classes -->
<scope>test</scope>
</dependency>

<!-- ServiceMIX -->

<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Logging -->

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>

<!-- Other -->

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Loading

0 comments on commit 83c8b39

Please sign in to comment.