Search in sources :

Example 1 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method restoreGameSession.

@Test
public void restoreGameSession() throws Exception {
    ClientMessage result = instance.transform(write(new RestoreGameSessionClientMessage(123)));
    assertThat(result, is(new RestoreGameSessionRequest(123)));
}
Also used : RestoreGameSessionRequest(com.faforever.server.integration.legacy.transformer.RestoreGameSessionRequest) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 2 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method gameChatMessage.

@Test
public void gameChatMessage() throws Exception {
    ClientMessage result = instance.transform(write(new GameChatMessageClientMessage("Message")));
    assertThat(result, is(new GameChatMessageReport("Message")));
}
Also used : GameChatMessageReport(com.faforever.server.game.GameChatMessageReport) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 3 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method armyScore.

@Test
public void armyScore() throws Exception {
    ClientMessage result = instance.transform(write(new ArmyScoreClientMessage(1, 10)));
    assertThat(result, is(new ArmyScoreReport(1, 10)));
}
Also used : ArmyScoreReport(com.faforever.server.game.ArmyScoreReport) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 4 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method aiOption.

@Test
public void aiOption() throws Exception {
    ClientMessage result = instance.transform(write(new AiOptionClientMessage("junit", "team", "1")));
    assertThat(result, is(new AiOptionReport("junit", "team", "1")));
}
Also used : AiOptionReport(com.faforever.server.game.AiOptionReport) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 5 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method playerDefeated.

@Test
public void playerDefeated() throws Exception {
    ClientMessage result = instance.transform(write(new PlayerDefeatedClientMessage()));
    assertThat(result, is(PlayerDefeatedReport.INSTANCE));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Aggregations

ClientMessage (com.faforever.server.common.ClientMessage)27 Test (org.junit.Test)26 SelectAvatarRequest (com.faforever.server.avatar.SelectAvatarRequest)1 BroadcastRequest (com.faforever.server.client.BroadcastRequest)1 LoginRequest (com.faforever.server.client.LoginRequest)1 CoopMissionCompletedReport (com.faforever.server.coop.CoopMissionCompletedReport)1 RequestException (com.faforever.server.error.RequestException)1 AiOptionReport (com.faforever.server.game.AiOptionReport)1 ArmyScoreReport (com.faforever.server.game.ArmyScoreReport)1 DisconnectPeerRequest (com.faforever.server.game.DisconnectPeerRequest)1 GameChatMessageReport (com.faforever.server.game.GameChatMessageReport)1 GameModsReport (com.faforever.server.game.GameModsReport)1 GameOptionReport (com.faforever.server.game.GameOptionReport)1 GameStateReport (com.faforever.server.game.GameStateReport)1 HostGameRequest (com.faforever.server.game.HostGameRequest)1 JoinGameRequest (com.faforever.server.game.JoinGameRequest)1 PlayerOptionReport (com.faforever.server.game.PlayerOptionReport)1 TeamKillReport (com.faforever.server.game.TeamKillReport)1 IceMessage (com.faforever.server.ice.IceMessage)1 RestoreGameSessionRequest (com.faforever.server.integration.legacy.transformer.RestoreGameSessionRequest)1