mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
Removes redundant throws (e.g. when Exception and IOException are thrown IOException got removed because it's unnecessary)
This commit is contained in:
parent
d9730c3c63
commit
fb313ac0c8
@ -91,7 +91,7 @@ public class ExportUtility {
|
||||
* @throws FileNotFoundException
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void writeInspectHtml(UserData userData, File playersFolder) throws FileNotFoundException, IOException {
|
||||
public static void writeInspectHtml(UserData userData, File playersFolder) throws IOException {
|
||||
if (!Settings.ANALYSIS_EXPORT.isTrue()) {
|
||||
return;
|
||||
}
|
||||
|
@ -1,14 +1,6 @@
|
||||
package test.java.main.java.com.djrapitops.plan.data;
|
||||
|
||||
import com.djrapitops.plugin.utilities.player.IOfflinePlayer;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import main.java.com.djrapitops.plan.Plan;
|
||||
import main.java.com.djrapitops.plan.data.SessionData;
|
||||
import main.java.com.djrapitops.plan.data.UserData;
|
||||
@ -19,9 +11,15 @@ import org.junit.runner.RunWith;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import test.java.utils.MockUtils;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.*;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -348,7 +346,7 @@ public class UserDataTest {
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
public void testPlayerConstructorBrokenBanned() throws IOException, Exception {
|
||||
public void testPlayerConstructorBrokenBanned() throws Exception {
|
||||
TestInit.init();
|
||||
test = new UserData(MockUtils.mockBrokenPlayer());
|
||||
UserData expected = new UserData(UUID.fromString("45b0dfdb-f71d-4cf3-8c21-27c9d4c651db"), 1234567L, true, "SURVIVAL", "TestName", true);
|
||||
@ -372,7 +370,7 @@ public class UserDataTest {
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
public void testOfflinePlayerConstructorBrokenBanned() throws IOException, Exception {
|
||||
public void testOfflinePlayerConstructorBrokenBanned() throws Exception {
|
||||
TestInit.init();
|
||||
test = new UserData((IOfflinePlayer) MockUtils.mockBrokenPlayer());
|
||||
UserData expected = new UserData(UUID.fromString("45b0dfdb-f71d-4cf3-8c21-27c9d4c651db"), 1234567L, true, "SURVIVAL", "TestName", true);
|
||||
|
@ -5,13 +5,6 @@
|
||||
*/
|
||||
package test.java.main.java.com.djrapitops.plan.data.cache.queue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import main.java.com.djrapitops.plan.Plan;
|
||||
import main.java.com.djrapitops.plan.data.UserData;
|
||||
import main.java.com.djrapitops.plan.data.cache.DBCallableProcessor;
|
||||
@ -22,7 +15,6 @@ import main.java.com.djrapitops.plan.utilities.MiscUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.junit.After;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
@ -32,6 +24,17 @@ import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import test.java.utils.MockUtils;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rsl1122
|
||||
@ -56,7 +59,7 @@ public class DataCacheGetQueueTest {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Before
|
||||
public void setUp() throws IOException, Exception {
|
||||
public void setUp() throws Exception {
|
||||
TestInit t = TestInit.init();
|
||||
assertTrue("Not set up", t.setUp());
|
||||
plan = t.getPlanMock();
|
||||
|
@ -5,22 +5,6 @@
|
||||
*/
|
||||
package test.java.main.java.com.djrapitops.plan.database;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import main.java.com.djrapitops.plan.Plan;
|
||||
import main.java.com.djrapitops.plan.data.KillData;
|
||||
import main.java.com.djrapitops.plan.data.SessionData;
|
||||
@ -35,7 +19,8 @@ import main.java.com.djrapitops.plan.utilities.ManageUtils;
|
||||
import main.java.com.djrapitops.plan.utilities.MiscUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.*;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
@ -44,9 +29,20 @@ import org.junit.runner.RunWith;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import test.java.utils.MockUtils;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -73,7 +69,7 @@ public class DatabaseTest {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Before
|
||||
public void setUp() throws IOException, Exception {
|
||||
public void setUp() throws Exception {
|
||||
TestInit t = TestInit.init();
|
||||
plan = t.getPlanMock();
|
||||
db = new SQLiteDB(plan, "debug" + MiscUtils.getTime()) {
|
||||
|
@ -5,11 +5,8 @@
|
||||
*/
|
||||
package test.java.main.java.com.djrapitops.plan.utilities;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.HashMap;
|
||||
import main.java.com.djrapitops.plan.utilities.HtmlUtils;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@ -17,6 +14,12 @@ import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rsl1122
|
||||
@ -81,7 +84,7 @@ public class HtmlUtilsTest {
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
@Test
|
||||
public void testGetServerAnalysisUrl() throws FileNotFoundException, Exception {
|
||||
public void testGetServerAnalysisUrl() throws Exception {
|
||||
TestInit.init();
|
||||
String result = HtmlUtils.getServerAnalysisUrlWithProtocol();
|
||||
String exp = "http://0.0.0.0:8804/server";
|
||||
|
@ -5,9 +5,6 @@
|
||||
*/
|
||||
package test.java.main.java.com.djrapitops.plan.utilities;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import main.java.com.djrapitops.plan.data.SessionData;
|
||||
import main.java.com.djrapitops.plan.utilities.ManageUtils;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -16,9 +13,14 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import test.java.utils.TestInit;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -42,7 +44,7 @@ public class ManageUtilsTest {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Before
|
||||
public void setUp() throws IOException, Exception {
|
||||
public void setUp() throws Exception {
|
||||
TestInit t = TestInit.init();
|
||||
assertTrue("Not set up", t.setUp());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user