[Picross-commit] SF.net SVN: picross:[107] branches/engine_split
Status: Pre-Alpha
Brought to you by:
yvan_norsa
From: <yva...@us...> - 2013-01-10 12:13:23
|
Revision: 107 http://sourceforge.net/p/picross/code/107 Author: yvan_norsa Date: 2013-01-10 12:13:19 +0000 (Thu, 10 Jan 2013) Log Message: ----------- moved tests Modified Paths: -------------- branches/engine_split/build.xml branches/engine_split/common/src/picross/common/game/simple/ui/LevelMenuModel.java branches/engine_split/common/src/picross/common/game/simple/ui/SimpleGameMediator.java branches/engine_split/engine/test/picross/engine/game/simple/XBMModelTest.java branches/engine_split/swing/src/picross/specific/grid/ui/UIBox.java branches/engine_split/swing/src/picross/specific/ui/PicrossUIHelper.java branches/engine_split/swing/test/picross/specific/grid/ui/IGridMediatorStub.java branches/engine_split/swing/test/picross/specific/grid/ui/UIBoxTest.java branches/engine_split/swing/test/picross/specific/ui/PicrossUIHelperTest.java Added Paths: ----------- branches/engine_split/common/test/ branches/engine_split/common/test/picross/ branches/engine_split/common/test/picross/common/ branches/engine_split/common/test/picross/common/grid/ branches/engine_split/common/test/picross/common/grid/ui/ branches/engine_split/common/test/picross/common/grid/ui/FillCommandTest.java branches/engine_split/common/test/picross/common/grid/ui/PaintCommandTest.java branches/engine_split/engine/src/picross/engine/Picross.java branches/engine_split/engine/test/picross/engine/PicrossTest.java branches/engine_split/swing/test/ branches/engine_split/swing/test/picross/ branches/engine_split/swing/test/picross/specific/ branches/engine_split/swing/test/picross/specific/grid/ branches/engine_split/swing/test/picross/specific/ui/ Removed Paths: ------------- branches/engine_split/common/src/picross/common/Picross.java branches/engine_split/swing/test/picross/specific/grid/ui/FillCommandTest.java branches/engine_split/swing/test/picross/specific/grid/ui/PaintCommandTest.java branches/engine_split/test/picross/PicrossTest.java branches/engine_split/test/picross/grid/ branches/engine_split/test/picross/ui/ Modified: branches/engine_split/build.xml =================================================================== --- branches/engine_split/build.xml 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/build.xml 2013-01-10 12:13:19 UTC (rev 107) @@ -27,6 +27,10 @@ value="src" /> <property name="engine.test.dir" value="engine/test" /> + <property name="common.test.dir" + value="common/test" /> + <property name="swing.test.dir" + value="swing/test" /> <property name="game.test.dir" value="test" /> @@ -174,6 +178,32 @@ </javac> </target> + <target name="common-compile-test" + depends="common-compile"> + <javac srcdir="${common.test.dir}" + destdir="${common.build.dir}" + deprecation="on" + debug="on" + optimize="off"> + <compilerarg value="-Xlint:all" /> + + <classpath refid="classpath" /> + </javac> + </target> + + <target name="swing-compile-test" + depends="swing-compile"> + <javac srcdir="${swing.test.dir}" + destdir="${swing.build.dir}" + deprecation="on" + debug="on" + optimize="off"> + <compilerarg value="-Xlint:all" /> + + <classpath refid="classpath" /> + </javac> + </target> + <target name="game-compile-test" depends="game-compile"> <javac srcdir="${game.test.dir}" @@ -269,7 +299,7 @@ </target> <target name="test" - depends="engine-test,game-test" /> + depends="engine-test,common-test,swing-test,game-test" /> <target name="engine-test" depends="dist,engine-compile-test"> @@ -291,6 +321,46 @@ </junit> </target> + <target name="common-test" + depends="dist,common-compile-test"> + <junit filtertrace="off" + showoutput="on" + printsummary="withOutAndErr"> + <formatter type="plain" + usefile="false" /> + + <batchtest fork="yes" + filtertrace="on"> + <fileset dir="${common.test.dir}"> + <include name="**/*Test.java" /> + <exclude name="**/Abstract*Test.java" /> + </fileset> + </batchtest> + + <classpath refid="classpath" /> + </junit> + </target> + + <target name="swing-test" + depends="dist,swing-compile-test"> + <junit filtertrace="off" + showoutput="on" + printsummary="withOutAndErr"> + <formatter type="plain" + usefile="false" /> + + <batchtest fork="yes" + filtertrace="on"> + <fileset dir="${swing.test.dir}"> + <include name="**/*Test.java" /> + <exclude name="**/Abstract*Test.java" /> + </fileset> + </batchtest> + + <classpath refid="classpath" /> + </junit> + </target> + <target name="game-test" depends="dist,game-compile-test"> <junit filtertrace="off" Deleted: branches/engine_split/common/src/picross/common/Picross.java =================================================================== --- branches/engine_split/common/src/picross/common/Picross.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/common/src/picross/common/Picross.java 2013-01-10 12:13:19 UTC (rev 107) @@ -1,95 +0,0 @@ -/* - * $Id$ - * - * Copyright (c) 2007-2008 - * - * This software is governed by the CeCILL license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL license and that you accept its terms. - */ - - -package picross.common; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; - -import java.net.URL; - -/** - * Helper class. - * - * @author Y. Norsa - */ -public final class Picross { - /*** Constant ***/ - - /** Data directory. */ - private static final String DATA_DIR = "/picross/data/"; - - /*** Constructor ***/ - - /** Fake constructor. */ - private Picross() { } - - /*** Static methods ***/ - - /** - * Loads a file. - * - * @param path file path - * @return URL of the file - * @throws FileNotFoundException if the file can't be found - */ - public static URL getFile(String path) throws FileNotFoundException { - URL fileUrl = Picross.class.getResource(path); - - if (fileUrl == null) { - throw new FileNotFoundException("\"" + path + "\" can't be found"); - } - - return fileUrl; - } - - /** - * Loads a data file. - * - * @param name filename - * @return a stream containing the loaded file - * @throws IllegalArgumentException if <code>name</code> - * is <code>null</code> or empty - * @throws IOException if there is a problem while opening the file - */ - public static InputStream loadDataFile(String name) throws IOException { - - if (name == null || name.equals("")) { - throw new IllegalArgumentException("name can't be null or empty"); - } - - return Picross.getFile(Picross.DATA_DIR + name).openStream(); - } -} - Modified: branches/engine_split/common/src/picross/common/game/simple/ui/LevelMenuModel.java =================================================================== --- branches/engine_split/common/src/picross/common/game/simple/ui/LevelMenuModel.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/common/src/picross/common/game/simple/ui/LevelMenuModel.java 2013-01-10 12:13:19 UTC (rev 107) @@ -42,7 +42,7 @@ import java.util.List; import java.util.Map; -import picross.common.Picross; +import picross.engine.Picross; import picross.engine.PicrossException; import picross.engine.game.simple.Dimensions; Modified: branches/engine_split/common/src/picross/common/game/simple/ui/SimpleGameMediator.java =================================================================== --- branches/engine_split/common/src/picross/common/game/simple/ui/SimpleGameMediator.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/common/src/picross/common/game/simple/ui/SimpleGameMediator.java 2013-01-10 12:13:19 UTC (rev 107) @@ -35,7 +35,7 @@ import java.io.IOException; -import picross.common.Picross; +import picross.engine.Picross; import picross.engine.PicrossException; import picross.engine.game.simple.XBMModel; Copied: branches/engine_split/common/test/picross/common/grid/ui/FillCommandTest.java (from rev 106, branches/engine_split/test/picross/grid/ui/FillCommandTest.java) =================================================================== --- branches/engine_split/common/test/picross/common/grid/ui/FillCommandTest.java (rev 0) +++ branches/engine_split/common/test/picross/common/grid/ui/FillCommandTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -0,0 +1,65 @@ +/* + * $Id$ + * + * Copyright (c) 2007-2008 + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + +package picross.common.grid.ui; + +import org.junit.Assert; +import org.junit.Test; + +/** + * @author Y. Norsa + */ +public class FillCommandTest { + @Test + public void testFillCommand() { + /* try { + new FillCommand(-1, -1, GridAction.UNKNOWN); + Assert.fail("row = -1"); + } catch (IllegalArgumentException argEx) { } + + try { + new FillCommand(0, -1, GridAction.UNKNOWN); + Assert.fail("column = -1"); + } catch (IllegalArgumentException argEx) { } + + try { + new FillCommand(0, 0, GridAction.UNKNOWN); + Assert.fail("UNKNOWN type"); + } catch (IllegalArgumentException argEx) { } + + new FillCommand(0, 0, GridAction.CHECK); + */ + } + +} + Copied: branches/engine_split/common/test/picross/common/grid/ui/PaintCommandTest.java (from rev 106, branches/engine_split/test/picross/grid/ui/PaintCommandTest.java) =================================================================== --- branches/engine_split/common/test/picross/common/grid/ui/PaintCommandTest.java (rev 0) +++ branches/engine_split/common/test/picross/common/grid/ui/PaintCommandTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -0,0 +1,58 @@ +/* + * $Id$ + * + * Copyright (c) 2007-2008 + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + +package picross.common.grid.ui; + +import org.junit.Assert; +import org.junit.Test; + +/** + * @author Y. Norsa + */ +public class PaintCommandTest { + @Test(expected = IllegalArgumentException.class) + public void paintCommandWithInvalidRow() { + new PaintCommand(-1, 0); + } + + @Test(expected = IllegalArgumentException.class) + public void paintCommandWithInvalidCol() { + new PaintCommand(0, -1); + } + + @Test + public void testPaintCommand() { + new PaintCommand(0, 0); + } +} + Copied: branches/engine_split/engine/src/picross/engine/Picross.java (from rev 106, branches/engine_split/common/src/picross/common/Picross.java) =================================================================== --- branches/engine_split/engine/src/picross/engine/Picross.java (rev 0) +++ branches/engine_split/engine/src/picross/engine/Picross.java 2013-01-10 12:13:19 UTC (rev 107) @@ -0,0 +1,95 @@ +/* + * $Id$ + * + * Copyright (c) 2007-2008 + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + +package picross.engine; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; + +import java.net.URL; + +/** + * Helper class. + * + * @author Y. Norsa + */ +public final class Picross { + /*** Constant ***/ + + /** Data directory. */ + private static final String DATA_DIR = "/picross/data/"; + + /*** Constructor ***/ + + /** Fake constructor. */ + private Picross() { } + + /*** Static methods ***/ + + /** + * Loads a file. + * + * @param path file path + * @return URL of the file + * @throws FileNotFoundException if the file can't be found + */ + public static URL getFile(String path) throws FileNotFoundException { + URL fileUrl = Picross.class.getResource(path); + + if (fileUrl == null) { + throw new FileNotFoundException("\"" + path + "\" can't be found"); + } + + return fileUrl; + } + + /** + * Loads a data file. + * + * @param name filename + * @return a stream containing the loaded file + * @throws IllegalArgumentException if <code>name</code> + * is <code>null</code> or empty + * @throws IOException if there is a problem while opening the file + */ + public static InputStream loadDataFile(String name) throws IOException { + + if (name == null || name.equals("")) { + throw new IllegalArgumentException("name can't be null or empty"); + } + + return Picross.getFile(Picross.DATA_DIR + name).openStream(); + } +} + Copied: branches/engine_split/engine/test/picross/engine/PicrossTest.java (from rev 106, branches/engine_split/test/picross/PicrossTest.java) =================================================================== --- branches/engine_split/engine/test/picross/engine/PicrossTest.java (rev 0) +++ branches/engine_split/engine/test/picross/engine/PicrossTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -0,0 +1,72 @@ +/* + * $Id$ + * + * Copyright (c) 2007-2008 + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + +package picross.engine; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests for the static methods of the Picross class. + * + * @author Y. Norsa + */ +public class PicrossTest { + /*** Methods ***/ + + @Test(expected = IllegalArgumentException.class) + public void loadNullFile() throws IOException { + Picross.loadDataFile(null); + } + + @Test(expected = IllegalArgumentException.class) + public void loadEmptyNamedFile() throws IOException { + Picross.loadDataFile(""); + } + + @Test(expected = FileNotFoundException.class) + public void loadMissingFile() throws IOException { + Picross.loadDataFile("fakeFile"); + } + + @Test + public void loadDataFile() throws IOException { + InputStream in = Picross.loadDataFile("asterix.xbm"); + Assert.assertNotNull("in = null", in); + in.close(); + } +} Modified: branches/engine_split/engine/test/picross/engine/game/simple/XBMModelTest.java =================================================================== --- branches/engine_split/engine/test/picross/engine/game/simple/XBMModelTest.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/engine/test/picross/engine/game/simple/XBMModelTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -42,7 +42,7 @@ import org.junit.Assert; import org.junit.Test; -import picross.Picross; +import picross.engine.Picross; import picross.engine.PicrossException; Modified: branches/engine_split/swing/src/picross/specific/grid/ui/UIBox.java =================================================================== --- branches/engine_split/swing/src/picross/specific/grid/ui/UIBox.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/swing/src/picross/specific/grid/ui/UIBox.java 2013-01-10 12:13:19 UTC (rev 107) @@ -41,7 +41,7 @@ import javax.swing.ImageIcon; -import picross.common.Picross; +import picross.engine.Picross; import picross.engine.grid.Box; import picross.engine.grid.Box.BoxState; Modified: branches/engine_split/swing/src/picross/specific/ui/PicrossUIHelper.java =================================================================== --- branches/engine_split/swing/src/picross/specific/ui/PicrossUIHelper.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/swing/src/picross/specific/ui/PicrossUIHelper.java 2013-01-10 12:13:19 UTC (rev 107) @@ -43,7 +43,7 @@ import javax.swing.ImageIcon; -import picross.common.Picross; +import picross.engine.Picross; import picross.common.ui.MissingImageException; Deleted: branches/engine_split/swing/test/picross/specific/grid/ui/FillCommandTest.java =================================================================== --- branches/engine_split/test/picross/grid/ui/FillCommandTest.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/swing/test/picross/specific/grid/ui/FillCommandTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -1,65 +0,0 @@ -/* - * $Id$ - * - * Copyright (c) 2007-2008 - * - * This software is governed by the CeCILL license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL license and that you accept its terms. - */ - - -package picross.grid.ui; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author Y. Norsa - */ -public class FillCommandTest { - @Test - public void testFillCommand() { - /* try { - new FillCommand(-1, -1, GridAction.UNKNOWN); - Assert.fail("row = -1"); - } catch (IllegalArgumentException argEx) { } - - try { - new FillCommand(0, -1, GridAction.UNKNOWN); - Assert.fail("column = -1"); - } catch (IllegalArgumentException argEx) { } - - try { - new FillCommand(0, 0, GridAction.UNKNOWN); - Assert.fail("UNKNOWN type"); - } catch (IllegalArgumentException argEx) { } - - new FillCommand(0, 0, GridAction.CHECK); - */ - } - -} - Modified: branches/engine_split/swing/test/picross/specific/grid/ui/IGridMediatorStub.java =================================================================== --- branches/engine_split/test/picross/grid/ui/IGridMediatorStub.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/swing/test/picross/specific/grid/ui/IGridMediatorStub.java 2013-01-10 12:13:19 UTC (rev 107) @@ -31,11 +31,14 @@ */ -package picross.grid.ui; +package picross.specific.grid.ui; import fr.cle.mmvcs.SimpleEvent; import fr.cle.mmvcs.SimpleListener; +import picross.common.grid.ui.IGridMediator; +import picross.common.grid.ui.GridView; + /** * @author Y. Norsa */ Deleted: branches/engine_split/swing/test/picross/specific/grid/ui/PaintCommandTest.java =================================================================== --- branches/engine_split/test/picross/grid/ui/PaintCommandTest.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/swing/test/picross/specific/grid/ui/PaintCommandTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -1,58 +0,0 @@ -/* - * $Id$ - * - * Copyright (c) 2007-2008 - * - * This software is governed by the CeCILL license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL license and that you accept its terms. - */ - - -package picross.grid.ui; - -import org.junit.Assert; -import org.junit.Test; - -/** - * @author Y. Norsa - */ -public class PaintCommandTest { - @Test(expected = IllegalArgumentException.class) - public void paintCommandWithInvalidRow() { - new PaintCommand(-1, 0); - } - - @Test(expected = IllegalArgumentException.class) - public void paintCommandWithInvalidCol() { - new PaintCommand(0, -1); - } - - @Test - public void testPaintCommand() { - new PaintCommand(0, 0); - } -} - Modified: branches/engine_split/swing/test/picross/specific/grid/ui/UIBoxTest.java =================================================================== --- branches/engine_split/test/picross/grid/ui/UIBoxTest.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/swing/test/picross/specific/grid/ui/UIBoxTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -31,7 +31,7 @@ */ -package picross.grid.ui; +package picross.specific.grid.ui; import javax.swing.ImageIcon; Modified: branches/engine_split/swing/test/picross/specific/ui/PicrossUIHelperTest.java =================================================================== --- branches/engine_split/test/picross/ui/PicrossUIHelperTest.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/swing/test/picross/specific/ui/PicrossUIHelperTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -31,7 +31,7 @@ */ -package picross.ui; +package picross.specific.ui; import java.io.FileNotFoundException; import java.io.IOException; @@ -42,6 +42,8 @@ import org.junit.Assert; import org.junit.Test; +import picross.common.ui.MissingImageException; + /** * Tests for the static methods of the Picross class. * Deleted: branches/engine_split/test/picross/PicrossTest.java =================================================================== --- branches/engine_split/test/picross/PicrossTest.java 2013-01-10 11:57:14 UTC (rev 106) +++ branches/engine_split/test/picross/PicrossTest.java 2013-01-10 12:13:19 UTC (rev 107) @@ -1,72 +0,0 @@ -/* - * $Id$ - * - * Copyright (c) 2007-2008 - * - * This software is governed by the CeCILL license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL license and that you accept its terms. - */ - - -package picross; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; - -import org.junit.Assert; -import org.junit.Test; - -/** - * Tests for the static methods of the Picross class. - * - * @author Y. Norsa - */ -public class PicrossTest { - /*** Methods ***/ - - @Test(expected = IllegalArgumentException.class) - public void loadNullFile() throws IOException { - Picross.loadDataFile(null); - } - - @Test(expected = IllegalArgumentException.class) - public void loadEmptyNamedFile() throws IOException { - Picross.loadDataFile(""); - } - - @Test(expected = FileNotFoundException.class) - public void loadMissingFile() throws IOException { - Picross.loadDataFile("fakeFile"); - } - - @Test - public void loadDataFile() throws IOException { - InputStream in = Picross.loadDataFile("asterix.xbm"); - Assert.assertNotNull("in = null", in); - in.close(); - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |