This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a commit to branch opentelemetry-1.1
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/opentelemetry-1.1 by this push:
new cea42c2a0f Fix arquillian setup to deploy tck test webapp
cea42c2a0f is described below
commit cea42c2a0f489dbb610027c239a9d29a35688e15
Author: Richard Zowalla <[email protected]>
AuthorDate: Thu Apr 24 08:42:20 2025 +0200
Fix arquillian setup to deploy tck test webapp
---
tck/microprofile-tck/opentelemetry/pom.xml | 35 +++++-----------
.../tck/opentelemetry/ArquillianExtension.java | 3 +-
.../OpenTelemetryTCKDeploymentProcessor.java | 47 ++++++++++++++++++++++
3 files changed, 58 insertions(+), 27 deletions(-)
diff --git a/tck/microprofile-tck/opentelemetry/pom.xml
b/tck/microprofile-tck/opentelemetry/pom.xml
index 33fe5e53a3..07600060f1 100644
--- a/tck/microprofile-tck/opentelemetry/pom.xml
+++ b/tck/microprofile-tck/opentelemetry/pom.xml
@@ -171,33 +171,18 @@
</dependency>
<dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-mp-client</artifactId>
- <version>${version.cxf}</version>
+ <groupId>io.opentelemetry</groupId>
+ <artifactId>opentelemetry-semconv</artifactId>
+ <version>1.20.1-alpha</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>ziplock</artifactId>
+ <version>${project.version}</version>
<scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.glassfish.jaxb</groupId>
- <artifactId>jaxb-xjc</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.ws.rs</groupId>
- <artifactId>jakarta.ws.rs-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.activation</groupId>
- <artifactId>jakarta.activation-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.json.bind</groupId>
- <artifactId>jakarta.json.bind-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jakarta.json</groupId>
- <artifactId>jakarta.json-api</artifactId>
- </exclusion>
- </exclusions>
</dependency>
+
</dependencies>
</project>
\ No newline at end of file
diff --git
a/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianExtension.java
b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianExtension.java
index df88509ea2..2c42994ac9 100644
---
a/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianExtension.java
+++
b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianExtension.java
@@ -16,12 +16,11 @@
*/
package org.apache.tomee.microprofile.tck.opentelemetry;
-import
org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.core.spi.LoadableExtension;
public class ArquillianExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder extensionBuilder) {
- extensionBuilder.observer(ArquillianLifecycle.class);
+
extensionBuilder.observer(ArquillianLifecycle.class).observer(OpenTelemetryTCKDeploymentProcessor.class);
}
}
\ No newline at end of file
diff --git
a/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/OpenTelemetryTCKDeploymentProcessor.java
b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/OpenTelemetryTCKDeploymentProcessor.java
new file mode 100644
index 0000000000..9f2616602d
--- /dev/null
+++
b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/OpenTelemetryTCKDeploymentProcessor.java
@@ -0,0 +1,47 @@
+/*
+ * 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.tomee.microprofile.tck.opentelemetry;
+
+import io.opentelemetry.semconv.trace.attributes.SemanticAttributes;
+import org.apache.ziplock.JarLocation;
+import
org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription;
+import org.jboss.arquillian.container.spi.event.container.BeforeDeploy;
+import org.jboss.arquillian.core.api.annotation.Observes;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+public class OpenTelemetryTCKDeploymentProcessor {
+
+ public void observeDeployment(@Observes final BeforeDeploy beforeDeploy) {
+ DeploymentDescription deployment = beforeDeploy.getDeployment();
+ Archive<?> testableArchive = deployment.getTestableArchive();
+ if (testableArchive != null) {
+ process(testableArchive);
+ } else {
+ process(deployment.getArchive());
+ }
+ }
+
+ private void process(Archive<?> archive) {
+ if (archive instanceof WebArchive webapp) {
+
webapp.addAsLibrary(JarLocation.jarLocation(SemanticAttributes.class)) //
required for some tck classes
+ .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+ }
+
+}
\ No newline at end of file