You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2021/03/13 10:58:39 UTC

[plc4x] branch develop updated: - Deleted some super-old legacy test

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

cdutz 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 4b41850  - Deleted some super-old legacy test
4b41850 is described below

commit 4b418507d67e51dc1d7ed41fe03a49856020f9a2
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Sat Mar 13 11:58:33 2021 +0100

    - Deleted some super-old legacy test
---
 plc4go/cmd/main/drivers/bacnetip_test.go | 43 --------------------
 plc4go/cmd/main/drivers/knxnetip_test.go | 42 -------------------
 plc4go/cmd/main/drivers/modbus_test.go   | 70 --------------------------------
 3 files changed, 155 deletions(-)

diff --git a/plc4go/cmd/main/drivers/bacnetip_test.go b/plc4go/cmd/main/drivers/bacnetip_test.go
deleted file mode 100644
index 1e5a832..0000000
--- a/plc4go/cmd/main/drivers/bacnetip_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// 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
-//
-//      http://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 drivers
-
-import (
-	"encoding/hex"
-	"github.com/apache/plc4x/plc4go/internal/plc4go/bacnetip/readwrite/model"
-	"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
-	"testing"
-)
-
-func TestBacnetIp(t *testing.T) {
-	t.Skip()
-	request, err := hex.DecodeString("000a00000006010300000004")
-	if err != nil {
-		t.Errorf("Error decoding test input")
-	}
-	rb := utils.NewReadBuffer(request)
-	adu, err := model.BVLCParse(rb)
-	if err != nil {
-		t.Errorf("Error parsing: %s", err)
-	}
-	if adu != nil {
-		// Do something ...
-	}
-
-}
diff --git a/plc4go/cmd/main/drivers/knxnetip_test.go b/plc4go/cmd/main/drivers/knxnetip_test.go
deleted file mode 100644
index 4503836..0000000
--- a/plc4go/cmd/main/drivers/knxnetip_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// 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
-//
-//      http://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 drivers
-
-import (
-	"encoding/hex"
-	"fmt"
-	driverModel "github.com/apache/plc4x/plc4go/internal/plc4go/knxnetip/readwrite/model"
-	"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
-	"testing"
-)
-
-func TestParser(t *testing.T) {
-	request, err := hex.DecodeString("06100202004e080100000000000036010200ff00000000c501010e37e000170c00246d00ec7830302d32342d36442d30302d45432d3738000000000000000000000000000a020201030104010501")
-	if err != nil {
-		// Output an error ...
-	}
-	rb := utils.NewReadBuffer(request)
-	knxMessage, err := driverModel.KnxNetIpMessageParse(rb)
-	if err != nil {
-		fmt.Printf("Got error parsing message: %s\n", err.Error())
-		// TODO: Possibly clean up ...
-		return
-	}
-	print(knxMessage)
-}
diff --git a/plc4go/cmd/main/drivers/modbus_test.go b/plc4go/cmd/main/drivers/modbus_test.go
deleted file mode 100644
index 65cf1e2..0000000
--- a/plc4go/cmd/main/drivers/modbus_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// 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
-//
-//      http://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 drivers
-
-import (
-	"encoding/hex"
-	"encoding/xml"
-	"fmt"
-	"github.com/apache/plc4x/plc4go/internal/plc4go/modbus/readwrite/model"
-	"github.com/apache/plc4x/plc4go/internal/plc4go/spi/utils"
-	"strings"
-	"testing"
-)
-
-func TestModbus(t *testing.T) {
-	test(t, "000000000006ff0408d20002", false)
-	test(t, "7cfe000000c9ff04c600000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000004000000000000000000000000000001db000001d600004a380000000000000000000000000000000000000000000000000000000000006461696d006e0000000000000000000000000000303100300000000000000000000000000000000000000000000000000000000000000000000000000000", true)
-	test(t, "000a0000001101140e060003270e000206000400000008", false)
-	test(t, "000a0000001b011418050600000000110600000000000000000000000000000000", true)
-	test(t, "000a0000000c011509060002000000010008", false)
-	test(t, "000a00000015011512060001270F00010000060002000000010000", false)
-}
-
-func test(t *testing.T, rawMessage string, response bool) {
-	// Cr9edz47r4eate the input data
-	// "000a 0000 0006 01 03 00 00 00 04"
-	request, err := hex.DecodeString(rawMessage)
-	if err != nil {
-		t.Errorf("Error decoding test input")
-	}
-	rb := utils.NewReadBuffer(request)
-	adu, err := model.ModbusTcpADUParse(rb, response)
-	if err != nil {
-		t.Errorf("Error parsing: %s", err)
-	}
-	if adu != nil {
-		serialized, err := xml.Marshal(adu)
-		if err != nil {
-			fmt.Println("Hurz!" + err.Error())
-			return
-		}
-		fmt.Println(string(serialized))
-		var deserializedAdu *model.ModbusTcpADU
-		xml.Unmarshal(serialized, &deserializedAdu)
-
-		wb := utils.NewWriteBuffer()
-		val := model.CastModbusTcpADU(deserializedAdu)
-		val.Serialize(*wb)
-		serializedMessage := hex.EncodeToString(wb.GetBytes())
-		if strings.ToUpper(serializedMessage) != strings.ToUpper(rawMessage) {
-			t.Errorf("The serilized result doesn't match the input")
-		}
-	}
-}