Skip to content

Commit

Permalink
Another try
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacqu committed Jun 29, 2024
1 parent 3f969ec commit 48c7e67
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.Objects;
import java.util.UUID;

import static fr.xephi.authme.TestHelper.PROJECT_ROOT;
Expand Down Expand Up @@ -102,7 +103,7 @@ public void setUpClasses() throws IOException {
File limboFilesFolder = new File(TEST_RESOURCES_FOLDER + PROJECT_ROOT + "data/limbo");
for (File file : limboFilesFolder.listFiles()) {
File from = new File(playerDataFolder, file.getName());
System.out.println("Limbo: Copy '" + file.getName() + "' to '" + from.getName() + "'");
// System.out.println("Limbo: Copy '" + file.getName() + "' to '" + from.getName() + "'");
Files.copy(file, from);
}

Expand All @@ -122,13 +123,13 @@ public void shouldMigrateOldSegmentFilesOnStartup() {
// Ensure that only the files of the current segmenting scheme remain
// Expected: ["seg16-8-limbo.json", "seg16-f-limbo.json"] in any order
// but: no item matches: "seg16-f-limbo.json" in ["seg16-8-limbo.json"]
System.out.println("Limbo migration test debug");
System.out.println(String.join(", ", playerDataFolder.list()));
assertThat(playerDataFolder.list(), arrayContainingInAnyOrder("seg16-8-limbo.json", "seg16-f-limbo.json"));
String[] list = playerDataFolder.list();
assertThat(String.join(", ", list),
list, arrayContainingInAnyOrder("seg16-8-limbo.json", "seg16-f-limbo.json"));

// Check that the expected limbo players can be read
System.out.println("Limbo player: " + persistenceHandler.getLimboPlayer(mockPlayerWithUuid(MIGRATED_UUID)));
assertThat(persistenceHandler.getLimboPlayer(mockPlayerWithUuid(MIGRATED_UUID)), MIGRATED_LIMBO_MATCHER);
LimboPlayer limboPlayer = persistenceHandler.getLimboPlayer(mockPlayerWithUuid(MIGRATED_UUID));
assertThat(Objects.toString(limboPlayer), limboPlayer, MIGRATED_LIMBO_MATCHER);
// Expected: Limbo with isOp=false, groups={noob}, canFly=true, walkSpeed=0.200000, flySpeed=0.100000
// but: was null
assertThat(persistenceHandler.getLimboPlayer(mockPlayerWithUuid(UUID_FAB69)), FAB69_MATCHER);
Expand Down

0 comments on commit 48c7e67

Please sign in to comment.