Permalink
Browse files

Tidied up code

  • Loading branch information...
wakaleo committed May 27, 2012
1 parent 25c6da5 commit 2565bd5c8e2b6ca3306edffb26dfefc6ed7ec81d
Showing 1,171 changed files with 598,011 additions and 327,693 deletions.
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>gameoflife</artifactId>
@@ -83,8 +84,8 @@
<id>integration-tests</id>
<phase>integration-test</phase>
<goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
</goals>
<configuration>
<parallel>classes</parallel>
@@ -15,7 +15,7 @@
@RunWith(ThucydidesRunner.class)
@Story(GameOfLifeApplication.RunSimulations.RunASimulation.class)
public class WhenTheUserEntersAnInitialGrid {
-
+
@Managed(uniqueSession = true)
WebDriver driver;
@@ -27,9 +27,9 @@
final static String[][] EMPTY_GRID
- = new String[][] {{".", ".", "."},
- {".", ".", "."},
- {".", ".", "."}};
+ = new String[][]{{".", ".", "."},
+ {".", ".", "."},
+ {".", ".", "."}};
@Test
@@ -47,6 +47,7 @@ public void userShouldBeAbleToSeedAnEmptyGridOnTheNewGamePage() {
player.starts_simulation();
player.should_see_grid(EMPTY_GRID);
}
+
@Test
public void theGridDisplayPageShouldContainANextGenerationButton() {
player.opens_home_page();
@@ -59,12 +60,12 @@ public void theGridDisplayPageShouldContainANextGenerationButton() {
public void userShouldBeAbleToEnterOneLiveCellInTheGrid() {
player.opens_home_page();
player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(1,1);
+ player.clicks_on_cell_at(1, 1);
player.starts_simulation();
- String[][] expectedGrid = new String[][] {{".", ".", "."},
- {".", "*", "."},
- {".", ".", "."}};
+ String[][] expectedGrid = new String[][]{{".", ".", "."},
+ {".", "*", "."},
+ {".", ".", "."}};
player.should_see_grid(expectedGrid);
}
@@ -73,14 +74,14 @@ public void userShouldBeAbleToEnterOneLiveCellInTheGrid() {
public void userShouldBeAbleToEnterLiveCellsInTheGrid() {
player.opens_home_page();
player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(0,0);
- player.clicks_on_cell_at(0,1);
- player.clicks_on_cell_at(1,1);
+ player.clicks_on_cell_at(0, 0);
+ player.clicks_on_cell_at(0, 1);
+ player.clicks_on_cell_at(1, 1);
player.starts_simulation();
- String[][] expectedGrid = new String[][] {{"*", "*", "."},
- {".", "*", "."},
- {".", ".", "."}};
+ String[][] expectedGrid = new String[][]{{"*", "*", "."},
+ {".", "*", "."},
+ {".", ".", "."}};
player.should_see_grid(expectedGrid);
}
@@ -15,7 +15,7 @@
@RunWith(ThucydidesRunner.class)
@Story(GameOfLifeApplication.RunSimulations.RunASimulation.class)
public class WhenTheUserSpawnsTheNextGeneration {
-
+
@Managed(uniqueSession = true)
WebDriver driver;
@@ -27,85 +27,85 @@
final static String[][] EMPTY_GRID
- = new String[][] {{".", ".", "."},
- {".", ".", "."},
- {".", ".", "."}};
-
-
- @Test
- public void anEmptyGridShouldProduceAnEmptyGrid() {
- String[][] expectedGrid = new String[][] {{".", ".", "."},
- {".", ".", "."},
- {".", ".", "."}};
-
- player.opens_home_page();
- player.chooses_to_start_a_new_game();
- player.starts_simulation();
- player.continues_simulation();
- player.should_see_grid(expectedGrid);
-
- }
-
- @Test
- public void aGridWithOneCellShouldProduceAnEmptyGrid() {
- String[][] expectedGrid = new String[][] {{".", ".", "."},
- {".", ".", "."},
- {".", ".", "."}};
-
- player.opens_home_page();
- player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(1,1);
- player.starts_simulation();
- player.continues_simulation();
- player.should_see_grid(expectedGrid);
- }
-
- @Test
- public void aGridWithTwoCellsShouldProduceAnEmptyGrid() {
- String[][] expectedGrid = new String[][] {{".", ".", "."},
- {".", ".", "."},
- {".", ".", "."}};
-
- player.opens_home_page();
- player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(1,1);
- player.clicks_on_cell_at(0,1);
- player.starts_simulation();
- player.continues_simulation();
- player.should_see_grid(expectedGrid);
- }
-
-
- @Test
+ = new String[][]{{".", ".", "."},
+ {".", ".", "."},
+ {".", ".", "."}};
+
+
+ @Test
+ public void anEmptyGridShouldProduceAnEmptyGrid() {
+ String[][] expectedGrid = new String[][]{{".", ".", "."},
+ {".", ".", "."},
+ {".", ".", "."}};
+
+ player.opens_home_page();
+ player.chooses_to_start_a_new_game();
+ player.starts_simulation();
+ player.continues_simulation();
+ player.should_see_grid(expectedGrid);
+
+ }
+
+ @Test
+ public void aGridWithOneCellShouldProduceAnEmptyGrid() {
+ String[][] expectedGrid = new String[][]{{".", ".", "."},
+ {".", ".", "."},
+ {".", ".", "."}};
+
+ player.opens_home_page();
+ player.chooses_to_start_a_new_game();
+ player.clicks_on_cell_at(1, 1);
+ player.starts_simulation();
+ player.continues_simulation();
+ player.should_see_grid(expectedGrid);
+ }
+
+ @Test
+ public void aGridWithTwoCellsShouldProduceAnEmptyGrid() {
+ String[][] expectedGrid = new String[][]{{".", ".", "."},
+ {".", ".", "."},
+ {".", ".", "."}};
+
+ player.opens_home_page();
+ player.chooses_to_start_a_new_game();
+ player.clicks_on_cell_at(1, 1);
+ player.clicks_on_cell_at(0, 1);
+ player.starts_simulation();
+ player.continues_simulation();
+ player.should_see_grid(expectedGrid);
+ }
+
+
+ @Test
public void aStableCellSetShouldProduceTheSameSetOfCells() {
- String[][] expectedGrid = new String[][] {{"*", "*", "."},
- {"*", "*", "."},
- {".", ".", "."}};
-
- player.opens_home_page();
- player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(0,0);
- player.clicks_on_cell_at(0,1);
- player.clicks_on_cell_at(1,0);
- player.clicks_on_cell_at(1,1);
- player.starts_simulation();
- player.continues_simulation();
- player.should_see_grid(expectedGrid);
+ String[][] expectedGrid = new String[][]{{"*", "*", "."},
+ {"*", "*", "."},
+ {".", ".", "."}};
+
+ player.opens_home_page();
+ player.chooses_to_start_a_new_game();
+ player.clicks_on_cell_at(0, 0);
+ player.clicks_on_cell_at(0, 1);
+ player.clicks_on_cell_at(1, 0);
+ player.clicks_on_cell_at(1, 1);
+ player.starts_simulation();
+ player.continues_simulation();
+ player.should_see_grid(expectedGrid);
}
@Test
public void aRotatingCellSetShouldProduceTheExpectedNewSetOfCells() {
- String[][] expectedGrid = new String[][] {{".", ".", "."},
- {".", "*", "."},
- {".", "*", "."}};
+ String[][] expectedGrid = new String[][]{{".", ".", "."},
+ {".", "*", "."},
+ {".", "*", "."}};
player.opens_home_page();
player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(0,0);
- player.clicks_on_cell_at(0,1);
- player.clicks_on_cell_at(1,0);
- player.clicks_on_cell_at(1,1);
- player.clicks_on_cell_at(1,2);
+ player.clicks_on_cell_at(0, 0);
+ player.clicks_on_cell_at(0, 1);
+ player.clicks_on_cell_at(1, 0);
+ player.clicks_on_cell_at(1, 1);
+ player.clicks_on_cell_at(1, 2);
player.starts_simulation();
player.continues_simulation();
player.continues_simulation();
@@ -115,15 +115,15 @@ public void aRotatingCellSetShouldProduceTheExpectedNewSetOfCells() {
@Test
public void aRotatingCellSetShouldProduceTheOriginalSetOfCellsAfterTwoGenerations() {
- String[][] expectedGrid = new String[][] {{".", ".", "."},
- {"*", "*", "*"},
- {".", ".", "."}};
+ String[][] expectedGrid = new String[][]{{".", ".", "."},
+ {"*", "*", "*"},
+ {".", ".", "."}};
player.opens_home_page();
player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(1,0);
- player.clicks_on_cell_at(1,1);
- player.clicks_on_cell_at(1,2);
+ player.clicks_on_cell_at(1, 0);
+ player.clicks_on_cell_at(1, 1);
+ player.clicks_on_cell_at(1, 2);
player.starts_simulation();
player.continues_simulation();
player.continues_simulation();
@@ -132,15 +132,15 @@ public void aRotatingCellSetShouldProduceTheOriginalSetOfCellsAfterTwoGeneration
@Test
public void aRotatingCellSetShouldProduceTheOriginalSetOfCellsAfterThreeGenerations() {
- String[][] expectedGrid = new String[][] {{".", "*", "."},
- {".", "*", "."},
- {".", "*", "."}};
+ String[][] expectedGrid = new String[][]{{".", "*", "."},
+ {".", "*", "."},
+ {".", "*", "."}};
player.opens_home_page();
player.chooses_to_start_a_new_game();
- player.clicks_on_cell_at(1,0);
- player.clicks_on_cell_at(1,1);
- player.clicks_on_cell_at(1,2);
+ player.clicks_on_cell_at(1, 0);
+ player.clicks_on_cell_at(1, 1);
+ player.clicks_on_cell_at(1, 2);
player.starts_simulation();
player.continues_simulation();
player.continues_simulation();
@@ -9,7 +9,7 @@
@DefaultUrl("http://localhost:9090/new")
public class EnterGridPage extends GameOfLifePage {
- @FindBy(id="submit")
+ @FindBy(id = "submit")
WebElement goButton;
public EnterGridPage(WebDriver driver) {
@@ -10,14 +10,14 @@
public class ShowGridPage extends GameOfLifePage {
- @FindBy(id="submit")
+ @FindBy(id = "submit")
WebElement nextButton;
public ShowGridPage(WebDriver driver) {
super(driver);
}
- public String[][] getDisplayedGrid() {
+ public String[][] getDisplayedGrid() {
return getTableWithId("grid");
}
@@ -40,7 +40,7 @@ public void clickOnNextGenerationButton() {
}
private String[][] tableContentsAsAnArray(List<String[]> tableContents,
- int numberOfColumns) {
+ int numberOfColumns) {
int numberOfRows = tableContents.size();
return tableContents.toArray(new String[numberOfRows][numberOfColumns]);
}
@@ -6,13 +6,19 @@
@Feature
public class RunSimulations {
- public class RunASimulation {}
+ public class RunASimulation {
+ }
}
@Feature
public class RecordResults {
- public class RecordASimulation {}
- public class ViewPastSimulationResults {}
- public class ViewSimulationStatistics {}
+ public class RecordASimulation {
+ }
+
+ public class ViewPastSimulationResults {
+ }
+
+ public class ViewSimulationStatistics {
+ }
}
}
View
@@ -1,14 +1,15 @@
<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>gameoflife</artifactId>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>gameoflife</artifactId>
+ <groupId>com.wakaleo.gameoflife</groupId>
+ <version>0.9.13-SNAPSHOT</version>
+ </parent>
<groupId>com.wakaleo.gameoflife</groupId>
+ <artifactId>gameoflife-build</artifactId>
+ <packaging>jar</packaging>
<version>0.9.13-SNAPSHOT</version>
- </parent>
- <groupId>com.wakaleo.gameoflife</groupId>
- <artifactId>gameoflife-build</artifactId>
- <packaging>jar</packaging>
- <version>0.9.13-SNAPSHOT</version>
- <name>gameoflife-build</name>
+ <name>gameoflife-build</name>
</project>
Oops, something went wrong.

3 comments on commit 2565bd5

@LLewis

This comment has been minimized.

Show comment
Hide comment

Update

@LLewis

This comment has been minimized.

Show comment
Hide comment
@LLewis

LLewis Jul 9, 2014

Updated LL

Updated LL

@LLewis

This comment has been minimized.

Show comment
Hide comment
@LLewis

LLewis Jul 9, 2014

Updated LL

Updated LL

Please sign in to comment.