From c2b4e6d2cee2cdb85fbf572f40bc3d348acfc9c7 Mon Sep 17 00:00:00 2001 From: Tom Evans Date: Thu, 3 Aug 2023 16:36:38 +0100 Subject: [PATCH] Update microprofile-parent version Signed-off-by: Tom Evans --- .gitignore | 1 + api/pom.xml | 2 +- .../operators/ConnectingOperators.java | 2 +- .../streams/operators/ProcessorBuilder.java | 18 ++++---- .../streams/operators/PublisherBuilder.java | 24 +++++------ .../streams/operators/package-info.java | 2 +- pom.xml | 3 +- tck/pom.xml | 12 ++++++ .../ReactiveStreamsArquillianTck.java | 42 ++++++++++++++----- 9 files changed, 71 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 770f212..ab1ac68 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ release.conf /bin/ .~lock.*.odg# **.DS_Store +.vscode diff --git a/api/pom.xml b/api/pom.xml index 3d6728d..cbfdfed 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -28,7 +28,7 @@ - 1.6 + 1.11.0 false diff --git a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ConnectingOperators.java b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ConnectingOperators.java index 477fc21..2f2df81 100644 --- a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ConnectingOperators.java +++ b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ConnectingOperators.java @@ -78,7 +78,7 @@ public interface ConnectingOperators { * in, so the resulting stream should only be run once. For the same reason, the processor passed in should not have * any active subscriptions and should not be used in more than one call to this method. * - * + * * @param processor * The processor builder to connect. * @return A stream builder that represents the passed in processor builder's outlet. diff --git a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ProcessorBuilder.java b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ProcessorBuilder.java index 67d36fd..d0037bc 100644 --- a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ProcessorBuilder.java +++ b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/ProcessorBuilder.java @@ -158,7 +158,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A {@link SubscriberBuilder} that will invoke the action for each element of the stream. */ @Override @@ -166,7 +166,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder} for the stream. */ @Override @@ -174,7 +174,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder} for the stream. */ @Override @@ -182,7 +182,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder} for the reduction. */ @Override @@ -190,7 +190,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder} for the reduction. */ @Override @@ -198,7 +198,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder} that will emit the collected result. */ @Override @@ -206,7 +206,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder} that will emit the collected result. */ @Override @@ -214,7 +214,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder} that will emit the list. */ @Override @@ -222,7 +222,7 @@ ProcessorBuilder flatMapCompletionStage( /** * {@inheritDoc} - * + * * @return A new {@link SubscriberBuilder}. */ @Override diff --git a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/PublisherBuilder.java b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/PublisherBuilder.java index 45da89d..aa159c5 100644 --- a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/PublisherBuilder.java +++ b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/PublisherBuilder.java @@ -155,7 +155,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream. */ @Override @@ -163,7 +163,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream. */ @Override @@ -171,7 +171,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream. */ @Override @@ -179,7 +179,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream. */ @Override @@ -187,7 +187,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream. */ @Override @@ -195,7 +195,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream. */ @Override @@ -203,7 +203,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream, R is the result type of the * collector's reduction operation. */ @@ -211,7 +211,7 @@ public interface PublisherBuilder CompletionRunner collect(Collector collector); /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream which emits the collected result. */ @Override @@ -219,7 +219,7 @@ public interface PublisherBuilder /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the stream that emits the list. */ @Override @@ -246,7 +246,7 @@ PublisherBuilder onErrorResumeWithRsPublisher( /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the composed stream. */ @Override @@ -254,7 +254,7 @@ PublisherBuilder onErrorResumeWithRsPublisher( /** * {@inheritDoc} - * + * * @return A new {@link CompletionRunner} that can be used to run the composed stream. */ @Override @@ -282,7 +282,7 @@ PublisherBuilder onErrorResumeWithRsPublisher( * Build this stream, using the supplied {@link ReactiveStreamsEngine}. This method is designed for the use case * where you have to supply a paritcular {@link ReactiveStreamsEngine}. Most cases you should use * {@link #buildRs()}. - * + * * @param engine * The engine to run the stream with. * @return A {@link Publisher} that will run this stream. diff --git a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/package-info.java b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/package-info.java index 227c016..9293691 100644 --- a/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/package-info.java +++ b/api/src/main/java/org/eclipse/microprofile/reactive/streams/operators/package-info.java @@ -65,7 +65,7 @@ * you want to output it as a comma separated list of lines to publish to an HTTP client request body, which expects a * {@link org.reactivestreams.Publisher} of {@link java.nio.ByteBuffer}. Here's how this might be implemented: *

