You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by Philipp Zehnder <ph...@bytefabrik.ai> on 2023/05/17 16:09:14 UTC
Updated integration Tests for adapters
Hi all,
as part of the API change in Connect, I have also adjusted the integration tests for adapters. [1]
In particular, you no longer need to customize the sink of the AdapterPipelines.
There is now an interface "IEventCollector" which you can implement and then get the generated events.
I think this makes the implementation much clearer.
The main thing that needs to be improved is the “prepareAdapter()”.
Therefore I’d like to create a builder to create “PipelineElementTemplates”.
If you have further ideas for improvement, feel free to tell me.
@Zike, I have adjusted the tests. The MQTT test is already working, but there is still a problem with the Pulsar test, which is why it is still commented out. What do you think about the new API?
[1] https://github.com/apache/streampipes/tree/remove-set-adapters/streampipes-integration-tests/src/test/java/org/apache/streampipes/integration/adapters
AW: Updated integration Tests for adapters
Posted by Philipp Zehnder <ph...@bytefabrik.ai>.
Hi Zike,
thanks a lot for your feedback!
You are absolutely right, the code you shared needs to be changed.
That is the part I was referring to with the „builder for PipelineElementTemplates“.
The idea would be to have a programmatic API to add user input to an AdapterConfiguration. I was thinking of something like that:
PipelineElementTemplageBuilder.create()
.withAdapterConfiguration(adapterConfiguration)
.textInput(PulsarProtocol.PULSAR_SUBSCRIPTION_NAME, "test-sub")
.checkbox("json-format")
// additional user input
.build()
However, this is currently just pseudocode to illustrate the idea, we still need to talk about the exact methods.
How do you like that?
Cheers,
Philipp
Von: Zike Yang <zi...@apache.org>
Datum: Donnerstag, 18. Mai 2023 um 16:27
An: dev@streampipes.apache.org <de...@streampipes.apache.org>
Betreff: Re: Updated integration Tests for adapters
Hi Philipp,
Thanks for driving this work! The new API looks good to me. But there
is one thing that is not very straightforward for me:
```
// Set authentication mode to unauthenticated
((StaticPropertyAlternatives) desc
.getConfig()
.get(1))
.getAlternatives()
.get(0)
.setSelected(true);
// Set format to Json
((StaticPropertyAlternatives) (desc)
.getConfig()
.get(3))
.getAlternatives()
.get(0)
.setSelected(true);
```
It seems too complex and uses some Majic numbers (0, 3) here, which
makes it hard to read and write.
Is it possible to make it more straightforward and readable?
Regarding the Pulsar integration tests, I can try to fix it.
I think we can create a draft PR first so that we can see all these
code changes and collaborate more easily.
What do you think?
Thanks,
Zike Yang
On Thu, May 18, 2023 at 12:09 AM Philipp Zehnder
<ph...@bytefabrik.ai> wrote:
>
> Hi all,
> as part of the API change in Connect, I have also adjusted the integration tests for adapters. [1]
> In particular, you no longer need to customize the sink of the AdapterPipelines.
> There is now an interface "IEventCollector" which you can implement and then get the generated events.
> I think this makes the implementation much clearer.
>
> The main thing that needs to be improved is the “prepareAdapter()”.
> Therefore I’d like to create a builder to create “PipelineElementTemplates”.
>
> If you have further ideas for improvement, feel free to tell me.
>
>
> @Zike, I have adjusted the tests. The MQTT test is already working, but there is still a problem with the Pulsar test, which is why it is still commented out. What do you think about the new API?
>
>
> [1] https://github.com/apache/streampipes/tree/remove-set-adapters/streampipes-integration-tests/src/test/java/org/apache/streampipes/integration/adapters
Re: Updated integration Tests for adapters
Posted by Zike Yang <zi...@apache.org>.
Hi Philipp,
Thanks for driving this work! The new API looks good to me. But there
is one thing that is not very straightforward for me:
```
// Set authentication mode to unauthenticated
((StaticPropertyAlternatives) desc
.getConfig()
.get(1))
.getAlternatives()
.get(0)
.setSelected(true);
// Set format to Json
((StaticPropertyAlternatives) (desc)
.getConfig()
.get(3))
.getAlternatives()
.get(0)
.setSelected(true);
```
It seems too complex and uses some Majic numbers (0, 3) here, which
makes it hard to read and write.
Is it possible to make it more straightforward and readable?
Regarding the Pulsar integration tests, I can try to fix it.
I think we can create a draft PR first so that we can see all these
code changes and collaborate more easily.
What do you think?
Thanks,
Zike Yang
On Thu, May 18, 2023 at 12:09 AM Philipp Zehnder
<ph...@bytefabrik.ai> wrote:
>
> Hi all,
> as part of the API change in Connect, I have also adjusted the integration tests for adapters. [1]
> In particular, you no longer need to customize the sink of the AdapterPipelines.
> There is now an interface "IEventCollector" which you can implement and then get the generated events.
> I think this makes the implementation much clearer.
>
> The main thing that needs to be improved is the “prepareAdapter()”.
> Therefore I’d like to create a builder to create “PipelineElementTemplates”.
>
> If you have further ideas for improvement, feel free to tell me.
>
>
> @Zike, I have adjusted the tests. The MQTT test is already working, but there is still a problem with the Pulsar test, which is why it is still commented out. What do you think about the new API?
>
>
> [1] https://github.com/apache/streampipes/tree/remove-set-adapters/streampipes-integration-tests/src/test/java/org/apache/streampipes/integration/adapters