Skip to content

Commit

Permalink
Add ProtocolVersion test to make sure pom ProtocolVersion matches Van…
Browse files Browse the repository at this point in the history
…illaPlugin protocol version

Signed-off-by: Nick Minkler <[email protected]>
  • Loading branch information
Sleaker committed Sep 27, 2013
1 parent 25cc66e commit 80f41a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,17 @@
</archive>
</configuration>
</plugin>
<!-- Surefire report test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.15</version>
<configuration>
<systemPropertyVariables>
<protocol>${protocolVersion}</protocol>
</systemPropertyVariables>
</configuration>
</plugin>
<!-- Dependency addition plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.spout.api.protocol.MessageCodec;

import org.spout.vanilla.EngineFaker;
import org.spout.vanilla.VanillaPlugin;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
Expand All @@ -54,6 +55,12 @@ protected BaseProtocolTest(CodecLookupService codecLookup, Message[] testMessage
this.testMessages = testMessages;
}

@Test
public void testProtocolVersion() {
String val = System.getProperty("protocol");
Integer i = Integer.valueOf(val);
assertEquals("Protocol Version in pom does not match version in Source: ", i.longValue(), VanillaPlugin.MINECRAFT_PROTOCOL_ID);
}
@Test
public void testMessageCodecLookup() {
for (Message message : testMessages) {
Expand Down

0 comments on commit 80f41a9

Please sign in to comment.