diff --git a/src/main/java/us/tastybento/bskyblock/commands/island/IslandSethomeCommand.java b/src/main/java/us/tastybento/bskyblock/commands/island/IslandSethomeCommand.java index d77af321a..65b3b54cc 100644 --- a/src/main/java/us/tastybento/bskyblock/commands/island/IslandSethomeCommand.java +++ b/src/main/java/us/tastybento/bskyblock/commands/island/IslandSethomeCommand.java @@ -30,7 +30,7 @@ public class IslandSethomeCommand extends CompositeCommand { user.sendMessage("general.errors.no-island"); return false; } - if (!getPlugin().getIslands().playerIsOnIsland(user)) { + if (!getPlugin().getIslands().userIsOnIsland(user)) { user.sendMessage("commands.island.sethome.must-be-on-your-island"); return false; } diff --git a/src/main/java/us/tastybento/bskyblock/listeners/ObsidianToLava.java b/src/main/java/us/tastybento/bskyblock/listeners/ObsidianToLava.java index e975eb829..dda3fff94 100644 --- a/src/main/java/us/tastybento/bskyblock/listeners/ObsidianToLava.java +++ b/src/main/java/us/tastybento/bskyblock/listeners/ObsidianToLava.java @@ -52,7 +52,7 @@ public class ObsidianToLava implements Listener { return false; } User user = User.getInstance(e.getPlayer()); - if (plugin.getIslands().playerIsOnIsland(user)) { + if (plugin.getIslands().userIsOnIsland(user)) { // Look around to see if this is a lone obsidian block Block b = e.getClickedBlock(); diff --git a/src/main/java/us/tastybento/bskyblock/managers/IslandsManager.java b/src/main/java/us/tastybento/bskyblock/managers/IslandsManager.java index 9f2c57d2b..291084089 100644 --- a/src/main/java/us/tastybento/bskyblock/managers/IslandsManager.java +++ b/src/main/java/us/tastybento/bskyblock/managers/IslandsManager.java @@ -6,6 +6,7 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; +import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -49,13 +50,13 @@ public class IslandsManager { * - Location to be checked * @return true if safe, otherwise false */ - public boolean isSafeLocation(final Location l) { + public boolean isSafeLocation(Location l) { if (l == null) { return false; } - final Block ground = l.getBlock().getRelative(BlockFace.DOWN); - final Block space1 = l.getBlock(); - final Block space2 = l.getBlock().getRelative(BlockFace.UP); + Block ground = l.getBlock().getRelative(BlockFace.DOWN); + Block space1 = l.getBlock(); + Block space2 = l.getBlock().getRelative(BlockFace.UP); // Ground must be solid if (!ground.getType().isSolid()) { @@ -93,8 +94,8 @@ public class IslandsManager { return false; } } - if (ground.getType().equals(Material.CACTUS) || ground.getType().equals(Material.BOAT) || ground.getType().equals(Material.FENCE) - || ground.getType().equals(Material.NETHER_FENCE) || ground.getType().equals(Material.SIGN_POST) || ground.getType().equals(Material.WALL_SIGN)) { + if (ground.getType().equals(Material.CACTUS) || ground.getType().equals(Material.BOAT) || ground.getType().toString().contains("FENCE") + || ground.getType().equals(Material.SIGN_POST) || ground.getType().equals(Material.WALL_SIGN)) { return false; } // Check that the space is not solid @@ -128,6 +129,10 @@ public class IslandsManager { // Island Cache private IslandCache islandCache; + /** + * Islands Manager + * @param plugin + */ public IslandsManager(BSkyBlock plugin){ this.plugin = plugin; // Set up the database handler to store and retrieve Island classes @@ -385,8 +390,7 @@ public class IslandsManager { if (spawn != null && spawn.onIsland(location)) { return Optional.of(spawn); } - Optional island = getIslandAt(location); - return island.map(x->x.onIsland(location) ? island.get() : null); + return getIslandAt(location).filter(i -> i.onIsland(location)); } /** @@ -397,7 +401,7 @@ public class IslandsManager { * @param number - a number - starting home location e.g., 1 * @return Location of a safe teleport spot or null if one cannot be found */ - public Location getSafeHomeLocation(final UUID playerUUID, int number) { + public Location getSafeHomeLocation(UUID playerUUID, int number) { // Try the numbered home location first Location l = plugin.getPlayers().getHomeLocation(playerUUID, number); if (l == null) { @@ -568,6 +572,13 @@ public class IslandsManager { return spawn.onIsland(playerLoc); } + /** + * @param spawn the spawn to set + */ + public void setSpawn(Island spawn) { + this.spawn = spawn; + } + /** * Checks if there is an island or blocks at this location * @param location - the location @@ -575,7 +586,7 @@ public class IslandsManager { */ public boolean isIsland(Location location){ if (location == null) { - return true; + return false; } location = getClosestIsland(location); if (islandCache.getIslandAt(location) != null) { @@ -589,7 +600,6 @@ public class IslandsManager { return true; } // Look around - for (int x = -5; x <= 5; x++) { for (int y = 10; y <= 255; y++) { for (int z = -5; z <= 5; z++) { @@ -617,6 +627,9 @@ public class IslandsManager { long z = Math.round((double) location.getBlockZ() / plugin.getSettings().getIslandDistance()) * plugin.getSettings().getIslandDistance() + plugin.getSettings().getIslandZOffset(); long y = plugin.getSettings().getIslandHeight(); + if (location.getBlockX() == x && location.getBlockZ() == z) { + return location; + } return new Location(location.getWorld(), x, y, z); } @@ -655,29 +668,9 @@ public class IslandsManager { if (player == null) { return false; } - // Get the player's island from the grid if it exists - Optional island = getIslandAt(loc); - if (island.isPresent()) { - // Return whether the location is within the protected zone and the player is on the list of acceptable players - return island.get().onIsland(loc) && island.get().getMemberSet().contains(player.getUniqueId()); - } - // Not in the grid, so do it the old way - // Make a list of test locations and test them - Set islandTestLocations = new HashSet<>(); - if (plugin.getPlayers().hasIsland(player.getUniqueId()) || plugin.getPlayers().inTeam(player.getUniqueId())) { - islandTestLocations.add(getIslandLocation(player.getUniqueId())); - } - // TODO: Check any coop locations - // Run through all the locations - for (Location islandTestLocation : islandTestLocations) { - if (loc.getWorld().equals(islandTestLocation.getWorld())) { - return loc.getX() >= islandTestLocation.getX() - plugin.getSettings().getIslandProtectionRange() - && loc.getX() < islandTestLocation.getX() + plugin.getSettings().getIslandProtectionRange() - && loc.getZ() >= islandTestLocation.getZ() - plugin.getSettings().getIslandProtectionRange() - && loc.getZ() < islandTestLocation.getZ() + plugin.getSettings().getIslandProtectionRange(); - } - } - return false; + // Get the player's island + Optional ii = getIslandAt(loc); + return getIslandAt(loc).filter(i -> i.onIsland(loc)).map(i -> i.getMemberSet().contains(player.getUniqueId())).orElse(false); } public int metrics_getCreatedCount(){ @@ -695,7 +688,10 @@ public class IslandsManager { * @param user - the User * @return true if on valid island, false if not */ - public boolean playerIsOnIsland(User user) { + public boolean userIsOnIsland(User user) { + if (user == null) { + return false; + } return Optional.ofNullable(getIsland(user.getUniqueId())).map(i -> i.onIsland(user.getLocation())).orElse(false); } @@ -723,7 +719,7 @@ public class IslandsManager { */ public void removePlayersFromIsland(final Island island) { // Teleport players away - for (Player player : plugin.getServer().getOnlinePlayers()) { + for (Player player : Bukkit.getOnlinePlayers()) { if (island.inIslandSpace(player.getLocation().getBlockX(), player.getLocation().getBlockZ())) { // Teleport island players to their island home if (plugin.getPlayers().hasIsland(player.getUniqueId()) || plugin.getPlayers().inTeam(player.getUniqueId())) { diff --git a/src/test/java/us/tastybento/bskyblock/listeners/ObsidianToLavaTest.java b/src/test/java/us/tastybento/bskyblock/listeners/ObsidianToLavaTest.java index 251bd480d..3299ea78c 100644 --- a/src/test/java/us/tastybento/bskyblock/listeners/ObsidianToLavaTest.java +++ b/src/test/java/us/tastybento/bskyblock/listeners/ObsidianToLavaTest.java @@ -124,7 +124,7 @@ public class ObsidianToLavaTest { // Put player in world when(iwm.inWorld(Mockito.any())).thenReturn(true); // Put player on island - when(im.playerIsOnIsland(Mockito.any())).thenReturn(true); + when(im.userIsOnIsland(Mockito.any())).thenReturn(true); // Set as survival when(who.getGameMode()).thenReturn(GameMode.SURVIVAL); @@ -186,7 +186,7 @@ public class ObsidianToLavaTest { when(who.getGameMode()).thenReturn(GameMode.SURVIVAL); // Test when player is not on island - when(im.playerIsOnIsland(Mockito.any())).thenReturn(false); + when(im.userIsOnIsland(Mockito.any())).thenReturn(false); assertFalse(listener.onPlayerInteract(event)); diff --git a/src/test/java/us/tastybento/bskyblock/managers/IslandsManagerTest.java b/src/test/java/us/tastybento/bskyblock/managers/IslandsManagerTest.java index 2c69a4436..de913e4ab 100644 --- a/src/test/java/us/tastybento/bskyblock/managers/IslandsManagerTest.java +++ b/src/test/java/us/tastybento/bskyblock/managers/IslandsManagerTest.java @@ -1,45 +1,74 @@ package us.tastybento.bskyblock.managers; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.util.logging.Logger; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; import org.bukkit.Bukkit; +import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Server; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; -import org.bukkit.inventory.ItemFactory; +import org.bukkit.entity.Player; +import org.bukkit.material.MaterialData; import org.bukkit.material.TrapDoor; -import org.bukkit.plugin.PluginManager; -import org.junit.BeforeClass; +import org.bukkit.scheduler.BukkitScheduler; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; +import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.reflect.Whitebox; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableSet.Builder; + import us.tastybento.bskyblock.BSkyBlock; import us.tastybento.bskyblock.Settings; +import us.tastybento.bskyblock.api.user.User; +import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.generators.IslandWorld; +import us.tastybento.bskyblock.managers.island.IslandCache; +import us.tastybento.bskyblock.util.DeleteIslandChunks; +import us.tastybento.bskyblock.util.Util; @RunWith(PowerMockRunner.class) -@PrepareForTest( { BSkyBlock.class, IslandsManager.class }) +@PrepareForTest( { Bukkit.class, BSkyBlock.class, IslandsManager.class, Util.class, Location.class }) public class IslandsManagerTest { - @Mock - static BSkyBlock plugin = mock(BSkyBlock.class); + private static BSkyBlock plugin; + private UUID uuid; + private User user; + private Settings s; + private PlayersManager pm; + private Player player; private static World world; + private IslandsManager manager; + private Block space1; + private Block ground; + private Block space2; + private Location location; + private BlockState blockState; - + /* @BeforeClass public static void setUpBeforeClass() throws Exception { Server server = mock(Server.class); @@ -47,139 +76,312 @@ public class IslandsManagerTest { when(server.getLogger()).thenReturn(Logger.getAnonymousLogger()); when(server.getWorld("world")).thenReturn(world); when(server.getVersion()).thenReturn("BSB_Mocking"); - PluginManager pluginManager = mock(PluginManager.class); when(server.getPluginManager()).thenReturn(pluginManager); - - ItemFactory itemFactory = mock(ItemFactory.class); - when(server.getItemFactory()).thenReturn(itemFactory); - Bukkit.setServer(server); - when(Bukkit.getLogger()).thenReturn(Logger.getAnonymousLogger()); - + // Set up plugin + plugin = mock(BSkyBlock.class); Whitebox.setInternalState(BSkyBlock.class, "instance", plugin); - when(Bukkit.getLogger()).thenReturn(Logger.getAnonymousLogger()); - - } + */ - @Test - public void testIsSafeLocation() { - Settings settings = mock(Settings.class); + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + // World + world = mock(World.class); + // Set up plugin + plugin = mock(BSkyBlock.class); + Whitebox.setInternalState(BSkyBlock.class, "instance", plugin); - when(plugin.getSettings()).thenReturn(settings); + // Command manager + CommandsManager cm = mock(CommandsManager.class); + when(plugin.getCommandsManager()).thenReturn(cm); + + // Settings + s = mock(Settings.class); + when(s.getResetWait()).thenReturn(0L); + when(s.getResetLimit()).thenReturn(3); + when(plugin.getSettings()).thenReturn(s); + + // Player + player = mock(Player.class); + // Sometimes use: Mockito.withSettings().verboseLogging() + user = mock(User.class); + when(user.isOp()).thenReturn(false); + uuid = UUID.randomUUID(); + when(user.getUniqueId()).thenReturn(uuid); + when(user.getPlayer()).thenReturn(player); + User.setPlugin(plugin); + // Set up user already + User.getInstance(player); + + // Locales + LocalesManager lm = mock(LocalesManager.class); + when(plugin.getLocalesManager()).thenReturn(lm); + when(lm.get(any(), any())).thenReturn("mock translation"); - IslandsManager manager = new IslandsManager(plugin); + // Has team + pm = mock(PlayersManager.class); + when(pm.inTeam(Mockito.eq(uuid))).thenReturn(true); + when(plugin.getPlayers()).thenReturn(pm); - Location location = mock(Location.class); - when(location.getWorld()).thenReturn(world); - when(location.getBlockX()).thenReturn(0); - when(location.getBlockY()).thenReturn(0); - when(location.getBlockZ()).thenReturn(0); + // Server & Scheduler - Block space1 = mock(Block.class); - Block ground = mock(Block.class); - Block space2 = mock(Block.class); + BukkitScheduler sch = mock(BukkitScheduler.class); + PowerMockito.mockStatic(Bukkit.class); + when(Bukkit.getScheduler()).thenReturn(sch); + // Standard location + manager = new IslandsManager(plugin); + location = mock(Location.class); + space1 = mock(Block.class); + ground = mock(Block.class); + space2 = mock(Block.class); when(location.getBlock()).thenReturn(space1); - - when(ground.getType()).thenReturn(Material.GRASS); - when(space1.getType()).thenReturn(Material.AIR); - when(space2.getType()).thenReturn(Material.AIR); when(space1.getRelative(BlockFace.DOWN)).thenReturn(ground); when(space1.getRelative(BlockFace.UP)).thenReturn(space2); - - BlockState blockState = mock(BlockState.class); - when(ground.getState()).thenReturn(blockState); - - // Closed trapdoor - TrapDoor trapDoor = mock(TrapDoor.class); - when(trapDoor.isOpen()).thenReturn(false); - when(blockState.getData()).thenReturn(trapDoor); - - // Happy path - assertTrue(manager.isSafeLocation(location)); - - // null - assertFalse(manager.isSafeLocation(null)); - - // Try all different types of ground - for (Material m : Material.values()) { - when(ground.getType()).thenReturn(m); - if (m.equals(Material.AIR) - || !m.isSolid() - || ground.getType().equals(Material.CACTUS) - || ground.getType().equals(Material.BOAT) - || ground.getType().equals(Material.FENCE) - || ground.getType().equals(Material.NETHER_FENCE) - || ground.getType().equals(Material.SIGN_POST) - || ground.getType().equals(Material.WALL_SIGN)) { - assertFalse("Materials : " + m , manager.isSafeLocation(location)); - } else { - assertTrue("Materials : " + m , manager.isSafeLocation(location)); - } - } - // Put ground back to GRASS - when(ground.getType()).thenReturn(Material.GRASS); - // Try all different types of lock around feet - for (Material m : Material.values()) { - when(space1.getType()).thenReturn(m); - if (m.isSolid()) { - if (m.equals(Material.SIGN_POST) || m.equals(Material.WALL_SIGN)) { - assertTrue("Materials : " + m , manager.isSafeLocation(location)); - } else { - assertFalse("Materials : " + m , manager.isSafeLocation(location)); - } - } else { - if (m.equals(Material.LAVA) || m.equals(Material.STATIONARY_LAVA) || m.equals(Material.PORTAL) || m.equals(Material.ENDER_PORTAL)) { - assertFalse("Materials : " + m , manager.isSafeLocation(location)); - } else { - assertTrue("Materials : " + m , manager.isSafeLocation(location)); - } - } - } + // A safe spot + when(ground.getType()).thenReturn(Material.STONE); when(space1.getType()).thenReturn(Material.AIR); - // Try all different types of lock around feet - for (Material m : Material.values()) { - when(space2.getType()).thenReturn(m); - if (m.isSolid()) { - if (m.equals(Material.SIGN_POST) || m.equals(Material.WALL_SIGN)) { - assertTrue("Materials : " + m , manager.isSafeLocation(location)); - } else { - assertFalse("Materials : " + m , manager.isSafeLocation(location)); - } - } else { - if (m.equals(Material.LAVA) || m.equals(Material.STATIONARY_LAVA) || m.equals(Material.PORTAL) || m.equals(Material.ENDER_PORTAL)) { - assertFalse("Materials : " + m , manager.isSafeLocation(location)); - } else { - assertTrue("Materials : " + m , manager.isSafeLocation(location)); - } - } - } - - // In liquid - when(settings.getAcidDamage()).thenReturn(0); - when(ground.getType()).thenReturn(Material.GRASS); - when(space1.getType()).thenReturn(Material.STATIONARY_WATER); - when(space2.getType()).thenReturn(Material.STATIONARY_WATER); - when(space1.isLiquid()).thenReturn(true); - when(space2.isLiquid()).thenReturn(true); - assertFalse("Submerged", manager.isSafeLocation(location)); - // In acid - when(settings.getAcidDamage()).thenReturn(10); - assertFalse("Submerged", manager.isSafeLocation(location)); - - when(settings.getAcidDamage()).thenReturn(0); when(space2.getType()).thenReturn(Material.AIR); - when(space2.isLiquid()).thenReturn(false); - assertTrue("In up to waist", manager.isSafeLocation(location)); - when(settings.getAcidDamage()).thenReturn(10); - assertFalse("In acid", manager.isSafeLocation(location)); - when(settings.getAcidDamage()).thenReturn(0); + // Neutral BlockState + blockState = mock(BlockState.class); + when(ground.getState()).thenReturn(blockState); + MaterialData md = mock(MaterialData.class); + when(blockState.getData()).thenReturn(md); + + // Online players + // Return a set of online players + PowerMockito.mockStatic(Bukkit.class); + when(Bukkit.getOnlinePlayers()).then(new Answer>() { + + @Override + public Set answer(InvocationOnMock invocation) throws Throwable { + + return new HashSet<>(); + } + + }); } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testIsSafeLocationSafe() { + IslandsManager manager = new IslandsManager(plugin); + assertTrue(manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testIsSafeLocationNull() { + IslandsManager manager = new IslandsManager(plugin); + assertFalse(manager.isSafeLocation(null)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testIsSafeLocationNonSolidGround() { + when(ground.getType()).thenReturn(Material.WATER); + assertFalse(manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testIsSafeLocationSubmerged() { + when(ground.getType()).thenReturn(Material.STONE); + when(space1.isLiquid()).thenReturn(true); + when(space2.isLiquid()).thenReturn(true); + assertFalse(manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testIsSafeLocationPortals() { + when(ground.getType()).thenReturn(Material.STONE); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.PORTAL); + assertFalse(manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.STONE); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.ENDER_PORTAL); + assertFalse(manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.STONE); + when(space1.getType()).thenReturn(Material.PORTAL); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse(manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.STONE); + when(space1.getType()).thenReturn(Material.ENDER_PORTAL); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse(manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.PORTAL); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse(manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.ENDER_PORTAL); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse(manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testIsSafeLocationAcid() { + when(ground.getType()).thenReturn(Material.GRASS); + when(space1.getType()).thenReturn(Material.STATIONARY_WATER); + when(space2.getType()).thenReturn(Material.AIR); + + when(s.getAcidDamage()).thenReturn(10); + + when(ground.isLiquid()).thenReturn(true); + when(space1.isLiquid()).thenReturn(false); + when(space2.isLiquid()).thenReturn(false); + assertFalse("In acid", manager.isSafeLocation(location)); + when(ground.isLiquid()).thenReturn(false); + when(space1.isLiquid()).thenReturn(true); + when(space2.isLiquid()).thenReturn(false); + assertFalse("In acid", manager.isSafeLocation(location)); + when(ground.isLiquid()).thenReturn(false); + when(space1.isLiquid()).thenReturn(false); + when(space2.isLiquid()).thenReturn(true); + assertFalse("In acid", manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testIsSafeLocationLava() { + when(ground.getType()).thenReturn(Material.LAVA); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse("In lava", manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.AIR); + when(space1.getType()).thenReturn(Material.LAVA); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse("In lava", manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.AIR); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.LAVA); + assertFalse("In lava", manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.STATIONARY_LAVA); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse("In lava", manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.AIR); + when(space1.getType()).thenReturn(Material.STATIONARY_LAVA); + when(space2.getType()).thenReturn(Material.AIR); + assertFalse("In lava", manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.AIR); + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.STATIONARY_LAVA); + assertFalse("In lava", manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testTrapDoor() { + when(ground.getType()).thenReturn(Material.TRAP_DOOR); + + // Open trapdoor + TrapDoor trapDoor = mock(TrapDoor.class); + when(trapDoor.isOpen()).thenReturn(true); + when(blockState.getData()).thenReturn(trapDoor); + + assertFalse("Open trapdoor", manager.isSafeLocation(location)); + + when(trapDoor.isOpen()).thenReturn(false); + assertTrue("Closed trapdoor", manager.isSafeLocation(location)); + + when(ground.getType()).thenReturn(Material.IRON_TRAPDOOR); + assertTrue("Closed iron trapdoor", manager.isSafeLocation(location)); + when(trapDoor.isOpen()).thenReturn(true); + assertFalse("Open iron trapdoor", manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testBadBlocks() { + // Fences + Arrays.asList(Material.values()).stream().filter(m -> m.toString().contains("FENCE")).forEach(m -> { + when(ground.getType()).thenReturn(m); + assertFalse("Fence :" + m.toString(), manager.isSafeLocation(location)); + }); + // Signs + when(ground.getType()).thenReturn(Material.SIGN_POST); + assertFalse("Sign", manager.isSafeLocation(location)); + when(ground.getType()).thenReturn(Material.WALL_SIGN); + assertFalse("Sign", manager.isSafeLocation(location)); + // Bad Blocks + Material[] badMats = {Material.CACTUS, Material.BOAT}; + Arrays.asList(badMats).forEach(m -> { + when(ground.getType()).thenReturn(m); + assertFalse("Bad mat :" + m.toString(), manager.isSafeLocation(location)); + }); + + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isSafeLocation(org.bukkit.Location)}. + */ + @Test + public void testSolidBlocks() { + when(space1.getType()).thenReturn(Material.STONE); + assertFalse("Solid", manager.isSafeLocation(location)); + + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.STONE); + assertFalse("Solid", manager.isSafeLocation(location)); + + when(space1.getType()).thenReturn(Material.WALL_SIGN); + when(space2.getType()).thenReturn(Material.AIR); + assertTrue("Wall sign 1", manager.isSafeLocation(location)); + + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.WALL_SIGN); + assertTrue("Wall sign 2", manager.isSafeLocation(location)); + + when(space1.getType()).thenReturn(Material.SIGN_POST); + when(space2.getType()).thenReturn(Material.AIR); + assertTrue("Wall sign 1", manager.isSafeLocation(location)); + + when(space1.getType()).thenReturn(Material.AIR); + when(space2.getType()).thenReturn(Material.SIGN_POST); + assertTrue("Wall sign 2", manager.isSafeLocation(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#IslandsManager(us.tastybento.bskyblock.BSkyBlock)}. + */ + @Test + public void testIslandsManager() { + assertNotNull(new IslandsManager(plugin)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#bigScan(org.bukkit.Location, int)}. + */ @Test public void testBigScan() throws Exception { Settings settings = mock(Settings.class); @@ -189,10 +391,10 @@ public class IslandsManagerTest { IslandWorld iwm = mock(IslandWorld.class); when(plugin.getIslandWorldManager()).thenReturn(iwm); when(iwm.getIslandWorld()).thenReturn(world); - + IslandsManager manager = new IslandsManager(plugin); - + Location location = mock(Location.class); when(location.getWorld()).thenReturn(world); when(location.getBlockX()).thenReturn(0); @@ -213,7 +415,7 @@ public class IslandsManagerTest { BlockState blockState = mock(BlockState.class); when(ground.getState()).thenReturn(blockState); - + // Negative value = full island scan // Null location should get a null response assertNull(manager.bigScan(null, -1)); @@ -221,6 +423,585 @@ public class IslandsManagerTest { assertNull(manager.bigScan(location, -1)); // Try null location, > 0 scan value assertNull(manager.bigScan(null, 10)); + + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#createIsland(org.bukkit.Location)}. + */ + @Test + public void testCreateIslandLocation() { + IslandsManager im = new IslandsManager(plugin); + Island island = im.createIsland(location); + assertNotNull(island); + assertEquals(island.getCenter(), location); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#createIsland(org.bukkit.Location, java.util.UUID)}. + */ + @Test + public void testCreateIslandLocationUUID() { + UUID owner = UUID.randomUUID(); + IslandsManager im = new IslandsManager(plugin); + Island island = im.createIsland(location, owner); + assertNotNull(island); + assertEquals(location, island.getCenter()); + assertEquals(owner, island.getOwner()); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#deleteIsland(us.tastybento.bskyblock.database.objects.Island, boolean)}. + */ + @Test + public void testDeleteIslandIslandBoolean() { + IslandsManager im = new IslandsManager(plugin); + + im.deleteIsland((Island)null, true); + UUID owner = UUID.randomUUID(); + Island island = im.createIsland(location, owner); + im.deleteIsland(island, false); + island = im.createIsland(location, owner); + im.deleteIsland(island, true); + assertNull(island); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#deleteIsland(java.util.UUID, boolean)}. + */ + @Test + public void testDeleteIslandUUIDBoolean() { + UUID owner = UUID.randomUUID(); + IslandsManager im = new IslandsManager(plugin); + Island island = im.createIsland(location, owner); + + im.deleteIsland(owner, false); + + assertNull(island.getOwner()); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#deleteIsland(java.util.UUID, boolean)}. + * @throws Exception + */ + @Test + public void testDeleteIslandUUIDBooleanRemoveBlocks() throws Exception { + DeleteIslandChunks dic = mock(DeleteIslandChunks.class); + PowerMockito.whenNew(DeleteIslandChunks.class).withAnyArguments().thenReturn(dic); + UUID owner = UUID.randomUUID(); + IslandsManager im = new IslandsManager(plugin); + Island island = im.createIsland(location, owner); + island = im.createIsland(location, owner); + im.deleteIsland(owner, true); + + assertNull(island); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#deleteIsland(java.util.UUID, boolean)}. + */ + @Test + public void testDeleteIslandUUIDBooleanNoIsland() { + UUID owner = UUID.randomUUID(); + IslandsManager im = new IslandsManager(plugin); + // Should error + im.deleteIsland(owner, false); + + Mockito.verify(plugin).logError(Mockito.anyString()); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getBanList(java.util.UUID)}. + */ + @Test + public void testGetBanList() { + UUID owner = UUID.randomUUID(); + IslandsManager im = new IslandsManager(plugin); + Island island = im.createIsland(location, owner); + Set bl = im.getBanList(owner); + assertNotNull(bl); + assertTrue(bl.isEmpty()); + UUID targetUUID = UUID.randomUUID(); + island.addToBanList(targetUUID); + bl = im.getBanList(owner); + assertTrue(bl.contains(targetUUID)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getCount()}. + */ + @Test + public void testGetCount() { + IslandsManager im = new IslandsManager(plugin); + assertTrue(im.getCount() == 0); + im.createIsland(location, UUID.randomUUID()); + assertTrue(im.getCount() == 1); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getIsland(java.util.UUID)}. + */ + @Test + public void testGetIsland() { + UUID owner = UUID.randomUUID(); + IslandsManager im = new IslandsManager(plugin); + Island island = im.createIsland(location, owner); + assertEquals(island, im.getIsland(owner)); + assertNull(im.getIsland(UUID.randomUUID())); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getIslandAt(int, int)}. + * @throws Exception + */ + @Test + public void testGetIslandAtIntInt() throws Exception { + IslandCache ic = mock(IslandCache.class); + Island is = mock(Island.class); + when(ic.getIslandAt(Mockito.anyInt(), Mockito.anyInt())).thenReturn(is); + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + IslandsManager im = new IslandsManager(plugin); + assertEquals(is, im.getIslandAt(1, 1)); + when(ic.getIslandAt(Mockito.anyInt(), Mockito.anyInt())).thenReturn(null); + assertNull(im.getIslandAt(100000, -100000)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getIslandAt(org.bukkit.Location)}. + * @throws Exception + */ + @Test + public void testGetIslandAtLocation() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + Island is = mock(Island.class); + when(ic.getIslandAt(Mockito.anyInt(), Mockito.anyInt())).thenReturn(is); + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + + PowerMockito.mockStatic(Util.class); + when(Util.inWorld(Mockito.any(Location.class))).thenReturn(true); + + IslandsManager im = new IslandsManager(plugin); + // In world, correct island + Optional oi = Optional.ofNullable(is); + assertEquals(oi, im.getIslandAt(location)); + + // in world, wrong island + when(ic.getIslandAt(Mockito.anyInt(), Mockito.anyInt())).thenReturn(null); + assertEquals(Optional.empty(), im.getIslandAt(new Location(world, 100000, 120, -100000))); + + // not in world + when(Util.inWorld(Mockito.any(Location.class))).thenReturn(false); + assertEquals(Optional.empty(), im.getIslandAt(new Location(world, 100000, 120, -100000))); + assertEquals(Optional.empty(), im.getIslandAt(location)); + + + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getIslandLocation(java.util.UUID)}. + */ + @Test + public void testGetIslandLocation() { + UUID owner = UUID.randomUUID(); + IslandsManager im = new IslandsManager(plugin); + im.createIsland(location, owner); + assertEquals(location, im.getIslandLocation(owner)); + assertNull(im.getIslandLocation(UUID.randomUUID())); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getIslandName(java.util.UUID)}. + * @throws Exception + */ + @Test + public void testGetIslandName() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + when(ic.getIslandName(Mockito.any())).thenReturn("name"); + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + IslandsManager im = new IslandsManager(plugin); + assertEquals("name", im.getIslandName(user.getUniqueId())); + + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getLast()}. + */ + @Test + public void testGetLast() { + IslandsManager im = new IslandsManager(plugin); + assertNull(im.getLast()); + im.setLast(location); + assertEquals(location, im.getLast()); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getMembers(java.util.UUID)}. + * @throws Exception + */ + @Test + public void testGetMembers() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + Set members = new HashSet<>(); + members.add(UUID.randomUUID()); + members.add(UUID.randomUUID()); + members.add(UUID.randomUUID()); + when(ic.getMembers(Mockito.any())).thenReturn(members); + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + IslandsManager im = new IslandsManager(plugin); + assertEquals(members, im.getMembers(UUID.randomUUID())); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getProtectedIslandAt(org.bukkit.Location)}. + * @throws Exception + */ + @Test + public void testGetProtectedIslandAt() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + Island is = mock(Island.class); + + when(ic.getIslandAt(Mockito.anyInt(), Mockito.anyInt())).thenReturn(is); + + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + + // In world + PowerMockito.mockStatic(Util.class); + when(Util.inWorld(Mockito.any(Location.class))).thenReturn(true); + + IslandsManager im = new IslandsManager(plugin); + Optional oi = Optional.ofNullable(is); + // In world, correct island + when(is.onIsland(Mockito.any())).thenReturn(true); + assertEquals(oi, im.getProtectedIslandAt(location)); + + // Not in protected space + when(is.onIsland(Mockito.any())).thenReturn(false); + assertEquals(Optional.empty(), im.getProtectedIslandAt(location)); + + im.setSpawn(is); + // In world, correct island + when(is.onIsland(Mockito.any())).thenReturn(true); + assertEquals(oi, im.getProtectedIslandAt(location)); + + // Not in protected space + when(is.onIsland(Mockito.any())).thenReturn(false); + assertEquals(Optional.empty(), im.getProtectedIslandAt(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getSafeHomeLocation(java.util.UUID, int)}. + */ + @Test + public void testGetSafeHomeLocation() { + IslandsManager im = new IslandsManager(plugin); + when(pm.getHomeLocation(Mockito.any(), Mockito.eq(0))).thenReturn(null); + when(pm.getHomeLocation(Mockito.any(), Mockito.eq(1))).thenReturn(location); + assertEquals(location, im.getSafeHomeLocation(UUID.randomUUID(), 0)); + // Change location so that it is not safe + // TODO + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getSpawnPoint()}. + */ + @Test + public void testGetSpawnPoint() { + IslandsManager im = new IslandsManager(plugin); + assertNull(im.getSpawnPoint()); + Island island = mock(Island.class); + when(island.getSpawnPoint()).thenReturn(location); + im.setSpawn(island); + assertEquals(location,im.getSpawnPoint()); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#homeTeleport(org.bukkit.entity.Player, int)}. + */ + @Test + public void testHomeTeleportPlayerInt() { + IslandsManager im = new IslandsManager(plugin); + when(pm.getHomeLocation(Mockito.any(), Mockito.eq(0))).thenReturn(null); + when(pm.getHomeLocation(Mockito.any(), Mockito.eq(1))).thenReturn(location); + when(player.getGameMode()).thenReturn(GameMode.SPECTATOR); + im.homeTeleport(player, 0); + Mockito.verify(player).teleport(location); + Mockito.verify(player).setGameMode(GameMode.SURVIVAL); + + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isAtSpawn(org.bukkit.Location)}. + */ + @Test + public void testIsAtSpawn() { + IslandsManager im = new IslandsManager(plugin); + assertFalse(im.isAtSpawn(location)); + Island island = mock(Island.class); + when(island.onIsland(Mockito.any())).thenReturn(true); + im.setSpawn(island); + assertTrue(im.isAtSpawn(location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isIsland(org.bukkit.Location)}. + * @throws Exception + */ + @Test + public void testIsIsland() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + Island is = mock(Island.class); + + when(ic.getIslandAt(Mockito.any())).thenReturn(is); + + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + + // In world + PowerMockito.mockStatic(Util.class); + when(Util.inWorld(Mockito.any(Location.class))).thenReturn(true); + + IslandsManager im = new IslandsManager(plugin); + assertFalse(im.isIsland(null)); + im.createIsland(location); + assertTrue(im.isIsland(location)); + + // No island in cache + when(ic.getIslandAt(Mockito.any())).thenReturn(null); + + // Use own generator + when(s.isUseOwnGenerator()).thenReturn(true); + assertFalse(im.isIsland(location)); + + when(s.isUseOwnGenerator()).thenReturn(false); + + // Location + when(location.getWorld()).thenReturn(world); + when(location.getBlockX()).thenReturn(10); + when(location.getBlockZ()).thenReturn(10); + when(location.getBlock()).thenReturn(space1); + + PowerMockito.whenNew(Location.class).withAnyArguments().thenReturn(location); + + when(location.getBlock()).thenReturn(space1); + + when(world.getBlockAt(Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(ground); + + // Liquid + when(space1.isEmpty()).thenReturn(false); + when(space1.isLiquid()).thenReturn(true); + assertTrue(im.isIsland(location)); + + // Empty space + when(space1.isEmpty()).thenReturn(true); + when(space1.isLiquid()).thenReturn(false); + assertTrue(im.isIsland(location)); + + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#getClosestIsland(org.bukkit.Location)}. + * @throws Exception + */ + @Test + public void testGetClosestIsland() throws Exception { + when(s.getIslandDistance()).thenReturn(100); + when(s.getIslandXOffset()).thenReturn(0); + when(s.getIslandZOffset()).thenReturn(0); + when(s.getIslandHeight()).thenReturn(120); + IslandsManager im = new IslandsManager(plugin); + when(location.getBlockX()).thenReturn(456); + when(location.getBlockZ()).thenReturn(456); + Location l = im.getClosestIsland(location); + assertEquals(500, l.getBlockX()); + assertEquals(500, l.getBlockZ()); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#isOwner(java.util.UUID)}. + * @throws Exception + */ + @Test + public void testIsOwner() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + Island is = mock(Island.class); + + when(ic.getIslandAt(Mockito.any())).thenReturn(is); + + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + + IslandsManager im = new IslandsManager(plugin); + assertFalse(im.isOwner(null)); + + when(ic.hasIsland(Mockito.any())).thenReturn(false); + assertFalse(im.isOwner(UUID.randomUUID())); + + when(ic.hasIsland(Mockito.any())).thenReturn(true); + when(ic.get(Mockito.any(UUID.class))).thenReturn(is); + UUID owner = UUID.randomUUID(); + when(is.getOwner()).thenReturn(owner); + UUID notOwner = UUID.randomUUID(); + while (owner.equals(notOwner)) { + notOwner = UUID.randomUUID(); + } + assertFalse(im.isOwner(notOwner)); + assertTrue(im.isOwner(owner)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#load()}. + */ + @Test + public void testLoad() { + IslandsManager im = new IslandsManager(plugin); + im.load(); } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#locationIsOnIsland(org.bukkit.entity.Player, org.bukkit.Location)}. + * @throws Exception + */ + @Test + public void testLocationIsOnIsland() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + Island is = mock(Island.class); + + when(ic.getIslandAt(Mockito.anyInt(),Mockito.anyInt())).thenReturn(is); + + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + + // In world + PowerMockito.mockStatic(Util.class); + when(Util.inWorld(Mockito.any(Location.class))).thenReturn(true); + + when(is.onIsland(Mockito.any())).thenReturn(true); + + Builder members = new ImmutableSet.Builder<>(); + members.add(uuid); + when(is.getMemberSet()).thenReturn(members.build()); + + when(player.getUniqueId()).thenReturn(uuid); + + IslandsManager im = new IslandsManager(plugin); + assertFalse(im.locationIsOnIsland(null, null)); + + assertTrue(im.locationIsOnIsland(player, location)); + + // No members + Builder mem = new ImmutableSet.Builder<>(); + when(is.getMemberSet()).thenReturn(mem.build()); + assertFalse(im.locationIsOnIsland(player, location)); + + // Not on island + when(is.getMemberSet()).thenReturn(members.build()); + when(is.onIsland(Mockito.any())).thenReturn(false); + assertFalse(im.locationIsOnIsland(player, location)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#userIsOnIsland(us.tastybento.bskyblock.api.user.User)}. + * @throws Exception + */ + @Test + public void testUserIsOnIsland() throws Exception { + // Mock island cache + IslandCache ic = mock(IslandCache.class); + Island is = mock(Island.class); + + when(ic.get(Mockito.any(UUID.class))).thenReturn(is); + + PowerMockito.whenNew(IslandCache.class).withAnyArguments().thenReturn(ic); + + IslandsManager im = new IslandsManager(plugin); + assertFalse(im.userIsOnIsland(null)); + + when(is.onIsland(Mockito.any())).thenReturn(false); + assertFalse(im.userIsOnIsland(user)); + + when(is.onIsland(Mockito.any())).thenReturn(true); + assertTrue(im.userIsOnIsland(user)); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#removeMobs(org.bukkit.Location)}. + */ + @Test + public void testRemoveMobs() { + IslandsManager im = new IslandsManager(plugin); + im.removeMobs(location); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#removePlayer(java.util.UUID)}. + */ + @Test + public void testRemovePlayer() { + IslandsManager im = new IslandsManager(plugin); + im.removePlayer(uuid); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#removePlayersFromIsland(us.tastybento.bskyblock.database.objects.Island)}. + */ + @Test + public void testRemovePlayersFromIsland() { + IslandsManager im = new IslandsManager(plugin); + Island is = mock(Island.class); + im.removePlayersFromIsland(is); + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#save(boolean)}. + */ + @Test + public void testSave() { + //fail("Not yet implemented"); // TODO + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#setIslandName(java.util.UUID, java.lang.String)}. + */ + @Test + public void testSetIslandName() { + //fail("Not yet implemented"); // TODO + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#setJoinTeam(us.tastybento.bskyblock.database.objects.Island, java.util.UUID)}. + */ + @Test + public void testSetJoinTeam() { + //fail("Not yet implemented"); // TODO + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#setLast(org.bukkit.Location)}. + */ + @Test + public void testSetLast() { + //fail("Not yet implemented"); // TODO + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#setLeaveTeam(java.util.UUID)}. + */ + @Test + public void testSetLeaveTeam() { + //fail("Not yet implemented"); // TODO + } + + /** + * Test method for {@link us.tastybento.bskyblock.managers.IslandsManager#shutdown()}. + */ + @Test + public void testShutdown() { + //fail("Not yet implemented"); // TODO + } + }