BakeoutController  0.1
A Controller for the Omicron vacuum chamber
TDKLambdaPowerSupplyTestCase.java
1 package unit.devices.tdk_lambda_power_supply;
2 
3 import devices.PowerSupply;
5 import org.junit.After;
6 import org.junit.Before;
8 
9 import java.io.IOException;
10 
11 import static org.junit.Assert.assertEquals;
12 
16 public abstract class TDKLambdaPowerSupplyTestCase extends DevicesTestCase {
17  public static final String deviceName = "Mockup Power Supply - Unit " +
18  "testing";
19  public static final int deviceAddress = 6;
20  public static final String errorMessage = "E01";
21  protected PowerSupply powerSupply;
22 
23  @Before
24  public void setUp() throws IOException {
25  setUpPowerSupply();
26  }
27 
28  private void setUpPowerSupply() throws IOException {
29  this.communicatorForDevice.setInputStreamData("OK");
30  powerSupply = new TDKLambdaPowerSupply(deviceName, communicatorForDevice,
31  deviceAddress);
32  this.communicatorForDevice.clear();
33  }
34 
35  @After
36  public void cleanUpCommunicator(){
37  this.communicatorForDevice.clear();
38  }
39 
40  protected void assertCorrectMessage(String expectedMessage){
41  String writtenData = this.communicatorForDevice.getOutputStreamData();
42  assertEquals(expectedMessage, writtenData);
43  }
44 }
void setInputStreamData(String dataForDeviceToRead)
Git Repo