Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
TestMessageListener.java
1 package org.bukkit.plugin.messaging;
2 
3 import org.bukkit.entity.Player;
4 import static org.junit.Assert.*;
5 
6 public class TestMessageListener implements PluginMessageListener {
7  private final String channel;
8  private final byte[] message;
9  private boolean received = false;
10 
11  public TestMessageListener(String channel, byte[] message) {
12  this.channel = channel;
13  this.message = message;
14  }
15 
16  public void onPluginMessageReceived(String channel, Player player, byte[] message) {
17  assertEquals(this.channel, channel);
18  assertArrayEquals(this.message, message);
19  this.received = true;
20  }
21 
22  public boolean hasReceived() {
23  return received;
24  }
25 
26  public void reset() {
27  received = false;
28  }
29 }
void onPluginMessageReceived(String channel, Player player, byte[] message)