|
|
|
|
@ -21,6 +21,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
* Encodes and decodes a given message.
|
|
|
|
|
* @param message Message to encode/decode.
|
|
|
|
|
* @return The decoded message.
|
|
|
|
|
* @throws InvalidMessageException If the message cannot be encoded.
|
|
|
|
|
*/
|
|
|
|
|
private BoatAction encodeDecodeMessage(BoatAction message) throws InvalidMessageException {
|
|
|
|
|
|
|
|
|
|
@ -40,6 +41,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
/**
|
|
|
|
|
* Tests if a specific boat action type message can be encoded and decoded correctly.
|
|
|
|
|
* @param type The type of boat action.
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
|
*/
|
|
|
|
|
private void boatActionTypeTest(BoatActionEnum type) throws Exception {
|
|
|
|
|
|
|
|
|
|
@ -59,6 +61,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests if an autopilot message can be encoded and decoded correctly.
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
|
*/
|
|
|
|
|
@Test
|
|
|
|
|
public void autoPilotTest() throws Exception {
|
|
|
|
|
@ -67,6 +70,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests if a sails in message can be encoded and decoded correctly.
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
|
*/
|
|
|
|
|
@Test
|
|
|
|
|
public void sailsInTest() throws Exception {
|
|
|
|
|
@ -75,6 +79,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests if a sails out message can be encoded and decoded correctly.
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
|
*/
|
|
|
|
|
@Test
|
|
|
|
|
public void sailsOutTest() throws Exception {
|
|
|
|
|
@ -83,6 +88,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests if a tack/gybe message can be encoded and decoded correctly.
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
|
*/
|
|
|
|
|
@Test
|
|
|
|
|
public void tackGybeTest() throws Exception {
|
|
|
|
|
@ -91,6 +97,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests if an upwind message can be encoded and decoded correctly.
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
|
*/
|
|
|
|
|
@Test
|
|
|
|
|
public void upwindTest() throws Exception {
|
|
|
|
|
@ -99,6 +106,7 @@ public class BoatActionDecoderTest {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests if a downwind message can be encoded and decoded correctly.
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
|
*/
|
|
|
|
|
@Test
|
|
|
|
|
public void downwindTest() throws Exception {
|
|
|
|
|
|