From bcca0a79500c63052cfb5c11063f831035d88c6d Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Mon, 20 Nov 2017 16:10:46 +0200 Subject: [PATCH] Fixed Tests --- .../djrapitops/plan/database/tables/UserInfoTable.java | 2 ++ .../java/com/djrapitops/plan/database/DatabaseTest.java | 4 ++-- Plan/test/test/java/utils/TestInit.java | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/UserInfoTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/UserInfoTable.java index d50137dd3..7dfa1323d 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/UserInfoTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/UserInfoTable.java @@ -127,11 +127,13 @@ public class UserInfoTable extends UserIDTable { public Map getAllUserInfo(UUID uuid) throws SQLException { String usersIDColumn = usersTable + "." + usersTable.getColumnID(); String serverIDColumn = serverTable + "." + serverTable.getColumnID(); + String usersNameColumn = usersTable + "." + usersTable.getColumnName() + " as name"; String serverUUIDColumn = serverTable + "." + serverTable.getColumnUUID() + " as s_uuid"; String sql = "SELECT " + tableName + "." + columnRegistered + ", " + columnBanned + ", " + columnOP + ", " + + usersNameColumn + ", " + serverUUIDColumn + " FROM " + tableName + " JOIN " + usersTable + " on " + usersIDColumn + "=" + columnUserID + diff --git a/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java b/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java index 23e2f6a2c..27fdb9f68 100644 --- a/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java +++ b/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java @@ -428,11 +428,11 @@ public class DatabaseTest { System.out.println(" " + entry.getValue()); } - List savedSessions = sessions.get("ServerName"); + List savedSessions = sessions.get(Plan.getServerUUID()); assertNotNull(savedSessions); assertEquals(1, savedSessions.size()); - assertNull(sessions.get(worlds.get(1))); + assertNull(sessions.get(UUID.randomUUID())); assertEquals(session, savedSessions.get(0)); diff --git a/Plan/test/test/java/utils/TestInit.java b/Plan/test/test/java/utils/TestInit.java index d9398ac34..7ff8136a5 100644 --- a/Plan/test/test/java/utils/TestInit.java +++ b/Plan/test/test/java/utils/TestInit.java @@ -100,10 +100,10 @@ public class TestInit { // Files File config = new File(getClass().getResource("/config.yml").getPath()); when(planMock.getResource("config.yml")).thenReturn(new FileInputStream(config)); - File analysis = new File(getClass().getResource("/server.html").getPath()); - when(planMock.getResource("server.html")).thenReturn(new FileInputStream(analysis)); - File player = new File(getClass().getResource("/player.html").getPath()); - when(planMock.getResource("player.html")).thenReturn(new FileInputStream(player)); + File analysis = new File(getClass().getResource("/web/server.html").getPath()); + when(planMock.getResource("/web/server.html")).thenReturn(new FileInputStream(analysis)); + File player = new File(getClass().getResource("/web/player.html").getPath()); + when(planMock.getResource("/web/player.html")).thenReturn(new FileInputStream(player)); File tempConfigFile = new File(planMock.getDataFolder(), "config.yml"); Config iConfig = new Config(tempConfigFile, FileUtil.lines(planMock, "config.yml")) {