use of org.openmuc.framework.driver.spi.Connection in project OpenMUC by isc-konstanz.
the class Iec61850DriverTest method testConnectValidSettings1.
@Test
public void testConnectValidSettings1() throws Exception {
// Test 1
String testDeviceAdress = host + ":" + port;
String testSettings = "-a 12 -lt 1 -rt 1";
Iec61850Driver testIec61850Driver = new Iec61850Driver();
Connection testIec61850Connection = testIec61850Driver.connect(testDeviceAdress, testSettings);
Assert.assertThat(testIec61850Connection, instanceOf(Connection.class));
testIec61850Connection.disconnect();
}
use of org.openmuc.framework.driver.spi.Connection in project OpenMUC by isc-konstanz.
the class Iec61850DriverTest method testConnectValidSettings2.
@Test
public void testConnectValidSettings2() throws Exception {
// Test 1
String testDeviceAdress = host + ":" + port;
String testSettings = "-a 12 -lt -rt ";
Iec61850Driver testIec61850Driver = new Iec61850Driver();
Connection testIec61850Connection = testIec61850Driver.connect(testDeviceAdress, testSettings);
Assert.assertThat(testIec61850Connection, instanceOf(Connection.class));
testIec61850Connection.disconnect();
}
use of org.openmuc.framework.driver.spi.Connection in project OpenMUC by isc-konstanz.
the class Iec61850DriverTest method expectExeption.
private void expectExeption(String testDeviceAdress, String testSettings, String exeptionMsg, Exception exception) {
Iec61850Driver testIec61850Driver = new Iec61850Driver();
Exception e = assertThrows(exception.getClass(), () -> {
Connection testIec61850Connection = testIec61850Driver.connect(testDeviceAdress, testSettings);
testIec61850Connection.disconnect();
});
assertEquals(exeptionMsg, e.getMessage());
}
use of org.openmuc.framework.driver.spi.Connection in project OpenMUC by isc-konstanz.
the class Iec61850DriverTest method testConnectEmptySettings.
@Test
public void testConnectEmptySettings() throws ArgumentSyntaxException, ConnectionException {
// test with valid syntax on the test server
String testDeviceAdress = host + ":" + port;
String testSettings = "";
Iec61850Driver testIec61850Driver = new Iec61850Driver();
Connection testIec61850Connection = testIec61850Driver.connect(testDeviceAdress, testSettings);
Assert.assertThat(testIec61850Connection, instanceOf(Connection.class));
testIec61850Connection.disconnect();
}
Aggregations