equal
deleted
inserted
replaced
29 * This is a basic test to ping TRK using Debug/Trace USB (OST) |
29 * This is a basic test to ping TRK using Debug/Trace USB (OST) |
30 * adding/deleting headers |
30 * adding/deleting headers |
31 */ |
31 */ |
32 public class TestOstTRK extends TestCase { |
32 public class TestOstTRK extends TestCase { |
33 |
33 |
|
34 private boolean startServer = true; // use false when doing Junit plugin test - use true when doing non-plugin junit test |
|
35 |
34 public void testOstTRK() { |
36 public void testOstTRK() { |
35 // for non-plugin junit test |
37 // for non-plugin junit test |
36 TCAPIConnection api2 = new TCAPIConnection(); |
38 TCAPIConnection api2 = new TCAPIConnection(); |
37 api2.nativeStartServer(); |
39 if (startServer) { |
|
40 api2.nativeStartServer(); |
|
41 } |
38 |
42 |
39 // connection |
43 // connection |
40 ITCVirtualSerialConnection conn = (ITCVirtualSerialConnection)TCFClassFactory.createITCVirtualSerialConnection("COM25"); |
44 ITCVirtualSerialConnection conn = (ITCVirtualSerialConnection)TCFClassFactory.createITCVirtualSerialConnection("COM27"); |
41 // set OST decoding for this connection |
45 // set OST decoding for this connection |
42 conn.setDecodeFormat("ost"); |
46 conn.setDecodeFormat("ost"); |
43 |
47 |
44 // message options |
48 // message options |
45 ITCMessageOptions options = TCFClassFactory.createITCMessageOptions(); |
49 ITCMessageOptions options = TCFClassFactory.createITCMessageOptions(); |
178 |
182 |
179 if (connStatus.isOK()) { |
183 if (connStatus.isOK()) { |
180 api.disconnect(); |
184 api.disconnect(); |
181 } |
185 } |
182 } |
186 } |
183 // for non-plugin junit test |
187 if (startServer) { |
184 api2.nativeStopServer(); |
188 // for non-plugin junit test |
|
189 api2.nativeStopServer(); |
|
190 } |
185 |
191 |
186 } |
192 } |
187 } |
193 } |