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/08/07 15:16:54 UTC

[plc4x] 02/03: test(plc4go/opcua): added manual 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 3e808f08933a46a35e8e3ef9b2e773698678e293
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Mon Aug 7 17:16:13 2023 +0200

    test(plc4go/opcua): added manual test
---
 .../tests/drivers/tests/manual_opcua_milo_test.go  | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/plc4go/tests/drivers/tests/manual_opcua_milo_test.go b/plc4go/tests/drivers/tests/manual_opcua_milo_test.go
new file mode 100644
index 0000000000..d39dda1167
--- /dev/null
+++ b/plc4go/tests/drivers/tests/manual_opcua_milo_test.go
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+package tests
+
+import (
+	"testing"
+
+	"github.com/apache/plc4x/plc4go/internal/opcua"
+	plc4go "github.com/apache/plc4x/plc4go/pkg/api"
+	"github.com/apache/plc4x/plc4go/pkg/api/transports"
+	"github.com/apache/plc4x/plc4go/spi/options/converter"
+	"github.com/apache/plc4x/plc4go/spi/testutils"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestManualMiloOpcuaRead(t *testing.T) {
+	t.Skip()
+
+	optionsForTesting := testutils.EnrichOptionsWithOptionsForTesting(t)
+
+	connectionString := "opcua://milo.digitalpetri.com:62541/milo"
+	driverManager := plc4go.NewPlcDriverManager(converter.WithOptionToExternal(optionsForTesting...)...)
+	t.Cleanup(func() {
+		assert.NoError(t, driverManager.Close())
+	})
+	driverManager.RegisterDriver(opcua.NewDriver(optionsForTesting...))
+	transports.RegisterTcpTransport(driverManager, converter.WithOptionToExternal(optionsForTesting...)...)
+	test := testutils.NewManualTestSuite(t, connectionString, driverManager)
+
+	test.AddTestCase("ns=2;i=10846;BOOL", 0)
+
+	test.Run()
+}