42 lines
1.0 KiB
Java
42 lines
1.0 KiB
Java
package jmri.jmris;
|
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
/**
|
|
* Tests for the jmri.jmris.JmriConnection class
|
|
*
|
|
* @author Paul Bender
|
|
*/
|
|
public class JmriConnectionTest {
|
|
|
|
@Test
|
|
public void testCtorwithStreamParameter() {
|
|
java.io.DataOutputStream output = new java.io.DataOutputStream(
|
|
new java.io.OutputStream() {
|
|
// null output string drops characters
|
|
// could be replaced by one that checks for specific outputs
|
|
@Override
|
|
public void write(int b) {
|
|
}
|
|
});
|
|
JmriConnection a = new JmriConnection(output);
|
|
assertThat(a).isNotNull();
|
|
}
|
|
|
|
@BeforeEach
|
|
public void setUp() {
|
|
jmri.util.JUnitUtil.setUp();
|
|
}
|
|
|
|
@AfterEach
|
|
public void tearDown() {
|
|
jmri.util.JUnitUtil.tearDown();
|
|
|
|
}
|
|
|
|
}
|