Search in sources :

Example 1 with PermissionRegistry

use of fr.neatmonster.nocheatplus.permissions.PermissionRegistry in project NoCheatPlus by NoCheatPlus.

the class TestActions method testOptimizedLogActionEmpty.

@Test
public void testOptimizedLogActionEmpty() {
    PluginTests.setUnitTestNoCheatPlusAPI(false);
    PermissionRegistry pReg = NCPAPIProvider.getNoCheatPlusAPI().getPermissionRegistry();
    final ConfigFile config = new DefaultConfig();
    config.set("actions", "log:dummy:0:0:icf");
    config.set("strings.dummy", "dummy");
    config.set(ConfPaths.LOGGING_ACTIVE, false);
    ActionList actionList = config.getOptimizedActionList("actions", pReg.getOrRegisterPermission("dummy"));
    Action<ViolationData, ActionList>[] actions = actionList.getActions(0.0);
    if (actions.length != 0) {
        fail("Wrong number of actions.");
    }
}
Also used : Action(fr.neatmonster.nocheatplus.actions.Action) ConfigFile(fr.neatmonster.nocheatplus.config.ConfigFile) DefaultConfig(fr.neatmonster.nocheatplus.config.DefaultConfig) ActionList(fr.neatmonster.nocheatplus.actions.ActionList) PermissionRegistry(fr.neatmonster.nocheatplus.permissions.PermissionRegistry) Test(org.junit.Test)

Aggregations

Action (fr.neatmonster.nocheatplus.actions.Action)1 ActionList (fr.neatmonster.nocheatplus.actions.ActionList)1 ConfigFile (fr.neatmonster.nocheatplus.config.ConfigFile)1 DefaultConfig (fr.neatmonster.nocheatplus.config.DefaultConfig)1 PermissionRegistry (fr.neatmonster.nocheatplus.permissions.PermissionRegistry)1 Test (org.junit.Test)1