diff --git a/Java/Test/me/dilley/MineStatTest.java b/Java/Test/me/dilley/MineStatTest.java index 80349a7d..c62f2ac2 100644 --- a/Java/Test/me/dilley/MineStatTest.java +++ b/Java/Test/me/dilley/MineStatTest.java @@ -1,5 +1,7 @@ -/* JUnit tests for MineStat.java class */ -/* Contributed by Annukka Tormala (nukka) */ +/* + * JUnit tests for MineStat.java class + * Contributed by Annukka Tormala (nukka) + */ package me.dilley; @@ -8,65 +10,65 @@ public class MineStatTest { - @Test - // Tests if address is correct - public void checkAddress() + @Test + // Tests if address is correct + public void checkAddress() { - MineStat ms = new MineStat("minecraft.frag.land", 25565); - ms.setAddress("minecraft.frag.land"); - assertEquals("minecraft.frag.land", ms.getAddress()); - } + MineStat ms = new MineStat("minecraft.frag.land", 25565); + ms.setAddress("minecraft.frag.land"); + assertEquals("minecraft.frag.land", ms.getAddress()); + } - @Test - // Tests if port number is correct - public void checkPort() + @Test + // Tests if port number is correct + public void checkPort() { - MineStat ms = new MineStat("minecraft.frag.land", 25565); - ms.setPort(25565); - assertEquals(25565, ms.getPort()); - } + MineStat ms = new MineStat("minecraft.frag.land", 25565); + ms.setPort(25565); + assertEquals(25565, ms.getPort()); + } - @Test - // Tests if version number is correct - public void checkVersion() + @Test + // Tests if version number is correct + public void checkVersion() { - MineStat ms = new MineStat("minecraft.frag.land", 25565); - ms.setVersion("BungeeCord 1.8.x-1.12.x"); - assertEquals("BungeeCord 1.8.x-1.12.x", ms.getVersion()); - } + MineStat ms = new MineStat("minecraft.frag.land", 25565); + ms.setVersion("BungeeCord 1.8.x-1.12.x"); + assertEquals("BungeeCord 1.8.x-1.12.x", ms.getVersion()); + } - @Test - // Tests if number of current players is correct - public void checkNumberOfCurrentPlayers() + @Test + // Tests if number of current players is correct + public void checkNumberOfCurrentPlayers() { - MineStat ms = new MineStat("minecraft.frag.land", 25565); - ms.setCurrentPlayers(0); - assertEquals(0, ms.getCurrentPlayers()); - } + MineStat ms = new MineStat("minecraft.frag.land", 25565); + ms.setCurrentPlayers(0); + assertEquals(0, ms.getCurrentPlayers()); + } - @Test - // Tests if number of maximum players is correct - public void checkNumberOfMaximumPlayers() + @Test + // Tests if number of maximum players is correct + public void checkNumberOfMaximumPlayers() { - MineStat ms = new MineStat("minecraft.frag.land", 25565); - ms.setMaximumPlayers(32); - assertEquals(32, ms.getMaximumPlayers()); - } + MineStat ms = new MineStat("minecraft.frag.land", 25565); + ms.setMaximumPlayers(32); + assertEquals(32, ms.getMaximumPlayers()); + } - @Test - // Tests if the message of the day is correct - public void checkMessageOfTheDay() + @Test + // Tests if the message of the day is correct + public void checkMessageOfTheDay() { - MineStat ms = new MineStat("minecraft.frag.land", 25565); - ms.setMotd("Frag Land"); - assertEquals("Frag Land", ms.getMotd()); - } + MineStat ms = new MineStat("minecraft.frag.land", 25565); + ms.setMotd("Frag Land"); + assertEquals("Frag Land", ms.getMotd()); + } - @Test - // Tests if the server is up - public void checkThatServerIsUp() + @Test + // Tests if the server is up + public void checkThatServerIsUp() { - MineStat ms = new MineStat("minecraft.frag.land", 25565); - assertTrue(ms.isServerUp()); - } + MineStat ms = new MineStat("minecraft.frag.land", 25565); + assertTrue(ms.isServerUp()); + } } diff --git a/Java/me/dilley/MineStat.java b/Java/me/dilley/MineStat.java index d70d9a10..922f7d1d 100644 --- a/Java/me/dilley/MineStat.java +++ b/Java/me/dilley/MineStat.java @@ -1,6 +1,6 @@ /* * MineStat.java - A Minecraft server status checker - * Copyright (C) 2014-2022 Lloyd Dilley + * Copyright (C) 2014-2024 Lloyd Dilley * http://www.dilley.me/ * * This program is free software; you can redistribute it and/or modify @@ -18,10 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/** - * @author Lloyd Dilley - */ - package me.dilley; import com.google.gson.*; @@ -32,6 +28,9 @@ import java.util.Base64; import java.util.Date; +/** + * @author Lloyd Dilley + */ public class MineStat { public static final String VERSION = "3.0.6"; // MineStat version @@ -59,9 +58,10 @@ public enum ConnectionStatus private final int magicNumber; private final String shortDescription; - private ConnectionStatus(int magicNumber, String shortDescription) { - this.magicNumber = magicNumber; - this.shortDescription = shortDescription; + private ConnectionStatus(int magicNumber, String shortDescription) + { + this.magicNumber = magicNumber; + this.shortDescription = shortDescription; } public int getMagicNumber() { return magicNumber; } diff --git a/Java/pom.xml b/Java/pom.xml index 913bdcba..72b31cc1 100644 --- a/Java/pom.xml +++ b/Java/pom.xml @@ -1,11 +1,13 @@ - + 4.0.0 - MineStat + io.github.fragland MineStat 3.0.6 jar + + MineStat MineStat is a Minecraft server status checker. https://github.com/fragland/minestat @@ -36,18 +38,17 @@ + + com.google.code.gson + gson + 2.11.0 + junit junit 4.13.2 test - - - com.google.code.gson - gson - 2.11.0 - @@ -64,6 +65,7 @@ + org.apache.maven.plugins maven-compiler-plugin 3.13.0 @@ -151,7 +153,6 @@ - org.apache.maven.plugins