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
The following commit(s) were added to refs/heads/develop by this push:
new 02c7c06a3b fix(plc4go): unbreak plc4xGenerator on bacnetip
DriverContext
02c7c06a3b is described below
commit 02c7c06a3b81f7a6140fd4d15a2126f121f76808
Author: Sebastian Rühl <[email protected]>
AuthorDate: Thu May 21 16:54:29 2026 +0200
fix(plc4go): unbreak plc4xGenerator on bacnetip DriverContext
Phase-1's DriverContext introduced the first non-pointer `model.*` enum
fields used directly as struct members. plc4xGenerator's
serializableFieldTemplate emits `if x != nil` for any SelectorExpr field,
which is valid for pointer/interface fields but invalid Go for value-typed
enums like MaxApduLengthAccepted / BACnetSegmentation / MaxSegmentsAccepted.
CI's regenerated DriverContext_plc4xgen.go therefore failed to compile,
breaking the mockery step.
Mark the three enum fields with `stringer:"true"` so the generator calls
their generated `.String()` instead of the SelectorExpr template. Mirrors
how knxnetip's KnxMedium and opcua's UserTokenType are tagged. The enum
values now appear by name in debug output instead of being hidden.
Also check in the generated Configuration_plc4xgen.go and
DriverContext_plc4xgen.go alongside MessageCodec_plc4xgen.go and
Subscriber_plc4xgen.go (cbus and opcua track theirs too).
---
plc4go/internal/bacnetip/Configuration_plc4xgen.go | 126 +++++++++
plc4go/internal/bacnetip/DriverContext.go | 6 +-
plc4go/internal/bacnetip/DriverContext_plc4xgen.go | 95 +++++++
plc4go/internal/bacnetip/MessageCodec.go | 1 -
plc4go/internal/bacnetip/MessageCodec_test.go | 10 +-
plc4go/internal/bacnetip/Segmentation.go | 26 +-
plc4go/internal/bacnetip/Subscriber_plc4xgen.go | 31 +++
plc4go/internal/bacnetip/TagHandler_test.go | 8 +-
plc4go/internal/bacnetip/ValueDecoder.go | 2 +-
plc4go/internal/bacnetip/mocks_test.go | 310 +++++++++++++++++++++
plc4go/tests/integration/bacnetip/README.md | 20 ++
.../tests/integration/bacnetip/integration_test.go | 3 +-
12 files changed, 610 insertions(+), 28 deletions(-)
diff --git a/plc4go/internal/bacnetip/Configuration_plc4xgen.go
b/plc4go/internal/bacnetip/Configuration_plc4xgen.go
new file mode 100644
index 0000000000..32a880cb31
--- /dev/null
+++ b/plc4go/internal/bacnetip/Configuration_plc4xgen.go
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://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, 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.
+ */
+
+// Code generated by "plc4xGenerator -type=Configuration"; DO NOT EDIT.
+
+package bacnetip
+
+import (
+ "context"
+ "encoding/binary"
+ "fmt"
+ "github.com/apache/plc4x/plc4go/spi/utils"
+)
+
+var _ = fmt.Printf
+
+func (d *Configuration) Serialize() ([]byte, error) {
+ if d == nil {
+ return nil, fmt.Errorf("(*DeviceInfoCache)(nil)")
+ }
+ wb :=
utils.NewWriteBufferByteBased(utils.WithByteOrderForByteBasedBuffer(binary.BigEndian))
+ if err := d.SerializeWithWriteBuffer(context.Background(), wb); err !=
nil {
+ return nil, err
+ }
+ return wb.GetBytes(), nil
+}
+
+func (d *Configuration) SerializeWithWriteBuffer(ctx context.Context,
writeBuffer utils.WriteBuffer) error {
+ if d == nil {
+ return fmt.Errorf("(*DeviceInfoCache)(nil)")
+ }
+ if err := writeBuffer.PushContext("Configuration"); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteUint32("localDeviceId", 32,
d.LocalDeviceId); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteUint16("localNetworkNumber", 16,
d.LocalNetworkNumber); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteUint16("maxApduLengthAccepted", 16,
d.MaxApduLengthAccepted); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteString("segmentationSupported",
uint32(len(d.SegmentationSupported)*8), d.SegmentationSupported); err != nil {
+ return err
+ }
+ {
+ _value := fmt.Sprintf("%v", d.MaxSegmentsAccepted)
+
+ if err := writeBuffer.WriteString("maxSegmentsAccepted",
uint32(len(_value)*8), _value); err != nil {
+ return err
+ }
+ }
+
+ if err := writeBuffer.WriteUint16("vendorId", 16, d.VendorId); err !=
nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteString("foreignDeviceBBMD",
uint32(len(d.ForeignDeviceBBMD)*8), d.ForeignDeviceBBMD); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteUint16("foreignDeviceTTL", 16,
d.ForeignDeviceTTL); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteUint32("apduTimeoutMs", 32,
d.ApduTimeoutMs); err != nil {
+ return err
+ }
+ {
+ _value := fmt.Sprintf("%v", d.ApduRetries)
+
+ if err := writeBuffer.WriteString("apduRetries",
uint32(len(_value)*8), _value); err != nil {
+ return err
+ }
+ }
+
+ if err := writeBuffer.WriteUint32("covLifetimeSeconds", 32,
d.CovLifetimeSeconds); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteUint32("discoveryTimeoutSeconds", 32,
d.DiscoveryTimeoutSeconds); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteString("staticDevices",
uint32(len(d.StaticDevices)*8), d.StaticDevices); err != nil {
+ return err
+ }
+ if err := writeBuffer.PopContext("Configuration"); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (d *Configuration) String() string {
+ if alternateStringer, ok := any(d).(utils.AlternateStringer); ok {
+ if alternateString, use := alternateStringer.AlternateString();
use {
+ return alternateString
+ }
+ }
+ wb :=
utils.NewWriteBufferBoxBased(utils.WithWriteBufferBoxBasedMergeSingleBoxes(),
utils.WithWriteBufferBoxBasedOmitEmptyBoxes())
+ if err := wb.WriteSerializable(context.Background(), d); err != nil {
+ return err.Error()
+ }
+ return wb.GetBox().String()
+}
diff --git a/plc4go/internal/bacnetip/DriverContext.go
b/plc4go/internal/bacnetip/DriverContext.go
index 0ade7262d6..ea2e69c7e5 100644
--- a/plc4go/internal/bacnetip/DriverContext.go
+++ b/plc4go/internal/bacnetip/DriverContext.go
@@ -34,15 +34,15 @@ type DriverContext struct {
// maxApduLengthAccepted is the Configuration.MaxApduLengthAccepted
byte count
// translated to its BACnet enum value (used in IAm responses and
confirmed
// requests). E.g. 1476 → MaxApduLengthAccepted_NUM_OCTETS_1476.
- maxApduLengthAccepted model.MaxApduLengthAccepted
+ maxApduLengthAccepted model.MaxApduLengthAccepted `stringer:"true"`
// segmentation is Configuration.SegmentationSupported translated to its
// BACnet enum. Defaults to SEGMENTED_BOTH for unknown strings.
- segmentation model.BACnetSegmentation
+ segmentation model.BACnetSegmentation `stringer:"true"`
// maxSegmentsAccepted is Configuration.MaxSegmentsAccepted translated
to its
// BACnet enum value (e.g. 16 → NUM_SEGMENTS_16).
- maxSegmentsAccepted model.MaxSegmentsAccepted
+ maxSegmentsAccepted model.MaxSegmentsAccepted `stringer:"true"`
awaitSetupComplete bool
awaitDisconnectComplete bool
diff --git a/plc4go/internal/bacnetip/DriverContext_plc4xgen.go
b/plc4go/internal/bacnetip/DriverContext_plc4xgen.go
new file mode 100644
index 0000000000..242653fe28
--- /dev/null
+++ b/plc4go/internal/bacnetip/DriverContext_plc4xgen.go
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://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, 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.
+ */
+
+// Code generated by "plc4xGenerator -type=DriverContext"; DO NOT EDIT.
+
+package bacnetip
+
+import (
+ "context"
+ "encoding/binary"
+ "fmt"
+ "github.com/apache/plc4x/plc4go/spi/utils"
+)
+
+var _ = fmt.Printf
+
+func (d *DriverContext) Serialize() ([]byte, error) {
+ if d == nil {
+ return nil, fmt.Errorf("(*DeviceInfoCache)(nil)")
+ }
+ wb :=
utils.NewWriteBufferByteBased(utils.WithByteOrderForByteBasedBuffer(binary.BigEndian))
+ if err := d.SerializeWithWriteBuffer(context.Background(), wb); err !=
nil {
+ return nil, err
+ }
+ return wb.GetBytes(), nil
+}
+
+func (d *DriverContext) SerializeWithWriteBuffer(ctx context.Context,
writeBuffer utils.WriteBuffer) error {
+ if d == nil {
+ return fmt.Errorf("(*DeviceInfoCache)(nil)")
+ }
+ if err := writeBuffer.PushContext("DriverContext"); err != nil {
+ return err
+ }
+ {
+ _value := fmt.Sprintf("%v", d.configuration)
+
+ if err := writeBuffer.WriteString("configuration",
uint32(len(_value)*8), _value); err != nil {
+ return err
+ }
+ }
+
+ if err := writeBuffer.WriteString("maxApduLengthAccepted",
uint32(len(d.maxApduLengthAccepted.String())*8),
d.maxApduLengthAccepted.String()); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteString("segmentation",
uint32(len(d.segmentation.String())*8), d.segmentation.String()); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteString("maxSegmentsAccepted",
uint32(len(d.maxSegmentsAccepted.String())*8), d.maxSegmentsAccepted.String());
err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteBit("awaitSetupComplete",
d.awaitSetupComplete); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteBit("awaitDisconnectComplete",
d.awaitDisconnectComplete); err != nil {
+ return err
+ }
+ if err := writeBuffer.PopContext("DriverContext"); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (d *DriverContext) String() string {
+ if alternateStringer, ok := any(d).(utils.AlternateStringer); ok {
+ if alternateString, use := alternateStringer.AlternateString();
use {
+ return alternateString
+ }
+ }
+ wb :=
utils.NewWriteBufferBoxBased(utils.WithWriteBufferBoxBasedMergeSingleBoxes(),
utils.WithWriteBufferBoxBasedOmitEmptyBoxes())
+ if err := wb.WriteSerializable(context.Background(), d); err != nil {
+ return err.Error()
+ }
+ return wb.GetBox().String()
+}
diff --git a/plc4go/internal/bacnetip/MessageCodec.go
b/plc4go/internal/bacnetip/MessageCodec.go
index 812e287eea..3f2cbe51cb 100644
--- a/plc4go/internal/bacnetip/MessageCodec.go
+++ b/plc4go/internal/bacnetip/MessageCodec.go
@@ -127,4 +127,3 @@ func (m *MessageCodec) Receive(ctx context.Context)
(spi.Message, error) {
// TODO: maybe we return here a not enough error error
return nil, nil
}
-
diff --git a/plc4go/internal/bacnetip/MessageCodec_test.go
b/plc4go/internal/bacnetip/MessageCodec_test.go
index 86b7a7395c..4036fce80d 100644
--- a/plc4go/internal/bacnetip/MessageCodec_test.go
+++ b/plc4go/internal/bacnetip/MessageCodec_test.go
@@ -64,12 +64,12 @@ func (f *fakeTransportInstance) WrittenBytes() []byte {
return append([]byte(nil), f.writeBuffer.Bytes()...)
}
-func (f *fakeTransportInstance) Connect(_ context.Context) error {
f.connected = true; return nil }
+func (f *fakeTransportInstance) Connect(_ context.Context) error {
f.connected = true; return nil }
func (f *fakeTransportInstance) ConnectWithContext(_ context.Context) error {
return f.Connect(nil) }
-func (f *fakeTransportInstance) Close() error {
f.connected = false; return nil }
-func (f *fakeTransportInstance) IsConnected() bool {
return f.connected }
-func (f *fakeTransportInstance) String() string {
return "fake" }
-func (f *fakeTransportInstance) Reset() {}
+func (f *fakeTransportInstance) Close() error {
f.connected = false; return nil }
+func (f *fakeTransportInstance) IsConnected() bool {
return f.connected }
+func (f *fakeTransportInstance) String() string {
return "fake" }
+func (f *fakeTransportInstance) Reset() {}
func (f *fakeTransportInstance) GetNumBytesAvailableInBuffer() (uint32, error)
{
f.mu.Lock()
diff --git a/plc4go/internal/bacnetip/Segmentation.go
b/plc4go/internal/bacnetip/Segmentation.go
index 656d0a7b3d..c6bcc4575a 100644
--- a/plc4go/internal/bacnetip/Segmentation.go
+++ b/plc4go/internal/bacnetip/Segmentation.go
@@ -35,12 +35,12 @@ import (
// expected sequence number, returning a SegmentAck PDU the caller must
transmit
// after every received segment.
type inboundReassembler struct {
- invokeId uint8
- expectedSeq uint8
- buffer []byte
- windowSize uint8 // actual window size we advertised in the original
request
- moreFollows bool
- complete bool
+ invokeId uint8
+ expectedSeq uint8
+ buffer []byte
+ windowSize uint8 // actual window size we advertised in the original
request
+ moreFollows bool
+ complete bool
}
// NewInboundReassembler creates a fresh reassembler tracking the given invoke
@@ -100,13 +100,13 @@ func (r *inboundReassembler) Bytes() []byte { return
r.buffer }
// SendNext returns the next segment to put on the wire, then waits for the
// remote SegmentAck via AcknowledgeSegment before calling SendNext again.
type outboundSegmenter struct {
- invokeId uint8
- payload []byte
- maxSegment uint16 // bytes per segment (peer's max APDU minus header
overhead)
- windowSize uint8
- nextSeq uint8
- cursor int // byte offset into payload
- done bool
+ invokeId uint8
+ payload []byte
+ maxSegment uint16 // bytes per segment (peer's max APDU minus header
overhead)
+ windowSize uint8
+ nextSeq uint8
+ cursor int // byte offset into payload
+ done bool
}
// NewOutboundSegmenter prepares a segmenter for the given serialized request
diff --git a/plc4go/internal/bacnetip/Subscriber_plc4xgen.go
b/plc4go/internal/bacnetip/Subscriber_plc4xgen.go
index f8420f3ac0..cc9eac69f3 100644
--- a/plc4go/internal/bacnetip/Subscriber_plc4xgen.go
+++ b/plc4go/internal/bacnetip/Subscriber_plc4xgen.go
@@ -84,6 +84,37 @@ func (d *Subscriber) SerializeWithWriteBuffer(ctx
context.Context, writeBuffer u
if err := writeBuffer.PopContext("consumers",
utils.WithRenderAsList(true)); err != nil {
return err
}
+ if err := writeBuffer.PushContext("handles",
utils.WithRenderAsList(true)); err != nil {
+ return err
+ }
+ for _name, elem := range d.handles {
+ name := fmt.Sprintf("%v", _name)
+
+ var elem any = elem
+ if serializable, ok := elem.(utils.Serializable); ok {
+ if err := writeBuffer.PushContext(name); err != nil {
+ return err
+ }
+ if err := serializable.SerializeWithWriteBuffer(ctx,
writeBuffer); err != nil {
+ return err
+ }
+ if err := writeBuffer.PopContext(name); err != nil {
+ return err
+ }
+ } else {
+ elemAsString := fmt.Sprintf("%v", elem)
+ if err := writeBuffer.WriteString(name,
uint32(len(elemAsString)*8), elemAsString); err != nil {
+ return err
+ }
+ }
+ }
+ if err := writeBuffer.PopContext("handles",
utils.WithRenderAsList(true)); err != nil {
+ return err
+ }
+
+ if err := writeBuffer.WriteUint32("nextProcessId", 32,
d.nextProcessId.Load()); err != nil {
+ return err
+ }
if err := writeBuffer.PushContext("_options",
utils.WithRenderAsList(true)); err != nil {
return err
}
diff --git a/plc4go/internal/bacnetip/TagHandler_test.go
b/plc4go/internal/bacnetip/TagHandler_test.go
index d3072ef548..16432d668a 100644
--- a/plc4go/internal/bacnetip/TagHandler_test.go
+++ b/plc4go/internal/bacnetip/TagHandler_test.go
@@ -97,10 +97,10 @@ func TestTagHandler_ParseInvalidString(t *testing.T) {
cases := []string{
"",
"garbage",
- "ANALOG_INPUT,1", // missing property
- "ANALOG_INPUT/X", // missing instance
- "ANALOG_INPUT,abc/X", // non-numeric instance
- ",1/X", // missing object type
+ "ANALOG_INPUT,1", // missing property
+ "ANALOG_INPUT/X", // missing instance
+ "ANALOG_INPUT,abc/X", // non-numeric instance
+ ",1/X", // missing object type
}
for _, c := range cases {
_, err := h.ParseTag(c)
diff --git a/plc4go/internal/bacnetip/ValueDecoder.go
b/plc4go/internal/bacnetip/ValueDecoder.go
index 94124f3e58..48f983ca0a 100644
--- a/plc4go/internal/bacnetip/ValueDecoder.go
+++ b/plc4go/internal/bacnetip/ValueDecoder.go
@@ -41,7 +41,7 @@ import (
// - CharacterString→ PlcSTRING
// - OctetString → PlcRawByteArray
// - Enumerated → PlcUDINT (the raw numeric; the property identifier on
-// the request side determines the enum schema)
+// the request side determines the enum schema)
// - BitString → PlcRawByteArray (packed MSB-first)
// - Date → PlcDATE (year-1900 + month + day-of-month)
// - Time → PlcTIME_OF_DAY
diff --git a/plc4go/internal/bacnetip/mocks_test.go
b/plc4go/internal/bacnetip/mocks_test.go
index 36c1e00c02..2f49bbaf1f 100644
--- a/plc4go/internal/bacnetip/mocks_test.go
+++ b/plc4go/internal/bacnetip/mocks_test.go
@@ -24,8 +24,11 @@
package bacnetip
import (
+ "context"
+
"github.com/apache/plc4x/plc4go/pkg/api/model"
"github.com/apache/plc4x/plc4go/pkg/api/values"
+ "github.com/apache/plc4x/plc4go/spi/transactions"
mock "github.com/stretchr/testify/mock"
)
@@ -323,3 +326,310 @@ func (_c *MockBacNetPlcTag_String_Call) RunAndReturn(run
func() string) *MockBac
_c.Call.Return(run)
return _c
}
+
+// NewMockRequestTransaction creates a new instance of MockRequestTransaction.
It also registers a testing interface on the mock and a cleanup function to
assert the mocks expectations.
+// The first argument is typically a *testing.T value.
+func NewMockRequestTransaction(t interface {
+ mock.TestingT
+ Cleanup(func())
+}) *MockRequestTransaction {
+ mock := &MockRequestTransaction{}
+ mock.Mock.Test(t)
+
+ t.Cleanup(func() { mock.AssertExpectations(t) })
+
+ return mock
+}
+
+// MockRequestTransaction is an autogenerated mock type for the
RequestTransaction type
+type MockRequestTransaction struct {
+ mock.Mock
+}
+
+type MockRequestTransaction_Expecter struct {
+ mock *mock.Mock
+}
+
+func (_m *MockRequestTransaction) EXPECT() *MockRequestTransaction_Expecter {
+ return &MockRequestTransaction_Expecter{mock: &_m.Mock}
+}
+
+// AwaitCompletion provides a mock function for the type MockRequestTransaction
+func (_mock *MockRequestTransaction) AwaitCompletion(ctx context.Context)
error {
+ ret := _mock.Called(ctx)
+
+ if len(ret) == 0 {
+ panic("no return value specified for AwaitCompletion")
+ }
+
+ var r0 error
+ if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
+ r0 = returnFunc(ctx)
+ } else {
+ r0 = ret.Error(0)
+ }
+ return r0
+}
+
+// MockRequestTransaction_AwaitCompletion_Call is a *mock.Call that shadows
Run/Return methods with type explicit version for method 'AwaitCompletion'
+type MockRequestTransaction_AwaitCompletion_Call struct {
+ *mock.Call
+}
+
+// AwaitCompletion is a helper method to define mock.On call
+// - ctx context.Context
+func (_e *MockRequestTransaction_Expecter) AwaitCompletion(ctx interface{})
*MockRequestTransaction_AwaitCompletion_Call {
+ return &MockRequestTransaction_AwaitCompletion_Call{Call:
_e.mock.On("AwaitCompletion", ctx)}
+}
+
+func (_c *MockRequestTransaction_AwaitCompletion_Call) Run(run func(ctx
context.Context)) *MockRequestTransaction_AwaitCompletion_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ var arg0 context.Context
+ if args[0] != nil {
+ arg0 = args[0].(context.Context)
+ }
+ run(
+ arg0,
+ )
+ })
+ return _c
+}
+
+func (_c *MockRequestTransaction_AwaitCompletion_Call) Return(err error)
*MockRequestTransaction_AwaitCompletion_Call {
+ _c.Call.Return(err)
+ return _c
+}
+
+func (_c *MockRequestTransaction_AwaitCompletion_Call) RunAndReturn(run
func(ctx context.Context) error) *MockRequestTransaction_AwaitCompletion_Call {
+ _c.Call.Return(run)
+ return _c
+}
+
+// EndRequest provides a mock function for the type MockRequestTransaction
+func (_mock *MockRequestTransaction) EndRequest() error {
+ ret := _mock.Called()
+
+ if len(ret) == 0 {
+ panic("no return value specified for EndRequest")
+ }
+
+ var r0 error
+ if returnFunc, ok := ret.Get(0).(func() error); ok {
+ r0 = returnFunc()
+ } else {
+ r0 = ret.Error(0)
+ }
+ return r0
+}
+
+// MockRequestTransaction_EndRequest_Call is a *mock.Call that shadows
Run/Return methods with type explicit version for method 'EndRequest'
+type MockRequestTransaction_EndRequest_Call struct {
+ *mock.Call
+}
+
+// EndRequest is a helper method to define mock.On call
+func (_e *MockRequestTransaction_Expecter) EndRequest()
*MockRequestTransaction_EndRequest_Call {
+ return &MockRequestTransaction_EndRequest_Call{Call:
_e.mock.On("EndRequest")}
+}
+
+func (_c *MockRequestTransaction_EndRequest_Call) Run(run func())
*MockRequestTransaction_EndRequest_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ run()
+ })
+ return _c
+}
+
+func (_c *MockRequestTransaction_EndRequest_Call) Return(err error)
*MockRequestTransaction_EndRequest_Call {
+ _c.Call.Return(err)
+ return _c
+}
+
+func (_c *MockRequestTransaction_EndRequest_Call) RunAndReturn(run func()
error) *MockRequestTransaction_EndRequest_Call {
+ _c.Call.Return(run)
+ return _c
+}
+
+// FailRequest provides a mock function for the type MockRequestTransaction
+func (_mock *MockRequestTransaction) FailRequest(err error) error {
+ ret := _mock.Called(err)
+
+ if len(ret) == 0 {
+ panic("no return value specified for FailRequest")
+ }
+
+ var r0 error
+ if returnFunc, ok := ret.Get(0).(func(error) error); ok {
+ r0 = returnFunc(err)
+ } else {
+ r0 = ret.Error(0)
+ }
+ return r0
+}
+
+// MockRequestTransaction_FailRequest_Call is a *mock.Call that shadows
Run/Return methods with type explicit version for method 'FailRequest'
+type MockRequestTransaction_FailRequest_Call struct {
+ *mock.Call
+}
+
+// FailRequest is a helper method to define mock.On call
+// - err error
+func (_e *MockRequestTransaction_Expecter) FailRequest(err interface{})
*MockRequestTransaction_FailRequest_Call {
+ return &MockRequestTransaction_FailRequest_Call{Call:
_e.mock.On("FailRequest", err)}
+}
+
+func (_c *MockRequestTransaction_FailRequest_Call) Run(run func(err error))
*MockRequestTransaction_FailRequest_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ var arg0 error
+ if args[0] != nil {
+ arg0 = args[0].(error)
+ }
+ run(
+ arg0,
+ )
+ })
+ return _c
+}
+
+func (_c *MockRequestTransaction_FailRequest_Call) Return(err1 error)
*MockRequestTransaction_FailRequest_Call {
+ _c.Call.Return(err1)
+ return _c
+}
+
+func (_c *MockRequestTransaction_FailRequest_Call) RunAndReturn(run func(err
error) error) *MockRequestTransaction_FailRequest_Call {
+ _c.Call.Return(run)
+ return _c
+}
+
+// IsCompleted provides a mock function for the type MockRequestTransaction
+func (_mock *MockRequestTransaction) IsCompleted() bool {
+ ret := _mock.Called()
+
+ if len(ret) == 0 {
+ panic("no return value specified for IsCompleted")
+ }
+
+ var r0 bool
+ if returnFunc, ok := ret.Get(0).(func() bool); ok {
+ r0 = returnFunc()
+ } else {
+ r0 = ret.Get(0).(bool)
+ }
+ return r0
+}
+
+// MockRequestTransaction_IsCompleted_Call is a *mock.Call that shadows
Run/Return methods with type explicit version for method 'IsCompleted'
+type MockRequestTransaction_IsCompleted_Call struct {
+ *mock.Call
+}
+
+// IsCompleted is a helper method to define mock.On call
+func (_e *MockRequestTransaction_Expecter) IsCompleted()
*MockRequestTransaction_IsCompleted_Call {
+ return &MockRequestTransaction_IsCompleted_Call{Call:
_e.mock.On("IsCompleted")}
+}
+
+func (_c *MockRequestTransaction_IsCompleted_Call) Run(run func())
*MockRequestTransaction_IsCompleted_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ run()
+ })
+ return _c
+}
+
+func (_c *MockRequestTransaction_IsCompleted_Call) Return(b bool)
*MockRequestTransaction_IsCompleted_Call {
+ _c.Call.Return(b)
+ return _c
+}
+
+func (_c *MockRequestTransaction_IsCompleted_Call) RunAndReturn(run func()
bool) *MockRequestTransaction_IsCompleted_Call {
+ _c.Call.Return(run)
+ return _c
+}
+
+// String provides a mock function for the type MockRequestTransaction
+func (_mock *MockRequestTransaction) String() string {
+ ret := _mock.Called()
+
+ if len(ret) == 0 {
+ panic("no return value specified for String")
+ }
+
+ var r0 string
+ if returnFunc, ok := ret.Get(0).(func() string); ok {
+ r0 = returnFunc()
+ } else {
+ r0 = ret.Get(0).(string)
+ }
+ return r0
+}
+
+// MockRequestTransaction_String_Call is a *mock.Call that shadows Run/Return
methods with type explicit version for method 'String'
+type MockRequestTransaction_String_Call struct {
+ *mock.Call
+}
+
+// String is a helper method to define mock.On call
+func (_e *MockRequestTransaction_Expecter) String()
*MockRequestTransaction_String_Call {
+ return &MockRequestTransaction_String_Call{Call: _e.mock.On("String")}
+}
+
+func (_c *MockRequestTransaction_String_Call) Run(run func())
*MockRequestTransaction_String_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ run()
+ })
+ return _c
+}
+
+func (_c *MockRequestTransaction_String_Call) Return(s string)
*MockRequestTransaction_String_Call {
+ _c.Call.Return(s)
+ return _c
+}
+
+func (_c *MockRequestTransaction_String_Call) RunAndReturn(run func() string)
*MockRequestTransaction_String_Call {
+ _c.Call.Return(run)
+ return _c
+}
+
+// Submit provides a mock function for the type MockRequestTransaction
+func (_mock *MockRequestTransaction) Submit(operationInfo string, operation
transactions.RequestTransactionRunnable) {
+ _mock.Called(operationInfo, operation)
+ return
+}
+
+// MockRequestTransaction_Submit_Call is a *mock.Call that shadows Run/Return
methods with type explicit version for method 'Submit'
+type MockRequestTransaction_Submit_Call struct {
+ *mock.Call
+}
+
+// Submit is a helper method to define mock.On call
+// - operationInfo string
+// - operation transactions.RequestTransactionRunnable
+func (_e *MockRequestTransaction_Expecter) Submit(operationInfo interface{},
operation interface{}) *MockRequestTransaction_Submit_Call {
+ return &MockRequestTransaction_Submit_Call{Call: _e.mock.On("Submit",
operationInfo, operation)}
+}
+
+func (_c *MockRequestTransaction_Submit_Call) Run(run func(operationInfo
string, operation transactions.RequestTransactionRunnable))
*MockRequestTransaction_Submit_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ var arg0 string
+ if args[0] != nil {
+ arg0 = args[0].(string)
+ }
+ var arg1 transactions.RequestTransactionRunnable
+ if args[1] != nil {
+ arg1 = args[1].(transactions.RequestTransactionRunnable)
+ }
+ run(
+ arg0,
+ arg1,
+ )
+ })
+ return _c
+}
+
+func (_c *MockRequestTransaction_Submit_Call) Return()
*MockRequestTransaction_Submit_Call {
+ _c.Call.Return()
+ return _c
+}
+
+func (_c *MockRequestTransaction_Submit_Call) RunAndReturn(run
func(operationInfo string, operation transactions.RequestTransactionRunnable))
*MockRequestTransaction_Submit_Call {
+ _c.Run(run)
+ return _c
+}
diff --git a/plc4go/tests/integration/bacnetip/README.md
b/plc4go/tests/integration/bacnetip/README.md
index bb0e51606e..a530b05a4e 100644
--- a/plc4go/tests/integration/bacnetip/README.md
+++ b/plc4go/tests/integration/bacnetip/README.md
@@ -1,3 +1,23 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ https://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, 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.
+ -->
+
+
# BACnet/IP Integration Tests
End-to-end integration tests for the plc4go BACnet/IP driver. The suite runs
diff --git a/plc4go/tests/integration/bacnetip/integration_test.go
b/plc4go/tests/integration/bacnetip/integration_test.go
index 5684b86db3..b568f2f5d2 100644
--- a/plc4go/tests/integration/bacnetip/integration_test.go
+++ b/plc4go/tests/integration/bacnetip/integration_test.go
@@ -1,3 +1,5 @@
+//go:build integration
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -23,7 +25,6 @@
// build tag (`integration`) and an environment variable (`BACNET_IT`) so the
// default `make test` does not try to run them.
//
-//go:build integration
package bacnetip_test