Search in sources :

Example 16 with ClientMessage

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

the class V2ClientMessageTransformerTest method gameMods.

@Test
public void gameMods() throws Exception {
    ClientMessage result = instance.transform(write(new GameModsClientMessage(Arrays.asList("1", "2"))));
    assertThat(result, is(new GameModsReport(Arrays.asList("1", "2"))));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) GameModsReport(com.faforever.server.game.GameModsReport) Test(org.junit.Test)

Example 17 with ClientMessage

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

the class V2ClientMessageTransformerTest method listIceServers.

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

Example 18 with ClientMessage

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

the class V2ClientMessageTransformerTest method gameOption.

@Test
public void gameOption() throws Exception {
    ClientMessage result = instance.transform(write(new GameOptionClientMessage("key", "value")));
    assertThat(result, is(new GameOptionReport("key", "value")));
}
Also used : GameOptionReport(com.faforever.server.game.GameOptionReport) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 19 with ClientMessage

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

the class V2ClientMessageTransformerTest method broadcast.

@Test
public void broadcast() throws Exception {
    ClientMessage result = instance.transform(write(new BroadcastClientMessage("Hello JUnit")));
    assertThat(result, is(new BroadcastRequest("Hello JUnit")));
}
Also used : BroadcastRequest(com.faforever.server.client.BroadcastRequest) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 20 with ClientMessage

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

the class V2ClientMessageTransformerTest method teamKill.

@Test
public void teamKill() throws Exception {
    ClientMessage result = instance.transform(write(new TeamKillClientMessage(100, 1, "A", 2, "B")));
    assertThat(result, is(new TeamKillReport(Duration.ofSeconds(100), 1, "A", 2, "B")));
}
Also used : TeamKillReport(com.faforever.server.game.TeamKillReport) 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