Improved a single world table test

This commit is contained in:
Rsl1122 2018-04-07 12:42:36 +03:00
parent 1e993ed0dd
commit 181dae64d1
2 changed files with 2 additions and 17 deletions

View File

@ -247,23 +247,6 @@ public class WorldTable extends Table {
});
}
private Map<Integer, Integer> getWorldIDServerIDRelation() throws SQLException {
String sql = "SELECT " +
Col.ID + ", " +
Col.SERVER_ID +
" FROM " + tableName;
return query(new QueryAllStatement<Map<Integer, Integer>>(sql, 100) {
@Override
public Map<Integer, Integer> processResults(ResultSet set) throws SQLException {
HashMap<Integer, Integer> idServerIdMap = new HashMap<>();
while (set.next()) {
idServerIdMap.put(set.getInt(Col.ID.get()), set.getInt(Col.SERVER_ID.get()));
}
return idServerIdMap;
}
});
}
public void alterTableV16() throws SQLException {
addColumns(Col.SERVER_ID + " integer NOT NULL DEFAULT 0");

View File

@ -895,7 +895,9 @@ public class SQLiteTest {
@Test
public void testWorldTableGetWorldNamesNoException() throws SQLException {
saveAllData(db);
Set<String> worldNames = db.getWorldTable().getWorldNames(TestConstants.SERVER_UUID);
assertEquals(new HashSet<>(worlds), worldNames);
}
@Test