Author: echatellier Date: 2015-06-23 14:46:29 +0000 (Tue, 23 Jun 2015) New Revision: 4284 Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4284 Log: Update assertj Added: trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractAssertjIT.java Removed: trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractFestIT.java Modified: trunk/pom.xml trunk/src/test/java/fr/ifremer/isisfish/ui/input/InputIT.java trunk/src/test/java/fr/ifremer/isisfish/ui/simulator/SimulatorIT.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2015-06-23 14:23:39 UTC (rev 4283) +++ trunk/pom.xml 2015-06-23 14:46:29 UTC (rev 4284) @@ -402,13 +402,13 @@ <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-swing</artifactId> - <version>2.0.2</version> + <version>2.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-swing-junit</artifactId> - <version>2.0.2</version> + <version>2.1.0</version> <scope>test</scope> </dependency> </dependencies> Copied: trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractAssertjIT.java (from rev 4279, trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractFestIT.java) =================================================================== --- trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractAssertjIT.java (rev 0) +++ trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractAssertjIT.java 2015-06-23 14:46:29 UTC (rev 4284) @@ -0,0 +1,74 @@ +/* + * #%L + * IsisFish + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 Ifremer, Code Lutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ +package fr.ifremer.isisfish.ui; + +import org.assertj.swing.edt.FailOnThreadViolationRepaintManager; +import org.assertj.swing.edt.GuiActionRunner; +import org.assertj.swing.edt.GuiQuery; +import org.assertj.swing.exception.WaitTimedOutError; +import org.assertj.swing.fixture.FrameFixture; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; + +import fr.ifremer.isisfish.AbstractIsisFishTest; + +/** + * Test commun qui permet d'instancier une fenetre Isis à partir de laquelle dépendent + * tous les tests. + * + * @author Eric Chatellier + */ +public abstract class AbstractAssertjIT extends AbstractIsisFishTest { + + protected FrameFixture mainWindow; + + @BeforeClass + public static void setUpOnce() throws Exception { + //Assume.assumeTrue(!java.awt.GraphicsEnvironment.isHeadless()); + FailOnThreadViolationRepaintManager.install(); + } + + @Before + public void setUp() { + WelcomeUI frame = GuiActionRunner.execute(new GuiQuery<WelcomeUI>() { + protected WelcomeUI executeInEDT() { + return new WelcomeUI(new WelcomeContext()); + } + }); + mainWindow = new FrameFixture(frame); + try { + mainWindow.show(); // shows the frame to test + } catch (WaitTimedOutError e) { + // ok, but not a problem, isis is so slow... + } + mainWindow.maximize(); + } + + @After + public void tearDown() { + mainWindow.cleanUp(); + } +} Deleted: trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractFestIT.java =================================================================== --- trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractFestIT.java 2015-06-23 14:23:39 UTC (rev 4283) +++ trunk/src/test/java/fr/ifremer/isisfish/ui/AbstractFestIT.java 2015-06-23 14:46:29 UTC (rev 4284) @@ -1,75 +0,0 @@ -/* - * #%L - * IsisFish - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 Ifremer, Code Lutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ -package fr.ifremer.isisfish.ui; - -import org.assertj.swing.edt.FailOnThreadViolationRepaintManager; -import org.assertj.swing.edt.GuiActionRunner; -import org.assertj.swing.edt.GuiQuery; -import org.assertj.swing.exception.WaitTimedOutError; -import org.assertj.swing.fixture.FrameFixture; -import org.junit.After; -import org.junit.Assume; -import org.junit.Before; -import org.junit.BeforeClass; - -import fr.ifremer.isisfish.AbstractIsisFishTest; - -/** - * Test commun qui permet d'instancier une fenetre Isis à partir de laquelle dépendent - * tous les tests. - * - * @author Eric Chatellier - */ -public abstract class AbstractFestIT extends AbstractIsisFishTest { - - protected FrameFixture mainWindow; - - @BeforeClass - public static void setUpOnce() throws Exception { - Assume.assumeTrue(!java.awt.GraphicsEnvironment.isHeadless()); - FailOnThreadViolationRepaintManager.install(); - } - - @Before - public void setUp() { - WelcomeUI frame = GuiActionRunner.execute(new GuiQuery<WelcomeUI>() { - protected WelcomeUI executeInEDT() { - return new WelcomeUI(new WelcomeContext()); - } - }); - mainWindow = new FrameFixture(frame); - try { - mainWindow.show(); // shows the frame to test - } catch (WaitTimedOutError e) { - // ok, but not a problem, isis is so slow... - } - mainWindow.maximize(); - } - - @After - public void tearDown() { - mainWindow.cleanUp(); - } -} Modified: trunk/src/test/java/fr/ifremer/isisfish/ui/input/InputIT.java =================================================================== --- trunk/src/test/java/fr/ifremer/isisfish/ui/input/InputIT.java 2015-06-23 14:23:39 UTC (rev 4283) +++ trunk/src/test/java/fr/ifremer/isisfish/ui/input/InputIT.java 2015-06-23 14:46:29 UTC (rev 4284) @@ -32,14 +32,14 @@ import org.junit.Before; import org.junit.Test; -import fr.ifremer.isisfish.ui.AbstractFestIT; +import fr.ifremer.isisfish.ui.AbstractAssertjIT; /** * Swing tests. * * @author Eric Chatellier */ -public class InputIT extends AbstractFestIT { +public class InputIT extends AbstractAssertjIT { @Before @Override Modified: trunk/src/test/java/fr/ifremer/isisfish/ui/simulator/SimulatorIT.java =================================================================== --- trunk/src/test/java/fr/ifremer/isisfish/ui/simulator/SimulatorIT.java 2015-06-23 14:23:39 UTC (rev 4283) +++ trunk/src/test/java/fr/ifremer/isisfish/ui/simulator/SimulatorIT.java 2015-06-23 14:46:29 UTC (rev 4284) @@ -27,14 +27,14 @@ import org.junit.Before; import org.junit.Test; -import fr.ifremer.isisfish.ui.AbstractFestIT; +import fr.ifremer.isisfish.ui.AbstractAssertjIT; /** * UI fest tests related to simulation params and launch. * * @author Eric Chatellier */ -public class SimulatorIT extends AbstractFestIT { +public class SimulatorIT extends AbstractAssertjIT { @Before @Override