From 74021d3033e20bfdd3feac0522499f12336b0525 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:24:45 +0300 Subject: [PATCH 01/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 19 ++++++++++++++++++ .../20151009120851591/besouroEpisodes.txt | 0 .besouro/20151009120851591/disagreements.txt | 0 .../randomHeuristicEpisodes.txt | 0 .besouro/20151009120851591/userComments.txt | 0 .besouro/20151009120851591/zorroEpisodes.txt | 0 .../unioulu/tol/sqatlab/gameoflife/Cell.java | 20 +++++++++++++++++++ 7 files changed, 39 insertions(+) create mode 100644 .besouro/20151009120851591/actions.txt create mode 100644 .besouro/20151009120851591/besouroEpisodes.txt create mode 100644 .besouro/20151009120851591/disagreements.txt create mode 100644 .besouro/20151009120851591/randomHeuristicEpisodes.txt create mode 100644 .besouro/20151009120851591/userComments.txt create mode 100644 .besouro/20151009120851591/zorroEpisodes.txt diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt new file mode 100644 index 0000000..086fa30 --- /dev/null +++ b/.besouro/20151009120851591/actions.txt @@ -0,0 +1,19 @@ +FileOpenedAction 1444381731929 Cell.java 68 0 0 0 +FileOpenedAction 1444382042814 TestCell.java 200 1 1 0 +FileOpenedAction 1444382044824 TestGrid.java 199 1 1 0 +RefactoringAction 1444382154363 TestCell.java RENAME test()=>void testLiveCell() METHOD +RefactoringAction 1444382159384 TestCell.java RENAME testLiveCell()=>void testLiveCellWithNoNei() METHOD +RefactoringAction 1444382161903 TestCell.java RENAME testLiveCellWithNoNei()=>void testLiveCellWithNoNeighbors() METHOD +RefactoringAction 1444382163920 TestCell.java RENAME testLiveCellWithNoNeighbors()=>void testLiveCellWithNoNeighborsS() METHOD +RefactoringAction 1444382166938 TestCell.java RENAME testLiveCellWithNoNeighborsS()=>void testLiveCellWithNoNeighborsShouldDie() METHOD +RefactoringAction 1444382343810 TestCell.java ADD import org.unioulu.tol.sqatlab.gameoflife.Cell IMPORT +RefactoringAction 1444382375514 Cell.java ADD Cell() METHOD +RefactoringAction 1444382400658 Cell.java ADD void nextIteration() METHOD +RefactoringAction 1444382407831 Cell.java ADD Object getState() METHOD +RefactoringAction 1444382454762 Cell.java ADD Cell(String) METHOD +RefactoringAction 1444382499474 Cell.java ADD String state FIELD +RefactoringAction 1444382527942 TestCell.java ADD void testLiveCellWithNoNeighborsShouldDie()/2 METHOD +RefactoringAction 1444382667364 TestCell.java RENAME testLiveCellWithNoNeighborsShouldDie()/2=>void testLiveCellTwoNeigh() METHOD +RefactoringAction 1444382669382 TestCell.java RENAME testLiveCellTwoNeigh()=>void testLiveCellTwoNeighbors() METHOD +RefactoringAction 1444382672400 TestCell.java RENAME testLiveCellTwoNeighbors()=>void testLiveCellTwoNeighborsShouldLive() METHOD +EditAction 1444382684458 Cell.java 317 4 2 0 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20151009120851591/disagreements.txt b/.besouro/20151009120851591/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20151009120851591/userComments.txt b/.besouro/20151009120851591/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index b66e9c8..66aeb9c 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -2,4 +2,24 @@ public class Cell { + private String state; + + public Cell(){ + + } + + public Cell(String initialState) { + this.state = initialState; + } + + public void nextIteration() { + + + } + + public String getState() { + // TODO Auto-generated method stub + return this.state; + } + } From c325a70f51f59e931edaf50c36ec97272959ca1a Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:24:48 +0300 Subject: [PATCH 02/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 1 + .../tol/sqatlab/gameoflife/test/TestCell.java | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 086fa30..c3e8943 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -17,3 +17,4 @@ RefactoringAction 1444382667364 TestCell.java RENAME testLiveCellWithNoNeighbors RefactoringAction 1444382669382 TestCell.java RENAME testLiveCellTwoNeigh()=>void testLiveCellTwoNeighbors() METHOD RefactoringAction 1444382672400 TestCell.java RENAME testLiveCellTwoNeighbors()=>void testLiveCellTwoNeighborsShouldLive() METHOD EditAction 1444382684458 Cell.java 317 4 2 0 +EditAction 1444382687826 TestCell.java 633 2 8 2 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index d8de09e..6021342 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -3,12 +3,33 @@ import static org.junit.Assert.*; import org.junit.Test; +import org.unioulu.tol.sqatlab.gameoflife.Cell; public class TestCell { @Test - public void test() { + public void testLiveCellWithNoNeighborsShouldDie() { + //arrange + Cell cell= new Cell("Alive"); + // + cell.nextIteration(); + + //assert + assertEquals("Dead", cell.getState()); fail("Not yet implemented"); } + + @Test + public void testLiveCellTwoNeighborsShouldLive() { + //arrange + Cell cell= new Cell("Alive"); + // + cell.nextIteration(); + + //assert + assertEquals("Dead", cell.getState()); + fail("Not yet implemented"); + } + } From 1c22722f33fd757b16eac1228024f051911150be Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:29:25 +0300 Subject: [PATCH 03/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 4 ++++ src/org/unioulu/tol/sqatlab/gameoflife/Cell.java | 12 ++++++++---- .../tol/sqatlab/gameoflife/test/TestCell.java | 6 +++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index c3e8943..f132eca 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -18,3 +18,7 @@ RefactoringAction 1444382669382 TestCell.java RENAME testLiveCellTwoNeigh()=>voi RefactoringAction 1444382672400 TestCell.java RENAME testLiveCellTwoNeighbors()=>void testLiveCellTwoNeighborsShouldLive() METHOD EditAction 1444382684458 Cell.java 317 4 2 0 EditAction 1444382687826 TestCell.java 633 2 8 2 +RefactoringAction 1444382796684 Cell.java RENAME nextIteration()=>void nextIteration(int) METHOD +RefactoringAction 1444382802057 Cell.java RENAME nextIteration(int)=>void nextIteration() METHOD +RefactoringAction 1444382804068 Cell.java RENAME nextIteration()=>void nextIteration(int) METHOD +EditAction 1444382964926 TestCell.java 637 2 7 2 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 66aeb9c..4be8c69 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -2,7 +2,7 @@ public class Cell { - private String state; + String state; public Cell(){ @@ -12,9 +12,13 @@ public Cell(String initialState) { this.state = initialState; } - public void nextIteration() { - - + public void nextIteration(int numOfLiveCells) { + if (state == "Alive" && numOfLiveCells < 2){ + state = "Dead"; + } + else{ + state = "Alive"; + } } public String getState() { diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 6021342..c1a1993 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -12,11 +12,11 @@ public void testLiveCellWithNoNeighborsShouldDie() { //arrange Cell cell= new Cell("Alive"); // - cell.nextIteration(); + cell.nextIteration(0); //assert assertEquals("Dead", cell.getState()); - fail("Not yet implemented"); + //fail("Not yet implemented"); } @Test @@ -24,7 +24,7 @@ public void testLiveCellTwoNeighborsShouldLive() { //arrange Cell cell= new Cell("Alive"); // - cell.nextIteration(); + cell.nextIteration(2); //assert assertEquals("Dead", cell.getState()); From 471a5c80514e926429c908cb77063d8583d39f16 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:31:00 +0300 Subject: [PATCH 04/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index f132eca..6efaba1 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -22,3 +22,4 @@ RefactoringAction 1444382796684 Cell.java RENAME nextIteration()=>void nextItera RefactoringAction 1444382802057 Cell.java RENAME nextIteration(int)=>void nextIteration() METHOD RefactoringAction 1444382804068 Cell.java RENAME nextIteration()=>void nextIteration(int) METHOD EditAction 1444382964926 TestCell.java 637 2 7 2 +EditAction 1444383059188 TestCell.java 640 2 6 2 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index c1a1993..0405be8 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -27,8 +27,8 @@ public void testLiveCellTwoNeighborsShouldLive() { cell.nextIteration(2); //assert - assertEquals("Dead", cell.getState()); - fail("Not yet implemented"); + assertEquals("Alive", cell.getState()); + //fail("Not yet implemented"); } From ae91f1d454fe1ac22bdade776013bd202d149f4c Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:44:04 +0300 Subject: [PATCH 05/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 27 ++++++++++++++++ .../20151009120851591/besouroEpisodes.txt | 3 ++ .../randomHeuristicEpisodes.txt | 2 ++ .besouro/20151009120851591/zorroEpisodes.txt | 2 ++ .../tol/sqatlab/gameoflife/test/TestGrid.java | 31 +++++++++++++++++-- 5 files changed, 63 insertions(+), 2 deletions(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 6efaba1..a01e06a 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -23,3 +23,30 @@ RefactoringAction 1444382802057 Cell.java RENAME nextIteration(int)=>void nextIt RefactoringAction 1444382804068 Cell.java RENAME nextIteration()=>void nextIteration(int) METHOD EditAction 1444382964926 TestCell.java 637 2 7 2 EditAction 1444383059188 TestCell.java 640 2 6 2 +UnitTestCaseAction 1444383064879 TestCell.java OK +UnitTestSessionAction 1444383064882 TestCell OK +UnitTestCaseAction 1444383083295 TestCell.java OK +UnitTestSessionAction 1444383083296 TestCell OK +RefactoringAction 1444383214260 TestGrid.java ADD import org.unioulu.tol.sqatlab.gameoflife.Cell IMPORT +RefactoringAction 1444383223076 TestGrid.java ADD import org.unioulu.tol.sqatlab.gameoflife.Grid IMPORT +RefactoringAction 1444383396542 Cell.java ADD Cell(int, int) METHOD +RefactoringAction 1444383415717 Cell.java ADD int x FIELD +RefactoringAction 1444383415718 Cell.java ADD int y FIELD +FileOpenedAction 1444383466155 Grid.java 68 0 0 0 +RefactoringAction 1444383500167 Grid.java ADD Grid() METHOD +RefactoringAction 1444383512726 TestGrid.java RENAME test()=>void testSi() METHOD +RefactoringAction 1444383517240 TestGrid.java RENAME testSi()=>void testSingleCellOn() METHOD +RefactoringAction 1444383522755 TestGrid.java RENAME testSingleCellOn()=>void testSingleCellOnGridHasNoNeighbors() METHOD +RefactoringAction 1444383531536 Grid.java ADD int getNeighbors(Cell) METHOD +RefactoringAction 1444383585118 Grid.java ADD void addCell(Cell) METHOD +RefactoringAction 1444383716046 TestGrid.java ADD void testSingleCellOnGridHasNoNeighbors()/2 METHOD +RefactoringAction 1444383724063 TestGrid.java RENAME testSingleCellOnGridHasNoNeighbors()/2=>void testTwo() METHOD +RefactoringAction 1444383726080 TestGrid.java RENAME testTwo()=>void testTwoNeigh() METHOD +RefactoringAction 1444383727596 TestGrid.java RENAME testTwoNeigh()=>void testTwoNeighbors() METHOD +RefactoringAction 1444383796196 TestGrid.java RENAME testTwoNeighbors()=>void testTwoNeighborsC() METHOD +RefactoringAction 1444383797713 TestGrid.java RENAME testTwoNeighborsC()=>void testTwoNeighborsCells() METHOD +RefactoringAction 1444383800230 TestGrid.java RENAME testTwoNeighborsCells()=>void testTwoNeighborsCellsS() METHOD +RefactoringAction 1444383802245 TestGrid.java RENAME testTwoNeighborsCellsS()=>void testTwoNeighborsCellsShould() METHOD +RefactoringAction 1444383807763 TestGrid.java RENAME testTwoNeighborsCellsShould()=>void testTwoNeighborsCellsShouldHaveOne() METHOD +RefactoringAction 1444383812279 TestGrid.java RENAME testTwoNeighborsCellsShouldHaveOne()=>void testTwoNeighborsCellsShouldHaveOneNeighbor() METHOD +EditAction 1444383843268 TestGrid.java 760 2 12 2 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index e69de29..fb5e880 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -0,0 +1,3 @@ +1444383064882 test-first 4 1332 true +1444383064883 test-last 1 1332 false +1444383083296 regression 1 0 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index e69de29..61807ce 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -0,0 +1,2 @@ +1444383064882 test-first 4 1332 true +1444383083296 regression 1 0 true diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index e69de29..ba0c4a2 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -0,0 +1,2 @@ +1444383064882 test-first 4 1332 true +1444383083296 regression 1 18 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index 9614d55..a6e496c 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -2,12 +2,39 @@ import static org.junit.Assert.*; import org.junit.Test; +import org.unioulu.tol.sqatlab.gameoflife.Cell; +import org.unioulu.tol.sqatlab.gameoflife.Grid; public class TestGrid { @Test - public void test() { - fail("Not yet implemented"); + public void testSingleCellOnGridHasNoNeighbors() { + Grid grid = new Grid(); + Cell cell = new Cell(0,0); + + + grid.addCell(cell); + + + int numNeighbors = grid.getNeighbors(cell); + + assertEquals(0, numNeighbors); + + } + + @Test + public void testTwoNeighborsCellsShouldHaveOneNeighbor() { + Grid grid = new Grid(); + Cell cell1 = new Cell(0,0); + Cell cell2 = new Cell(0,1); + + grid.addCell(cell1); + grid.addCell(cell2); + + int numNeighbors = grid.getNeighbors(cell1); + + assertEquals(1, numNeighbors); + } } From b8ec05afa5ba852c40b4dc448963a1cdcd3b532f Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:44:07 +0300 Subject: [PATCH 06/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index a01e06a..b2b3869 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -50,3 +50,4 @@ RefactoringAction 1444383802245 TestGrid.java RENAME testTwoNeighborsCellsS()=>v RefactoringAction 1444383807763 TestGrid.java RENAME testTwoNeighborsCellsShould()=>void testTwoNeighborsCellsShouldHaveOne() METHOD RefactoringAction 1444383812279 TestGrid.java RENAME testTwoNeighborsCellsShouldHaveOne()=>void testTwoNeighborsCellsShouldHaveOneNeighbor() METHOD EditAction 1444383843268 TestGrid.java 760 2 12 2 +EditAction 1444383846261 Grid.java 197 3 1 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 19dbf0b..1041fef 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -2,4 +2,20 @@ public class Grid { + public Grid(){ + + } + + public int getNeighbors(Cell cell) { + + return 0; + } + + public void addCell(Cell cell) { + + + } + + + } From b24bf55f749b5902cd8e466d8f371aacd63afbfc Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:53:29 +0300 Subject: [PATCH 07/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/Cell.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index b2b3869..4ee75a1 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -51,3 +51,4 @@ RefactoringAction 1444383807763 TestGrid.java RENAME testTwoNeighborsCellsShould RefactoringAction 1444383812279 TestGrid.java RENAME testTwoNeighborsCellsShouldHaveOne()=>void testTwoNeighborsCellsShouldHaveOneNeighbor() METHOD EditAction 1444383843268 TestGrid.java 760 2 12 2 EditAction 1444383846261 Grid.java 197 3 1 0 +EditAction 1444384408011 Grid.java 197 3 1 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 4be8c69..37db683 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -3,6 +3,8 @@ public class Cell { String state; + int x; + int y; public Cell(){ @@ -12,6 +14,11 @@ public Cell(String initialState) { this.state = initialState; } + public Cell(int x, int y) { + this.x = x; + this.y = y; + } + public void nextIteration(int numOfLiveCells) { if (state == "Alive" && numOfLiveCells < 2){ state = "Dead"; From 436351319a85a51a187c66a1b700323efdf03bde Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:04:03 +0300 Subject: [PATCH 08/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 13 +++++++++++++ src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 4ee75a1..65a6521 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -52,3 +52,16 @@ RefactoringAction 1444383812279 TestGrid.java RENAME testTwoNeighborsCellsShould EditAction 1444383843268 TestGrid.java 760 2 12 2 EditAction 1444383846261 Grid.java 197 3 1 0 EditAction 1444384408011 Grid.java 197 3 1 0 +UnitTestCaseAction 1444384476954 TestGrid.java FAIL +UnitTestSessionAction 1444384476956 TestGrid FAIL +RefactoringAction 1444384563939 Grid.java ADD Set<> cells FIELD +RefactoringAction 1444384594660 Grid.java ADD import java.util.HashSet IMPORT +RefactoringAction 1444384598129 Grid.java ADD import java.util.Set IMPORT +RefactoringAction 1444384717061 Cell.java ADD int hashCode() METHOD +RefactoringAction 1444384717062 Cell.java ADD boolean equals(Object) METHOD +RefactoringAction 1444384960243 Cell.java ADD int get FIELD +RefactoringAction 1444384964267 Cell.java RENAME get=>int getX FIELD +RefactoringAction 1444384965791 Cell.java RENAME getX=>int getX() METHOD +RefactoringAction 1444384993491 Cell.java ADD int getX()/2 METHOD +RefactoringAction 1444384996016 Cell.java RENAME getX()/2=>int getY() METHOD +EditAction 1444385041968 Grid.java 353 3 3 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 1041fef..2d8d58c 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -1,18 +1,24 @@ package org.unioulu.tol.sqatlab.gameoflife; +import java.util.HashSet; +import java.util.Set; + public class Grid { + private Set cells = new HashSet<>(); + public Grid(){ } public int getNeighbors(Cell cell) { - + Set neighbors = new HashSet(); return 0; } public void addCell(Cell cell) { + cells.add(cell); } From 74c9aa9f86e9e80511181e202f6137245619de36 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:05:35 +0300 Subject: [PATCH 09/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 1 + .../unioulu/tol/sqatlab/gameoflife/Cell.java | 43 +++++++++++++++++++ .../unioulu/tol/sqatlab/gameoflife/Grid.java | 3 ++ 3 files changed, 47 insertions(+) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 65a6521..633f2b8 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -65,3 +65,4 @@ RefactoringAction 1444384965791 Cell.java RENAME getX=>int getX() METHOD RefactoringAction 1444384993491 Cell.java ADD int getX()/2 METHOD RefactoringAction 1444384996016 Cell.java RENAME getX()/2=>int getY() METHOD EditAction 1444385041968 Grid.java 353 3 3 0 +EditAction 1444385134911 Grid.java 362 3 3 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 37db683..7c8e23d 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -19,6 +19,16 @@ public Cell(int x, int y) { this.y = y; } + + public int getX(){ + return x; + } + + public int getY(){ + return y; + } + + public void nextIteration(int numOfLiveCells) { if (state == "Alive" && numOfLiveCells < 2){ state = "Dead"; @@ -27,6 +37,39 @@ public void nextIteration(int numOfLiveCells) { state = "Alive"; } } + + + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((state == null) ? 0 : state.hashCode()); + result = prime * result + x; + result = prime * result + y; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Cell other = (Cell) obj; + if (state == null) { + if (other.state != null) + return false; + } else if (!state.equals(other.state)) + return false; + if (x != other.x) + return false; + if (y != other.y) + return false; + return true; + } public String getState() { // TODO Auto-generated method stub diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 2d8d58c..e6f7a03 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -13,6 +13,9 @@ public Grid(){ public int getNeighbors(Cell cell) { Set neighbors = new HashSet(); + + + return 0; } From 554a380c4bd669b00155f9d3b3d53829c3fca705 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:14:08 +0300 Subject: [PATCH 10/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 2 ++ src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 15 ++++++++++----- .../tol/sqatlab/gameoflife/test/TestGrid.java | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 633f2b8..cceba62 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -66,3 +66,5 @@ RefactoringAction 1444384993491 Cell.java ADD int getX()/2 METHOD RefactoringAction 1444384996016 Cell.java RENAME getX()/2=>int getY() METHOD EditAction 1444385041968 Grid.java 353 3 3 0 EditAction 1444385134911 Grid.java 362 3 3 0 +RefactoringAction 1444385505863 Grid.java RENAME getNeighbors(Cell)=>int getNumOfNeighbors(Cell) METHOD +EditAction 1444385647505 TestGrid.java 770 2 12 2 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index e6f7a03..12cc5e9 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -11,12 +11,17 @@ public Grid(){ } - public int getNeighbors(Cell cell) { - Set neighbors = new HashSet(); + public int getNumOfNeighbors(Cell cell) { + int numNeighbors = 0; + Set neighborhood = new HashSet(); + for(int i=-1;i<=1; i++){ + Cell neighbor = new Cell(cell.x + i, cell.y + i); + if (cells.contains(neighbor)){ + numNeighbors++; + } + } - - - return 0; + return numNeighbors-1; } public void addCell(Cell cell) { diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index a6e496c..9355668 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -16,7 +16,7 @@ public void testSingleCellOnGridHasNoNeighbors() { grid.addCell(cell); - int numNeighbors = grid.getNeighbors(cell); + int numNeighbors = grid.getNumOfNeighbors(cell); assertEquals(0, numNeighbors); @@ -31,7 +31,7 @@ public void testTwoNeighborsCellsShouldHaveOneNeighbor() { grid.addCell(cell1); grid.addCell(cell2); - int numNeighbors = grid.getNeighbors(cell1); + int numNeighbors = grid.getNumOfNeighbors(cell1); assertEquals(1, numNeighbors); From 479b8fdb651f4aaed5e28ff268174f429424012a Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:35:24 +0300 Subject: [PATCH 11/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 12 ++++++++++++ .besouro/20151009120851591/besouroEpisodes.txt | 4 ++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20151009120851591/zorroEpisodes.txt | 1 + .../unioulu/tol/sqatlab/gameoflife/Grid.java | 18 ++++++++++++------ .../tol/sqatlab/gameoflife/test/TestCell.java | 12 ++++++++++++ 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index cceba62..895148d 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -68,3 +68,15 @@ EditAction 1444385041968 Grid.java 353 3 3 0 EditAction 1444385134911 Grid.java 362 3 3 0 RefactoringAction 1444385505863 Grid.java RENAME getNeighbors(Cell)=>int getNumOfNeighbors(Cell) METHOD EditAction 1444385647505 TestGrid.java 770 2 12 2 +UnitTestCaseAction 1444385654688 TestGrid.java FAIL +UnitTestSessionAction 1444385654692 TestGrid FAIL +RefactoringAction 1444385844489 Grid.java ADD int dx FIELD +RefactoringAction 1444386253884 Grid.java REMOVE dx FIELD +CompilationAction 1444386305467 Grid.java +CompilationAction 1444386317135 Grid.java +UnitTestCaseAction 1444386318135 TestGrid.java OK +UnitTestSessionAction 1444386318136 TestGrid OK +FileOpenedAction 1444386759799 Cell.java 1232 9 21 0 +RefactoringAction 1444386904582 TestCell.java ADD void testLiveCellTwoNeighborsShouldLive()/2 METHOD +RefactoringAction 1444386909599 TestCell.java RENAME testLiveCellTwoNeighborsShouldLive()/2=>void testLiveCellThreeNeighborsShouldLive() METHOD +EditAction 1444386923183 TestCell.java 869 3 9 3 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index fb5e880..0438efb 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -1,3 +1,7 @@ 1444383064882 test-first 4 1332 true 1444383064883 test-last 1 1332 false 1444383083296 regression 1 0 true +1444386318136 test-first 3 3103 true +1444386318137 test-first 3 3103 true +1444386318138 test-first 3 3103 true +1444386318139 test-first 3 3103 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index 61807ce..a56ae1b 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -1,2 +1,3 @@ 1444383064882 test-first 4 1332 true 1444383083296 regression 1 0 true +1444386318136 test-first 3 3103 true diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index ba0c4a2..4a9e8eb 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -1,2 +1,3 @@ 1444383064882 test-first 4 1332 true 1444383083296 regression 1 18 true +1444386318136 test-first 3 3234 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 12cc5e9..4b649f6 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -13,13 +13,15 @@ public Grid(){ public int getNumOfNeighbors(Cell cell) { int numNeighbors = 0; - Set neighborhood = new HashSet(); - for(int i=-1;i<=1; i++){ - Cell neighbor = new Cell(cell.x + i, cell.y + i); - if (cells.contains(neighbor)){ - numNeighbors++; + for (int dx=-1; dx<= 1; dx++){ + for (int dy=-1; dy<= 1; dy++){ + Cell neighbor = new Cell(cell.x + dx, cell.y + dy); + if(cells.contains(neighbor)){ + numNeighbors++; + } + } + } - } return numNeighbors-1; } @@ -33,3 +35,7 @@ public void addCell(Cell cell) { } + + + + diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 0405be8..130f00b 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -31,5 +31,17 @@ public void testLiveCellTwoNeighborsShouldLive() { //fail("Not yet implemented"); } + @Test + public void testLiveCellThreeNeighborsShouldLive() { + //arrange + Cell cell= new Cell("Alive"); + // + cell.nextIteration(3); + + //assert + assertEquals("Alive", cell.getState()); + //fail("Not yet implemented"); + } + } From e242256d28975911c237cfdf4f5c7f558662b280 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:39:25 +0300 Subject: [PATCH 12/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 8 ++++++++ .besouro/20151009120851591/besouroEpisodes.txt | 3 +++ .../20151009120851591/randomHeuristicEpisodes.txt | 2 ++ .besouro/20151009120851591/zorroEpisodes.txt | 2 ++ src/org/unioulu/tol/sqatlab/gameoflife/Cell.java | 3 +++ .../tol/sqatlab/gameoflife/test/TestCell.java | 12 ++++++++++++ 6 files changed, 30 insertions(+) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 895148d..4f20430 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -80,3 +80,11 @@ FileOpenedAction 1444386759799 Cell.java 1232 9 21 0 RefactoringAction 1444386904582 TestCell.java ADD void testLiveCellTwoNeighborsShouldLive()/2 METHOD RefactoringAction 1444386909599 TestCell.java RENAME testLiveCellTwoNeighborsShouldLive()/2=>void testLiveCellThreeNeighborsShouldLive() METHOD EditAction 1444386923183 TestCell.java 869 3 9 3 +UnitTestCaseAction 1444386932080 TestCell.java OK +UnitTestSessionAction 1444386932081 TestCell OK +UnitTestCaseAction 1444387083826 TestCell.java OK +UnitTestSessionAction 1444387083827 TestCell OK +RefactoringAction 1444387101669 TestCell.java ADD void testLiveCellThreeNeighborsShouldLive()/2 METHOD +RefactoringAction 1444387116687 TestCell.java RENAME testLiveCellThreeNeighborsShouldLive()/2=>void testLiveCellMoreThanThreeNeighborsShouldLive() METHOD +RefactoringAction 1444387121204 TestCell.java RENAME testLiveCellMoreThanThreeNeighborsShouldLive()=>void testLiveCellMoreThanThreeNeighborsShouldDie() METHOD +EditAction 1444387164688 TestCell.java 1105 4 12 4 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index 0438efb..6c45895 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -5,3 +5,6 @@ 1444386318137 test-first 3 3103 true 1444386318138 test-first 3 3103 true 1444386318139 test-first 3 3103 true +1444386932081 test-addition 1 172 true +1444386932082 test-addition 1 172 true +1444387083827 regression 1 0 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index a56ae1b..d6f86cf 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -1,3 +1,5 @@ 1444383064882 test-first 4 1332 true 1444383083296 regression 1 0 true 1444386318136 test-first 3 3103 true +1444386932081 test-addition 1 172 false +1444387083827 regression 1 0 true diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index 4a9e8eb..ce1a131 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -1,3 +1,5 @@ 1444383064882 test-first 4 1332 true 1444383083296 regression 1 18 true 1444386318136 test-first 3 3234 true +1444386932081 test-addition 1 613 true +1444387083827 regression 1 151 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 7c8e23d..a82d788 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -33,6 +33,9 @@ public void nextIteration(int numOfLiveCells) { if (state == "Alive" && numOfLiveCells < 2){ state = "Dead"; } + else if (state == "Alive" && numOfLiveCells > 3){ + state = "Dead"; + } else{ state = "Alive"; } diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 130f00b..5c092bf 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -43,5 +43,17 @@ public void testLiveCellThreeNeighborsShouldLive() { //fail("Not yet implemented"); } + @Test + public void testLiveCellMoreThanThreeNeighborsShouldDie() { + //arrange + Cell cell= new Cell("Alive"); + // + cell.nextIteration(4); + + //assert + assertEquals("Alive", cell.getState()); + //fail("Not yet implemented"); + } + } From bef976cd6845f3831da603ea441f0176b8d7a64f Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:39:35 +0300 Subject: [PATCH 13/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 3 +++ src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 4f20430..3fc5edb 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -88,3 +88,6 @@ RefactoringAction 1444387101669 TestCell.java ADD void testLiveCellThreeNeighbor RefactoringAction 1444387116687 TestCell.java RENAME testLiveCellThreeNeighborsShouldLive()/2=>void testLiveCellMoreThanThreeNeighborsShouldLive() METHOD RefactoringAction 1444387121204 TestCell.java RENAME testLiveCellMoreThanThreeNeighborsShouldLive()=>void testLiveCellMoreThanThreeNeighborsShouldDie() METHOD EditAction 1444387164688 TestCell.java 1105 4 12 4 +UnitTestCaseAction 1444387167780 TestCell.java FAIL +UnitTestSessionAction 1444387167781 TestCell FAIL +EditAction 1444387174643 TestCell.java 1104 4 12 4 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 5c092bf..2333149 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -51,7 +51,7 @@ public void testLiveCellMoreThanThreeNeighborsShouldDie() { cell.nextIteration(4); //assert - assertEquals("Alive", cell.getState()); + assertEquals("Dead", cell.getState()); //fail("Not yet implemented"); } From 307e3e396698839df730ca306d496d8802e057e8 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:41:03 +0300 Subject: [PATCH 14/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 7 +++++++ .besouro/20151009120851591/besouroEpisodes.txt | 4 ++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20151009120851591/zorroEpisodes.txt | 1 + .../tol/sqatlab/gameoflife/test/TestCell.java | 18 +++++++++++++++--- 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 3fc5edb..fcac488 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -91,3 +91,10 @@ EditAction 1444387164688 TestCell.java 1105 4 12 4 UnitTestCaseAction 1444387167780 TestCell.java FAIL UnitTestSessionAction 1444387167781 TestCell FAIL EditAction 1444387174643 TestCell.java 1104 4 12 4 +UnitTestCaseAction 1444387177940 TestCell.java OK +UnitTestSessionAction 1444387177940 TestCell OK +RefactoringAction 1444387218351 TestCell.java ADD void testLiveCellMoreThanThreeNeighborsShouldDie()/2 METHOD +RefactoringAction 1444387223370 TestCell.java RENAME testLiveCellMoreThanThreeNeighborsShouldDie()/2=>void testDeadCellMoreThanThreeNeighborsShouldDie() METHOD +RefactoringAction 1444387229388 TestCell.java RENAME testDeadCellMoreThanThreeNeighborsShouldDie()=>void testDeadCellThreeNeighborsShouldDie() METHOD +RefactoringAction 1444387233907 TestCell.java RENAME testDeadCellThreeNeighborsShouldDie()=>void testDeadCellThreeNeighborsShouldLive() METHOD +EditAction 1444387262177 TestCell.java 1204 5 15 5 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index 6c45895..0758eae 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -8,3 +8,7 @@ 1444386932081 test-addition 1 172 true 1444386932082 test-addition 1 172 true 1444387083827 regression 1 0 true +1444387177940 test-addition 2 76 true +1444387177941 test-addition 1 76 true +1444387177942 test-addition 2 76 true +1444387177943 test-addition 1 76 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index d6f86cf..26f65a4 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -3,3 +3,4 @@ 1444386318136 test-first 3 3103 true 1444386932081 test-addition 1 172 false 1444387083827 regression 1 0 true +1444387177940 test-addition 2 76 true diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index ce1a131..7af5f94 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -3,3 +3,4 @@ 1444386318136 test-first 3 3234 true 1444386932081 test-addition 1 613 true 1444387083827 regression 1 151 true +1444387177940 test-addition 2 94 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 2333149..51b36c6 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -28,7 +28,7 @@ public void testLiveCellTwoNeighborsShouldLive() { //assert assertEquals("Alive", cell.getState()); - //fail("Not yet implemented"); + } @Test @@ -40,7 +40,7 @@ public void testLiveCellThreeNeighborsShouldLive() { //assert assertEquals("Alive", cell.getState()); - //fail("Not yet implemented"); + } @Test @@ -52,7 +52,19 @@ public void testLiveCellMoreThanThreeNeighborsShouldDie() { //assert assertEquals("Dead", cell.getState()); - //fail("Not yet implemented"); + + } + + @Test + public void testDeadCellThreeNeighborsShouldLive() { + //arrange + Cell cell= new Cell("Dead"); + // + cell.nextIteration(3); + + //assert + assertEquals("Alive", cell.getState()); + } From 70038cb37794ee53ed2f61905de3f1ff6ff0a12c Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:43:03 +0300 Subject: [PATCH 15/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 5 +++++ .besouro/20151009120851591/besouroEpisodes.txt | 3 +++ .besouro/20151009120851591/randomHeuristicEpisodes.txt | 2 ++ .besouro/20151009120851591/zorroEpisodes.txt | 2 ++ src/org/unioulu/tol/sqatlab/gameoflife/Cell.java | 5 ++++- src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 2 +- 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index fcac488..86c2f20 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -98,3 +98,8 @@ RefactoringAction 1444387223370 TestCell.java RENAME testLiveCellMoreThanThreeNe RefactoringAction 1444387229388 TestCell.java RENAME testDeadCellMoreThanThreeNeighborsShouldDie()=>void testDeadCellThreeNeighborsShouldDie() METHOD RefactoringAction 1444387233907 TestCell.java RENAME testDeadCellThreeNeighborsShouldDie()=>void testDeadCellThreeNeighborsShouldLive() METHOD EditAction 1444387262177 TestCell.java 1204 5 15 5 +UnitTestCaseAction 1444387265352 TestCell.java OK +UnitTestSessionAction 1444387265353 TestCell OK +UnitTestCaseAction 1444387373886 TestCell.java OK +UnitTestSessionAction 1444387373887 TestCell OK +EditAction 1444387382070 TestCell.java 1203 5 15 5 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index 0758eae..8546359 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -12,3 +12,6 @@ 1444387177941 test-addition 1 76 true 1444387177942 test-addition 2 76 true 1444387177943 test-addition 1 76 true +1444387265353 test-addition 1 47 true +1444387265354 test-addition 1 47 true +1444387373887 regression 1 0 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index 26f65a4..ec6280e 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -4,3 +4,5 @@ 1444386932081 test-addition 1 172 false 1444387083827 regression 1 0 true 1444387177940 test-addition 2 76 true +1444387265353 test-addition 1 47 true +1444387373887 regression 1 0 false diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index 7af5f94..005bfb3 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -4,3 +4,5 @@ 1444386932081 test-addition 1 613 true 1444387083827 regression 1 151 true 1444387177940 test-addition 2 94 true +1444387265353 test-addition 1 87 true +1444387373887 regression 1 108 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index a82d788..6a17f0a 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -30,7 +30,10 @@ public int getY(){ public void nextIteration(int numOfLiveCells) { - if (state == "Alive" && numOfLiveCells < 2){ + if (state == "Dead" && numOfLiveCells == 3){ + state = "Alive"; + } + else if (state == "Alive" && numOfLiveCells < 2){ state = "Dead"; } else if (state == "Alive" && numOfLiveCells > 3){ diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 51b36c6..010a79d 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -63,7 +63,7 @@ public void testDeadCellThreeNeighborsShouldLive() { cell.nextIteration(3); //assert - assertEquals("Alive", cell.getState()); + assertEquals("Dead", cell.getState()); } From ed2cf69f8d5d3c85ae6bb2443941234ad643da50 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:43:11 +0300 Subject: [PATCH 16/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 3 +++ src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 86c2f20..c600c94 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -103,3 +103,6 @@ UnitTestSessionAction 1444387265353 TestCell OK UnitTestCaseAction 1444387373886 TestCell.java OK UnitTestSessionAction 1444387373887 TestCell OK EditAction 1444387382070 TestCell.java 1203 5 15 5 +UnitTestCaseAction 1444387385187 TestCell.java FAIL +UnitTestSessionAction 1444387385188 TestCell FAIL +EditAction 1444387390465 TestCell.java 1204 5 15 5 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 010a79d..51b36c6 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -63,7 +63,7 @@ public void testDeadCellThreeNeighborsShouldLive() { cell.nextIteration(3); //assert - assertEquals("Dead", cell.getState()); + assertEquals("Alive", cell.getState()); } From dd56f7b45b485fa326813e1efda7276129bb00a2 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:44:37 +0300 Subject: [PATCH 17/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 7 +++++++ .besouro/20151009120851591/besouroEpisodes.txt | 1 + .../20151009120851591/randomHeuristicEpisodes.txt | 1 + .besouro/20151009120851591/zorroEpisodes.txt | 1 + .../tol/sqatlab/gameoflife/test/TestCell.java | 12 ++++++++++++ 5 files changed, 22 insertions(+) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index c600c94..7b4f2ba 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -106,3 +106,10 @@ EditAction 1444387382070 TestCell.java 1203 5 15 5 UnitTestCaseAction 1444387385187 TestCell.java FAIL UnitTestSessionAction 1444387385188 TestCell FAIL EditAction 1444387390465 TestCell.java 1204 5 15 5 +UnitTestCaseAction 1444387395305 TestCell.java OK +UnitTestSessionAction 1444387395306 TestCell OK +RefactoringAction 1444387434615 TestCell.java ADD void testLiveCellMoreThanThreeNeighborsShouldDie()/2 METHOD +RefactoringAction 1444387442136 TestCell.java RENAME testLiveCellMoreThanThreeNeighborsShouldDie()/2=>void testLiveCellLessThanThreeNeighborsShouldDie() METHOD +RefactoringAction 1444387447156 TestCell.java RENAME testLiveCellLessThanThreeNeighborsShouldDie()=>void testLiveCellLessThanTNeighborsShouldDie() METHOD +RefactoringAction 1444387449675 TestCell.java RENAME testLiveCellLessThanTNeighborsShouldDie()=>void testLiveCellLessThanTwoNeighborsShouldDie() METHOD +EditAction 1444387476092 TestCell.java 1405 6 18 6 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index 8546359..99b9ca8 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -15,3 +15,4 @@ 1444387265353 test-addition 1 47 true 1444387265354 test-addition 1 47 true 1444387373887 regression 1 0 true +1444387395306 regression 2 13 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index ec6280e..32dda4c 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -6,3 +6,4 @@ 1444387177940 test-addition 2 76 true 1444387265353 test-addition 1 47 true 1444387373887 regression 1 0 false +1444387395306 regression 2 13 true diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index 005bfb3..9ad2f29 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -6,3 +6,4 @@ 1444387177940 test-addition 2 94 true 1444387265353 test-addition 1 87 true 1444387373887 regression 1 108 true +1444387395306 regression 2 21 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 51b36c6..4e6ff9d 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -67,5 +67,17 @@ public void testDeadCellThreeNeighborsShouldLive() { } + @Test + public void testLiveCellLessThanTwoNeighborsShouldDie() { + //arrange + Cell cell= new Cell("Alive"); + // + cell.nextIteration(1); + + //assert + assertEquals("Dead", cell.getState()); + + } + } From 5bdb9c0afa0f2990c3dc2d7db29685b905049df7 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:46:18 +0300 Subject: [PATCH 18/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 3 +++ .besouro/20151009120851591/besouroEpisodes.txt | 2 ++ .besouro/20151009120851591/randomHeuristicEpisodes.txt | 1 + .besouro/20151009120851591/zorroEpisodes.txt | 1 + 4 files changed, 7 insertions(+) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 7b4f2ba..fa38ef2 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -113,3 +113,6 @@ RefactoringAction 1444387442136 TestCell.java RENAME testLiveCellMoreThanThreeNe RefactoringAction 1444387447156 TestCell.java RENAME testLiveCellLessThanThreeNeighborsShouldDie()=>void testLiveCellLessThanTNeighborsShouldDie() METHOD RefactoringAction 1444387449675 TestCell.java RENAME testLiveCellLessThanTNeighborsShouldDie()=>void testLiveCellLessThanTwoNeighborsShouldDie() METHOD EditAction 1444387476092 TestCell.java 1405 6 18 6 +UnitTestCaseAction 1444387479171 TestCell.java OK +UnitTestSessionAction 1444387479172 TestCell OK +EditAction 1444387577706 Cell.java 1383 9 21 0 diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index 99b9ca8..e09e9ac 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -16,3 +16,5 @@ 1444387265354 test-addition 1 47 true 1444387373887 regression 1 0 true 1444387395306 regression 2 13 true +1444387479172 test-addition 1 44 true +1444387479173 test-addition 1 44 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index 32dda4c..c94704c 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -7,3 +7,4 @@ 1444387265353 test-addition 1 47 true 1444387373887 regression 1 0 false 1444387395306 regression 2 13 true +1444387479172 test-addition 1 44 true diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index 9ad2f29..ada1dff 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -7,3 +7,4 @@ 1444387265353 test-addition 1 87 true 1444387373887 regression 1 108 true 1444387395306 regression 2 21 true +1444387479172 test-addition 1 83 true From 14b8a6c22b5d50e61b011ce4fb67b6b2b2a00382 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:46:21 +0300 Subject: [PATCH 19/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index fa38ef2..bf2efe9 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -116,3 +116,4 @@ EditAction 1444387476092 TestCell.java 1405 6 18 6 UnitTestCaseAction 1444387479171 TestCell.java OK UnitTestSessionAction 1444387479172 TestCell OK EditAction 1444387577706 Cell.java 1383 9 21 0 +EditAction 1444387580729 TestCell.java 1406 6 18 6 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 4e6ff9d..0c0645b 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -75,7 +75,7 @@ public void testLiveCellLessThanTwoNeighborsShouldDie() { cell.nextIteration(1); //assert - assertEquals("Dead", cell.getState()); + assertEquals("Alive", cell.getState()); } From c6b5dae114f4390d0e70683f243fb76f0351a717 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:46:31 +0300 Subject: [PATCH 20/21] besouro automatic message --- .besouro/20151009120851591/actions.txt | 3 +++ src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index bf2efe9..357324d 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -117,3 +117,6 @@ UnitTestCaseAction 1444387479171 TestCell.java OK UnitTestSessionAction 1444387479172 TestCell OK EditAction 1444387577706 Cell.java 1383 9 21 0 EditAction 1444387580729 TestCell.java 1406 6 18 6 +UnitTestCaseAction 1444387585818 TestCell.java FAIL +UnitTestSessionAction 1444387585819 TestCell FAIL +EditAction 1444387590854 TestCell.java 1405 6 18 6 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 0c0645b..4e6ff9d 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -75,7 +75,7 @@ public void testLiveCellLessThanTwoNeighborsShouldDie() { cell.nextIteration(1); //assert - assertEquals("Alive", cell.getState()); + assertEquals("Dead", cell.getState()); } From c05a7ddab4e6a086ef02f5b1f0f20dfd232f7e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Niemel=C3=A4?= Date: Fri, 9 Oct 2015 13:55:02 +0300 Subject: [PATCH 21/21] Added tests and functionalities for checking game rules. --- .besouro/20151009120851591/actions.txt | 2 ++ .besouro/20151009120851591/besouroEpisodes.txt | 1 + .besouro/20151009120851591/randomHeuristicEpisodes.txt | 1 + .besouro/20151009120851591/zorroEpisodes.txt | 1 + 4 files changed, 5 insertions(+) diff --git a/.besouro/20151009120851591/actions.txt b/.besouro/20151009120851591/actions.txt index 357324d..9ce9ede 100644 --- a/.besouro/20151009120851591/actions.txt +++ b/.besouro/20151009120851591/actions.txt @@ -120,3 +120,5 @@ EditAction 1444387580729 TestCell.java 1406 6 18 6 UnitTestCaseAction 1444387585818 TestCell.java FAIL UnitTestSessionAction 1444387585819 TestCell FAIL EditAction 1444387590854 TestCell.java 1405 6 18 6 +UnitTestCaseAction 1444387595920 TestCell.java OK +UnitTestSessionAction 1444387595921 TestCell OK diff --git a/.besouro/20151009120851591/besouroEpisodes.txt b/.besouro/20151009120851591/besouroEpisodes.txt index e09e9ac..6f5036e 100644 --- a/.besouro/20151009120851591/besouroEpisodes.txt +++ b/.besouro/20151009120851591/besouroEpisodes.txt @@ -18,3 +18,4 @@ 1444387395306 regression 2 13 true 1444387479172 test-addition 1 44 true 1444387479173 test-addition 1 44 true +1444387595921 refactoring 2A 18 true diff --git a/.besouro/20151009120851591/randomHeuristicEpisodes.txt b/.besouro/20151009120851591/randomHeuristicEpisodes.txt index c94704c..b64cdb6 100644 --- a/.besouro/20151009120851591/randomHeuristicEpisodes.txt +++ b/.besouro/20151009120851591/randomHeuristicEpisodes.txt @@ -8,3 +8,4 @@ 1444387373887 regression 1 0 false 1444387395306 regression 2 13 true 1444387479172 test-addition 1 44 true +1444387595921 refactoring 2A 18 false diff --git a/.besouro/20151009120851591/zorroEpisodes.txt b/.besouro/20151009120851591/zorroEpisodes.txt index ada1dff..bf590c5 100644 --- a/.besouro/20151009120851591/zorroEpisodes.txt +++ b/.besouro/20151009120851591/zorroEpisodes.txt @@ -8,3 +8,4 @@ 1444387373887 regression 1 108 true 1444387395306 regression 2 21 true 1444387479172 test-addition 1 83 true +1444387595921 refactoring 2A 116 true