Fix the spacing and clean it up.
This commit is contained in:
parent
f89de50d75
commit
71a60e6ee3
@ -374,7 +374,7 @@ public class Jail {
|
|||||||
* @return Distance between the location provided and the teleport in location.
|
* @return Distance between the location provided and the teleport in location.
|
||||||
*/
|
*/
|
||||||
public double getDistance(Location loc) {
|
public double getDistance(Location loc) {
|
||||||
if (!loc.getWorld().getName().equalsIgnoreCase(getTeleportIn().getWorld().getName())) return (double) Integer.MAX_VALUE;
|
if (!loc.getWorld().getName().equalsIgnoreCase(getTeleportIn().getWorld().getName())) return Integer.MAX_VALUE;
|
||||||
else return loc.distance(getTeleportIn());
|
else return loc.distance(getTeleportIn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ import com.graywolf336.jail.JailManager;
|
|||||||
import com.graywolf336.jail.command.commands.HandCuffCommand;
|
import com.graywolf336.jail.command.commands.HandCuffCommand;
|
||||||
import com.graywolf336.jail.command.commands.ToggleJailDebugCommand;
|
import com.graywolf336.jail.command.commands.ToggleJailDebugCommand;
|
||||||
import com.graywolf336.jail.command.commands.UnHandCuffCommand;
|
import com.graywolf336.jail.command.commands.UnHandCuffCommand;
|
||||||
import com.graywolf336.jail.command.commands.UnJailForceCommand;
|
|
||||||
import com.graywolf336.jail.command.commands.UnJailCommand;
|
import com.graywolf336.jail.command.commands.UnJailCommand;
|
||||||
|
import com.graywolf336.jail.command.commands.UnJailForceCommand;
|
||||||
import com.graywolf336.jail.enums.Lang;
|
import com.graywolf336.jail.enums.Lang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,11 +10,11 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import com.graywolf336.jail.JailMain;
|
import com.graywolf336.jail.JailMain;
|
||||||
import com.graywolf336.jail.JailManager;
|
import com.graywolf336.jail.JailManager;
|
||||||
import com.graywolf336.jail.command.subcommands.JailCreateCellCommand;
|
|
||||||
import com.graywolf336.jail.command.subcommands.JailCheckCommand;
|
import com.graywolf336.jail.command.subcommands.JailCheckCommand;
|
||||||
import com.graywolf336.jail.command.subcommands.JailClearCommand;
|
import com.graywolf336.jail.command.subcommands.JailClearCommand;
|
||||||
import com.graywolf336.jail.command.subcommands.JailCommand;
|
import com.graywolf336.jail.command.subcommands.JailCommand;
|
||||||
import com.graywolf336.jail.command.subcommands.JailConfirmCommand;
|
import com.graywolf336.jail.command.subcommands.JailConfirmCommand;
|
||||||
|
import com.graywolf336.jail.command.subcommands.JailCreateCellCommand;
|
||||||
import com.graywolf336.jail.command.subcommands.JailCreateCommand;
|
import com.graywolf336.jail.command.subcommands.JailCreateCommand;
|
||||||
import com.graywolf336.jail.command.subcommands.JailDeleteCellCommand;
|
import com.graywolf336.jail.command.subcommands.JailDeleteCellCommand;
|
||||||
import com.graywolf336.jail.command.subcommands.JailDeleteCellsCommand;
|
import com.graywolf336.jail.command.subcommands.JailDeleteCellsCommand;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package test.java.com.graywolf336.jail;
|
package test.java.com.graywolf336.jail;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
import static org.mockito.Matchers.any;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -22,6 +22,8 @@ import org.junit.runner.RunWith;
|
|||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
import org.powermock.modules.junit4.PowerMockRunner;
|
import org.powermock.modules.junit4.PowerMockRunner;
|
||||||
|
|
||||||
|
import test.java.com.graywolf336.jail.util.TestInstanceCreator;
|
||||||
|
|
||||||
import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
|
import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
|
||||||
import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
|
import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
|
||||||
import com.graywolf336.jail.JailMain;
|
import com.graywolf336.jail.JailMain;
|
||||||
@ -29,8 +31,6 @@ import com.graywolf336.jail.beans.CachePrisoner;
|
|||||||
import com.graywolf336.jail.beans.Jail;
|
import com.graywolf336.jail.beans.Jail;
|
||||||
import com.graywolf336.jail.beans.Prisoner;
|
import com.graywolf336.jail.beans.Prisoner;
|
||||||
|
|
||||||
import test.java.com.graywolf336.jail.util.TestInstanceCreator;
|
|
||||||
|
|
||||||
@RunWith(PowerMockRunner.class)
|
@RunWith(PowerMockRunner.class)
|
||||||
@PrepareForTest({ JailMain.class, PluginDescriptionFile.class })
|
@PrepareForTest({ JailMain.class, PluginDescriptionFile.class })
|
||||||
public class BenchmarkTest extends AbstractBenchmark {
|
public class BenchmarkTest extends AbstractBenchmark {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package test.java.com.graywolf336.jail;
|
package test.java.com.graywolf336.jail;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
package test.java.com.graywolf336.jail;
|
package test.java.com.graywolf336.jail;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
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.Mockito.atLeast;
|
import static org.mockito.Mockito.atLeast;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package test.java.com.graywolf336.jail;
|
package test.java.com.graywolf336.jail;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package test.java.com.graywolf336.jail;
|
package test.java.com.graywolf336.jail;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package test.java.com.graywolf336.jail;
|
package test.java.com.graywolf336.jail;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package test.java.com.graywolf336.jail.util;
|
package test.java.com.graywolf336.jail.util;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.HumanEntity;
|
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.HumanEntity;
|
||||||
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
|
|
||||||
public class MockPlayerInventory implements PlayerInventory {
|
public class MockPlayerInventory implements PlayerInventory {
|
||||||
|
|
||||||
private int armorSize = 4, inventorySize = 36;
|
private int armorSize = 4, inventorySize = 36;
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
package test.java.com.graywolf336.jail.util;
|
package test.java.com.graywolf336.jail.util;
|
||||||
|
|
||||||
|
import static org.mockito.Matchers.any;
|
||||||
|
import static org.mockito.Matchers.anyBoolean;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -18,8 +24,6 @@ import org.bukkit.generator.ChunkGenerator;
|
|||||||
import org.mockito.invocation.InvocationOnMock;
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
|
|
||||||
import static org.mockito.Mockito.*;
|
|
||||||
|
|
||||||
public class MockWorldFactory {
|
public class MockWorldFactory {
|
||||||
|
|
||||||
private static final Map<String, World> createdWorlds = new HashMap<String, World>();
|
private static final Map<String, World> createdWorlds = new HashMap<String, World>();
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
package test.java.com.graywolf336.jail.util;
|
package test.java.com.graywolf336.jail.util;
|
||||||
|
|
||||||
|
import static org.mockito.Matchers.any;
|
||||||
|
import static org.mockito.Matchers.anyBoolean;
|
||||||
|
import static org.mockito.Matchers.anyLong;
|
||||||
|
import static org.mockito.Matchers.anyString;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.doReturn;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
import static org.powermock.api.support.membermodification.MemberMatcher.constructor;
|
||||||
|
import static org.powermock.api.support.membermodification.MemberModifier.suppress;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -12,9 +23,9 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldType;
|
|
||||||
import org.bukkit.World.Environment;
|
import org.bukkit.World.Environment;
|
||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
|
import org.bukkit.WorldType;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemFactory;
|
import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemFactory;
|
||||||
@ -26,22 +37,14 @@ import org.bukkit.plugin.PluginLogger;
|
|||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
|
||||||
import org.mockito.Matchers;
|
import org.mockito.Matchers;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
|
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
import org.powermock.api.mockito.PowerMockito;
|
||||||
import org.powermock.core.MockGateway;
|
import org.powermock.core.MockGateway;
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||||
|
|
||||||
import static org.mockito.Matchers.anyString;
|
|
||||||
import static org.mockito.Mockito.*;
|
|
||||||
import static org.powermock.api.support.membermodification.MemberMatcher.constructor;
|
|
||||||
import static org.powermock.api.support.membermodification.MemberModifier.suppress;
|
|
||||||
|
|
||||||
import com.graywolf336.jail.JailMain;
|
import com.graywolf336.jail.JailMain;
|
||||||
|
|
||||||
@PrepareForTest({ CraftItemFactory.class })
|
@PrepareForTest({ CraftItemFactory.class })
|
||||||
@ -261,7 +264,7 @@ public class TestInstanceCreator {
|
|||||||
when(mockPlayer.getInventory()).thenReturn(new MockPlayerInventory());
|
when(mockPlayer.getInventory()).thenReturn(new MockPlayerInventory());
|
||||||
|
|
||||||
// Init our second command sender, but this time is an instance of a player
|
// Init our second command sender, but this time is an instance of a player
|
||||||
mockPlayerSender = (CommandSender) mockPlayer;
|
mockPlayerSender = mockPlayer;
|
||||||
when(mockPlayerSender.getServer()).thenReturn(mockServer);
|
when(mockPlayerSender.getServer()).thenReturn(mockServer);
|
||||||
when(mockPlayerSender.getName()).thenReturn("graywolf336");
|
when(mockPlayerSender.getName()).thenReturn("graywolf336");
|
||||||
when(mockPlayerSender.isPermissionSet(anyString())).thenReturn(true);
|
when(mockPlayerSender.isPermissionSet(anyString())).thenReturn(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user