Rename DummyNoCheatPlusAPI to UnitTestNoCheatPlusAPI for the prefix.

Allows determining the state of the system more easily.
This commit is contained in:
asofold 2018-01-15 21:45:41 +01:00
parent 13b00a6b8e
commit 30b293e735
3 changed files with 12 additions and 6 deletions

View File

@ -45,6 +45,9 @@ import fr.neatmonster.nocheatplus.logging.LogManager;
* ComponentWithName (tag)</li>
* <hr>
* Not sure about all the login-denial API, some of those might get removed.
* <hr>
* NOTE: Class names for implementations of the NoCheatPlusAPI which aim at unit
* tests, where server access might not work, should start with "UnitTest".
*
* @author asofold
*

View File

@ -31,15 +31,18 @@ import fr.neatmonster.nocheatplus.logging.StaticLog;
public class PluginTests {
/**
* Dummy API, providing only a minimal subset of functionality for offline-testing. Some methods do nothing, some throw an UnsupportedOperationException, some will do something (set/get MCAccess).
* Dummy API, providing only a minimal subset of functionality for
* offline-testing. Some methods do nothing, some throw an
* UnsupportedOperationException, some will do something (set/get MCAccess).
*
* @author asofold
*
*/
public static class DummyNoCheatPlusAPI implements NoCheatPlusAPI {
public static class UnitTestNoCheatPlusAPI implements NoCheatPlusAPI {
private final DefaultGenericInstanceRegistry genericInstanceRegistry = new DefaultGenericInstanceRegistry();
public DummyNoCheatPlusAPI() {
public UnitTestNoCheatPlusAPI() {
genericInstanceRegistry.registerGenericInstance(MCAccess.class, new MCAccessBukkit());
}
@ -162,9 +165,9 @@ public class PluginTests {
}
public static void setDummNoCheatPlusAPI(boolean force) {
public static void setUnitTestNoCheatPlusAPI(boolean force) {
if (force || NCPAPIProvider.getNoCheatPlusAPI() == null) {
NCPAPIProvider.setNoCheatPlusAPI(new DummyNoCheatPlusAPI());
NCPAPIProvider.setNoCheatPlusAPI(new UnitTestNoCheatPlusAPI());
}
}

View File

@ -71,7 +71,7 @@ public class BlockTests {
* Initialize BlockProperties with default config and Bukkit-API compliance :p.
*/
public static void initBlockProperties() {
PluginTests.setDummNoCheatPlusAPI(false);
PluginTests.setUnitTestNoCheatPlusAPI(false);
BlockProperties.init(NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(MCAccess.class), new DefaultConfigWorldConfigProvider());
}