use of org.openhab.binding.modbus.internal.pooling.ModbusSerialSlaveEndpoint in project openhab1-addons by openhab.
the class ModbusSlaveEndpointTestCase method testEqualsDifferentSerial.
@Test
public void testEqualsDifferentSerial() {
ModbusSerialSlaveEndpoint e1 = new ModbusSerialSlaveEndpoint(new SerialParameters("port1", 9600, SerialPort.FLOWCONTROL_NONE, SerialPort.FLOWCONTROL_NONE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE, Modbus.DEFAULT_SERIAL_ENCODING, true, 500));
ModbusSerialSlaveEndpoint e2 = new ModbusSerialSlaveEndpoint(new SerialParameters("port2", 9600, SerialPort.FLOWCONTROL_NONE, SerialPort.FLOWCONTROL_NONE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE, Modbus.DEFAULT_SERIAL_ENCODING, true, 500));
Assert.assertNotEquals(e1, e2);
Assert.assertNotEquals(e1.hashCode(), e2.hashCode());
}
use of org.openhab.binding.modbus.internal.pooling.ModbusSerialSlaveEndpoint in project openhab1-addons by openhab.
the class ModbusSlaveEndpointTestCase method testEqualsDifferentProtocol2.
@Test
public void testEqualsDifferentProtocol2() {
ModbusTCPSlaveEndpoint e1 = new ModbusTCPSlaveEndpoint("127.0.0.1", 500);
ModbusSerialSlaveEndpoint e2 = new ModbusSerialSlaveEndpoint(new SerialParameters());
Assert.assertNotEquals(e1, e2);
Assert.assertNotEquals(e1.hashCode(), e2.hashCode());
}
use of org.openhab.binding.modbus.internal.pooling.ModbusSerialSlaveEndpoint in project openhab1-addons by openhab.
the class ModbusSlaveEndpointTestCase method testEqualsSameSerial3.
/**
* even though different echo parameter & baud rate, the endpoints are considered the same due to same port
*/
@Test
public void testEqualsSameSerial3() {
ModbusSerialSlaveEndpoint e1 = new ModbusSerialSlaveEndpoint(new SerialParameters("port1", 9600, SerialPort.FLOWCONTROL_NONE, SerialPort.FLOWCONTROL_NONE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE, Modbus.DEFAULT_SERIAL_ENCODING, true, 500));
ModbusSerialSlaveEndpoint e2 = new ModbusSerialSlaveEndpoint(new SerialParameters("port1", 9600, SerialPort.FLOWCONTROL_NONE, SerialPort.FLOWCONTROL_NONE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE, Modbus.DEFAULT_SERIAL_ENCODING, false, 500));
Assert.assertEquals(e1, e2);
Assert.assertEquals(e1.hashCode(), e2.hashCode());
}
use of org.openhab.binding.modbus.internal.pooling.ModbusSerialSlaveEndpoint in project openhab1-addons by openhab.
the class ModbusSlaveEndpointTestCase method testEqualsSameSerial.
@Test
public void testEqualsSameSerial() {
ModbusSerialSlaveEndpoint e1 = new ModbusSerialSlaveEndpoint(new SerialParameters());
ModbusSerialSlaveEndpoint e2 = new ModbusSerialSlaveEndpoint(new SerialParameters());
Assert.assertEquals(e1, e2);
}
use of org.openhab.binding.modbus.internal.pooling.ModbusSerialSlaveEndpoint in project openhab1-addons by openhab.
the class ModbusSlaveEndpointTestCase method testEqualsSameSerial2.
@Test
public void testEqualsSameSerial2() {
ModbusSerialSlaveEndpoint e1 = new ModbusSerialSlaveEndpoint(new SerialParameters("port1", 9600, SerialPort.FLOWCONTROL_NONE, SerialPort.FLOWCONTROL_NONE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE, Modbus.DEFAULT_SERIAL_ENCODING, true, 500));
ModbusSerialSlaveEndpoint e2 = new ModbusSerialSlaveEndpoint(new SerialParameters("port1", 9600, SerialPort.FLOWCONTROL_NONE, SerialPort.FLOWCONTROL_NONE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE, Modbus.DEFAULT_SERIAL_ENCODING, true, 500));
Assert.assertEquals(e1, e2);
}
Aggregations