Fixed Tests

This commit is contained in:
Rsl1122 2017-11-20 16:10:46 +02:00
parent 6981b222af
commit bcca0a7950
3 changed files with 8 additions and 6 deletions

View File

@ -127,11 +127,13 @@ public class UserInfoTable extends UserIDTable {
public Map<UUID, UserInfo> 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 +

View File

@ -428,11 +428,11 @@ public class DatabaseTest {
System.out.println(" " + entry.getValue());
}
List<Session> savedSessions = sessions.get("ServerName");
List<Session> 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));

View File

@ -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")) {