diff --git a/.gitignore b/.gitignore index ef33d64e43..97df4a9766 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ target *.iws *.versionsBackup -*.iml \ No newline at end of file +*.iml +.DS_Store \ No newline at end of file diff --git a/gameoflife-web/pom.xml b/gameoflife-web/pom.xml index 8936975567..ecc27cac29 100644 --- a/gameoflife-web/pom.xml +++ b/gameoflife-web/pom.xml @@ -13,10 +13,8 @@ gameoflife-web - 0.4.19 9090 9999 - http://localhost:${jetty.port} @@ -31,45 +29,6 @@ maven-surefire-plugin 2.9 - - true - - - - unit-tests - test - - test - - - false - classes - - **/webtests/*.java - - - - - integration-tests - integration-test - - test - - - false - classes - - **/webtests/*.java - - - **/pages/*.java - - - ${webdriver.base.url} - - - - org.mortbay.jetty @@ -86,26 +45,6 @@ foo ${jetty.stop.port} - - - start-jetty - pre-integration-test - - run - - - 0 - true - - - - stop-jetty - post-integration-test - - stop - - - maven-war-plugin @@ -147,6 +86,7 @@ + performance @@ -241,36 +181,6 @@ fest-assert 1.4 - - - - net.thucydides - thucydides-core - ${thucydides.version} - test - - - net.thucydides - thucydides-junit - ${thucydides.version} - test - - - net.thucydides.easyb - thucydides-easyb-plugin - ${thucydides.version} - test - - - com.googlecode.lambdaj - lambdaj - 2.3.1 - - - org.codehaus.groovy - groovy-all - 1.8.2 - org.slf4j slf4j-simple diff --git a/gameoflife-web/src/main/java/com/wakaleo/gameoflife/web/controllers/GameController.java b/gameoflife-web/src/main/java/com/wakaleo/gameoflife/webtests/controllers/GameController.java similarity index 94% rename from gameoflife-web/src/main/java/com/wakaleo/gameoflife/web/controllers/GameController.java rename to gameoflife-web/src/main/java/com/wakaleo/gameoflife/webtests/controllers/GameController.java index 49d8c9f02a..a7b78dd25e 100644 --- a/gameoflife-web/src/main/java/com/wakaleo/gameoflife/web/controllers/GameController.java +++ b/gameoflife-web/src/main/java/com/wakaleo/gameoflife/webtests/controllers/GameController.java @@ -1,4 +1,4 @@ -package com.wakaleo.gameoflife.web.controllers; +package com.wakaleo.gameoflife.webtests.controllers; import java.util.Random; @@ -31,7 +31,7 @@ public ModelAndView firstGeneration(@RequestParam("rows") int rows, @RequestParam("columns") int columns, HttpServletRequest request) { Universe universe = universeInstanciatedFromClickedCells(rows, columns, request); - // TODO: Hate this code + // TODO: Hate this code thinkABit(200); return showGridScreen(universe); @@ -40,8 +40,9 @@ public ModelAndView firstGeneration(@RequestParam("rows") int rows, @RequestMapping("/next") public ModelAndView nextGeneration(@RequestParam("rows") int rows, @RequestParam("columns") int columns, HttpServletRequest request) { - - Universe universe = universeInstanciatedFromClickedCells(rows, columns, request); + + Universe universe = universeInstanciatedFromClickedCells(rows, columns, + request); universe.createNextGeneration(); thinkABit(250); @@ -52,7 +53,7 @@ public ModelAndView nextGeneration(@RequestParam("rows") int rows, private void thinkABit(int max) { int thinkingTime = randomGenerator.nextInt(max/4); try { - Thread.sleep(thinkingTime); + Thread.currentThread().sleep(thinkingTime); } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/gameoflife-web/src/main/java/com/wakaleo/gameoflife/web/controllers/HomePageController.java b/gameoflife-web/src/main/java/com/wakaleo/gameoflife/webtests/controllers/HomePageController.java similarity index 90% rename from gameoflife-web/src/main/java/com/wakaleo/gameoflife/web/controllers/HomePageController.java rename to gameoflife-web/src/main/java/com/wakaleo/gameoflife/webtests/controllers/HomePageController.java index 24e40e99d6..74fa14c6a2 100644 --- a/gameoflife-web/src/main/java/com/wakaleo/gameoflife/web/controllers/HomePageController.java +++ b/gameoflife-web/src/main/java/com/wakaleo/gameoflife/webtests/controllers/HomePageController.java @@ -1,4 +1,4 @@ -package com.wakaleo.gameoflife.web.controllers; +package com.wakaleo.gameoflife.webtests.controllers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/gameoflife-web/src/main/webapp/WEB-INF/gameoflife-servlet.xml b/gameoflife-web/src/main/webapp/WEB-INF/gameoflife-servlet.xml index fbe6dc495e..1994335f5b 100644 --- a/gameoflife-web/src/main/webapp/WEB-INF/gameoflife-servlet.xml +++ b/gameoflife-web/src/main/webapp/WEB-INF/gameoflife-servlet.xml @@ -6,7 +6,7 @@ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - + diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenCreatingANewGame.java b/gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenCreatingANewGame.java similarity index 96% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenCreatingANewGame.java rename to gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenCreatingANewGame.java index 01a3a5e6af..0fcfd85881 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenCreatingANewGame.java +++ b/gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenCreatingANewGame.java @@ -1,4 +1,4 @@ -package com.wakaleo.gameoflife.web.controllers; +package com.wakaleo.gameoflife.webtests.controllers; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenDisplayingTheHomePage.java b/gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenDisplayingTheHomePage.java similarity index 92% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenDisplayingTheHomePage.java rename to gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenDisplayingTheHomePage.java index 39c34a74e7..f78c537202 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenDisplayingTheHomePage.java +++ b/gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenDisplayingTheHomePage.java @@ -1,4 +1,4 @@ -package com.wakaleo.gameoflife.web.controllers; +package com.wakaleo.gameoflife.webtests.controllers; import org.junit.Test; import org.springframework.web.servlet.ModelAndView; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenSpawningANewGeneration.java b/gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenSpawningANewGeneration.java similarity index 94% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenSpawningANewGeneration.java rename to gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenSpawningANewGeneration.java index 98f48ba869..5987abd204 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/controllers/WhenSpawningANewGeneration.java +++ b/gameoflife-web/src/test/java/com/wakaleo/gameoflife/webtests/controllers/WhenSpawningANewGeneration.java @@ -1,4 +1,4 @@ -package com.wakaleo.gameoflife.web.controllers; +package com.wakaleo.gameoflife.webtests.controllers; import javax.servlet.http.HttpServletRequest; diff --git a/gameoflife-webtests/pom.xml b/gameoflife-webtests/pom.xml new file mode 100644 index 0000000000..3576659d52 --- /dev/null +++ b/gameoflife-webtests/pom.xml @@ -0,0 +1,177 @@ + + + 4.0.0 + + gameoflife + com.wakaleo.gameoflife + 0.7.49-SNAPSHOT + + gameoflife-webtests + gameoflife-webtests + + UTF-8 + 9090 + 9999 + http://localhost:${jetty.port} + + + + org.easytesting + fest-assert + 1.4 + test + + + net.thucydides + thucydides-core + ${thucydides.version} + test + + + net.thucydides + thucydides-junit + ${thucydides.version} + test + + + net.thucydides.easyb + thucydides-easyb-plugin + ${thucydides.version} + test + + + com.googlecode.lambdaj + lambdaj + 2.3.1 + test + + + org.codehaus.groovy + groovy-all + 1.8.2 + test + + + org.slf4j + slf4j-simple + 1.6.1 + test + + + org.slf4j + slf4j-api + 1.6.1 + test + + + com.wakaleo.gameoflife + gameoflife-web + ${project.version} + war + + + + + + maven-surefire-plugin + 2.9 + + true + + + + unit-tests + test + + test + + + false + classes + + **/webtests/*.java + + + + + integration-tests + integration-test + + test + + + false + classes + + **/webtests/*.java + + + **/pages/*.java + + + ${webdriver.base.url} + + + + + + + + + + integration-tests + + true + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.1.3 + + + start-container + pre-integration-test + + start + + + + stop-container + post-integration-test + + stop + + + + + + jetty7x + embedded + + + standalone + + + com.wakaleo.gameoflife + gameoflife-web + war + + / + + + + + ${jetty.port} + + + + + + + + + diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserEntersAnInitialGrid.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserEntersAnInitialGrid.java similarity index 94% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserEntersAnInitialGrid.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserEntersAnInitialGrid.java index 748c69762c..bc9202315c 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserEntersAnInitialGrid.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserEntersAnInitialGrid.java @@ -1,7 +1,7 @@ -package com.wakaleo.gameoflife.web.webtests; +package com.wakaleo.gameoflife.webtests; -import com.wakaleo.gameoflife.web.requirements.GameOfLifeApplication; -import com.wakaleo.gameoflife.web.webtests.steps.PlayerSteps; +import com.wakaleo.gameoflife.webtests.requirements.GameOfLifeApplication; +import com.wakaleo.gameoflife.webtests.steps.PlayerSteps; import net.thucydides.core.annotations.Managed; import net.thucydides.core.annotations.ManagedPages; import net.thucydides.core.annotations.Steps; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserGoesToTheHomePage.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserGoesToTheHomePage.java similarity index 79% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserGoesToTheHomePage.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserGoesToTheHomePage.java index 7de0fe9848..df52683b44 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserGoesToTheHomePage.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserGoesToTheHomePage.java @@ -1,6 +1,7 @@ -package com.wakaleo.gameoflife.web.webtests; +package com.wakaleo.gameoflife.webtests; -import com.wakaleo.gameoflife.web.webtests.steps.PlayerSteps; +import com.wakaleo.gameoflife.webtests.requirements.GameOfLifeApplication.RunSimulations.RunASimulation; +import com.wakaleo.gameoflife.webtests.steps.PlayerSteps; import net.thucydides.core.annotations.Managed; import net.thucydides.core.annotations.ManagedPages; import net.thucydides.core.annotations.Steps; @@ -11,8 +12,6 @@ import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; -import com.wakaleo.gameoflife.web.requirements.GameOfLifeApplication.RunSimulations.RunASimulation; - @RunWith(ThucydidesRunner.class) @Story(RunASimulation.class) public class WhenTheUserGoesToTheHomePage { diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserSpawnsTheNextGeneration.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserSpawnsTheNextGeneration.java similarity index 95% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserSpawnsTheNextGeneration.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserSpawnsTheNextGeneration.java index 3f72b97ce6..052e4f5f2b 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/WhenTheUserSpawnsTheNextGeneration.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/WhenTheUserSpawnsTheNextGeneration.java @@ -1,8 +1,7 @@ -package com.wakaleo.gameoflife.web.webtests; +package com.wakaleo.gameoflife.webtests; -import com.wakaleo.gameoflife.web.requirements.GameOfLifeApplication; -import com.wakaleo.gameoflife.web.webtests.pages.EnterGridPage; -import com.wakaleo.gameoflife.web.webtests.steps.PlayerSteps; +import com.wakaleo.gameoflife.webtests.requirements.GameOfLifeApplication; +import com.wakaleo.gameoflife.webtests.steps.PlayerSteps; import net.thucydides.core.annotations.Managed; import net.thucydides.core.annotations.ManagedPages; import net.thucydides.core.annotations.Steps; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/EnterGridPage.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/EnterGridPage.java similarity index 87% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/EnterGridPage.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/EnterGridPage.java index e0c447d4ca..cabb363c59 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/EnterGridPage.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/EnterGridPage.java @@ -1,7 +1,6 @@ -package com.wakaleo.gameoflife.web.webtests.pages; +package com.wakaleo.gameoflife.webtests.pages; import net.thucydides.core.annotations.DefaultUrl; -import net.thucydides.core.pages.PageObject; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/GameOfLifePage.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/GameOfLifePage.java similarity index 90% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/GameOfLifePage.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/GameOfLifePage.java index 5e2c5bb7a9..bba2c37763 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/GameOfLifePage.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/GameOfLifePage.java @@ -1,4 +1,4 @@ -package com.wakaleo.gameoflife.web.webtests.pages; +package com.wakaleo.gameoflife.webtests.pages; import net.thucydides.core.annotations.DefaultUrl; import net.thucydides.core.pages.PageObject; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/HomePage.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/HomePage.java similarity index 83% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/HomePage.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/HomePage.java index 92f93757ea..a116593aa0 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/HomePage.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/HomePage.java @@ -1,7 +1,6 @@ -package com.wakaleo.gameoflife.web.webtests.pages; +package com.wakaleo.gameoflife.webtests.pages; import net.thucydides.core.annotations.DefaultUrl; -import net.thucydides.core.pages.PageObject; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/ShowGridPage.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/ShowGridPage.java similarity index 92% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/ShowGridPage.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/ShowGridPage.java index 0bdc3fc8f2..d43d18f0b6 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/pages/ShowGridPage.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/pages/ShowGridPage.java @@ -1,7 +1,5 @@ -package com.wakaleo.gameoflife.web.webtests.pages; +package com.wakaleo.gameoflife.webtests.pages; -import net.thucydides.core.annotations.DefaultUrl; -import net.thucydides.core.pages.PageObject; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/requirements/GameOfLifeApplication.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/requirements/GameOfLifeApplication.java similarity index 87% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/requirements/GameOfLifeApplication.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/requirements/GameOfLifeApplication.java index 9df24f9545..8be76ed07f 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/requirements/GameOfLifeApplication.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/requirements/GameOfLifeApplication.java @@ -1,4 +1,4 @@ -package com.wakaleo.gameoflife.web.requirements; +package com.wakaleo.gameoflife.webtests.requirements; import net.thucydides.core.annotations.Feature; diff --git a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/steps/PlayerSteps.java b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/steps/PlayerSteps.java similarity index 84% rename from gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/steps/PlayerSteps.java rename to gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/steps/PlayerSteps.java index 7da41030da..4036bca163 100644 --- a/gameoflife-web/src/test/java/com/wakaleo/gameoflife/web/webtests/steps/PlayerSteps.java +++ b/gameoflife-webtests/src/test/java/com/wakaleo/gameoflife/webtests/steps/PlayerSteps.java @@ -1,9 +1,9 @@ -package com.wakaleo.gameoflife.web.webtests.steps; +package com.wakaleo.gameoflife.webtests.steps; -import com.wakaleo.gameoflife.web.webtests.pages.EnterGridPage; -import com.wakaleo.gameoflife.web.webtests.pages.GameOfLifePage; -import com.wakaleo.gameoflife.web.webtests.pages.HomePage; -import com.wakaleo.gameoflife.web.webtests.pages.ShowGridPage; +import com.wakaleo.gameoflife.webtests.pages.EnterGridPage; +import com.wakaleo.gameoflife.webtests.pages.GameOfLifePage; +import com.wakaleo.gameoflife.webtests.pages.HomePage; +import com.wakaleo.gameoflife.webtests.pages.ShowGridPage; import net.thucydides.core.annotations.Step; import net.thucydides.core.pages.Pages; diff --git a/pom.xml b/pom.xml index 872b24760c..7fbbeeeaf9 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,7 @@ 1.6 wakaleo + 0.4.19 @@ -152,6 +153,7 @@ gameoflife-web gameoflife-webservice gameoflife-cli + gameoflife-webtests