Search in sources :

Example 1 with PartiesYAMLDispatcher

use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.

the class FileDispatcherTest method testParty.

@Test
public void testParty() {
    PartiesYAMLDispatcher dispatcher = getFileDispatcher();
    party(dispatcher, true);
    dispatcher.stop();
}
Also used : PartiesYAMLDispatcher(com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher) Test(org.junit.jupiter.api.Test)

Example 2 with PartiesYAMLDispatcher

use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.

the class FileDispatcherTest method testListParties.

@Test
public void testListParties() {
    PartyManager mockPartyManager = mock(PartyManager.class);
    when(mockPlugin.getPartyManager()).thenReturn(mockPartyManager);
    when(mockPartyManager.initializeParty(any())).thenAnswer((mock) -> initializeParty(mock.getArgument(0)));
    PlayerManager mockPlayerManager = mock(PlayerManager.class);
    when(mockPlugin.getPlayerManager()).thenReturn(mockPlayerManager);
    when(mockPlayerManager.initializePlayer(any())).thenAnswer((mock) -> initializePlayer(mock.getArgument(0)));
    PartiesYAMLDispatcher dispatcher = getFileDispatcher();
    populateWithParties(dispatcher);
    listPartiesNumber(dispatcher);
    listPartiesByName(dispatcher);
    listPartiesByMembers(dispatcher);
    listPartiesByKills(dispatcher);
    listPartiesByExperience(dispatcher);
    dispatcher.stop();
}
Also used : PartiesYAMLDispatcher(com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher) PlayerManager(com.alessiodp.parties.common.players.PlayerManager) PartyManager(com.alessiodp.parties.common.parties.PartyManager) Test(org.junit.jupiter.api.Test)

Example 3 with PartiesYAMLDispatcher

use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.

the class FileDispatcherTest method testExists.

@Test
public void testExists() {
    PartiesYAMLDispatcher dispatcher = getFileDispatcher();
    party(dispatcher, false);
    exists(dispatcher);
    dispatcher.stop();
}
Also used : PartiesYAMLDispatcher(com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher) Test(org.junit.jupiter.api.Test)

Example 4 with PartiesYAMLDispatcher

use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.

the class FileDispatcherTest method testCountPlayersInParty.

@Test
public void testCountPlayersInParty() {
    PartiesYAMLDispatcher dispatcher = getFileDispatcher();
    countPlayersInParty(dispatcher);
    dispatcher.stop();
}
Also used : PartiesYAMLDispatcher(com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher) Test(org.junit.jupiter.api.Test)

Example 5 with PartiesYAMLDispatcher

use of com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher in project Parties by AlessioDP.

the class FileDispatcherTest method getFileDispatcher.

private PartiesYAMLDispatcher getFileDispatcher() {
    ConfigMain.STORAGE_SETTINGS_YAML_DBFILE = "database-" + (databaseId++) + ".yaml";
    PartiesYAMLDispatcher ret = new PartiesYAMLDispatcher(mockPlugin);
    ret.init();
    assertFalse(ret.isFailed());
    return ret;
}
Also used : PartiesYAMLDispatcher(com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher)

Aggregations

PartiesYAMLDispatcher (com.alessiodp.parties.common.storage.dispatchers.PartiesYAMLDispatcher)9 Test (org.junit.jupiter.api.Test)8 PartyManager (com.alessiodp.parties.common.parties.PartyManager)1 PlayerManager (com.alessiodp.parties.common.players.PlayerManager)1 PartiesSQLDispatcher (com.alessiodp.parties.common.storage.dispatchers.PartiesSQLDispatcher)1