Search in sources :

Example 6 with Version

use of games.strategy.util.Version in project triplea by triplea-game.

the class DownloadFileDescriptionTest method testGetMapName.

@Test
public void testGetMapName() {
    final String mapName = "abc";
    final DownloadFileDescription testObj = new DownloadFileDescription("", "", mapName, new Version(0, 0), DownloadFileDescription.DownloadType.MAP, DownloadFileDescription.MapCategory.EXPERIMENTAL);
    assertThat(testObj.getMapName(), is(mapName));
}
Also used : Version(games.strategy.util.Version) Test(org.junit.jupiter.api.Test)

Example 7 with Version

use of games.strategy.util.Version in project triplea by triplea-game.

the class MapDownloadListSortTest method createDownload.

private static DownloadFileDescription createDownload(final String mapName, final String url) {
    final String description = "fake";
    final Version version = new Version("1");
    return new DownloadFileDescription(url, description, mapName, version, DownloadFileDescription.DownloadType.MAP, DownloadFileDescription.MapCategory.EXPERIMENTAL);
}
Also used : Version(games.strategy.util.Version)

Example 8 with Version

use of games.strategy.util.Version in project triplea by triplea-game.

the class LobbyPropertyFileParserTest method parseWithSimpleCase.

/**
 * Just one set of values in a config file with no verson. The props we return should be a pretty
 * straight forward 1:1
 */
@Test
public void parseWithSimpleCase() throws Exception {
    final TestProps testProps = new TestProps();
    testProps.host = TestData.host;
    testProps.port = TestData.port;
    testProps.errorMessage = TestData.errorMessage;
    testProps.message = TestData.message;
    testProps.version = TestData.clientCurrentVersion;
    final File testFile = createTempFile(testProps);
    final LobbyServerProperties result = LobbyPropertyFileParser.parse(testFile, new Version(TestData.clientCurrentVersion));
    assertThat(result.host, is(TestData.host));
    assertThat(result.port, is(Integer.valueOf(TestData.port)));
    assertThat(result.serverMessage, is(TestData.message));
    assertThat(result.serverErrorMessage, is(TestData.errorMessage));
}
Also used : Version(games.strategy.util.Version) File(java.io.File) LobbyServerProperties(games.strategy.engine.lobby.client.login.LobbyServerProperties) Test(org.junit.jupiter.api.Test)

Example 9 with Version

use of games.strategy.util.Version in project triplea by triplea-game.

the class GameSelectorModelTest method prepareMockGameDataExpectations.

private void prepareMockGameDataExpectations() {
    when(mockGameData.getGameVersion()).thenReturn(new Version(fakeGameVersion));
    when(mockGameData.getSequence()).thenReturn(mockSequence);
    when(mockSequence.getRound()).thenReturn(Integer.valueOf(fakeGameRound));
    when(mockGameData.getGameName()).thenReturn(fakeGameName);
}
Also used : Version(games.strategy.util.Version)

Example 10 with Version

use of games.strategy.util.Version in project triplea by triplea-game.

the class DownloadFileDescriptionTest method mapInstallLocationTest.

private static void mapInstallLocationTest(final String inputUrl, final String mapName, final File expected) {
    final DownloadFileDescription testObj = new DownloadFileDescription(inputUrl, "", mapName, new Version(0, 0), DownloadFileDescription.DownloadType.MAP, DownloadFileDescription.MapCategory.EXPERIMENTAL);
    assertThat(testObj.getInstallLocation().getAbsolutePath(), is(expected.getAbsolutePath()));
}
Also used : Version(games.strategy.util.Version)

Aggregations

Version (games.strategy.util.Version)19 Test (org.junit.jupiter.api.Test)7 GameEngineVersion (games.strategy.engine.GameEngineVersion)5 LobbyServerProperties (games.strategy.engine.lobby.client.login.LobbyServerProperties)3 File (java.io.File)3 IOException (java.io.IOException)2 List (java.util.List)2 JSONArray (com.github.openjson.JSONArray)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ClientLogger (games.strategy.debug.ClientLogger)1 ClientContext (games.strategy.engine.ClientContext)1 ClientFileSystemHelper (games.strategy.engine.ClientFileSystemHelper)1 GameData (games.strategy.engine.data.GameData)1 GameDescription (games.strategy.engine.lobby.server.GameDescription)1 ResourceLoader (games.strategy.triplea.ResourceLoader)1 ClientSetting (games.strategy.triplea.settings.ClientSetting)1 SwingComponents (games.strategy.ui.SwingComponents)1 ObjectInputStream (java.io.ObjectInputStream)1 Timestamp (java.sql.Timestamp)1 ArrayList (java.util.ArrayList)1