mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 01:49:49 -05:00
tests
Former-commit-id: 525822770b1b4ca0de9e19995f65d788dee4c05a
This commit is contained in:
1 parent
b6ab45a84a
commit
b7b1d7cbaa
4 files changed
+256
-12
No files matched your search
@@ -15,9 +15,9 @@ public final class JSONFile extends FileEnvelope {
|
||||
super(
|
||||
plugin,
|
||||
file,
|
||||
resourcePath.endsWith(".yml")
|
||||
resourcePath.endsWith(".json")
|
||||
? resourcePath
|
||||
: resourcePath + ".yml",
|
||||
: resourcePath + ".json",
|
||||
loadDefault
|
||||
);
|
||||
}
|
||||
@@ -26,9 +26,9 @@ public final class JSONFile extends FileEnvelope {
|
||||
super(
|
||||
plugin,
|
||||
file,
|
||||
resourcePath.endsWith(".yml")
|
||||
resourcePath.endsWith(".json")
|
||||
? resourcePath
|
||||
: resourcePath + ".yml",
|
||||
: resourcePath + ".json",
|
||||
true
|
||||
);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public final class JSONFile extends FileEnvelope {
|
||||
plugin.getDataFolder().getAbsolutePath() + (resourcePath.startsWith("/")
|
||||
? resourcePath
|
||||
: "/" + resourcePath),
|
||||
fileName.endsWith(".yml") ? fileName : fileName + ".yml"
|
||||
fileName.endsWith(".json") ? fileName : fileName + ".json"
|
||||
),
|
||||
resourcePath.isEmpty()
|
||||
? fileName
|
||||
|
||||
@@ -8,13 +8,13 @@ import org.junit.jupiter.api.Test;
|
||||
import org.llorllale.cactoos.matchers.Assertion;
|
||||
import org.maxgamer.quickshop.QuickShopTest;
|
||||
|
||||
class JSONFileTest {
|
||||
final class JSONFileTest {
|
||||
|
||||
private QuickShopTest plugin;
|
||||
private IFile json;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
void start() {
|
||||
MockBukkit.mock();
|
||||
plugin = MockBukkit.load(QuickShopTest.class);
|
||||
json = new JSONFile(plugin, "messages");
|
||||
@@ -31,7 +31,7 @@ class JSONFileTest {
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void tearDown() {
|
||||
void stop() {
|
||||
MockBukkit.unload();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,27 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class QuickShopTest extends JavaPlugin {
|
||||
public final class QuickShopTest extends JavaPlugin {
|
||||
|
||||
public QuickShopTest() {
|
||||
super();
|
||||
}
|
||||
|
||||
public QuickShopTest(@NotNull JavaPluginLoader loader, @NotNull PluginDescriptionFile description,
|
||||
@NotNull File dataFolder, @NotNull File file) {
|
||||
public QuickShopTest(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
|
||||
super(loader, description, new File("build"), file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user