- * + * *

  *   Publisher<Row> rowsPublisher = ...;
  *
diff --git a/pom.xml b/pom.xml
index f103c9d..652767a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     
         org.eclipse.microprofile
         microprofile-parent
-        2.5
+        2.8
     
 
     org.eclipse.microprofile.reactive-streams-operators
@@ -33,6 +33,7 @@
 
     
         2018
+        2.8
     
 
     Eclipse MicroProfile Reactive Streams Operators
diff --git a/tck/pom.xml b/tck/pom.xml
index 3c78577..77e6c5b 100644
--- a/tck/pom.xml
+++ b/tck/pom.xml
@@ -45,6 +45,18 @@
     Eclipse MicroProfile Reactive Streams Operators TCK
     Eclipse MicroProfile Reactive Streams Operators :: TCK
 
+    
+        
+            
+                org.eclipse.microprofile
+                microprofile-tck-bom
+                ${version.microprofile.tck.bom}
+                pom
+                import
+            
+        
+    
+
     
         
             org.eclipse.microprofile.reactive-streams-operators
diff --git a/tck/src/main/java/org/eclipse/microprofile/reactive/streams/operators/tck/arquillian/ReactiveStreamsArquillianTck.java b/tck/src/main/java/org/eclipse/microprofile/reactive/streams/operators/tck/arquillian/ReactiveStreamsArquillianTck.java
index 49f0c9b..3487d22 100644
--- a/tck/src/main/java/org/eclipse/microprofile/reactive/streams/operators/tck/arquillian/ReactiveStreamsArquillianTck.java
+++ b/tck/src/main/java/org/eclipse/microprofile/reactive/streams/operators/tck/arquillian/ReactiveStreamsArquillianTck.java
@@ -19,6 +19,7 @@
 
 package org.eclipse.microprofile.reactive.streams.operators.tck.arquillian;
 
+import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -37,15 +38,14 @@
 import org.testng.IClassListener;
 import org.testng.IMethodInstance;
 import org.testng.IMethodInterceptor;
-import org.testng.IObjectFactory;
 import org.testng.ITestClass;
 import org.testng.ITestContext;
 import org.testng.ITestListener;
 import org.testng.ITestNGListener;
+import org.testng.ITestObjectFactory;
 import org.testng.ITestResult;
 import org.testng.TestNG;
 import org.testng.annotations.Test;
-import org.testng.internal.ObjectFactoryImpl;
 
 import jakarta.inject.Inject;
 
@@ -78,18 +78,40 @@ public static JavaArchive tckDeployment() {
     @Inject
     private ReactiveStreamsCdiTck tck;
 
-    @Test
-    public void runAllTckTests() throws Throwable {
-        TestNG testng = new TestNG();
+    private class TCKObjectFactory implements ITestObjectFactory {
+        @Override
+        public  T newInstance(Class cls, Object... parameters) {
+            if (cls.equals(ReactiveStreamsCdiTck.class)) {
+                return (T) tck;
+            } else {
+                return ITestObjectFactory.super.newInstance(cls, parameters);
+            }
+        }
 
-        ObjectFactoryImpl delegate = new ObjectFactoryImpl();
-        testng.setObjectFactory((IObjectFactory) (constructor, params) -> {
+        @Override
+        public  T newInstance(String clsName, Object... parameters) {
+            if (clsName.equals(ReactiveStreamsCdiTck.class.getName())) {
+                return (T) tck;
+            } else {
+                return ITestObjectFactory.super.newInstance(clsName, parameters);
+            }
+        }
+
+        @Override
+        public  T newInstance(Constructor constructor, Object... parameters) {
             if (constructor.getDeclaringClass().equals(ReactiveStreamsCdiTck.class)) {
-                return tck;
+                return (T) tck;
             } else {
-                return delegate.newInstance(constructor, params);
+                return ITestObjectFactory.super.newInstance(constructor, parameters);
             }
-        });
+        }
+    }
+
+    @Test
+    public void runAllTckTests() throws Throwable {
+        TestNG testng = new TestNG();
+
+        testng.setObjectFactory(new TCKObjectFactory());
 
         testng.setUseDefaultListeners(false);
         ResultListener resultListener = new ResultListener();