equal
deleted
inserted
replaced
36 * This is a basic test to ping TRK using Debug/Trace USB (OST) |
36 * This is a basic test to ping TRK using Debug/Trace USB (OST) |
37 * OST headers are included |
37 * OST headers are included |
38 */ |
38 */ |
39 public class TestOSTTRKNoFormat extends TestCase { |
39 public class TestOSTTRKNoFormat extends TestCase { |
40 |
40 |
|
41 private boolean startServer = true; // use false when doing Junit plugin test - use true when doing non-plugin junit test |
|
42 |
41 public void testOstTRK() { |
43 public void testOstTRK() { |
42 // for non-plugin junit test |
44 // for non-plugin junit test |
43 TCAPIConnection api2 = new TCAPIConnection(); |
45 TCAPIConnection api2 = new TCAPIConnection(); |
44 api2.nativeStartServer(); |
46 if (startServer) { |
|
47 api2.nativeStartServer(); |
|
48 } |
45 |
49 |
46 // connection |
50 // connection |
47 ITCVirtualSerialConnection conn = (ITCVirtualSerialConnection)TCFClassFactory.createITCVirtualSerialConnection("COM19"); |
51 ITCVirtualSerialConnection conn = (ITCVirtualSerialConnection)TCFClassFactory.createITCVirtualSerialConnection("COM27"); |
48 // set OST decoding for this connection |
52 // set OST decoding for this connection |
49 conn.setDecodeFormat("ost"); |
53 conn.setDecodeFormat("ost"); |
50 |
54 |
51 // message options |
55 // message options |
52 ITCMessageOptions options = TCFClassFactory.createITCMessageOptions(); |
56 ITCMessageOptions options = TCFClassFactory.createITCMessageOptions(); |
186 if (connStatus.isOK()) { |
190 if (connStatus.isOK()) { |
187 api.disconnect(); |
191 api.disconnect(); |
188 } |
192 } |
189 } |
193 } |
190 // for non-plugin junit test |
194 // for non-plugin junit test |
191 api2.nativeStopServer(); |
195 if (startServer) { |
|
196 api2.nativeStopServer(); |
|
197 } |
192 } |
198 } |
193 |
199 |
194 } |
200 } |