BakeoutController-Basic  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 
18  public static final int deviceAddress = 6;
19  public static final String errorMessage = "E01";
20  protected PowerSupply powerSupply;
21 
22  @Before
23  public void setUp() throws IOException {
24  setUpPowerSupply();
25  }
26 
27  private void setUpPowerSupply() throws IOException {
28  this.communicatorForDevice.setInputStreamData("OK");
29  powerSupply = new TDKLambdaPowerSupply(communicatorForDevice,
30  deviceAddress);
31  this.communicatorForDevice.clear();
32  }
33 
34  @After
35  public void cleanUpCommunicator(){
36  this.communicatorForDevice.clear();
37  }
38 
39  protected void assertCorrectMessage(String expectedMessage){
40  String writtenData = this.communicatorForDevice.getOutputStreamData();
41  assertEquals(expectedMessage, writtenData);
42  }
43 }
void setInputStreamData(String dataForDeviceToRead)
Git Repo