Skip to content

Commit

Permalink
Update to Bukkit Development Builds
Browse files Browse the repository at this point in the history
Change things so unit testing can run after Bukkit's breaking commit with classloader stuff
  • Loading branch information
chrisgward committed Jan 20, 2014
1 parent f39ef36 commit 839bfe0
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 8 deletions.
13 changes: 12 additions & 1 deletion Essentials/src/com/earth2me/essentials/Essentials.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@
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;


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);
Expand All @@ -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()
{
Expand Down
96 changes: 96 additions & 0 deletions Essentials/src/com/earth2me/essentials/OfflinePlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,30 +474,126 @@ public void awardAchievement(Achievement a)
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)
{
Expand Down
2 changes: 1 addition & 1 deletion Essentials/test/com/earth2me/essentials/EconomyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 19 additions & 1 deletion Essentials/test/com/earth2me/essentials/FakeServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ public String getMotd()
@Override
public WarningState getWarningState()
{
throw new UnsupportedOperationException("Not supported yet.");
return WarningState.DEFAULT;
}

@Override
Expand Down Expand Up @@ -1177,4 +1177,22 @@ public CachedServerIcon loadServerIcon(File file) throws IllegalArgumentExceptio
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.");
}
}
2 changes: 1 addition & 1 deletion Essentials/test/com/earth2me/essentials/StorageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Essentials/test/com/earth2me/essentials/ToggleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Essentials/test/com/earth2me/essentials/UserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Essentials/test/com/earth2me/essentials/UtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 839bfe0

Please sign in to comment.