mirror of https://github.com/FreeCol/freecol.git
Fix test suite warnings.
This commit is contained in:
parent
52dad7a471
commit
710e2a09af
20
build.xml
20
build.xml
|
@ -123,6 +123,9 @@
|
|||
source="${java.target.version}"
|
||||
target="${java.target.version}"
|
||||
includeantruntime="false">
|
||||
<compilerarg value="-Xlint:unchecked"/>
|
||||
<compilerarg value="-Xlint:deprecation"/>
|
||||
<compilerarg value="-g"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
|
@ -144,7 +147,6 @@
|
|||
<arg value="rev-parse"/>
|
||||
<arg value="HEAD"/>
|
||||
</exec>
|
||||
<echo message="${gitRawRevision}" />
|
||||
</target>
|
||||
|
||||
<target name="git-revision" unless="have-revision"
|
||||
|
@ -653,10 +655,18 @@
|
|||
<target name="build-unit-tests" depends="build">
|
||||
<depend srcDir="test/src" destDir="${freecol.build.dir}"
|
||||
cache="${freecol.build.dir}" />
|
||||
<javac srcdir="test/src" destdir="${freecol.build.dir}"
|
||||
classpathref="test.build.classpath" debug="on" deprecation="off"
|
||||
source="${java.target.version}" target="${java.target.version}"
|
||||
includeantruntime="false"/>
|
||||
<javac srcdir="test/src"
|
||||
destdir="${freecol.build.dir}"
|
||||
classpathref="test.build.classpath"
|
||||
debug="on"
|
||||
optimize="on"
|
||||
deprecation="off"
|
||||
source="${java.target.version}"
|
||||
target="${java.target.version}"
|
||||
includeantruntime="false">
|
||||
<compilerarg value="-Xlint:unchecked"/>
|
||||
<compilerarg value="-Xlint:deprecation"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="validate" description="Validates the specification.">
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
|
||||
package net.sf.freecol.client;
|
||||
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import junit.framework.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import net.sf.freecol.client.control.ConnectController;
|
||||
import net.sf.freecol.server.FreeColServer;
|
||||
|
||||
|
@ -34,13 +36,13 @@ public class ClientTestHelper {
|
|||
// tests where the resource manager is exercised.
|
||||
System.setProperty("java.awt.headless", "true");
|
||||
|
||||
FreeColClient client = new FreeColClient(null, null, false, null, false, null, null, null);
|
||||
FreeColClient client = new FreeColClient(null, null, false, null,
|
||||
false, null, null, null);
|
||||
ConnectController connectController = client.getConnectController();
|
||||
client.setFreeColServer(freeColServer);
|
||||
client.setSinglePlayer(true);
|
||||
boolean connected
|
||||
= connectController.login("test", FreeColServer.LOCALHOST,
|
||||
freeColServer.getPort());
|
||||
boolean connected = connectController.login("test",
|
||||
FreeColServer.LOCALHOST, freeColServer.getPort());
|
||||
assertTrue(connected);
|
||||
client.getPreGameController().setReady(true);
|
||||
return client;
|
||||
|
|
|
@ -71,8 +71,10 @@ public class SaveLoadTest extends FreeColTestCase {
|
|||
ServerTestHelper.stopServer();
|
||||
|
||||
FreeColServer server = ServerTestHelper.startServer(false, true);
|
||||
server.getSpecification().getMapGeneratorOptions()
|
||||
.getOption(MapGeneratorOptions.IMPORT_FILE).setValue(file);
|
||||
FileOption importOption = (FileOption)server.getSpecification()
|
||||
.getMapGeneratorOptions()
|
||||
.getOption(MapGeneratorOptions.IMPORT_FILE);
|
||||
importOption.setValue(file);
|
||||
Controller c = server.getController();
|
||||
assertNotNull(c);
|
||||
assertTrue(c instanceof PreGameController);
|
||||
|
@ -82,8 +84,7 @@ public class SaveLoadTest extends FreeColTestCase {
|
|||
} catch (FreeColException e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
server.getSpecification().getMapGeneratorOptions()
|
||||
.getOption(MapGeneratorOptions.IMPORT_FILE).setValue(null);
|
||||
importOption.setValue(null);
|
||||
|
||||
assertEquals(FreeColServer.GameState.IN_GAME, server.getGameState());
|
||||
assertNotNull(server.getGame());
|
||||
|
|
|
@ -18,10 +18,8 @@
|
|||
*/
|
||||
package net.sf.freecol.server;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static junit.framework.Assert.fail;
|
||||
import junit.framework.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
|
Loading…
Reference in New Issue