|
|
|
@ -19,6 +19,7 @@ public class JoinAcceptanceDecoderTest {
|
|
|
|
* Encodes and decodes a given message.
|
|
|
|
* Encodes and decodes a given message.
|
|
|
|
* @param message Message to encode/decode.
|
|
|
|
* @param message Message to encode/decode.
|
|
|
|
* @return The decoded message.
|
|
|
|
* @return The decoded message.
|
|
|
|
|
|
|
|
* @throws InvalidMessageException If the message cannot be encoded.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private JoinAcceptance encodeDecodeMessage(JoinAcceptance message) throws InvalidMessageException {
|
|
|
|
private JoinAcceptance encodeDecodeMessage(JoinAcceptance message) throws InvalidMessageException {
|
|
|
|
|
|
|
|
|
|
|
|
@ -37,6 +38,7 @@ public class JoinAcceptanceDecoderTest {
|
|
|
|
* Tests if a specific acceptance type message can be encoded and decoded correctly.
|
|
|
|
* Tests if a specific acceptance type message can be encoded and decoded correctly.
|
|
|
|
* @param type The type of acceptance response.
|
|
|
|
* @param type The type of acceptance response.
|
|
|
|
* @param sourceID The source ID to assign.
|
|
|
|
* @param sourceID The source ID to assign.
|
|
|
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void responseTypeTest(JoinAcceptanceEnum type, int sourceID) throws Exception {
|
|
|
|
private void responseTypeTest(JoinAcceptanceEnum type, int sourceID) throws Exception {
|
|
|
|
|
|
|
|
|
|
|
|
@ -57,6 +59,7 @@ public class JoinAcceptanceDecoderTest {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tests if a join success message, with a source ID, can be encoded and decoded correctly.
|
|
|
|
* Tests if a join success message, with a source ID, can be encoded and decoded correctly.
|
|
|
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void joinSuccessSourceIDTest() throws Exception {
|
|
|
|
public void joinSuccessSourceIDTest() throws Exception {
|
|
|
|
@ -65,6 +68,7 @@ public class JoinAcceptanceDecoderTest {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tests if a join success message, with no source ID, can be encoded and decoded correctly.
|
|
|
|
* Tests if a join success message, with no source ID, can be encoded and decoded correctly.
|
|
|
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void joinSuccessNoSourceIDTest() throws Exception {
|
|
|
|
public void joinSuccessNoSourceIDTest() throws Exception {
|
|
|
|
@ -73,6 +77,7 @@ public class JoinAcceptanceDecoderTest {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tests if a participants full message can be encoded and decoded correctly.
|
|
|
|
* Tests if a participants full message can be encoded and decoded correctly.
|
|
|
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void participantFullTest() throws Exception {
|
|
|
|
public void participantFullTest() throws Exception {
|
|
|
|
@ -81,6 +86,7 @@ public class JoinAcceptanceDecoderTest {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tests if a ghosts full message can be encoded and decoded correctly.
|
|
|
|
* Tests if a ghosts full message can be encoded and decoded correctly.
|
|
|
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void ghostFullTest() throws Exception {
|
|
|
|
public void ghostFullTest() throws Exception {
|
|
|
|
@ -89,6 +95,7 @@ public class JoinAcceptanceDecoderTest {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Tests if a server full message can be encoded and decoded correctly.
|
|
|
|
* Tests if a server full message can be encoded and decoded correctly.
|
|
|
|
|
|
|
|
* @throws Exception if test fails.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void serverFullTest() throws Exception {
|
|
|
|
public void serverFullTest() throws Exception {
|
|
|
|
|