You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/06/20 06:03:21 UTC

[plc4x] 04/04: test(plc4go/cbus): set executor for browse test

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit e5cf78485b3b6b2bffd91f596fa2f3ed64bec893
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue Jun 20 08:03:10 2023 +0200

    test(plc4go/cbus): set executor for browse test
---
 plc4go/internal/cbus/Browser_test.go | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/plc4go/internal/cbus/Browser_test.go b/plc4go/internal/cbus/Browser_test.go
index 3fef9b7ee8..c1860d88e8 100644
--- a/plc4go/internal/cbus/Browser_test.go
+++ b/plc4go/internal/cbus/Browser_test.go
@@ -35,7 +35,9 @@ import (
 	readWriteModel "github.com/apache/plc4x/plc4go/protocols/cbus/readwrite/model"
 	_default "github.com/apache/plc4x/plc4go/spi/default"
 	spiModel "github.com/apache/plc4x/plc4go/spi/model"
+	"github.com/apache/plc4x/plc4go/spi/pool"
 	"github.com/apache/plc4x/plc4go/spi/testutils"
+	"github.com/apache/plc4x/plc4go/spi/transactions"
 	"github.com/apache/plc4x/plc4go/spi/transports"
 	"github.com/apache/plc4x/plc4go/spi/transports/test"
 	"github.com/apache/plc4x/plc4go/spi/utils"
@@ -88,6 +90,13 @@ func TestBrowser_BrowseQuery(t *testing.T) {
 			setup: func(t *testing.T, fields *fields) {
 				_options := testutils.EnrichOptionsWithOptionsForTesting(t)
 
+				executor := pool.NewFixedSizeExecutor(10, 10, _options...)
+				executor.Start()
+				t.Cleanup(executor.Stop)
+				_options = append(_options,
+					transactions.WithCustomExecutor(executor),
+				)
+
 				transport := test.NewTransport(_options...)
 				transportUrl := url.URL{Scheme: "test"}
 				transportInstance, err := transport.CreateTransportInstance(transportUrl, nil, _options...)
@@ -246,6 +255,11 @@ func TestBrowser_browseUnitInfo(t *testing.T) {
 			setup: func(t *testing.T, fields *fields) {
 				_options := testutils.EnrichOptionsWithOptionsForTesting(t)
 
+				executor := pool.NewFixedSizeExecutor(10, 10, _options...)
+				executor.Start()
+				t.Cleanup(executor.Stop)
+				_options = append(_options, transactions.WithCustomExecutor(executor))
+
 				transport := test.NewTransport(_options...)
 				transportUrl := url.URL{Scheme: "test"}
 				transportInstance, err := transport.CreateTransportInstance(transportUrl, nil, _options...)