mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-26 11:08:08 +01:00
Improved a single world table test
This commit is contained in:
parent
1e993ed0dd
commit
181dae64d1
@ -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");
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user