1 package unit.devices.pvci_pressure_gauge;
3 import com.ghgande.j2mod.modbus.msg.ModbusRequest;
5 import org.jmock.Expectations;
6 import org.junit.Before;
9 import java.io.IOException;
19 public void setContext()
throws Exception {
20 context.checking(
new ExpectationsForTest());
23 @Test(expected = IOException.class)
24 public void construct()
throws IOException {
29 private class ExpectationsForTest
extends Expectations {
30 public ExpectationsForTest()
throws Exception {
31 oneOf(mockModbusConnector).getTransactionForRequest(
32 with(any(ModbusRequest.class))
34 will(returnValue(mockTransaction));
36 oneOf(mockModbusConnector).parseStringFromResponse(mockResponse);
37 will(returnValue(null));