diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 987588a6..c2e60bf4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -4,7 +4,6 @@ on:
push:
branches:
- main
- - jakarta
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 0febf759..12bd6a57 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -28,8 +28,7 @@ jobs:
- uses: actions/setup-java@v1
with:
- # https://issues.sonatype.org/browse/NEXUS-31214
- java-version: 12
+ java-version: 17
- name: maven release ${{steps.metadata.outputs.current-version}}
run: |
diff --git a/api/pom.xml b/api/pom.xml
index 459dfd73..19ffd587 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -1,13 +1,14 @@
+ 4.0.0smallrye-context-propagation-parentio.smallrye2.0.1-SNAPSHOT
- 4.0.0smallrye-context-propagation-api
+ SmallRye Context Propagation: API
diff --git a/api/src/main/java/io/smallrye/context/api/CurrentThreadContext.java b/api/src/main/java/io/smallrye/context/api/CurrentThreadContext.java
index 210f75f8..18f82e3e 100644
--- a/api/src/main/java/io/smallrye/context/api/CurrentThreadContext.java
+++ b/api/src/main/java/io/smallrye/context/api/CurrentThreadContext.java
@@ -43,7 +43,7 @@
/**
* Defines that the current thread context should be removed. This is mutually exclusive
* with the other settings.
- *
+ *
* @return a boolean indicating if the current thread context should be removed. Defaults to false.
*/
@Nonbinding
@@ -151,7 +151,7 @@
* For example, to run as the current application, but under the
* transaction of the thread where the task executes:
*
- *
+ *
*
* {@literal @}WithThreadContext(unchanged = ThreadContext.TRANSACTION,
* propagated = ThreadContext.APPLICATION,
diff --git a/api/src/main/java/io/smallrye/context/api/ThreadContextConfig.java b/api/src/main/java/io/smallrye/context/api/ThreadContextConfig.java
index a4587d1a..5939d4c4 100644
--- a/api/src/main/java/io/smallrye/context/api/ThreadContextConfig.java
+++ b/api/src/main/java/io/smallrye/context/api/ThreadContextConfig.java
@@ -190,7 +190,7 @@
* For example, to run as the current application, but under the
* transaction of the thread where the task executes:
*
- *
+ *
*
* {@literal @}Inject {@literal @}ThreadContextConfig(unchanged = ThreadContext.TRANSACTION,
* propagated = ThreadContext.APPLICATION,
diff --git a/application/pom.xml b/application/pom.xml
index 1f756565..aab54602 100644
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -6,39 +6,19 @@
smallrye-context-propagation-parent2.0.1-SNAPSHOT
+
smallrye-context-propagation-application
- smallrye-context-propagation-application
+ SmallRye Context Propagation: Application
-
- junit
- junit
- test
- ${project.groupId}smallrye-context-propagation
- ${project.version}org.eclipse.microprofile.context-propagationmicroprofile-context-propagation-api
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
-
- test-jar
-
-
-
-
-
-
diff --git a/cdi/pom.xml b/cdi/pom.xml
index 7df5426e..20c46f22 100644
--- a/cdi/pom.xml
+++ b/cdi/pom.xml
@@ -6,52 +6,26 @@
smallrye-context-propagation-parent2.0.1-SNAPSHOT
+
smallrye-context-propagation-cdi
- smallrye-context-propagation-cdi
+ SmallRye Context Propagation: CDI
-
- junit
- junit
- test
- ${project.groupId}smallrye-context-propagation
- ${project.version}${project.groupId}smallrye-context-propagation-api
- ${project.version}jakarta.enterprisejakarta.enterprise.cdi-api
- providedorg.jboss.weldweld-spi
-
- org.jboss.weld
- weld-api
-
-
-
- org.jboss.weld
- weld-core-impl
-
-
- org.eclipse.microprofile.config
- microprofile-config-api
- ${version.microprofile.config}
-
-
- io.smallrye.config
- smallrye-config
- ${version.smallrye.config}
-
diff --git a/cdi/src/test/java/io/smallrye/context/inject/AppTest.java b/cdi/src/test/java/io/smallrye/context/inject/AppTest.java
deleted file mode 100644
index 8f6c243c..00000000
--- a/cdi/src/test/java/io/smallrye/context/inject/AppTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package io.smallrye.context.inject;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
- extends TestCase {
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest(String testName) {
- super(testName);
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite() {
- return new TestSuite(AppTest.class);
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testApp() {
- assertTrue(true);
- }
-}
diff --git a/core/build-release-8 b/core/build-release-8
deleted file mode 100644
index e69de29b..00000000
diff --git a/core/pom.xml b/core/pom.xml
index f1ebb505..abf3216e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -6,42 +6,34 @@
smallrye-context-propagation-parent2.0.1-SNAPSHOT
- smallrye-context-propagation
- smallrye-context-propagation
-
- 12
-
+ smallrye-context-propagation
+ SmallRye Context Propagation: Core
-
- junit
- junit
- test
- org.eclipse.microprofile.context-propagationmicroprofile-context-propagation-api
+
+ org.eclipse.microprofile.config
+ microprofile-config-api
+ ${project.groupId}smallrye-context-propagation-api
- ${project.version}${project.groupId}smallrye-context-propagation-storage
- ${project.version}
- org.eclipse.microprofile.config
- microprofile-config-api
- ${version.microprofile.config}
+ jakarta.enterprise
+ jakarta.enterprise.cdi-apiorg.jboss.threadsjboss-threads
- ${version.jboss.threads}
diff --git a/core/src/main/java/io/smallrye/context/FastStorageThreadContextProvider.java b/core/src/main/java/io/smallrye/context/FastStorageThreadContextProvider.java
index 88c6df14..46ec7d78 100644
--- a/core/src/main/java/io/smallrye/context/FastStorageThreadContextProvider.java
+++ b/core/src/main/java/io/smallrye/context/FastStorageThreadContextProvider.java
@@ -8,7 +8,7 @@
/**
* Special implementation of a {@link FastThreadContextProvider} if your context is using {@link StorageManager} to obtain its
* ThreadLocal, in which case we can obtain it from there to propagate it, if we know its {@link StorageDeclaration}.
- *
+ *
* @param The StorageDeclaration for that ThreadLocal
*/
public interface FastStorageThreadContextProvider> extends FastThreadContextProvider {
diff --git a/core/src/main/java/io/smallrye/context/FastThreadContextProvider.java b/core/src/main/java/io/smallrye/context/FastThreadContextProvider.java
index 8c1361b6..d5cca3d0 100644
--- a/core/src/main/java/io/smallrye/context/FastThreadContextProvider.java
+++ b/core/src/main/java/io/smallrye/context/FastThreadContextProvider.java
@@ -15,7 +15,7 @@ public interface FastThreadContextProvider extends ThreadContextProvider {
/**
* Designates the ThreadLocal that we should capture/restore. Must always be
* the same returned ThreadLocal.
- *
+ *
* @param props properties
* @return the ThreadLocal to capture/restore
*/
@@ -24,7 +24,7 @@ public interface FastThreadContextProvider extends ThreadContextProvider {
/**
* The cleared value. Defaults to null. Override this if your cleared value
* is not null.
- *
+ *
* @param props properties
* @return the cleared value for the ThreadLocal
*/
diff --git a/core/src/main/java/io/smallrye/context/SmallRyeContextManager.java b/core/src/main/java/io/smallrye/context/SmallRyeContextManager.java
index 3140da1d..64686775 100644
--- a/core/src/main/java/io/smallrye/context/SmallRyeContextManager.java
+++ b/core/src/main/java/io/smallrye/context/SmallRyeContextManager.java
@@ -214,7 +214,7 @@ public DefaultValues getDefaultValues() {
/**
* Returns a {@link SmallRyeThreadContext} instance which propagates default contexts, possibly
* configured via MP Config.
- *
+ *
* @return a {@link SmallRyeThreadContext} instance which propagates default contexts, possibly
* configured via MP Config
*/
@@ -229,7 +229,7 @@ public SmallRyeThreadContext defaultThreadContext() {
/**
* Returns a {@link SmallRyeThreadContext} instance which propagates all thread contexts.
- *
+ *
* @return a {@link SmallRyeThreadContext} instance which propagates all thread contexts.
*/
public SmallRyeThreadContext allPropagatedThreadContext() {
@@ -246,7 +246,7 @@ public SmallRyeThreadContext allPropagatedThreadContext() {
/**
* Returns a {@link SmallRyeThreadContext} instance which clears all thread contexts.
- *
+ *
* @return a {@link SmallRyeThreadContext} instance which clears all thread contexts.
*/
public SmallRyeThreadContext allClearedThreadContext() {
@@ -345,7 +345,7 @@ public SmallRyeContextManager build() {
* Registers the built instance to the current {@link SmallRyeContextManagerProvider} before any extensions
* are loaded. This is useful because the extensions might require the built {@link SmallRyeContextManager}
* to be registered on the current class loader in order to use it, so this prevents building two.
- *
+ *
* @return this builder
*/
public Builder registerOnProvider() {
@@ -359,7 +359,7 @@ public Builder registerOnProvider() {
* {@link SmallRyeManagedExecutor.Builder#withExecutorService(ExecutorService)} and
* {@link SmallRyeManagedExecutor.Builder#withNewExecutorService()}. Also serves as the default executor to use
* by all {@link CompletionStage} and {@link CompletableFuture} wrapped by {@link ThreadContext}.
- *
+ *
* @param executorService the executor service to delegate to. If null, all created {@link ManagedExecutor}
* will create new backing executor services, and all *Async methods of the
* {@link CompletionStage} and {@link CompletableFuture} wrapped by {@link ThreadContext} will throw due to a
@@ -373,7 +373,7 @@ public Builder withDefaultExecutorService(ExecutorService executorService) {
/**
* Enable or disable FastThreadContextProviders optimisations. Defaults to enabled.
- *
+ *
* @param enable set to false to disable FastThreadContextProviders.
* @return this builder.
*/
diff --git a/core/src/main/java/io/smallrye/context/SmallRyeManagedExecutor.java b/core/src/main/java/io/smallrye/context/SmallRyeManagedExecutor.java
index 44351fb9..929edf03 100644
--- a/core/src/main/java/io/smallrye/context/SmallRyeManagedExecutor.java
+++ b/core/src/main/java/io/smallrye/context/SmallRyeManagedExecutor.java
@@ -312,7 +312,7 @@ public CompletionStage copy(CompletionStage stage) {
/**
* Returns a ThreadContext which has the same propagation settings as this ManagedExecutor,
* which uses this ManagedExecutor as its default executor.
- *
+ *
* @return a ThreadContext with the same propagation settings as this ManagedExecutor.
*/
public SmallRyeThreadContext getThreadContext() {
@@ -399,7 +399,7 @@ public Builder injectionPointName(String name) {
* {@link SmallRyeContextManager.Builder#withDefaultExecutorService(ExecutorService)}. Set to null to
* disable delegation
* and force creating a new executor service.
- *
+ *
* @param executorService the executor service to delegate to, or null to force creating a new executor
* service.
* @return this builder
@@ -415,7 +415,7 @@ public Builder withExecutorService(ExecutorService executorService) {
* Forces the creation of a new executor service. This is has the same effect as calling
* {@link #withExecutorService(ExecutorService)} with
* null.
- *
+ *
* @return this builder
* @see #withExecutorService(ExecutorService)
* @see SmallRyeContextManager.Builder#withDefaultExecutorService(ExecutorService)
diff --git a/core/src/main/java/io/smallrye/context/SmallRyeThreadContext.java b/core/src/main/java/io/smallrye/context/SmallRyeThreadContext.java
index 266e092c..ab0c7781 100644
--- a/core/src/main/java/io/smallrye/context/SmallRyeThreadContext.java
+++ b/core/src/main/java/io/smallrye/context/SmallRyeThreadContext.java
@@ -84,7 +84,7 @@ public void execute(Runnable command) {
/**
* Updates the current @{link SmallRyeThreadContext} in use by the current thread, and returns an
* object suitable for use in try-with-resource to restore the previous value.
- *
+ *
* @param threadContext the @{link SmallRyeThreadContext} to use
* @return an object suitable for use in try-with-resource to restore the previous value.
*/
@@ -108,7 +108,7 @@ public void close() {
/**
* Invokes the given @{link Runnable} with the current @{link SmallRyeThreadContext} updated to the given value
* for the current thread.
- *
+ *
* @param threadContext the @{link SmallRyeThreadContext} to use
* @param f the @{link Runnable} to invoke
*/
@@ -129,7 +129,7 @@ public static void withThreadContext(SmallRyeThreadContext threadContext, Runnab
/**
* Invokes the given @{link Supplier} with the current @{link SmallRyeThreadContext} updated to the given value
* for the current thread.
- *
+ *
* @param threadContext the @{link SmallRyeThreadContext} to use
* @param f the @{link Supplier} to invoke
* @param The type of @{link Supplier} to return
@@ -152,7 +152,7 @@ public static T withThreadContext(SmallRyeThreadContext threadContext, Suppl
/**
* Returns the current thread's @{link SmallRyeThreadContext} if set, or a @{link SmallRyeThreadContext}
* with default contexts, possibly configured via MP Config.
- *
+ *
* @return the current thread's @{link SmallRyeThreadContext} if set, or a @{link SmallRyeThreadContext}
* with default contexts, possibly configured via MP Config.
*/
@@ -163,7 +163,7 @@ public static SmallRyeThreadContext getCurrentThreadContextOrDefaultContexts() {
/**
* Returns the current thread's @{link SmallRyeThreadContext} if set, or a @{link SmallRyeThreadContext}
* which propagates all contexts.
- *
+ *
* @return the current thread's @{link SmallRyeThreadContext} if set, or a @{link SmallRyeThreadContext}
* which propagates all contexts.
*/
@@ -174,7 +174,7 @@ public static SmallRyeThreadContext getCurrentThreadContextOrPropagatedContexts(
/**
* Returns the current thread's @{link SmallRyeThreadContext} if set, or a @{link SmallRyeThreadContext}
* which clears all contexts.
- *
+ *
* @return the current thread's @{link SmallRyeThreadContext} if set, or a @{link SmallRyeThreadContext}
* which clears all contexts.
*/
@@ -185,7 +185,7 @@ public static SmallRyeThreadContext getCurrentThreadContextOrClearedContexts() {
/**
* Returns the current thread's @{link SmallRyeThreadContext} if set, or the given @{link SmallRyeThreadContext}
* default value.
- *
+ *
* @param defaultValue the default value to use
* @return the current thread's @{link SmallRyeThreadContext} if set, or the given @{link SmallRyeThreadContext}
* default value.
@@ -197,7 +197,7 @@ public static SmallRyeThreadContext getCurrentThreadContext(SmallRyeThreadContex
/**
* Returns the current thread's @{link SmallRyeThreadContext} if set, or null.
- *
+ *
* @return the current thread's @{link SmallRyeThreadContext} if set, or null.
*/
public static SmallRyeThreadContext getCurrentThreadContext() {
@@ -234,7 +234,7 @@ public ExecutorService getDefaultExecutor() {
/**
* Returns true if this thread context has no context to propagate nor clear, and so
* will not contextualise anything.
- *
+ *
* @return true if this thread context has no context to propagate nor clear
*/
public boolean isEmpty() {
@@ -243,7 +243,7 @@ public boolean isEmpty() {
/**
* Returns true if the given lambda instance is already contextualized
- *
+ *
* @param lambda the lambda to test
* @return true if the given lambda instance is already contextualized
*/
@@ -270,7 +270,7 @@ public static Builder builder() {
* or the default executor service as set by
* {@link SmallRyeContextManager.Builder#withDefaultExecutorService(ExecutorService)},
* or otherwise have no default executor.
- *
+ *
* If this thread context has no default executor, the new stage and all dependent stages created from it, and so forth,
* have no default asynchronous execution facility and must raise {@link java.lang.UnsupportedOperationException}
* for all *Async methods that do not specify an executor. For example,
@@ -318,7 +318,7 @@ public CompletableFuture withContextCapture(CompletableFuture future,
* or the default executor service as set by
* {@link SmallRyeContextManager.Builder#withDefaultExecutorService(ExecutorService)},
* or otherwise have no default executor.
- *
+ *
* If this thread context has no default executor, the new stage and all dependent stages created from it, and so forth,
* and/or cleared as described in the documentation of the {@link ManagedExecutor} class, except that
* this ThreadContext instance takes the place of the default asynchronous execution facility in
diff --git a/core/src/main/java/io/smallrye/context/impl/ContextHolder.java b/core/src/main/java/io/smallrye/context/impl/ContextHolder.java
index c7e06d5d..eca7078f 100644
--- a/core/src/main/java/io/smallrye/context/impl/ContextHolder.java
+++ b/core/src/main/java/io/smallrye/context/impl/ContextHolder.java
@@ -8,7 +8,7 @@ public interface ContextHolder {
/**
* Store a thread local and its current value while capturing, in a way that storage is flattend in the context wrapper with
* minimal allocation.
- *
+ *
* @param index the context provider index
* @param threadLocal the context provider's threadLocal
* @param value the current or cleared value of the threadLocal (depending on ThreadContext settings)
diff --git a/core/src/main/java/io/smallrye/context/impl/SlowActiveContextState.java b/core/src/main/java/io/smallrye/context/impl/SlowActiveContextState.java
index 3b2c9ab4..13d420ec 100644
--- a/core/src/main/java/io/smallrye/context/impl/SlowActiveContextState.java
+++ b/core/src/main/java/io/smallrye/context/impl/SlowActiveContextState.java
@@ -18,7 +18,7 @@ public class SlowActiveContextState implements CleanAutoCloseable {
/**
* Restores a previously captured context.
- *
+ *
* @param threadContext the thread context
* @param threadContextSnapshots the captured snapshots
*/
diff --git a/core/src/main/java/io/smallrye/context/impl/SlowCapturedContextState.java b/core/src/main/java/io/smallrye/context/impl/SlowCapturedContextState.java
index 676bdf80..cf0e92aa 100644
--- a/core/src/main/java/io/smallrye/context/impl/SlowCapturedContextState.java
+++ b/core/src/main/java/io/smallrye/context/impl/SlowCapturedContextState.java
@@ -17,7 +17,7 @@ public class SlowCapturedContextState implements CapturedContextState {
/**
* Captures the current context according to the given ThreadContext
- *
+ *
* @param threadContext the thread context
*/
public SlowCapturedContextState(SmallRyeThreadContext threadContext) {
@@ -27,7 +27,7 @@ public SlowCapturedContextState(SmallRyeThreadContext threadContext) {
/**
* Restores the captured context and returns an instance that can unrestore (cleanup) it.
- *
+ *
* @return the captured context state
*/
public SlowActiveContextState begin() {
diff --git a/core/src/main/java/io/smallrye/context/impl/ThreadContextProviderPlan.java b/core/src/main/java/io/smallrye/context/impl/ThreadContextProviderPlan.java
index e8f424d4..4e18c117 100644
--- a/core/src/main/java/io/smallrye/context/impl/ThreadContextProviderPlan.java
+++ b/core/src/main/java/io/smallrye/context/impl/ThreadContextProviderPlan.java
@@ -62,7 +62,7 @@ public ThreadContextProviderPlan(Set propagatedSet, Set takeThreadContextSnapshots() {
@@ -94,7 +94,7 @@ public boolean isFast() {
* Use this if @{link {@link #isFast()} is true (it will throw otherwise) when you want to capture the current context
* using the fast-path, and feed the captured context in the given @{link ContextHolder}, which must have a size compatible
* with @{link {@link #size()}.
- *
+ *
* @param threadContext The thread context settings
* @param tcTl the current ThreadContext thread-local (for contextual settings)
* @param contextHolder the contextual lambda in which we will capture context
diff --git a/core/src/main/java9/io/smallrye/context/Jdk9CompletableFutureWrapper.java b/core/src/main/java9/io/smallrye/context/Jdk9CompletableFutureWrapper.java
deleted file mode 100644
index f6425e3b..00000000
--- a/core/src/main/java9/io/smallrye/context/Jdk9CompletableFutureWrapper.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package io.smallrye.context;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-import java.util.concurrent.Executor;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Supplier;
-
-public class Jdk9CompletableFutureWrapper extends CompletableFutureWrapper {
-
- public Jdk9CompletableFutureWrapper(SmallRyeThreadContext context, CompletableFuture f, Executor executor,
- int flags) {
- super(context, f, executor, flags);
- }
-
- // Java 9
-
- @Override
- public CompletableFuture newIncompleteFuture() {
- CompletableFuture ret = new CompletableFuture<>();
- return context.withContextCapture(ret, executor, flags);
- }
-
- @Override
- public Executor defaultExecutor() {
- return executor;
- }
-
- @Override
- public CompletableFuture copy() {
- return context.withContextCapture(f.copy(), executor, flags);
- }
-
- @Override
- public CompletionStage minimalCompletionStage() {
- // this creates a new MinimalStage we need to wrap
- return context.withContextCapture(f.minimalCompletionStage());
- }
-
- @Override
- public CompletableFuture completeAsync(Supplier extends T> supplier) {
- // just forward
- return context.withContextCapture(f.completeAsync(context.contextualSupplierUnlessContextualized(supplier), executor),
- executor, flags);
- }
-
- @Override
- public CompletableFuture completeAsync(Supplier extends T> supplier, Executor executor) {
- // just forward
- return context.withContextCapture(f.completeAsync(context.contextualSupplierUnlessContextualized(supplier), executor),
- this.executor, flags);
- }
-
- @Override
- public CompletableFuture orTimeout(long timeout, TimeUnit unit) {
- // just forward
- return context.withContextCapture(f.orTimeout(timeout, unit), executor, flags);
- }
-
- @Override
- public CompletableFuture completeOnTimeout(T value, long timeout, TimeUnit unit) {
- // just forward
- return context.withContextCapture(f.completeOnTimeout(value, timeout, unit), executor, flags);
- }
-}
diff --git a/core/src/main/java9/io/smallrye/context/impl/JdkSpecificImpl.java b/core/src/main/java9/io/smallrye/context/impl/JdkSpecificImpl.java
deleted file mode 100644
index 3f174d10..00000000
--- a/core/src/main/java9/io/smallrye/context/impl/JdkSpecificImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package io.smallrye.context.impl;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-import java.util.concurrent.Executor;
-
-import io.smallrye.context.CompletionStageWrapper;
-import io.smallrye.context.Jdk9CompletableFutureWrapper;
-import io.smallrye.context.JdkSpecific;
-import io.smallrye.context.SmallRyeThreadContext;
-
-public class JdkSpecificImpl implements JdkSpecific.Contract {
-
- @Override
- public CompletionStage newCompletionStageWrapper(SmallRyeThreadContext threadContext,
- CompletionStage future, Executor executor) {
- return new CompletionStageWrapper<>(threadContext, future, executor);
- }
-
- @Override
- public CompletableFuture newCompletableFutureWrapper(SmallRyeThreadContext threadContext,
- CompletableFuture future, Executor executor, int flags) {
- return new Jdk9CompletableFutureWrapper<>(threadContext, future, executor, flags);
- }
-
-}
diff --git a/jta/pom.xml b/jta/pom.xml
index 16b7f610..a4cbfc6b 100644
--- a/jta/pom.xml
+++ b/jta/pom.xml
@@ -6,15 +6,11 @@
smallrye-context-propagation-parent2.0.1-SNAPSHOT
+
smallrye-context-propagation-jta
- smallrye-context-propagation-jta
+ SmallRye Context Propagation: JTA
-
- junit
- junit
- test
- org.eclipse.microprofile.context-propagationmicroprofile-context-propagation-api
@@ -22,45 +18,10 @@
jakarta.enterprisejakarta.enterprise.cdi-api
- providedjakarta.transactionjakarta.transaction-api
- ${version.jta}
-
-
- org.jboss.weld.module
- weld-jta
- ${version.weld.core}
- test
-
-
- org.jboss.narayana.jta
- narayana-jta-jakarta
- ${version.narayana}
-
-
- org.jboss.logmanager
- jboss-logmanager
-
-
- test
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
-
- test-jar
-
-
-
-
-
-
diff --git a/jta/src/test/java/io/smallrye/context/inject/AppTest.java b/jta/src/test/java/io/smallrye/context/inject/AppTest.java
deleted file mode 100644
index 8f6c243c..00000000
--- a/jta/src/test/java/io/smallrye/context/inject/AppTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package io.smallrye.context.inject;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
- extends TestCase {
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest(String testName) {
- super(testName);
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite() {
- return new TestSuite(AppTest.class);
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testApp() {
- assertTrue(true);
- }
-}
diff --git a/pom.xml b/pom.xml
index 30941c02..cf0d0b68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,8 +4,8 @@
io.smallrye
- smallrye-jakarta-parent
- 36
+ smallrye-parent
+ 39smallrye-context-propagation-parent
@@ -37,35 +37,24 @@
- 1.3
- 3.0.1
- 3.0.0
+ 1.3
+ 3.0.1
+
+ 5.0.SP33.4.2.Final2.0.05.12.4.Final2.2.211.3.8
- 4.0.SP1
- 4.0.2.Final
-
-
- 2.0.0
- 5.0.5.Final
- 6.0.0.Beta1
- 2.0.0.Beta1
- 5.6.5.Final
- 2.5.0
- 4.3.3
- 2.2false
-
-
- Stéphane Épardaud
- stef@epardaud.fr
-
+
+
+ Stéphane Épardaud
+ stef@epardaud.fr
+ Matěj Novotnýmanovotn@redhat.com
@@ -74,86 +63,88 @@
+
org.eclipse.microprofile.context-propagationmicroprofile-context-propagation-api${version.microprofile.context-propagation}
-
org.eclipse.microprofile.context-propagationmicroprofile-context-propagation-tck${version.microprofile.context-propagation}
-
- io.reactivex.rxjava2
- rxjava
- ${version.rxjava2}
+ org.eclipse.microprofile.config
+ microprofile-config-api
+ ${version.microprofile.config}
- io.reactivex
- rxjava
- ${version.rxjava1}
+ jakarta.enterprise
+ jakarta.enterprise.cdi-api
+ ${version.jakarta.enterprise.cdi.api}
+ provided
+
+
+ jakarta.transaction
+ jakarta.transaction-api
+ ${version.jta}
+ provided
-
+
- org.jboss.weld
- weld-api
- ${version.weld-api}
+ ${project.groupId}
+ smallrye-context-propagation-api
+ ${project.version}
+
+
+ ${project.groupId}
+ smallrye-context-propagation
+ ${project.version}
+
+ ${project.groupId}
+ smallrye-context-propagation-storage
+ ${project.version}
+
+
+
org.jboss.weldweld-spi${version.weld-api}
- org.jboss.weld
- weld-core-impl
- ${version.weld-core}
+ org.jboss.threads
+ jboss-threads
+ ${version.jboss.threads}
+
+
+ io.reactivex.rxjava2
+ rxjava
+ ${version.rxjava2}
+
+
+ io.reactivex
+ rxjava
+ ${version.rxjava1}
+ apicorecdijtaapplicationpropagators-rxjava1propagators-rxjava2
- tests
- tck
- apistorage
+ testsuite
-
-
- eclipse-snapshots
- https://repo.eclipse.org/content/repositories/microprofile-snapshots
-
- false
-
-
- true
-
-
-
-
- jboss-public-repository-group
- JBoss Public Maven Repository Group
- https://repository.jboss.org/nexus/content/groups/public/
-
- true
-
-
- true
-
-
-
-
diff --git a/propagators-rxjava1/pom.xml b/propagators-rxjava1/pom.xml
index d3a7fa06..0f3a1bb3 100644
--- a/propagators-rxjava1/pom.xml
+++ b/propagators-rxjava1/pom.xml
@@ -6,21 +6,15 @@
smallrye-context-propagation-parent2.0.1-SNAPSHOT
+
smallrye-context-propagation-propagators-rxjava1
- smallrye-context-propagation-propagators-rxjava1
+ SmallRye Context Propagation: Propagators RxJava
-
- junit
- junit
- test
-
-
org.eclipse.microprofile.context-propagationmicroprofile-context-propagation-api
-
io.reactivexrxjava
diff --git a/propagators-rxjava2/pom.xml b/propagators-rxjava2/pom.xml
index d9724387..cd8551f1 100644
--- a/propagators-rxjava2/pom.xml
+++ b/propagators-rxjava2/pom.xml
@@ -6,21 +6,15 @@
smallrye-context-propagation-parent2.0.1-SNAPSHOT
+
smallrye-context-propagation-propagators-rxjava2
- smallrye-context-propagation-propagators-rxjava2
+ SmallRye Context Propagation: Propagators RxJava 2
-
- junit
- junit
- test
-
-
org.eclipse.microprofile.context-propagationmicroprofile-context-propagation-api
-
io.reactivex.rxjava2rxjava
diff --git a/storage/pom.xml b/storage/pom.xml
index a71ea9c1..24e50e79 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -8,6 +8,7 @@
4.0.0smallrye-context-propagation-storage
+ SmallRye Context Propagation: Storage
diff --git a/storage/src/main/java/io/smallrye/context/storage/spi/StorageManager.java b/storage/src/main/java/io/smallrye/context/storage/spi/StorageManager.java
index 379392ea..21bd4382 100644
--- a/storage/src/main/java/io/smallrye/context/storage/spi/StorageManager.java
+++ b/storage/src/main/java/io/smallrye/context/storage/spi/StorageManager.java
@@ -7,7 +7,7 @@ public interface StorageManager {
/**
* Returns the currently registered StorageManager
- *
+ *
* @return the currently registered StorageManager
*/
public static StorageManager instance() {
@@ -19,7 +19,7 @@ public static StorageManager instance() {
* may be a regular ThreadLocal, or one that this StorageManager manufactured for special dedicated
* storage. The returned ThreadLocal is cached and all subsequent calls to this method with the same
* storage declaration will always return the same ThreadLocal instance.
- *
+ *
* @param storageDeclarationClass the declaration class which defines the type of item we want to store in the
* required ThreadLocal
* @return the ThreadLocal, memoized
@@ -33,7 +33,7 @@ public static StorageManager instance() {
* may be a regular ThreadLocal, or one that this StorageManager manufactured for special dedicated
* storage. The returned ThreadLocal is cached and all subsequent calls to this method with the same
* storage declaration will always return the same ThreadLocal instance.
- *
+ *
* @param storageDeclarationClass the declaration class which defines the type of item we want to store in the
* required ThreadLocal
* @return the ThreadLocal, memoized
diff --git a/storage/src/main/java/io/smallrye/context/storage/spi/StorageManagerProvider.java b/storage/src/main/java/io/smallrye/context/storage/spi/StorageManagerProvider.java
index 97b612d5..b7eb8dff 100644
--- a/storage/src/main/java/io/smallrye/context/storage/spi/StorageManagerProvider.java
+++ b/storage/src/main/java/io/smallrye/context/storage/spi/StorageManagerProvider.java
@@ -18,7 +18,7 @@ public interface StorageManagerProvider {
* Returns the currently registered StorageManagerProvider. Will attempt to instantiate one based on
* the ServiceLoader for StorageManagerProvider if it is not set. Will default to DefaultStorageManagerProvider
* otherwise.
- *
+ *
* @return the currently registered StorageManagerProvider, lazily created.
*/
public static StorageManagerProvider instance() {
@@ -40,7 +40,7 @@ public static StorageManagerProvider instance() {
/**
* Registers and existing StorageManagerProvider
- *
+ *
* @param provider the provider to register
* @return a registration object allowing you to unregister it
* @throws IllegalStateException when there already is a registered provider
@@ -66,7 +66,7 @@ public default StorageManager getStorageManager() {
/**
* Obtain the StorageManager registered for the given ClassLoader
- *
+ *
* @param classloader the classloader to use for looking up the StorageManager
* @return the StorageManager registered for the given ClassLoader
*/
diff --git a/tck/src/test/resources/META-INF/services/org.jboss.weld.bootstrap.api.Service b/tck/src/test/resources/META-INF/services/org.jboss.weld.bootstrap.api.Service
deleted file mode 100644
index 00948aec..00000000
--- a/tck/src/test/resources/META-INF/services/org.jboss.weld.bootstrap.api.Service
+++ /dev/null
@@ -1,2 +0,0 @@
-
-io.smallrye.context.inject.TransactionServicesImpl
diff --git a/tests/src/test/java/io/smallrye/context/test/FullStackTest.java b/tests/src/test/java/io/smallrye/context/test/FullStackTest.java
deleted file mode 100644
index 201e5182..00000000
--- a/tests/src/test/java/io/smallrye/context/test/FullStackTest.java
+++ /dev/null
@@ -1,210 +0,0 @@
-package io.smallrye.context.test;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-
-import jakarta.enterprise.inject.spi.CDI;
-import jakarta.persistence.EntityManager;
-import jakarta.transaction.InvalidTransactionException;
-import jakarta.transaction.NotSupportedException;
-import jakarta.transaction.Status;
-import jakarta.transaction.SystemException;
-import jakarta.transaction.Transaction;
-import jakarta.transaction.TransactionManager;
-import jakarta.ws.rs.container.CompletionCallback;
-
-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.HttpClientBuilder;
-import org.apache.http.util.EntityUtils;
-import org.jboss.resteasy.cdi.CdiInjectorFactory;
-import org.jboss.resteasy.cdi.ResteasyCdiExtension;
-import org.jboss.resteasy.core.ResteasyContext;
-import org.jboss.resteasy.core.SynchronousDispatcher;
-import org.jboss.resteasy.plugins.server.vertx.VertxJaxrsServer;
-import org.jboss.resteasy.plugins.server.vertx.VertxResteasyDeployment;
-import org.jboss.resteasy.spi.HttpRequest;
-import org.jboss.resteasy.spi.HttpResponse;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-import org.jboss.weld.context.bound.BoundRequestContext;
-import org.jboss.weld.environment.se.Weld;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.arjuna.ats.jta.logging.jtaLogger;
-
-import io.smallrye.context.test.util.AbstractTest;
-import io.vertx.core.Vertx;
-import io.vertx.core.VertxOptions;
-
-public class FullStackTest extends AbstractTest {
- private final class MyVertxJaxrsServer extends VertxJaxrsServer {
- public Vertx getVertx() {
- return vertx;
- }
- }
-
- private MyVertxJaxrsServer vertxJaxrsServer;
- private Weld weld;
-
- @Before
- public void before() {
- VertxResteasyDeployment deployment = new VertxResteasyDeployment();
-
- weld = new Weld();
- weld.initialize();
-
- JTAUtils.startJTATM();
-
- ResteasyCdiExtension cdiExtension = CDI.current().select(ResteasyCdiExtension.class).get();
- deployment.setActualResourceClasses(cdiExtension.getResources());
- deployment.setInjectorFactoryClass(CdiInjectorFactory.class.getName());
- deployment.getActualProviderClasses().addAll(cdiExtension.getProviders());
- ResteasyProviderFactory providerFactory = ResteasyProviderFactory.newInstance();
- deployment.setProviderFactory(providerFactory);
- deployment.setDispatcher(new SynchronousDispatcher(providerFactory) {
-
- @Override
- public void invoke(HttpRequest req, HttpResponse response) {
- ResteasyContext.pushContext(Vertx.class, vertxJaxrsServer.getVertx());
-
- // set up CDI request context
- BoundRequestContext cdiContext = CDI.current().select(BoundRequestContext.class).get();
- Map contextMap = new HashMap();
- cdiContext.associate(contextMap);
- cdiContext.activate();
-
- EntityManager entityManager = CDI.current().select(EntityManager.class).get();
- TransactionManager transactionManager = CDI.current().select(TransactionManager.class).get();
- Transaction transaction;
- try {
- transactionManager.begin();
- transaction = transactionManager.getTransaction();
- } catch (SystemException | NotSupportedException e) {
- throw new RuntimeException(e);
- }
- System.err.println("BEGIN transaction " + transaction);
-
- boolean success = false;
- try {
- Thread.currentThread().setContextClassLoader(new CPClassLoader());
- super.invoke(req, response);
- success = true;
- } finally {
- // tear down request contexts
- if (req.getAsyncContext().isSuspended()) {
- // make sure we remove the CDI context
- cdiContext.deactivate();
- cdiContext.dissociate(contextMap);
- Transaction t2;
- try {
- t2 = transactionManager.suspend();
- System.err.println("SUSPEND " + t2);
- } catch (SystemException e) {
- throw new RuntimeException(e);
- }
- // clear it later
- req.getAsyncContext().getAsyncResponse().register((CompletionCallback) (t) -> {
- try {
- System.err.println("RESUME " + t2);
- Transaction currentTransaction = transactionManager.getTransaction();
- if (currentTransaction != t2) {
- if (currentTransaction != null)
- transactionManager.suspend();
- transactionManager.resume(t2);
- }
- } catch (InvalidTransactionException | IllegalStateException | SystemException e) {
- e.printStackTrace();
- }
- terminateContext(cdiContext, contextMap, entityManager, transactionManager, t2, t == null);
- });
- } else {
- // clear it now
- terminateContext(cdiContext, contextMap, entityManager, transactionManager, transaction, success);
- }
- }
- }
-
- private void terminateContext(BoundRequestContext cdiContext, Map contextMap,
- EntityManager entityManager,
- TransactionManager tm, Transaction tx, boolean success) {
- System.err.println("END: " + success + " " + tx);
- try {
- endTransaction(tm, tx, success);
- } catch (Exception e) {
- // let's not throw here
- e.printStackTrace();
- }
- // only need to terminate CDI context for "/test/async", otherwise context propagation handles it
- if (cdiContext.isActive()) {
- cdiContext.invalidate();
- cdiContext.deactivate();
- cdiContext.dissociate(contextMap);
- }
- }
-
- protected void endTransaction(TransactionManager tm, Transaction tx, boolean success) throws Exception {
-
- if (tx != tm.getTransaction()) {
- throw new RuntimeException(jtaLogger.i18NLogger.get_wrong_tx_on_thread());
- }
-
- if (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK || !success) {
- tm.rollback();
- } else {
- tm.commit();
- }
- }
-
- });
- deployment.start();
-
- vertxJaxrsServer = new MyVertxJaxrsServer();
- vertxJaxrsServer.setVertxOptions(new VertxOptions().setEventLoopPoolSize(1));
- vertxJaxrsServer.setDeployment(deployment);
- vertxJaxrsServer.setPort(8080);
- vertxJaxrsServer.setRootResourcePath("/");
- vertxJaxrsServer.setSecurityDomain(null);
- vertxJaxrsServer.start();
- }
-
- @After
- public void after() {
- weld.shutdown();
- vertxJaxrsServer.stop();
- JTAUtils.stop();
- }
-
- @Test
- public void fullStack() throws IOException {
- try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
- try (CloseableHttpResponse response = client.execute(new HttpGet("http://localhost:8080/test"))) {
- assertEquals(200, response.getStatusLine().getStatusCode());
- String body = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
- assertEquals("OK", body);
- }
-
- try (CloseableHttpResponse response = client.execute(new HttpGet("http://localhost:8080/test/async"))) {
- assertEquals(500, response.getStatusLine().getStatusCode());
- }
-
- try (CloseableHttpResponse response = client.execute(new HttpGet("http://localhost:8080/test/async-working"))) {
- assertEquals(200, response.getStatusLine().getStatusCode());
- String body = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
- assertEquals("OK", body);
- }
- }
-
- // TODO RestAssured depends on on Jakarta EE 8 classes (JAX-B specifically)
- // see https://github.com/rest-assured/rest-assured/issues/1510
- //RestAssured.when().get("/test").then().statusCode(200).body(is("OK"));
- //RestAssured.when().get("/test/async").then().statusCode(500);
- //RestAssured.when().get("/test/async-working").then().statusCode(200).body(is("OK"));
- }
-}
diff --git a/tests/src/test/java9/io/smallrye/context/test/CompletableFutureTest.java b/tests/src/test/java9/io/smallrye/context/test/CompletableFutureTest.java
deleted file mode 100644
index 69cc1faf..00000000
--- a/tests/src/test/java9/io/smallrye/context/test/CompletableFutureTest.java
+++ /dev/null
@@ -1,343 +0,0 @@
-package io.smallrye.context.test;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.CompletionStage;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import org.eclipse.microprofile.context.ThreadContext;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
-
-import io.smallrye.context.SmallRyeManagedExecutor;
-import io.smallrye.context.SmallRyeThreadContext;
-import io.smallrye.context.impl.Contextualized;
-import io.smallrye.context.impl.ThreadContextProviderPlan;
-import io.smallrye.context.test.util.AbstractTest;
-
-public class CompletableFutureTest extends AbstractTest {
-
- private SmallRyeManagedExecutor managedExecutor;
-
- @Before
- public void before() {
- managedExecutor = SmallRyeManagedExecutor.builder().propagated(MyThreadContextProvider.MY_CONTEXT_TYPE)
- .cleared(ThreadContext.ALL_REMAINING).build();
- MyContext.clear();
- }
-
- @Test
- public void testContextPropagation() throws InterruptedException, ExecutionException {
- // no context
- Assert.assertNull(MyContext.get());
- // nothing in the current thread
- managedExecutor.completedFuture(null)
- .thenApply(v -> {
- Assert.assertNull(MyContext.get());
- return v;
- })
- .get();
- // nothing in the executor thread
- managedExecutor.completedFuture(null)
- .thenApplyAsync(v -> {
- Assert.assertNull(MyContext.get());
- return v;
- })
- .get();
- // still no context
- Assert.assertNull(MyContext.get());
-
- // now with context
- MyContext ctx = new MyContext();
- MyContext.set(ctx);
- Assert.assertEquals(ctx, MyContext.get());
- try {
- // context in the current thread
- managedExecutor.completedFuture(null)
- .thenApply(v -> {
- Assert.assertEquals(ctx, MyContext.get());
- return v;
- })
- .get();
- // context in the executor thread
- managedExecutor.completedFuture(null)
- .thenApplyAsync(v -> {
- Assert.assertEquals(ctx, MyContext.get());
- return v;
- })
- .get();
- // still with context
- Assert.assertEquals(ctx, MyContext.get());
-
- // now create a CF while we have a context
- CompletableFuture cfCreatedWithContext = managedExecutor.completedFuture(null);
- // remove the context
- MyContext.clear();
-
- // check that we get no context, since we're capturing at lambda creation time
- // nothing in the current thread
- cfCreatedWithContext
- .thenApply(v -> {
- Assert.assertNull(MyContext.get());
- return v;
- })
- .get();
- // nothing in the executor thread
- cfCreatedWithContext
- .thenApplyAsync(v -> {
- Assert.assertNull(MyContext.get());
- return v;
- })
- .get();
-
- // now set it to another context and check we get the second context
- MyContext ctx2 = new MyContext();
- MyContext.set(ctx2);
- // context in the current thread
- cfCreatedWithContext
- .thenApply(v -> {
- Assert.assertEquals(ctx2, MyContext.get());
- return v;
- })
- .get();
- // context in the executor thread
- cfCreatedWithContext
- .thenApplyAsync(v -> {
- Assert.assertEquals(ctx2, MyContext.get());
- return v;
- })
- .get();
- } finally {
- MyContext.clear();
- }
- }
-
- @Test
- public void testJava9Methods() throws InterruptedException, ExecutionException {
- // only run on JDK >= 9 which has that method
- try {
- CompletableFuture.class.getDeclaredMethod("copy");
- } catch (NoSuchMethodException | SecurityException e) {
- Assume.assumeTrue(false);
- }
-
- CompletableFuture
-
-
- org.apache.maven.plugins
- maven-install-plugin
-
- true
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
-
- true
-
-
diff --git a/tck/src/test/java/io/smallrye/context/tck/SmallRyeContextArchiveProcessor.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/SmallRyeContextArchiveProcessor.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/SmallRyeContextArchiveProcessor.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/SmallRyeContextArchiveProcessor.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/SmallRyeContextLoadableExtension.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/SmallRyeContextLoadableExtension.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/SmallRyeContextLoadableExtension.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/SmallRyeContextLoadableExtension.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/TckContextManagerTest.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/TckContextManagerTest.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/TckContextManagerTest.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/TckContextManagerTest.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/TckMPConfigTest.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/TckMPConfigTest.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/TckMPConfigTest.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/TckMPConfigTest.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/TckManagedExecutorTest.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/TckManagedExecutorTest.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/TckManagedExecutorTest.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/TckManagedExecutorTest.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/TckThreadContextTest.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/TckThreadContextTest.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/TckThreadContextTest.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/TckThreadContextTest.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/ThreadContextCSCFTest.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/ThreadContextCSCFTest.java
similarity index 99%
rename from tck/src/test/java/io/smallrye/context/tck/ThreadContextCSCFTest.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/ThreadContextCSCFTest.java
index 96c81aad..3fbe1a15 100644
--- a/tck/src/test/java/io/smallrye/context/tck/ThreadContextCSCFTest.java
+++ b/testsuite/tck/src/test/java/io/smallrye/context/tck/ThreadContextCSCFTest.java
@@ -463,7 +463,7 @@ public void contextOfContextualFunctionOverridesContextOfManagedExecutor()
* by the ManagedExecutor's failedFuture implementation. Thread context is captured
* at each point where a dependent stage is added, rather than solely upon creation of the
* initial stage or construction of the builder.
- *
+ *
* @throws ExecutionException indicates test failure
* @throws InterruptedException indicates test failure
* @throws TimeoutException indicates test failure
@@ -749,7 +749,7 @@ public void newIncompleteFutureDependentStagesRunWithContext() throws ExecutionE
/**
* Verify that we can copy a CompletableFuture and get context propagation in the copy's dependent stages.
- *
+ *
* @throws InterruptedException indicates test failure
* @throws ExecutionException indicates test failure
* @throws TimeoutException indicates test failure
@@ -796,7 +796,7 @@ public void copyCompletableFuture() throws InterruptedException, ExecutionExcept
/**
* Verify that we can copy a CompletionStage and get context propagation in the copy's dependent stages.
- *
+ *
* @throws InterruptedException indicates test failure
* @throws ExecutionException indicates test failure
* @throws TimeoutException indicates test failure
diff --git a/testsuite/tck/src/test/java/io/smallrye/context/tck/TransactionServicesImpl.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/TransactionServicesImpl.java
new file mode 100644
index 00000000..42026e4c
--- /dev/null
+++ b/testsuite/tck/src/test/java/io/smallrye/context/tck/TransactionServicesImpl.java
@@ -0,0 +1,74 @@
+package io.smallrye.context.tck;
+
+import jakarta.transaction.RollbackException;
+import jakarta.transaction.Status;
+import jakarta.transaction.Synchronization;
+import jakarta.transaction.SystemException;
+import jakarta.transaction.Transaction;
+import jakarta.transaction.TransactionManager;
+import jakarta.transaction.UserTransaction;
+
+import org.jboss.weld.transaction.spi.TransactionServices;
+
+public class TransactionServicesImpl implements TransactionServices {
+ private Transaction getTransaction() {
+ try {
+ TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+
+ return tm == null ? null : tm.getTransaction();
+ } catch (SystemException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public void registerSynchronization(Synchronization synchronization) {
+ Transaction transaction = getTransaction();
+
+ if (transaction == null) {
+ throw new RuntimeException("No active transaction");
+ }
+
+ try {
+ transaction.registerSynchronization(synchronization);
+ } catch (RollbackException | SystemException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public boolean isTransactionActive() {
+ try {
+ Transaction transaction = getTransaction();
+ int status;
+
+ if (transaction == null) {
+ return false;
+ }
+
+ status = transaction.getStatus();
+
+ return status == Status.STATUS_ACTIVE ||
+ status == Status.STATUS_COMMITTING ||
+ status == Status.STATUS_MARKED_ROLLBACK ||
+ status == Status.STATUS_PREPARED ||
+ status == Status.STATUS_PREPARING ||
+ status == Status.STATUS_ROLLING_BACK;
+ } catch (SystemException | RuntimeException e) {
+ return false;
+ }
+ }
+
+ @Override
+ public UserTransaction getUserTransaction() {
+ try {
+ return com.arjuna.ats.jta.UserTransaction.userTransaction();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public void cleanup() {
+ }
+}
diff --git a/tck/src/test/java/io/smallrye/context/tck/cdi/TckBasicCDITest.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/cdi/TckBasicCDITest.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/cdi/TckBasicCDITest.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/cdi/TckBasicCDITest.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExecuter.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExecuter.java
similarity index 100%
rename from tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExecuter.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExecuter.java
diff --git a/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExtension.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExtension.java
similarity index 99%
rename from tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExtension.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExtension.java
index e8b2a84a..6e9eec93 100644
--- a/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExtension.java
+++ b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/LifecycleExtension.java
@@ -10,7 +10,7 @@
* 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,
+ * 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.
diff --git a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterDeploy.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterDeploy.java
similarity index 99%
rename from tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterDeploy.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterDeploy.java
index 556f6396..96068e3c 100644
--- a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterDeploy.java
+++ b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterDeploy.java
@@ -10,7 +10,7 @@
* 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,
+ * 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.
diff --git a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterUnDeploy.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterUnDeploy.java
similarity index 99%
rename from tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterUnDeploy.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterUnDeploy.java
index 2fe4354e..8431e56a 100644
--- a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterUnDeploy.java
+++ b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/AfterUnDeploy.java
@@ -10,7 +10,7 @@
* 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,
+ * 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.
diff --git a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeDeploy.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeDeploy.java
similarity index 99%
rename from tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeDeploy.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeDeploy.java
index 674430cc..bfaa526d 100644
--- a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeDeploy.java
+++ b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeDeploy.java
@@ -10,7 +10,7 @@
* 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,
+ * 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.
diff --git a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeUnDeploy.java b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeUnDeploy.java
similarity index 99%
rename from tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeUnDeploy.java
rename to testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeUnDeploy.java
index aab9eb8b..b2b4d4c1 100644
--- a/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeUnDeploy.java
+++ b/testsuite/tck/src/test/java/io/smallrye/context/tck/lifecycle/api/BeforeUnDeploy.java
@@ -10,7 +10,7 @@
* 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,
+ * 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.
diff --git a/tck/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/testsuite/tck/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
similarity index 100%
rename from tck/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
rename to testsuite/tck/src/test/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension
diff --git a/testsuite/tck/src/test/resources/META-INF/services/org.jboss.weld.bootstrap.api.Service b/testsuite/tck/src/test/resources/META-INF/services/org.jboss.weld.bootstrap.api.Service
new file mode 100644
index 00000000..61d52b8c
--- /dev/null
+++ b/testsuite/tck/src/test/resources/META-INF/services/org.jboss.weld.bootstrap.api.Service
@@ -0,0 +1 @@
+io.smallrye.context.tck.TransactionServicesImpl
diff --git a/tck/src/test/resources/arquillian.xml b/testsuite/tck/src/test/resources/arquillian.xml
similarity index 100%
rename from tck/src/test/resources/arquillian.xml
rename to testsuite/tck/src/test/resources/arquillian.xml
diff --git a/tests/src/test/resources/jndi.properties b/testsuite/tck/src/test/resources/jndi.properties
similarity index 100%
rename from tests/src/test/resources/jndi.properties
rename to testsuite/tck/src/test/resources/jndi.properties