Update to Bukkit Development Builds

Change things so unit testing can run after Bukkit's breaking commit with classloader stuff
This commit is contained in:
Chris Ward 2014-01-20 21:20:13 +11:00
parent f39ef36115
commit 839bfe0c2e
9 changed files with 137 additions and 8 deletions

View File

@ -74,6 +74,7 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.java.JavaPluginLoader;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scheduler.BukkitTask;
import org.yaml.snakeyaml.error.YAMLException;
@ -81,7 +82,7 @@ import org.yaml.snakeyaml.error.YAMLException;
public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
{
public static final int BUKKIT_VERSION = 2882;
public static final int BUKKIT_VERSION = 2985;
private static final Logger LOGGER = Logger.getLogger("Essentials");
private transient ISettings settings;
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
@ -102,6 +103,16 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
private transient List<String> vanishedPlayers = new ArrayList<String>();
private transient SimpleCommandMap scm;
public Essentials()
{
}
public Essentials(final Server server)
{
super(new JavaPluginLoader(server), new PluginDescriptionFile("Essentials", "", "com.earth2me.essentials.Essentials"), null, null);
}
@Override
public ISettings getSettings()
{

View File

@ -474,30 +474,126 @@ public class OfflinePlayer implements Player
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void removeAchievement(Achievement achievement)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public boolean hasAchievement(Achievement achievement)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void incrementStatistic(Statistic ststc)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void decrementStatistic(Statistic statistic) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void incrementStatistic(Statistic ststc, int i)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void decrementStatistic(Statistic statistic, int i) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void setStatistic(Statistic statistic, int i) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public int getStatistic(Statistic statistic) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void incrementStatistic(Statistic ststc, Material mtrl)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void decrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public int getStatistic(Statistic statistic, Material material) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void incrementStatistic(Statistic ststc, Material mtrl, int i)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void decrementStatistic(Statistic statistic, Material material, int i) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void setStatistic(Statistic statistic, Material material, int i) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void incrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void decrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public int getStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void incrementStatistic(Statistic statistic, EntityType entityType, int i) throws IllegalArgumentException
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void decrementStatistic(Statistic statistic, EntityType entityType, int i)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void setStatistic(Statistic statistic, EntityType entityType, int i)
{
throw new UnsupportedOperationException(_("notSupportedYet"));
}
@Override
public void playNote(Location lctn, byte b, byte b1)
{

View File

@ -19,9 +19,9 @@ public class EconomyTest extends TestCase
public EconomyTest(final String testName)
{
super(testName);
ess = new Essentials();
final FakeServer server = new FakeServer();
server.createWorld("testWorld", Environment.NORMAL);
ess = new Essentials(server);
try
{
ess.setupForTesting(server);

View File

@ -1136,7 +1136,7 @@ public class FakeServer implements Server
@Override
public WarningState getWarningState()
{
throw new UnsupportedOperationException("Not supported yet.");
return WarningState.DEFAULT;
}
@Override
@ -1177,4 +1177,22 @@ public class FakeServer implements Server
public CachedServerIcon loadServerIcon(BufferedImage bufferedImage) throws IllegalArgumentException, Exception {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void setIdleTimeout(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int getIdleTimeout()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public UnsafeValues getUnsafe()
{
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -17,9 +17,9 @@ public class StorageTest extends TestCase
public StorageTest()
{
ess = new Essentials();
server = new FakeServer();
world = server.createWorld("testWorld", Environment.NORMAL);
ess = new Essentials(server);
try
{
ess.setupForTesting(server);

View File

@ -18,9 +18,9 @@ public class ToggleTest extends TestCase
public ToggleTest(String testName)
{
super(testName);
ess = new Essentials();
server = new FakeServer();
server.createWorld("testWorld", Environment.NORMAL);
ess = new Essentials(server);
try
{
ess.setupForTesting(server);

View File

@ -17,9 +17,9 @@ public class UserTest extends TestCase
public UserTest(String testName)
{
super(testName);
ess = new Essentials();
server = new FakeServer();
server.createWorld("testWorld", Environment.NORMAL);
ess = new Essentials(server);
try
{
ess.setupForTesting(server);

View File

@ -19,9 +19,9 @@ public class UtilTest extends TestCase
public UtilTest()
{
ess = new Essentials();
server = new FakeServer();
server.createWorld("testWorld", Environment.NORMAL);
ess = new Essentials(server);
try
{
ess.setupForTesting(server);

View File

@ -44,6 +44,10 @@
<id>ess-repo</id>
<url>http://repo.ess3.net/content/groups/public</url>
</repository>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public</url>
</repository>
</repositories>
<distributionManagement>
@ -71,7 +75,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.2-R0.1</version>
<version>1.7.2-R0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>