Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.shimmerresearch.shimmer3.communication;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
Expand Down Expand Up @@ -30,7 +31,6 @@
@FixMethodOrder(MethodSorters.NAME_ASCENDING) // Test methods will be run in alphabetical order
public class API_0000X_ByteCommunicationShimmer3 extends BasicProcessWithCallBack{
ShimmerPC mDevice;
TaskCompletionSource<Boolean> mWaitTask;
TaskCompletionSource<Boolean> mStreamingTask;
ByteCommunicationSimulatorS3 mByteCommunicationSimulatorS3;

Expand All @@ -41,20 +41,16 @@ public void setUp() {
mDevice.setTestRadio(mByteCommunicationSimulatorS3);
setWaitForData(mDevice);
}

@After
public void tearDown() {
mDevice.disconnectNoException();
}

@Test
public void test001_testConnectandDisconnect() {
mByteCommunicationSimulatorS3.setIsNewBMPSupported(false);
mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS); //Just to give time to connect to finish
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);

if (!mDevice.isConnected()) {
assert(false);
Expand Down Expand Up @@ -88,16 +84,7 @@ public void test001_testConnectandDisconnect() {
@Test
public void test002_testConnectandDisconnect_NewBMPSupported() {
mByteCommunicationSimulatorS3.setIsNewBMPSupported(true);
mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
boolean result = mWaitTask.getTask().waitForCompletion(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);

if (!mDevice.isConnected()) {
assert(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.shimmerresearch.shimmer3.communication;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
Expand Down Expand Up @@ -49,7 +50,6 @@
@FixMethodOrder(MethodSorters.NAME_ASCENDING) // Test methods will be run in alphabetical order
public class API_0000X_ByteCommunicationShimmer3R extends BasicProcessWithCallBack{
ShimmerPC mDevice;
TaskCompletionSource<Boolean> mWaitTask;
ByteCommunicationSimulatorS3R mByteCommunicationSimulatorS3R;
@Before
public void setUp() {
Expand All @@ -58,19 +58,15 @@ public void setUp() {
mDevice.setTestRadio(mByteCommunicationSimulatorS3R);
setWaitForData(mDevice);
}

@After
public void tearDown() {
mDevice.disconnectNoException();
}

@Test
public void test001_testConnectandDisconnect() {
mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);//Just to give time to connect to finish
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);

if (!mDevice.isConnected()) {
assert(false);
Expand Down Expand Up @@ -118,16 +114,7 @@ public void test001_testConnectandDisconnect() {

@Test
public void test002_ConnectandTestBMP390() {
mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);

if (!mDevice.isConnected()) {
assert(false);
Expand Down Expand Up @@ -159,16 +146,7 @@ public void test002_ConnectandTestBMP390() {
@Test
public void test003_ConnectandTestCalibParamRead() {

mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
if (!mDevice.isConnected()) {
assert(false);
}
Expand Down Expand Up @@ -214,16 +192,7 @@ public void test003_ConnectandTestCalibParamRead() {
@Test
public void test004_ConnectandTestDefaultLNAccelAndGyroCalibParam() {

mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
if (!mDevice.isConnected()) {
assert(false);
}
Expand Down Expand Up @@ -266,16 +235,7 @@ public void test004_ConnectandTestDefaultLNAccelAndGyroCalibParam() {
@Test
public void test005_ConnectandTestDefaultWRAccelCalibParam() {

mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
if (!mDevice.isConnected()) {
assert(false);
}
Expand Down Expand Up @@ -306,16 +266,7 @@ public void test005_ConnectandTestDefaultWRAccelCalibParam() {
@Test
public void test006_ConnectandTestDefaultMagCalibParam() {

mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
if (!mDevice.isConnected()) {
assert(false);
}
Expand All @@ -335,16 +286,7 @@ public void test006_ConnectandTestDefaultMagCalibParam() {
@Test
public void test007_ConnectandTestDefaultHighGAccelCalibParam() {

mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
if (!mDevice.isConnected()) {
assert(false);
}
Expand All @@ -363,16 +305,7 @@ public void test007_ConnectandTestDefaultHighGAccelCalibParam() {
@Test
public void test008_ConnectandTestDefaultAltMagCalibParam() {

mWaitTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mWaitTask = new TaskCompletionSource<>();
try {
mWaitTask.getTask().waitForCompletion(3, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
if (!mDevice.isConnected()) {
assert(false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.shimmerresearch.shimmer3.communication;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
Expand Down Expand Up @@ -29,7 +30,6 @@
@FixMethodOrder(MethodSorters.NAME_ASCENDING) // Test methods will be run in alphabetical order
public class API_0000X_ByteCommunicationShimmer3_CRC_Streaming extends BasicProcessWithCallBack{
ShimmerPC mDevice;
TaskCompletionSource<Boolean> mCalibrationTask;
TaskCompletionSource<Boolean> mStreamingTask;
ByteCommunicationSimulatorS3 mByteCommunicationSimulatorS3;

Expand All @@ -40,23 +40,19 @@ public void setUp() {
mDevice.setTestRadio(mByteCommunicationSimulatorS3);
setWaitForData(mDevice);
}

@After
public void tearDown() {
mDevice.disconnectNoException();
}

ArrayList<ObjectCluster> mListOJC;
@Test
public void test001_testStreaming() {
mListOJC = new ArrayList<ObjectCluster>();
mByteCommunicationSimulatorS3.setIsNewBMPSupported(false);
mCalibrationTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mCalibrationTask = new TaskCompletionSource<>();
mStreamingTask = new TaskCompletionSource<Boolean>();
try {
boolean result = mCalibrationTask.getTask().waitForCompletion(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
mStreamingTask = new TaskCompletionSource<Boolean>();

try {
mDevice.startStreaming();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.shimmerresearch.shimmer3.communication;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
Expand Down Expand Up @@ -29,7 +30,6 @@
@FixMethodOrder(MethodSorters.NAME_ASCENDING) // Test methods will be run in alphabetical order
public class API_0000X_ByteCommunicationShimmer3_Streaming extends BasicProcessWithCallBack{
ShimmerPC mDevice;
TaskCompletionSource<Boolean> mCalibrationTask;
TaskCompletionSource<Boolean> mStreamingTask;
ByteCommunicationSimulatorS3 mByteCommunicationSimulatorS3;

Expand All @@ -40,23 +40,19 @@ public void setUp() {
mDevice.setTestRadio(mByteCommunicationSimulatorS3);
setWaitForData(mDevice);
}

@After
public void tearDown() {
mDevice.disconnectNoException();
}

ArrayList<ObjectCluster> mListOJC;
@Test
public void test001_testStreaming() {
mListOJC = new ArrayList<ObjectCluster>();
mByteCommunicationSimulatorS3.setIsNewBMPSupported(false);
mCalibrationTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mCalibrationTask = new TaskCompletionSource<>();
mStreamingTask = new TaskCompletionSource<Boolean>();
try {
boolean result = mCalibrationTask.getTask().waitForCompletion(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
mStreamingTask = new TaskCompletionSource<Boolean>();

try {
mDevice.startStreaming();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.shimmerresearch.shimmer3.communication;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
Expand Down Expand Up @@ -29,7 +30,6 @@
@FixMethodOrder(MethodSorters.NAME_ASCENDING) // Test methods will be run in alphabetical order
public class API_0000X_ByteCommunicationShimmer3_Streaming_Contiguous_Check extends BasicProcessWithCallBack{
ShimmerPC mDevice;
TaskCompletionSource<Boolean> mCalibrationTask;
TaskCompletionSource<Boolean> mStreamingTask;
ByteCommunicationSimulatorS3 mByteCommunicationSimulatorS3;

Expand All @@ -40,23 +40,19 @@ public void setUp() {
mDevice.setTestRadio(mByteCommunicationSimulatorS3);
setWaitForData(mDevice);
}

@After
public void tearDown() {
mDevice.disconnectNoException();
}

ArrayList<ObjectCluster> mListOJC;
@Test
public void test001_testStreaming() {
mListOJC = new ArrayList<ObjectCluster>();
mByteCommunicationSimulatorS3.setIsNewBMPSupported(false);
mCalibrationTask = new TaskCompletionSource<Boolean>();
mDevice.connect("","");

mCalibrationTask = new TaskCompletionSource<>();
mStreamingTask = new TaskCompletionSource<Boolean>();
try {
boolean result = mCalibrationTask.getTask().waitForCompletion(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ByteCommunicationTestUtils.connectAndWaitUntilInitialised(mDevice);
mStreamingTask = new TaskCompletionSource<Boolean>();

try {
mDevice.startStreaming();
Expand Down
Loading
Loading