Skip to content

Commit

Permalink
Merge pull request #177 from tevans78/updateMPParent
Browse files Browse the repository at this point in the history
Update microprofile-parent version
  • Loading branch information
Azquelt authored Sep 8, 2023
2 parents 554a48d + 484bfa2 commit 249bc47
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 39 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ release.conf
/bin/
.~lock.*.odg#
**.DS_Store
.vscode
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright (c) 2018, 2022 Contributors to the Eclipse Foundation
~ Copyright (c) 2018, 2023 Contributors to the Eclipse Foundation
~
~ See the NOTICE file(s) distributed with this work for additional
~ information regarding copyright ownership.
Expand Down Expand Up @@ -28,7 +28,7 @@
</parent>

<properties>
<frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
<frontend-maven-plugin.version>1.11.0</frontend-maven-plugin.version>
<bnd.baseline.include.distribution.management>false</bnd.baseline.include.distribution.management>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public interface ConnectingOperators<T> {
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,71 +158,71 @@ <S> ProcessorBuilder<T, S> flatMapCompletionStage(

/**
* {@inheritDoc}
*
*
* @return A {@link SubscriberBuilder} that will invoke the action for each element of the stream.
*/
@Override
SubscriberBuilder<T, Void> forEach(Consumer<? super R> action);

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder} for the stream.
*/
@Override
SubscriberBuilder<T, Void> ignore();

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder} for the stream.
*/
@Override
SubscriberBuilder<T, Void> cancel();

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder} for the reduction.
*/
@Override
SubscriberBuilder<T, R> reduce(R identity, BinaryOperator<R> accumulator);

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder} for the reduction.
*/
@Override
SubscriberBuilder<T, Optional<R>> reduce(BinaryOperator<R> accumulator);

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder} that will emit the collected result.
*/
@Override
<S, A> SubscriberBuilder<T, S> collect(Collector<? super R, A, S> collector);

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder} that will emit the collected result.
*/
@Override
<S> SubscriberBuilder<T, S> collect(Supplier<S> supplier, BiConsumer<S, ? super R> accumulator);

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder} that will emit the list.
*/
@Override
SubscriberBuilder<T, List<R>> toList();

/**
* {@inheritDoc}
*
*
* @return A new {@link SubscriberBuilder}.
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,71 +155,71 @@ public interface PublisherBuilder<T>

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream.
*/
@Override
CompletionRunner<Void> forEach(Consumer<? super T> action);

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream.
*/
@Override
CompletionRunner<Void> ignore();

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream.
*/
@Override
CompletionRunner<Void> cancel();

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream.
*/
@Override
CompletionRunner<T> reduce(T identity, BinaryOperator<T> accumulator);

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream.
*/
@Override
CompletionRunner<Optional<T>> reduce(BinaryOperator<T> accumulator);

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream.
*/
@Override
CompletionRunner<Optional<T>> findFirst();

/**
* {@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.
*/
@Override
<R, A> CompletionRunner<R> collect(Collector<? super T, A, R> collector);
/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream which emits the collected result.
*/
@Override
<R> CompletionRunner<R> collect(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator);

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the stream that emits the list.
*/
@Override
Expand All @@ -246,15 +246,15 @@ PublisherBuilder<T> onErrorResumeWithRsPublisher(

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the composed stream.
*/
@Override
CompletionRunner<Void> to(Subscriber<? super T> subscriber);

/**
* {@inheritDoc}
*
*
* @return A new {@link CompletionRunner} that can be used to run the composed stream.
*/
@Override
Expand Down Expand Up @@ -282,7 +282,7 @@ PublisherBuilder<T> 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
* <p>
*
*
* <pre>
* Publisher&lt;Row&gt; rowsPublisher = ...;
*
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright (c) 2018, 2022 Contributors to the Eclipse Foundation
~ Copyright (c) 2018, 2023 Contributors to the Eclipse Foundation
~
~ See the NOTICE file(s) distributed with this work for additional
~ information regarding copyright ownership.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile-parent</artifactId>
<version>2.5</version>
<version>2.8</version>
</parent>

<groupId>org.eclipse.microprofile.reactive-streams-operators</groupId>
Expand All @@ -33,6 +33,7 @@

<properties>
<inceptionYear>2018</inceptionYear>
<version.microprofile.tck.bom>2.8</version.microprofile.tck.bom>
</properties>

<name>Eclipse MicroProfile Reactive Streams Operators</name>
Expand Down
14 changes: 13 additions & 1 deletion tck/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright (c) 2018, 2022 Contributors to the Eclipse Foundation
~ Copyright (c) 2018, 2023 Contributors to the Eclipse Foundation
~
~ See the NOTICE file(s) distributed with this work for additional
~ information regarding copyright ownership.
Expand Down Expand Up @@ -45,6 +45,18 @@
<name>Eclipse MicroProfile Reactive Streams Operators TCK</name>
<description>Eclipse MicroProfile Reactive Streams Operators :: TCK</description>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile-tck-bom</artifactId>
<version>${version.microprofile.tck.bom}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.reactive-streams-operators</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2018, 2023 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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> T newInstance(Class<T> 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> 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> T newInstance(Constructor<T> 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();
Expand Down

0 comments on commit 249bc47

Please sign in to comment.