From 0d51788bd24bb081819537c9ae91c71a6d9beb1b Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:21:49 +0300 Subject: [PATCH 01/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 8 ++ .besouro/2015100912171338/besouroEpisodes.txt | 5 ++ .besouro/2015100912171338/disagreements.txt | 0 .../randomHeuristicEpisodes.txt | 1 + .besouro/2015100912171338/userComments.txt | 0 .besouro/2015100912171338/zorroEpisodes.txt | 1 + .classpath | 14 +-- .gitattributes | 34 +++---- .gitignore | 88 +++++++++---------- .project | 34 +++---- .../unioulu/tol/sqatlab/gameoflife/Cell.java | 23 +++-- .../tol/sqatlab/gameoflife/GameOfLife.java | 10 +-- .../unioulu/tol/sqatlab/gameoflife/Grid.java | 10 +-- .../tol/sqatlab/gameoflife/test/TestCell.java | 28 +++--- .../tol/sqatlab/gameoflife/test/TestGrid.java | 26 +++--- 15 files changed, 155 insertions(+), 127 deletions(-) create mode 100644 .besouro/2015100912171338/actions.txt create mode 100644 .besouro/2015100912171338/besouroEpisodes.txt create mode 100644 .besouro/2015100912171338/disagreements.txt create mode 100644 .besouro/2015100912171338/randomHeuristicEpisodes.txt create mode 100644 .besouro/2015100912171338/userComments.txt create mode 100644 .besouro/2015100912171338/zorroEpisodes.txt diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt new file mode 100644 index 0000000..1a71055 --- /dev/null +++ b/.besouro/2015100912171338/actions.txt @@ -0,0 +1,8 @@ +FileOpenedAction 1444382233633 TestCell.java 214 1 2 0 +RefactoringAction 1444382415295 TestCell.java ADD import org.unioulu.tol.sqatlab.gameoflife.Cell IMPORT +RefactoringAction 1444382419786 Cell.java ADD Cell(String) METHOD +RefactoringAction 1444382430462 Cell.java ADD void nextIteration() METHOD +RefactoringAction 1444382436071 Cell.java ADD Object getState() METHOD +UnitTestCaseAction 1444382465610 TestSudokuVerifier.java OK +UnitTestSessionAction 1444382465617 TestSudokuVerifier OK +EditAction 1444382508374 Cell.java 286 3 1 0 diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt new file mode 100644 index 0000000..9f3b1a3 --- /dev/null +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -0,0 +1,5 @@ +1444382465617 refactoring 2B 231 true +1444382465618 refactoring 2B 231 true +1444382465619 refactoring 2B 231 true +1444382465620 refactoring 2B 231 true +1444382465621 regression 1 231 true diff --git a/.besouro/2015100912171338/disagreements.txt b/.besouro/2015100912171338/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..7d1a06c --- /dev/null +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -0,0 +1 @@ +1444382465617 refactoring 2B 231 false diff --git a/.besouro/2015100912171338/userComments.txt b/.besouro/2015100912171338/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt new file mode 100644 index 0000000..7d1a06c --- /dev/null +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -0,0 +1 @@ +1444382465617 refactoring 2B 231 false diff --git a/.classpath b/.classpath index 3e0fb27..2d74975 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/.gitattributes b/.gitattributes index bdb0cab..7351b55 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,17 +1,17 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 80e4de2..4926921 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,44 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -/bin/ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +/bin/ diff --git a/.project b/.project index a31ebfd..4cbf201 100644 --- a/.project +++ b/.project @@ -1,17 +1,17 @@ - - - GameOfLife - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + + + GameOfLife + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index b66e9c8..d7032b2 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -1,5 +1,18 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class Cell { - -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class Cell { + + public Cell(String string) { + // TODO Auto-generated constructor stub + } + + public void nextIteration() { + // TODO Auto-generated method stub + + } + + public String getState() { + return "Dead"; + } + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java index dbd5f88..975cdf4 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java @@ -1,5 +1,5 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class GameOfLife { - -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class GameOfLife { + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 19dbf0b..23a1681 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -1,5 +1,5 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class Grid { - -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class Grid { + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index d8de09e..bf7f1b7 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -1,14 +1,14 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class TestCell { - - @Test - public void test() { - fail("Not yet implemented"); - } - -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class TestCell { + + @Test + public void test() { + fail("Not yet implemented"); + } + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index 9614d55..c31384d 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -1,13 +1,13 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -import static org.junit.Assert.*; -import org.junit.Test; - -public class TestGrid { - - @Test - public void test() { - fail("Not yet implemented"); - } - -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +import static org.junit.Assert.*; +import org.junit.Test; + +public class TestGrid { + + @Test + public void test() { + fail("Not yet implemented"); + } + +} From 61795fa4a7f961373c259cad81a06346843e7cc6 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:21:52 +0300 Subject: [PATCH 02/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 1 + .../unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 1a71055..ff3a217 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -6,3 +6,4 @@ RefactoringAction 1444382436071 Cell.java ADD Object getState() METHOD UnitTestCaseAction 1444382465610 TestSudokuVerifier.java OK UnitTestSessionAction 1444382465617 TestSudokuVerifier OK EditAction 1444382508374 Cell.java 286 3 1 0 +EditAction 1444382511620 TestCell.java 372 1 3 1 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index bf7f1b7..13ea034 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -3,12 +3,17 @@ import static org.junit.Assert.*; import org.junit.Test; +import org.unioulu.tol.sqatlab.gameoflife.Cell; public class TestCell { @Test - public void test() { - fail("Not yet implemented"); + public void testLiveCellWithNoNeighborsShouldDie() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(); + + assertEquals("Dead", cell.getState()); } } From 1caaf77c9aabdd4c36df59d296faef2c995b57a6 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:23:07 +0300 Subject: [PATCH 03/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 9 +++++++++ .besouro/2015100912171338/besouroEpisodes.txt | 1 + .besouro/2015100912171338/randomHeuristicEpisodes.txt | 1 + .besouro/2015100912171338/zorroEpisodes.txt | 1 + .../unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 9 +++++++++ 5 files changed, 21 insertions(+) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index ff3a217..2c8d907 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -7,3 +7,12 @@ UnitTestCaseAction 1444382465610 TestSudokuVerifier.java OK UnitTestSessionAction 1444382465617 TestSudokuVerifier OK EditAction 1444382508374 Cell.java 286 3 1 0 EditAction 1444382511620 TestCell.java 372 1 3 1 +UnitTestCaseAction 1444382515566 TestCell.java OK +UnitTestSessionAction 1444382515567 TestSudokuVerifier OK +RefactoringAction 1444382548606 TestCell.java ADD void testLiveCellWithNoNeighborsShouldDie()/2 METHOD +RefactoringAction 1444382556119 TestCell.java RENAME testLiveCellWithNoNeighborsShouldDie()/2=>void testLiveCellWithTNoNeighborsShouldDie() METHOD +RefactoringAction 1444382557134 TestCell.java RENAME testLiveCellWithTNoNeighborsShouldDie()=>void testLiveCellWithTwoNoNeighborsShouldDie() METHOD +RefactoringAction 1444382561150 TestCell.java RENAME testLiveCellWithTwoNoNeighborsShouldDie()=>void testLiveCellWithTwoNeighborsShouldDie() METHOD +RefactoringAction 1444382567164 TestCell.java RENAME testLiveCellWithTwoNeighborsShouldDie()=>void testLiveCellWithTwoNeighborsShould() METHOD +RefactoringAction 1444382568679 TestCell.java RENAME testLiveCellWithTwoNeighborsShould()=>void testLiveCellWithTwoNeighborsShouldLive() METHOD +EditAction 1444382586081 TestCell.java 554 2 6 2 diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt index 9f3b1a3..71033b4 100644 --- a/.besouro/2015100912171338/besouroEpisodes.txt +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -3,3 +3,4 @@ 1444382465619 refactoring 2B 231 true 1444382465620 refactoring 2B 231 true 1444382465621 regression 1 231 true +1444382515567 test-addition 1 7 true diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt index 7d1a06c..d115d99 100644 --- a/.besouro/2015100912171338/randomHeuristicEpisodes.txt +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -1 +1,2 @@ 1444382465617 refactoring 2B 231 false +1444382515567 test-addition 1 7 true diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt index 7d1a06c..0ed2a48 100644 --- a/.besouro/2015100912171338/zorroEpisodes.txt +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -1 +1,2 @@ 1444382465617 refactoring 2B 231 false +1444382515567 test-addition 1 49 false diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 13ea034..a28e331 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -15,5 +15,14 @@ public void testLiveCellWithNoNeighborsShouldDie() { assertEquals("Dead", cell.getState()); } + + @Test + public void testLiveCellWithTwoNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(); + + assertEquals("Alive", cell.getState()); + } } From 873f692fdc18e02dd4472011c24f9b14c453a9b2 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:30:19 +0300 Subject: [PATCH 04/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 8 ++++++++ .../unioulu/tol/sqatlab/gameoflife/Cell.java | 17 +++++++++++------ .../tol/sqatlab/gameoflife/test/TestCell.java | 4 ++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 2c8d907..43f2ac6 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -16,3 +16,11 @@ RefactoringAction 1444382561150 TestCell.java RENAME testLiveCellWithTwoNoNeighb RefactoringAction 1444382567164 TestCell.java RENAME testLiveCellWithTwoNeighborsShouldDie()=>void testLiveCellWithTwoNeighborsShould() METHOD RefactoringAction 1444382568679 TestCell.java RENAME testLiveCellWithTwoNeighborsShould()=>void testLiveCellWithTwoNeighborsShouldLive() METHOD EditAction 1444382586081 TestCell.java 554 2 6 2 +UnitTestCaseAction 1444382590154 TestCell.java FAIL +UnitTestSessionAction 1444382590155 TestSudokuVerifier FAIL +RefactoringAction 1444382637204 Cell.java ADD String state FIELD +UnitTestCaseAction 1444382698193 TestCell.java FAIL +UnitTestSessionAction 1444382698195 TestSudokuVerifier FAIL +RefactoringAction 1444382833794 Cell.java RENAME nextIteration()=>void nextIteration(int) METHOD +CompilationAction 1444383018701 TestCell.java +EditAction 1444383018830 TestCell.java 556 2 6 2 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index d7032b2..cd51a6a 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -2,17 +2,22 @@ public class Cell { - public Cell(String string) { - // TODO Auto-generated constructor stub + String state; + + public Cell(String initialState) { + this.state = initialState; } - public void nextIteration() { - // TODO Auto-generated method stub - + public void nextIteration(int numberOfLiveCells) { + if (state.equals("Alive") && numberOfLiveCells < 2){ + state = "Dead"; + }else{ + state = "Alive"; + } } public String getState() { - return "Dead"; + return this.state; } } diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index a28e331..0541c6c 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -11,7 +11,7 @@ public class TestCell { public void testLiveCellWithNoNeighborsShouldDie() { Cell cell = new Cell("Alive"); - cell.nextIteration(); + cell.nextIteration(0); assertEquals("Dead", cell.getState()); } @@ -20,7 +20,7 @@ public void testLiveCellWithNoNeighborsShouldDie() { public void testLiveCellWithTwoNeighborsShouldLive() { Cell cell = new Cell("Alive"); - cell.nextIteration(); + cell.nextIteration(2); assertEquals("Alive", cell.getState()); } From 73df4e9c6298c7bf63041f78168dc1029d5628e2 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:38:16 +0300 Subject: [PATCH 05/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 18 ++++++++++++++++++ .besouro/2015100912171338/besouroEpisodes.txt | 6 ++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/2015100912171338/zorroEpisodes.txt | 1 + .../tol/sqatlab/gameoflife/test/TestGrid.java | 11 +++++++++-- 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 43f2ac6..f2bb705 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -24,3 +24,21 @@ UnitTestSessionAction 1444382698195 TestSudokuVerifier FAIL RefactoringAction 1444382833794 Cell.java RENAME nextIteration()=>void nextIteration(int) METHOD CompilationAction 1444383018701 TestCell.java EditAction 1444383018830 TestCell.java 556 2 6 2 +UnitTestCaseAction 1444383022775 TestCell.java OK +UnitTestSessionAction 1444383022776 TestSudokuVerifier OK +RefactoringAction 1444383044962 TestCell.java ADD void testLiveCellWithTwoNeighborsShouldLive()/2 METHOD +RefactoringAction 1444383051475 TestCell.java RENAME testLiveCellWithTwoNeighborsShouldLive()/2=>void testDeadCellWithTwoNeighborsShouldLive() METHOD +RefactoringAction 1444383055986 TestCell.java RENAME testDeadCellWithTwoNeighborsShouldLive()=>void testDeadCellWithNeighborsShouldLive() METHOD +RefactoringAction 1444383057495 TestCell.java RENAME testDeadCellWithNeighborsShouldLive()=>void testDeadCellWithNoNeighborsShouldLive() METHOD +RefactoringAction 1444383061508 TestCell.java RENAME testDeadCellWithNoNeighborsShouldLive()=>void testDeadCellWithNoLiveNeighborsShouldLive() METHOD +RefactoringAction 1444383115925 TestGrid.java RENAME test()=>void single() METHOD +RefactoringAction 1444383118433 TestGrid.java RENAME single()=>void singleCell() METHOD +RefactoringAction 1444383215745 TestGrid.java ADD import org.unioulu.tol.sqatlab.gameoflife.Grid IMPORT +RefactoringAction 1444383218728 TestGrid.java ADD import org.unioulu.tol.sqatlab.gameoflife.Cell IMPORT +RefactoringAction 1444383423489 Cell.java ADD Cell(int, int) METHOD +RefactoringAction 1444383433108 Cell.java RENAME Cell(int, int)=>Cell(int) METHOD +RefactoringAction 1444383434118 Cell.java RENAME Cell(int)=>Cell(int, int) METHOD +RefactoringAction 1444383447647 Cell.java ADD int x FIELD +RefactoringAction 1444383450670 Cell.java ADD int y FIELD +RefactoringAction 1444383487607 Grid.java ADD int getNeighbors(Cell) METHOD +EditAction 1444383495726 TestGrid.java 430 1 4 1 diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt index 71033b4..5af3cb5 100644 --- a/.besouro/2015100912171338/besouroEpisodes.txt +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -4,3 +4,9 @@ 1444382465620 refactoring 2B 231 true 1444382465621 regression 1 231 true 1444382515567 test-addition 1 7 true +1444383022776 test-addition 2 474 true +1444383022777 test-addition 2 474 true +1444383022778 test-addition 1 474 true +1444383022779 test-addition 2 474 true +1444383022780 test-addition 2 474 true +1444383022781 test-addition 1 474 true diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt index d115d99..46195c3 100644 --- a/.besouro/2015100912171338/randomHeuristicEpisodes.txt +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -1,2 +1,3 @@ 1444382465617 refactoring 2B 231 false 1444382515567 test-addition 1 7 true +1444383022776 test-addition 2 474 false diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt index 0ed2a48..a26e088 100644 --- a/.besouro/2015100912171338/zorroEpisodes.txt +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -1,2 +1,3 @@ 1444382465617 refactoring 2B 231 false 1444382515567 test-addition 1 49 false +1444383022776 test-addition 2 507 false diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index c31384d..1939ad1 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -2,12 +2,19 @@ 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 singleCell() { + Grid grid = new Grid(); + Cell cell = new Cell(0,0); + + int numNeighbors = grid.getNeighbors(cell); + + assertEquals(0, numNeighbors); } } From 9641b899e9850eb5e1d89baeed8e77fc0a664ce7 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:38:21 +0300 Subject: [PATCH 06/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index f2bb705..c519aba 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -42,3 +42,4 @@ RefactoringAction 1444383447647 Cell.java ADD int x FIELD RefactoringAction 1444383450670 Cell.java ADD int y FIELD RefactoringAction 1444383487607 Grid.java ADD int getNeighbors(Cell) METHOD EditAction 1444383495726 TestGrid.java 430 1 4 1 +EditAction 1444383500314 Grid.java 169 1 1 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 23a1681..254eea3 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -2,4 +2,9 @@ public class Grid { + public int getNeighbors(Cell cell) { + // TODO Auto-generated method stub + return 0; + } + } From a08fc6f5b0e0cdf077c88ee594abfe345a53ba33 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:38:24 +0300 Subject: [PATCH 07/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/Cell.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index c519aba..e187a39 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -43,3 +43,4 @@ RefactoringAction 1444383450670 Cell.java ADD int y FIELD RefactoringAction 1444383487607 Grid.java ADD int getNeighbors(Cell) METHOD EditAction 1444383495726 TestGrid.java 430 1 4 1 EditAction 1444383500314 Grid.java 169 1 1 0 +EditAction 1444383503273 Cell.java 477 4 5 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index cd51a6a..957360f 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -3,11 +3,18 @@ public class Cell { String state; + int x; + int y; public Cell(String initialState) { this.state = initialState; } + public Cell(int x, int y) { + this.x = x; + this.y = y; + } + public void nextIteration(int numberOfLiveCells) { if (state.equals("Alive") && numberOfLiveCells < 2){ state = "Dead"; From 2283b411e51ca693b4a857c4ef6971ae3f1e7be8 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:38:27 +0300 Subject: [PATCH 08/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index e187a39..8bb17bd 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -44,3 +44,4 @@ RefactoringAction 1444383487607 Grid.java ADD int getNeighbors(Cell) METHOD EditAction 1444383495726 TestGrid.java 430 1 4 1 EditAction 1444383500314 Grid.java 169 1 1 0 EditAction 1444383503273 Cell.java 477 4 5 0 +EditAction 1444383506438 TestCell.java 739 3 9 3 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 0541c6c..4f246b9 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -25,4 +25,12 @@ public void testLiveCellWithTwoNeighborsShouldLive() { assertEquals("Alive", cell.getState()); } + @Test + public void testDeadCellWithNoLiveNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(2); + + assertEquals("Alive", cell.getState()); + } } From 20cbf432cf91cba374a73e543dac5720aa1841dc Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:40:37 +0300 Subject: [PATCH 09/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 16 +++++ .besouro/2015100912171338/besouroEpisodes.txt | 64 +++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/2015100912171338/zorroEpisodes.txt | 1 + .../tol/sqatlab/gameoflife/test/TestGrid.java | 9 ++- 5 files changed, 88 insertions(+), 3 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 8bb17bd..0dbbc27 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -45,3 +45,19 @@ EditAction 1444383495726 TestGrid.java 430 1 4 1 EditAction 1444383500314 Grid.java 169 1 1 0 EditAction 1444383503273 Cell.java 477 4 5 0 EditAction 1444383506438 TestCell.java 739 3 9 3 +UnitTestCaseAction 1444383512002 TestGrid.java OK +UnitTestSessionAction 1444383512008 TestGrid OK +RefactoringAction 1444383551595 TestGrid.java ADD void singleCell()/2 METHOD +RefactoringAction 1444383562104 TestGrid.java RENAME singleCell()/2=>void test() METHOD +RefactoringAction 1444383565120 TestGrid.java RENAME test()=>void testSingle() METHOD +RefactoringAction 1444383567129 TestGrid.java RENAME testSingle()=>void testSingleCell() METHOD +RefactoringAction 1444383568643 TestGrid.java RENAME testSingleCell()=>void testSingleCellOn() METHOD +RefactoringAction 1444383571153 TestGrid.java RENAME testSingleCellOn()=>void testSingleCellOnGrid() METHOD +RefactoringAction 1444383572664 TestGrid.java RENAME testSingleCellOnGrid()=>void testSingleCellOnGridHas() METHOD +RefactoringAction 1444383573673 TestGrid.java RENAME testSingleCellOnGridHas()=>void testSingleCellOnGridHasNo() METHOD +RefactoringAction 1444383576181 TestGrid.java RENAME testSingleCellOnGridHasNo()=>void testSingleCellOnGridHasNoNeig() METHOD +RefactoringAction 1444383577693 TestGrid.java RENAME testSingleCellOnGridHasNoNeig()=>void testSingleCellOnGridHasNoNeigh() METHOD +RefactoringAction 1444383579702 TestGrid.java RENAME testSingleCellOnGridHasNoNeigh()=>void testSingleCellOnGridHasNoNeighbors() METHOD +RefactoringAction 1444383599234 TestGrid.java REMOVE singleCell() METHOD +RefactoringAction 1444383622259 Grid.java ADD void addCell(Cell) METHOD +EditAction 1444383636118 TestGrid.java 495 1 5 1 diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt index 5af3cb5..4a5a040 100644 --- a/.besouro/2015100912171338/besouroEpisodes.txt +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -10,3 +10,67 @@ 1444383022779 test-addition 2 474 true 1444383022780 test-addition 2 474 true 1444383022781 test-addition 1 474 true +1444383512008 refactoring 3 467 true +1444383512009 refactoring 3 467 true +1444383512010 refactoring 3 467 true +1444383512011 refactoring 3 467 true +1444383512012 refactoring 3 467 true +1444383512013 refactoring 3 467 true +1444383512014 refactoring 3 467 true +1444383512015 refactoring 3 467 true +1444383512016 refactoring 3 467 true +1444383512017 refactoring 3 467 true +1444383512018 refactoring 3 467 true +1444383512019 refactoring 3 467 true +1444383512020 refactoring 3 467 true +1444383512021 refactoring 3 467 true +1444383512022 refactoring 3 467 true +1444383512023 refactoring 3 467 true +1444383512024 refactoring 3 467 true +1444383512025 refactoring 3 467 true +1444383512026 refactoring 3 467 true +1444383512027 refactoring 3 467 true +1444383512028 refactoring 3 467 true +1444383512029 refactoring 3 467 true +1444383512030 refactoring 3 467 true +1444383512031 refactoring 3 467 true +1444383512032 refactoring 3 467 true +1444383512033 refactoring 3 467 true +1444383512034 refactoring 3 467 true +1444383512035 refactoring 3 467 true +1444383512036 refactoring 3 467 true +1444383512037 refactoring 3 467 true +1444383512038 refactoring 3 467 true +1444383512039 refactoring 3 467 true +1444383512040 refactoring 3 467 true +1444383512041 refactoring 3 467 true +1444383512042 refactoring 3 467 true +1444383512043 refactoring 3 467 true +1444383512044 refactoring 3 467 true +1444383512045 refactoring 3 467 true +1444383512046 refactoring 3 467 true +1444383512047 refactoring 3 467 true +1444383512048 refactoring 3 467 true +1444383512049 refactoring 3 467 true +1444383512050 refactoring 3 467 true +1444383512051 refactoring 3 467 true +1444383512052 refactoring 3 467 true +1444383512053 refactoring 3 467 true +1444383512054 refactoring 3 467 true +1444383512055 refactoring 3 467 true +1444383512056 refactoring 3 467 true +1444383512057 refactoring 3 467 true +1444383512058 refactoring 3 467 true +1444383512059 refactoring 3 467 true +1444383512060 refactoring 3 467 true +1444383512061 refactoring 3 467 true +1444383512062 refactoring 3 467 true +1444383512063 refactoring 3 467 true +1444383512064 refactoring 3 467 true +1444383512065 refactoring 3 467 true +1444383512066 refactoring 3 467 true +1444383512067 refactoring 3 467 true +1444383512068 refactoring 3 467 true +1444383512069 refactoring 3 467 true +1444383512070 refactoring 3 467 true +1444383512071 refactoring 3 467 true diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt index 46195c3..0e2b7d5 100644 --- a/.besouro/2015100912171338/randomHeuristicEpisodes.txt +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -1,3 +1,4 @@ 1444382465617 refactoring 2B 231 false 1444382515567 test-addition 1 7 true 1444383022776 test-addition 2 474 false +1444383512008 refactoring 3 467 true diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt index a26e088..473f1b5 100644 --- a/.besouro/2015100912171338/zorroEpisodes.txt +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -1,3 +1,4 @@ 1444382465617 refactoring 2B 231 false 1444382515567 test-addition 1 49 false 1444383022776 test-addition 2 507 false +1444383512008 refactoring 3 489 false diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index 1939ad1..8572823 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -8,13 +8,16 @@ public class TestGrid { @Test - public void singleCell() { + public void testSingleCellOnGridHasNoNeighbors() { + //arrange Grid grid = new Grid(); Cell cell = new Cell(0,0); + + grid.addCell(cell); int numNeighbors = grid.getNeighbors(cell); assertEquals(0, numNeighbors); - } - + } + } From e04ee1861893277c9fe7d87824a9c7372dda1bd1 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:40:40 +0300 Subject: [PATCH 10/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 2 ++ src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 0dbbc27..b5bdf1a 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -61,3 +61,5 @@ RefactoringAction 1444383579702 TestGrid.java RENAME testSingleCellOnGridHasNoNe RefactoringAction 1444383599234 TestGrid.java REMOVE singleCell() METHOD RefactoringAction 1444383622259 Grid.java ADD void addCell(Cell) METHOD EditAction 1444383636118 TestGrid.java 495 1 5 1 +CompilationAction 1444383639351 TestGrid.java +EditAction 1444383639487 Grid.java 252 2 1 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 254eea3..619e5bb 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -7,4 +7,9 @@ public int getNeighbors(Cell cell) { return 0; } + public void addCell(Cell cell) { + // TODO Auto-generated method stub + + } + } From 372442cd9921eaadf3d793f11184f5348b7353c0 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:42:43 +0300 Subject: [PATCH 11/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 16 ++++++++++++++++ .besouro/2015100912171338/besouroEpisodes.txt | 1 + .../2015100912171338/randomHeuristicEpisodes.txt | 1 + .besouro/2015100912171338/zorroEpisodes.txt | 9 +++++---- .../tol/sqatlab/gameoflife/test/TestGrid.java | 14 ++++++++++++++ 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index b5bdf1a..0f52bdf 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -63,3 +63,19 @@ RefactoringAction 1444383622259 Grid.java ADD void addCell(Cell) METHOD EditAction 1444383636118 TestGrid.java 495 1 5 1 CompilationAction 1444383639351 TestGrid.java EditAction 1444383639487 Grid.java 252 2 1 0 +UnitTestCaseAction 1444383645588 TestGrid.java OK +UnitTestSessionAction 1444383645589 TestGrid OK +RefactoringAction 1444383652871 TestGrid.java ADD void testSingleCellOnGridHasNoNeighbors()/2 METHOD +RefactoringAction 1444383721604 TestGrid.java RENAME testSingleCellOnGridHasNoNeighbors()/2=>void testCellOnGridHasNoNeighbors() METHOD +RefactoringAction 1444383723615 TestGrid.java RENAME testCellOnGridHasNoNeighbors()=>void testTwoCellOnGridHasNoNeighbors() METHOD +RefactoringAction 1444383727627 TestGrid.java RENAME testTwoCellOnGridHasNoNeighbors()=>void testTwoNeightCellOnGridHasNoNeighbors() METHOD +RefactoringAction 1444383729642 TestGrid.java RENAME testTwoNeightCellOnGridHasNoNeighbors()=>void testTwoNeightborCellOnGridHasNoNeighbors() METHOD +RefactoringAction 1444383731654 TestGrid.java RENAME testTwoNeightborCellOnGridHasNoNeighbors()=>void testTwoNeightborCellCellOnGridHasNoNeighbors() METHOD +RefactoringAction 1444383735664 TestGrid.java RENAME testTwoNeightborCellCellOnGridHasNoNeighbors()=>void testTwoNeightborCells() METHOD +RefactoringAction 1444383740175 TestGrid.java RENAME testTwoNeightborCells()=>void testTwoNeightborCellsShouldHave() METHOD +RefactoringAction 1444383742186 TestGrid.java RENAME testTwoNeightborCellsShouldHave()=>void testTwoNeightborCellsShouldHaveOne() METHOD +RefactoringAction 1444383747202 TestGrid.java RENAME testTwoNeightborCellsShouldHaveOne()=>void testTwoNeightborCellsShouldHaveOneNe() METHOD +RefactoringAction 1444383749716 TestGrid.java RENAME testTwoNeightborCellsShouldHaveOneNe()=>void testTwoNeightborCellsShouldHaveOneNeight() METHOD +RefactoringAction 1444383751727 TestGrid.java RENAME testTwoNeightborCellsShouldHaveOneNeight()=>void testTwoNeightborCellsShouldHaveOneNeighbi() METHOD +RefactoringAction 1444383755246 TestGrid.java RENAME testTwoNeightborCellsShouldHaveOneNeighbi()=>void testTwoNeightborCellsShouldHaveOneNeighbor() METHOD +EditAction 1444383761912 TestGrid.java 811 2 12 2 diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt index 4a5a040..5517b24 100644 --- a/.besouro/2015100912171338/besouroEpisodes.txt +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -74,3 +74,4 @@ 1444383512069 refactoring 3 467 true 1444383512070 refactoring 3 467 true 1444383512071 refactoring 3 467 true +1444383645589 test-first 2 93 true diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt index 0e2b7d5..5bb1bfc 100644 --- a/.besouro/2015100912171338/randomHeuristicEpisodes.txt +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -2,3 +2,4 @@ 1444382515567 test-addition 1 7 true 1444383022776 test-addition 2 474 false 1444383512008 refactoring 3 467 true +1444383645589 test-first 2 93 true diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt index 473f1b5..16c1605 100644 --- a/.besouro/2015100912171338/zorroEpisodes.txt +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -1,4 +1,5 @@ -1444382465617 refactoring 2B 231 false -1444382515567 test-addition 1 49 false -1444383022776 test-addition 2 507 false -1444383512008 refactoring 3 489 false +1444382465617 refactoring 2B 231 true +1444382515567 test-addition 1 49 true +1444383022776 test-addition 2 507 true +1444383512008 refactoring 3 489 true +1444383645589 test-first 2 133 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index 8572823..d2f47dc 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -20,4 +20,18 @@ public void testSingleCellOnGridHasNoNeighbors() { assertEquals(0, numNeighbors); } + @Test + public void testTwoNeightborCellsShouldHaveOneNeighbor() { + //arrange + 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 84ce07457cfbe26fcc4cc063ba60127625c9a9c3 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 12:58:50 +0300 Subject: [PATCH 12/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 9 ++++++ .../unioulu/tol/sqatlab/gameoflife/Cell.java | 31 +++++++++++++++++++ .../unioulu/tol/sqatlab/gameoflife/Grid.java | 9 ++++-- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 0f52bdf..ba89158 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -79,3 +79,12 @@ RefactoringAction 1444383749716 TestGrid.java RENAME testTwoNeightborCellsShould RefactoringAction 1444383751727 TestGrid.java RENAME testTwoNeightborCellsShouldHaveOneNeight()=>void testTwoNeightborCellsShouldHaveOneNeighbi() METHOD RefactoringAction 1444383755246 TestGrid.java RENAME testTwoNeightborCellsShouldHaveOneNeighbi()=>void testTwoNeightborCellsShouldHaveOneNeighbor() METHOD EditAction 1444383761912 TestGrid.java 811 2 12 2 +UnitTestCaseAction 1444383766613 TestGrid.java FAIL +UnitTestSessionAction 1444383766614 TestGrid.testTwoNeightborCellsShouldHaveOneNeighbor FAIL +RefactoringAction 1444384611457 Grid.java ADD Set cell FIELD +RefactoringAction 1444384612467 Grid.java RENAME cell=>Set cells FIELD +RefactoringAction 1444384635501 Grid.java ADD import java.util.HashSet IMPORT +RefactoringAction 1444384647069 Grid.java ADD import java.util.Set IMPORT +RefactoringAction 1444384705120 Cell.java ADD int hashCode() METHOD +RefactoringAction 1444384705122 Cell.java ADD boolean equals(Object) METHOD +EditAction 1444384729803 Cell.java 1158 6 19 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 957360f..2e346a0 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -2,6 +2,37 @@ public class Cell { + @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; + } + String state; int x; int y; diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 619e5bb..4dd554c 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -1,15 +1,18 @@ package org.unioulu.tol.sqatlab.gameoflife; +import java.util.HashSet; +import java.util.Set; + public class Grid { + private Set cells = new HashSet<>(); + public int getNeighbors(Cell cell) { - // TODO Auto-generated method stub return 0; } public void addCell(Cell cell) { - // TODO Auto-generated method stub - + cells.add(cell); } } From c69c1c9958b50c465e82c9b07f24a328afb4527f Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:04:33 +0300 Subject: [PATCH 13/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 16 ++++++++++++++++ src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 3 +++ 2 files changed, 19 insertions(+) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index ba89158..988b342 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -88,3 +88,19 @@ RefactoringAction 1444384647069 Grid.java ADD import java.util.Set IMPORT RefactoringAction 1444384705120 Cell.java ADD int hashCode() METHOD RefactoringAction 1444384705122 Cell.java ADD boolean equals(Object) METHOD EditAction 1444384729803 Cell.java 1158 6 19 0 +UnitTestCaseAction 1444384734043 TestGrid.java FAIL +UnitTestSessionAction 1444384734044 TestGrid.testTwoNeightborCellsShouldHaveOneNeighbor FAIL +UnitTestCaseAction 1444384741808 TestGrid.java FAIL +UnitTestSessionAction 1444384741809 TestGrid FAIL +RefactoringAction 1444384962243 Cell.java REMOVE hashCode() METHOD +RefactoringAction 1444384962244 Cell.java REMOVE equals(Object) METHOD +RefactoringAction 1444384968269 Cell.java ADD int hashCode() METHOD +RefactoringAction 1444384968270 Cell.java ADD boolean equals(Object) METHOD +RefactoringAction 1444384987843 Cell.java ADD int get() METHOD +RefactoringAction 1444384993854 Cell.java RENAME get()=>int getX() METHOD +RefactoringAction 1444385009373 Cell.java REMOVE getX() METHOD +RefactoringAction 1444385029386 Cell.java ADD int getX() METHOD +RefactoringAction 1444385029387 Cell.java ADD void setX(int) METHOD +RefactoringAction 1444385029388 Cell.java ADD int getY() METHOD +RefactoringAction 1444385029389 Cell.java ADD void setY(int) METHOD +EditAction 1444385072192 Grid.java 345 2 3 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 4dd554c..11f968b 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -8,6 +8,9 @@ public class Grid { private Set cells = new HashSet<>(); public int getNeighbors(Cell cell) { + Set neigbors = new HashSet(); + + return 0; } From a4dada57dbd61ec4032b5291e2c99a9091cdd7dd Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:04:37 +0300 Subject: [PATCH 14/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 1 + .../unioulu/tol/sqatlab/gameoflife/Cell.java | 68 ++++++++++++------- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 988b342..1489425 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -104,3 +104,4 @@ RefactoringAction 1444385029387 Cell.java ADD void setX(int) METHOD RefactoringAction 1444385029388 Cell.java ADD int getY() METHOD RefactoringAction 1444385029389 Cell.java ADD void setY(int) METHOD EditAction 1444385072192 Grid.java 345 2 3 0 +EditAction 1444385076545 Cell.java 1341 10 23 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 2e346a0..3dde0ac 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -1,7 +1,49 @@ package org.unioulu.tol.sqatlab.gameoflife; public class Cell { + String state; + int x; + int y; + + public Cell(String initialState) { + this.state = initialState; + } + + public Cell(int x, int y) { + this.x = x; + this.y = y; + } + + + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public void nextIteration(int numberOfLiveCells) { + if (state.equals("Alive") && numberOfLiveCells < 2){ + state = "Dead"; + }else{ + state = "Alive"; + } + } + public String getState() { + return this.state; + } + @Override public int hashCode() { final int prime = 31; @@ -32,30 +74,4 @@ public boolean equals(Object obj) { return false; return true; } - - String state; - int x; - int y; - - public Cell(String initialState) { - this.state = initialState; - } - - public Cell(int x, int y) { - this.x = x; - this.y = y; - } - - public void nextIteration(int numberOfLiveCells) { - if (state.equals("Alive") && numberOfLiveCells < 2){ - state = "Dead"; - }else{ - state = "Alive"; - } - } - - public String getState() { - return this.state; - } - } From 61ad301577ebaa42f45f929745e7cbac2036e505 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:12:50 +0300 Subject: [PATCH 15/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 6 ++++++ src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 1489425..1f7e13d 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -105,3 +105,9 @@ RefactoringAction 1444385029388 Cell.java ADD int getY() METHOD RefactoringAction 1444385029389 Cell.java ADD void setY(int) METHOD EditAction 1444385072192 Grid.java 345 2 3 0 EditAction 1444385076545 Cell.java 1341 10 23 0 +RefactoringAction 1444385519937 Grid.java RENAME getNeighbors(Cell)=>int getNumNeighbors(Cell) METHOD +RefactoringAction 1444385521950 Grid.java RENAME getNumNeighbors(Cell)=>int geNeighbors(Cell) METHOD +RefactoringAction 1444385522960 Grid.java RENAME geNeighbors(Cell)=>int getNeighbors(Cell) METHOD +RefactoringAction 1444385563567 Grid.java RENAME getNeighbors(Cell)=>int getNumNeighbors(Cell) METHOD +RefactoringAction 1444385567488 Grid.java RENAME getNumNeighbors(Cell)=>int getNeighbors(Cell) METHOD +EditAction 1444385569490 TestGrid.java 817 2 12 2 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index d2f47dc..6598791 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -15,7 +15,7 @@ public void testSingleCellOnGridHasNoNeighbors() { grid.addCell(cell); - int numNeighbors = grid.getNeighbors(cell); + int numNeighbors = grid.getNumNeighbors(cell); assertEquals(0, numNeighbors); } @@ -30,7 +30,7 @@ public void testTwoNeightborCellsShouldHaveOneNeighbor() { grid.addCell(cell1); grid.addCell(cell2); - int numNeighbors = grid.getNeighbors(cell1); + int numNeighbors = grid.getNumNeighbors(cell1); assertEquals(1, numNeighbors); } From c83851efcf206f078b3321eabad9f98d010d00df Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:14:05 +0300 Subject: [PATCH 16/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 6 ++++++ src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 1f7e13d..0122fc1 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -111,3 +111,9 @@ RefactoringAction 1444385522960 Grid.java RENAME geNeighbors(Cell)=>int getNeigh RefactoringAction 1444385563567 Grid.java RENAME getNeighbors(Cell)=>int getNumNeighbors(Cell) METHOD RefactoringAction 1444385567488 Grid.java RENAME getNumNeighbors(Cell)=>int getNeighbors(Cell) METHOD EditAction 1444385569490 TestGrid.java 817 2 12 2 +CompilationAction 1444385572727 TestGrid.java +UnitTestCaseAction 1444385616863 TestGrid.java FAIL +UnitTestSessionAction 1444385616864 TestGrid FAIL +UnitTestCaseAction 1444385630397 TestGrid.java FAIL +UnitTestSessionAction 1444385630398 TestGrid FAIL +EditAction 1444385644616 Grid.java 527 2 5 0 diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 11f968b..1cf0524 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -7,11 +7,18 @@ public class Grid { private Set cells = new HashSet<>(); - public int getNeighbors(Cell cell) { - Set neigbors = new HashSet(); - + public int getNumNeighbors(Cell cell) { + int numNeighbors =0; + Set neigborhood = new HashSet(); + + for(int i=-1;i<=1;i++){ + Cell neighbor = new Cell(cell.x, cell.y + i); + if(cells.contains(neighbor)){ + numNeighbors++; + } + } - return 0; + return numNeighbors; } public void addCell(Cell cell) { From a8adb33522b8565e31ff7d43f2098c46393613a2 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:16:17 +0300 Subject: [PATCH 17/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 11 +++++++++ .besouro/2015100912171338/besouroEpisodes.txt | 24 +++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/2015100912171338/zorroEpisodes.txt | 1 + .../unioulu/tol/sqatlab/gameoflife/Grid.java | 5 ++-- .../tol/sqatlab/gameoflife/test/TestGrid.java | 15 ++++++++++++ 6 files changed, 54 insertions(+), 3 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 0122fc1..85e0343 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -117,3 +117,14 @@ UnitTestSessionAction 1444385616864 TestGrid FAIL UnitTestCaseAction 1444385630397 TestGrid.java FAIL UnitTestSessionAction 1444385630398 TestGrid FAIL EditAction 1444385644616 Grid.java 527 2 5 0 +UnitTestCaseAction 1444385650807 TestGrid.java FAIL +UnitTestSessionAction 1444385650808 TestGrid FAIL +UnitTestCaseAction 1444385694951 TestGrid.java OK +UnitTestSessionAction 1444385694952 TestGrid OK +RefactoringAction 1444385741316 TestGrid.java ADD void testTwoNeightborCellsShouldHaveOneNeighbor()/2 METHOD +RefactoringAction 1444385766354 TestGrid.java RENAME testTwoNeightborCellsShouldHaveOneNeighbor()/2=>void testTwoNeightborCellsOnShouldHaveOneNeighbor() METHOD +RefactoringAction 1444385768366 TestGrid.java RENAME testTwoNeightborCellsOnShouldHaveOneNeighbor()=>void testTwoNeightborCellsOnDiShouldHaveOneNeighbor() METHOD +RefactoringAction 1444385770888 TestGrid.java RENAME testTwoNeightborCellsOnDiShouldHaveOneNeighbor()=>void testTwoNeightborCellsOnDifferentShouldHaveOneNeighbor() METHOD +RefactoringAction 1444385772397 TestGrid.java RENAME testTwoNeightborCellsOnDifferentShouldHaveOneNeighbor()=>void testTwoNeightborCellsOnDifferentRowShouldHaveOneNeighbor() METHOD +RefactoringAction 1444385773407 TestGrid.java RENAME testTwoNeightborCellsOnDifferentRowShouldHaveOneNeighbor()=>void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() METHOD +EditAction 1444385776507 TestGrid.java 1154 3 19 3 diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt index 5517b24..9e5d649 100644 --- a/.besouro/2015100912171338/besouroEpisodes.txt +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -75,3 +75,27 @@ 1444383512070 refactoring 3 467 true 1444383512071 refactoring 3 467 true 1444383645589 test-first 2 93 true +1444385694952 test-first 1 2042 true +1444385694953 test-first 1 2042 true +1444385694954 test-first 1 2042 true +1444385694955 test-first 1 2042 true +1444385694956 test-first 1 2042 true +1444385694957 test-first 1 2042 true +1444385694958 test-first 1 2042 true +1444385694959 test-first 1 2042 true +1444385694960 test-first 1 2042 true +1444385694961 test-first 1 2042 true +1444385694962 test-first 1 2042 true +1444385694963 test-first 1 2042 true +1444385694964 test-first 1 2042 true +1444385694965 test-first 1 2042 true +1444385694966 test-first 1 2042 true +1444385694967 test-first 1 2042 true +1444385694968 test-first 1 2042 true +1444385694969 test-first 1 2042 true +1444385694970 test-first 1 2042 true +1444385694971 test-first 1 2042 true +1444385694972 test-first 1 2042 true +1444385694973 test-first 1 2042 true +1444385694974 test-first 1 2042 true +1444385694975 test-first 1 2042 true diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt index 5bb1bfc..bf7a59f 100644 --- a/.besouro/2015100912171338/randomHeuristicEpisodes.txt +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -3,3 +3,4 @@ 1444383022776 test-addition 2 474 false 1444383512008 refactoring 3 467 true 1444383645589 test-first 2 93 true +1444385694952 test-first 1 2042 true diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt index 16c1605..2d56370 100644 --- a/.besouro/2015100912171338/zorroEpisodes.txt +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -3,3 +3,4 @@ 1444383022776 test-addition 2 507 true 1444383512008 refactoring 3 489 true 1444383645589 test-first 2 133 true +1444385694952 test-first 1 2049 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 1cf0524..7ffa0bd 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -8,7 +8,7 @@ public class Grid { private Set cells = new HashSet<>(); public int getNumNeighbors(Cell cell) { - int numNeighbors =0; + int numNeighbors = 0; Set neigborhood = new HashSet(); for(int i=-1;i<=1;i++){ @@ -17,8 +17,7 @@ public int getNumNeighbors(Cell cell) { numNeighbors++; } } - - return numNeighbors; + 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 6598791..a8867be 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -34,4 +34,19 @@ public void testTwoNeightborCellsShouldHaveOneNeighbor() { assertEquals(1, numNeighbors); } + + @Test + public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { + //arrange + Grid grid = new Grid(); + Cell cell1 = new Cell(0,0); + Cell cell2 = new Cell(1,0); + + grid.addCell(cell1); + grid.addCell(cell2); + + int numNeighbors = grid.getNumNeighbors(cell1); + + assertEquals(1, numNeighbors); + } } From 67894a890576f63c01f55def8d8a82b6fac5a4a0 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:32:42 +0300 Subject: [PATCH 18/21] besouro automatic message --- .besouro/2015100912171338/actions.txt | 5 +++++ .besouro/2015100912171338/besouroEpisodes.txt | 4 ++++ .../2015100912171338/randomHeuristicEpisodes.txt | 1 + .besouro/2015100912171338/zorroEpisodes.txt | 1 + src/org/unioulu/tol/sqatlab/gameoflife/Grid.java | 12 +++++++----- .../tol/sqatlab/gameoflife/test/TestGrid.java | 4 ++++ 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 85e0343..2873d01 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -128,3 +128,8 @@ RefactoringAction 1444385770888 TestGrid.java RENAME testTwoNeightborCellsOnDiSh RefactoringAction 1444385772397 TestGrid.java RENAME testTwoNeightborCellsOnDifferentShouldHaveOneNeighbor()=>void testTwoNeightborCellsOnDifferentRowShouldHaveOneNeighbor() METHOD RefactoringAction 1444385773407 TestGrid.java RENAME testTwoNeightborCellsOnDifferentRowShouldHaveOneNeighbor()=>void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() METHOD EditAction 1444385776507 TestGrid.java 1154 3 19 3 +UnitTestCaseAction 1444385780901 TestGrid.java FAIL +UnitTestSessionAction 1444385780902 TestGrid.testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor FAIL +UnitTestCaseAction 1444385871729 TestGrid.java OK +UnitTestSessionAction 1444385871731 TestGrid OK +EditAction 1444386761596 TestGrid.java 1198 3 19 3 diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt index 9e5d649..973e254 100644 --- a/.besouro/2015100912171338/besouroEpisodes.txt +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -99,3 +99,7 @@ 1444385694973 test-first 1 2042 true 1444385694974 test-first 1 2042 true 1444385694975 test-first 1 2042 true +1444385871731 test-addition 2 130 true +1444385871732 test-addition 1 130 true +1444385871733 test-addition 2 130 true +1444385871734 test-addition 1 130 true diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt index bf7a59f..594f61c 100644 --- a/.besouro/2015100912171338/randomHeuristicEpisodes.txt +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -4,3 +4,4 @@ 1444383512008 refactoring 3 467 true 1444383645589 test-first 2 93 true 1444385694952 test-first 1 2042 true +1444385871731 test-addition 2 130 false diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt index 2d56370..33ee37a 100644 --- a/.besouro/2015100912171338/zorroEpisodes.txt +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -4,3 +4,4 @@ 1444383512008 refactoring 3 489 true 1444383645589 test-first 2 133 true 1444385694952 test-first 1 2049 true +1444385871731 test-addition 2 176 true diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 7ffa0bd..0a6114f 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -6,15 +6,17 @@ public class Grid { private Set cells = new HashSet<>(); - + public int getNumNeighbors(Cell cell) { int numNeighbors = 0; Set neigborhood = new HashSet(); - for(int i=-1;i<=1;i++){ - Cell neighbor = new Cell(cell.x, 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; diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index a8867be..b2238d5 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -49,4 +49,8 @@ public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { assertEquals(1, numNeighbors); } + + //adding State and live neighbor + + } From 2477bd8e74589941c69ae4ba4c730df6fb0919b4 Mon Sep 17 00:00:00 2001 From: BartlomiejBocian Date: Fri, 9 Oct 2015 13:53:08 +0300 Subject: [PATCH 19/21] End of exercices --- .besouro/2015100912171338/actions.txt | 6 + .besouro/2015100912171338/besouroEpisodes.txt | 3 + .../randomHeuristicEpisodes.txt | 3 + .besouro/2015100912171338/zorroEpisodes.txt | 3 + .classpath | 14 +- .gitattributes | 34 ++-- .gitignore | 88 +++++----- .project | 34 ++-- .../unioulu/tol/sqatlab/gameoflife/Cell.java | 154 +++++++++--------- .../tol/sqatlab/gameoflife/GameOfLife.java | 10 +- .../unioulu/tol/sqatlab/gameoflife/Grid.java | 58 +++---- .../tol/sqatlab/gameoflife/test/TestCell.java | 72 ++++---- .../tol/sqatlab/gameoflife/test/TestGrid.java | 112 ++++++------- 13 files changed, 303 insertions(+), 288 deletions(-) diff --git a/.besouro/2015100912171338/actions.txt b/.besouro/2015100912171338/actions.txt index 2873d01..7e563f0 100644 --- a/.besouro/2015100912171338/actions.txt +++ b/.besouro/2015100912171338/actions.txt @@ -133,3 +133,9 @@ UnitTestSessionAction 1444385780902 TestGrid.testTwoNeightborCellsOnDifferentRow UnitTestCaseAction 1444385871729 TestGrid.java OK UnitTestSessionAction 1444385871731 TestGrid OK EditAction 1444386761596 TestGrid.java 1198 3 19 3 +UnitTestCaseAction 1444386766376 TestCell.java OK +UnitTestSessionAction 1444386766377 TestCell.testDeadCellWithNoLiveNeighborsShouldLive OK +UnitTestCaseAction 1444386774177 TestCell.java OK +UnitTestSessionAction 1444386774179 TestCell.testDeadCellWithNoLiveNeighborsShouldLive OK +UnitTestCaseAction 1444386784599 TestCell.java OK +UnitTestSessionAction 1444386784600 TestSudokuVerifier OK diff --git a/.besouro/2015100912171338/besouroEpisodes.txt b/.besouro/2015100912171338/besouroEpisodes.txt index 973e254..d0701fe 100644 --- a/.besouro/2015100912171338/besouroEpisodes.txt +++ b/.besouro/2015100912171338/besouroEpisodes.txt @@ -103,3 +103,6 @@ 1444385871732 test-addition 1 130 true 1444385871733 test-addition 2 130 true 1444385871734 test-addition 1 130 true +1444386766377 regression 1 4 true +1444386774179 regression 1 0 true +1444386784600 regression 1 0 true diff --git a/.besouro/2015100912171338/randomHeuristicEpisodes.txt b/.besouro/2015100912171338/randomHeuristicEpisodes.txt index 594f61c..f5cb768 100644 --- a/.besouro/2015100912171338/randomHeuristicEpisodes.txt +++ b/.besouro/2015100912171338/randomHeuristicEpisodes.txt @@ -5,3 +5,6 @@ 1444383645589 test-first 2 93 true 1444385694952 test-first 1 2042 true 1444385871731 test-addition 2 130 false +1444386766377 regression 1 4 false +1444386774179 regression 1 0 true +1444386784600 regression 1 0 true diff --git a/.besouro/2015100912171338/zorroEpisodes.txt b/.besouro/2015100912171338/zorroEpisodes.txt index 33ee37a..ede7023 100644 --- a/.besouro/2015100912171338/zorroEpisodes.txt +++ b/.besouro/2015100912171338/zorroEpisodes.txt @@ -5,3 +5,6 @@ 1444383645589 test-first 2 133 true 1444385694952 test-first 1 2049 true 1444385871731 test-addition 2 176 true +1444386766377 regression 1 894 true +1444386774179 regression 1 7 true +1444386784600 regression 1 10 true diff --git a/.classpath b/.classpath index 2d74975..3e0fb27 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/.gitattributes b/.gitattributes index 7351b55..bdb0cab 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,17 +1,17 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 4926921..80e4de2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,44 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -/bin/ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +/bin/ diff --git a/.project b/.project index 4cbf201..a31ebfd 100644 --- a/.project +++ b/.project @@ -1,17 +1,17 @@ - - - GameOfLife - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + + + GameOfLife + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 3dde0ac..0ce51f8 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -1,77 +1,77 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class Cell { - String state; - int x; - int y; - - public Cell(String initialState) { - this.state = initialState; - } - - public Cell(int x, int y) { - this.x = x; - this.y = y; - } - - - - public int getX() { - return x; - } - - public void setX(int x) { - this.x = x; - } - - public int getY() { - return y; - } - - public void setY(int y) { - this.y = y; - } - - public void nextIteration(int numberOfLiveCells) { - if (state.equals("Alive") && numberOfLiveCells < 2){ - state = "Dead"; - }else{ - state = "Alive"; - } - } - - public String getState() { - return this.state; - } - - @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; - } -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class Cell { + String state; + int x; + int y; + + public Cell(String initialState) { + this.state = initialState; + } + + public Cell(int x, int y) { + this.x = x; + this.y = y; + } + + + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public void nextIteration(int numberOfLiveCells) { + if (state.equals("Alive") && numberOfLiveCells < 2){ + state = "Dead"; + }else{ + state = "Alive"; + } + } + + public String getState() { + return this.state; + } + + @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; + } +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java index 975cdf4..dbd5f88 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java @@ -1,5 +1,5 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class GameOfLife { - -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class GameOfLife { + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 0a6114f..c1fce1d 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -1,29 +1,29 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -import java.util.HashSet; -import java.util.Set; - -public class Grid { - - private Set cells = new HashSet<>(); - - public int getNumNeighbors(Cell cell) { - int numNeighbors = 0; - Set neigborhood = new HashSet(); - - 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; - } - - public void addCell(Cell cell) { - cells.add(cell); - } - -} +package org.unioulu.tol.sqatlab.gameoflife; + +import java.util.HashSet; +import java.util.Set; + +public class Grid { + + private Set cells = new HashSet<>(); + + public int getNumNeighbors(Cell cell) { + int numNeighbors = 0; + Set neigborhood = new HashSet(); + + 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; + } + + public void addCell(Cell cell) { + cells.add(cell); + } + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 4f246b9..aa1b07f 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -1,36 +1,36 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.unioulu.tol.sqatlab.gameoflife.Cell; - -public class TestCell { - - @Test - public void testLiveCellWithNoNeighborsShouldDie() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(0); - - assertEquals("Dead", cell.getState()); - } - - @Test - public void testLiveCellWithTwoNeighborsShouldLive() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(2); - - assertEquals("Alive", cell.getState()); - } - - @Test - public void testDeadCellWithNoLiveNeighborsShouldLive() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(2); - - assertEquals("Alive", cell.getState()); - } -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.unioulu.tol.sqatlab.gameoflife.Cell; + +public class TestCell { + + @Test + public void testLiveCellWithNoNeighborsShouldDie() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(0); + + assertEquals("Dead", cell.getState()); + } + + @Test + public void testLiveCellWithTwoNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(2); + + assertEquals("Alive", cell.getState()); + } + + @Test + public void testDeadCellWithNoLiveNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(2); + + assertEquals("Alive", cell.getState()); + } +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index b2238d5..9600b6f 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -1,56 +1,56 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -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 testSingleCellOnGridHasNoNeighbors() { - //arrange - Grid grid = new Grid(); - Cell cell = new Cell(0,0); - - grid.addCell(cell); - - int numNeighbors = grid.getNumNeighbors(cell); - - assertEquals(0, numNeighbors); - } - - @Test - public void testTwoNeightborCellsShouldHaveOneNeighbor() { - //arrange - 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.getNumNeighbors(cell1); - - assertEquals(1, numNeighbors); - } - - @Test - public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { - //arrange - Grid grid = new Grid(); - Cell cell1 = new Cell(0,0); - Cell cell2 = new Cell(1,0); - - grid.addCell(cell1); - grid.addCell(cell2); - - int numNeighbors = grid.getNumNeighbors(cell1); - - assertEquals(1, numNeighbors); - } - - //adding State and live neighbor - - -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +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 testSingleCellOnGridHasNoNeighbors() { + //arrange + Grid grid = new Grid(); + Cell cell = new Cell(0,0); + + grid.addCell(cell); + + int numNeighbors = grid.getNumNeighbors(cell); + + assertEquals(0, numNeighbors); + } + + @Test + public void testTwoNeightborCellsShouldHaveOneNeighbor() { + //arrange + 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.getNumNeighbors(cell1); + + assertEquals(1, numNeighbors); + } + + @Test + public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { + //arrange + Grid grid = new Grid(); + Cell cell1 = new Cell(0,0); + Cell cell2 = new Cell(1,0); + + grid.addCell(cell1); + grid.addCell(cell2); + + int numNeighbors = grid.getNumNeighbors(cell1); + + assertEquals(1, numNeighbors); + } + + //adding State and live neighbor + + +} From 6fe004b188010cb763515981739988f9c4f7e3c5 Mon Sep 17 00:00:00 2001 From: somename Date: Fri, 9 Oct 2015 13:53:15 +0300 Subject: [PATCH 20/21] besouro automatic message --- .classpath | 14 +- .gitattributes | 34 ++-- .gitignore | 88 +++++----- .project | 34 ++-- .../unioulu/tol/sqatlab/gameoflife/Cell.java | 154 +++++++++--------- .../tol/sqatlab/gameoflife/GameOfLife.java | 10 +- .../unioulu/tol/sqatlab/gameoflife/Grid.java | 58 +++---- .../tol/sqatlab/gameoflife/test/TestCell.java | 72 ++++---- .../tol/sqatlab/gameoflife/test/TestGrid.java | 112 ++++++------- 9 files changed, 288 insertions(+), 288 deletions(-) diff --git a/.classpath b/.classpath index 3e0fb27..2d74975 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/.gitattributes b/.gitattributes index bdb0cab..7351b55 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,17 +1,17 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 80e4de2..4926921 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,44 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -/bin/ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +/bin/ diff --git a/.project b/.project index a31ebfd..4cbf201 100644 --- a/.project +++ b/.project @@ -1,17 +1,17 @@ - - - GameOfLife - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + + + GameOfLife + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 0ce51f8..3dde0ac 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -1,77 +1,77 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class Cell { - String state; - int x; - int y; - - public Cell(String initialState) { - this.state = initialState; - } - - public Cell(int x, int y) { - this.x = x; - this.y = y; - } - - - - public int getX() { - return x; - } - - public void setX(int x) { - this.x = x; - } - - public int getY() { - return y; - } - - public void setY(int y) { - this.y = y; - } - - public void nextIteration(int numberOfLiveCells) { - if (state.equals("Alive") && numberOfLiveCells < 2){ - state = "Dead"; - }else{ - state = "Alive"; - } - } - - public String getState() { - return this.state; - } - - @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; - } -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class Cell { + String state; + int x; + int y; + + public Cell(String initialState) { + this.state = initialState; + } + + public Cell(int x, int y) { + this.x = x; + this.y = y; + } + + + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public void nextIteration(int numberOfLiveCells) { + if (state.equals("Alive") && numberOfLiveCells < 2){ + state = "Dead"; + }else{ + state = "Alive"; + } + } + + public String getState() { + return this.state; + } + + @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; + } +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java index dbd5f88..975cdf4 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java @@ -1,5 +1,5 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class GameOfLife { - -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class GameOfLife { + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index c1fce1d..0a6114f 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -1,29 +1,29 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -import java.util.HashSet; -import java.util.Set; - -public class Grid { - - private Set cells = new HashSet<>(); - - public int getNumNeighbors(Cell cell) { - int numNeighbors = 0; - Set neigborhood = new HashSet(); - - 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; - } - - public void addCell(Cell cell) { - cells.add(cell); - } - -} +package org.unioulu.tol.sqatlab.gameoflife; + +import java.util.HashSet; +import java.util.Set; + +public class Grid { + + private Set cells = new HashSet<>(); + + public int getNumNeighbors(Cell cell) { + int numNeighbors = 0; + Set neigborhood = new HashSet(); + + 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; + } + + public void addCell(Cell cell) { + cells.add(cell); + } + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index aa1b07f..4f246b9 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -1,36 +1,36 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.unioulu.tol.sqatlab.gameoflife.Cell; - -public class TestCell { - - @Test - public void testLiveCellWithNoNeighborsShouldDie() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(0); - - assertEquals("Dead", cell.getState()); - } - - @Test - public void testLiveCellWithTwoNeighborsShouldLive() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(2); - - assertEquals("Alive", cell.getState()); - } - - @Test - public void testDeadCellWithNoLiveNeighborsShouldLive() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(2); - - assertEquals("Alive", cell.getState()); - } -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.unioulu.tol.sqatlab.gameoflife.Cell; + +public class TestCell { + + @Test + public void testLiveCellWithNoNeighborsShouldDie() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(0); + + assertEquals("Dead", cell.getState()); + } + + @Test + public void testLiveCellWithTwoNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(2); + + assertEquals("Alive", cell.getState()); + } + + @Test + public void testDeadCellWithNoLiveNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(2); + + assertEquals("Alive", cell.getState()); + } +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index 9600b6f..b2238d5 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -1,56 +1,56 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -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 testSingleCellOnGridHasNoNeighbors() { - //arrange - Grid grid = new Grid(); - Cell cell = new Cell(0,0); - - grid.addCell(cell); - - int numNeighbors = grid.getNumNeighbors(cell); - - assertEquals(0, numNeighbors); - } - - @Test - public void testTwoNeightborCellsShouldHaveOneNeighbor() { - //arrange - 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.getNumNeighbors(cell1); - - assertEquals(1, numNeighbors); - } - - @Test - public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { - //arrange - Grid grid = new Grid(); - Cell cell1 = new Cell(0,0); - Cell cell2 = new Cell(1,0); - - grid.addCell(cell1); - grid.addCell(cell2); - - int numNeighbors = grid.getNumNeighbors(cell1); - - assertEquals(1, numNeighbors); - } - - //adding State and live neighbor - - -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +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 testSingleCellOnGridHasNoNeighbors() { + //arrange + Grid grid = new Grid(); + Cell cell = new Cell(0,0); + + grid.addCell(cell); + + int numNeighbors = grid.getNumNeighbors(cell); + + assertEquals(0, numNeighbors); + } + + @Test + public void testTwoNeightborCellsShouldHaveOneNeighbor() { + //arrange + 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.getNumNeighbors(cell1); + + assertEquals(1, numNeighbors); + } + + @Test + public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { + //arrange + Grid grid = new Grid(); + Cell cell1 = new Cell(0,0); + Cell cell2 = new Cell(1,0); + + grid.addCell(cell1); + grid.addCell(cell2); + + int numNeighbors = grid.getNumNeighbors(cell1); + + assertEquals(1, numNeighbors); + } + + //adding State and live neighbor + + +} From e04154ea429b8353bf283dc48eb02a918e134314 Mon Sep 17 00:00:00 2001 From: BartlomiejBocian Date: Fri, 9 Oct 2015 13:54:08 +0300 Subject: [PATCH 21/21] stop besouro --- .classpath | 14 +- .gitattributes | 34 ++-- .gitignore | 88 +++++----- .project | 34 ++-- .../unioulu/tol/sqatlab/gameoflife/Cell.java | 154 +++++++++--------- .../tol/sqatlab/gameoflife/GameOfLife.java | 10 +- .../unioulu/tol/sqatlab/gameoflife/Grid.java | 58 +++---- .../tol/sqatlab/gameoflife/test/TestCell.java | 72 ++++---- .../tol/sqatlab/gameoflife/test/TestGrid.java | 112 ++++++------- 9 files changed, 288 insertions(+), 288 deletions(-) diff --git a/.classpath b/.classpath index 2d74975..3e0fb27 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/.gitattributes b/.gitattributes index 7351b55..bdb0cab 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,17 +1,17 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 4926921..80e4de2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,44 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -/bin/ +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# ========================= +# Operating System Files +# ========================= + +# OSX +# ========================= + +.DS_Store +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +/bin/ diff --git a/.project b/.project index 4cbf201..a31ebfd 100644 --- a/.project +++ b/.project @@ -1,17 +1,17 @@ - - - GameOfLife - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + + + GameOfLife + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java index 3dde0ac..0ce51f8 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Cell.java @@ -1,77 +1,77 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class Cell { - String state; - int x; - int y; - - public Cell(String initialState) { - this.state = initialState; - } - - public Cell(int x, int y) { - this.x = x; - this.y = y; - } - - - - public int getX() { - return x; - } - - public void setX(int x) { - this.x = x; - } - - public int getY() { - return y; - } - - public void setY(int y) { - this.y = y; - } - - public void nextIteration(int numberOfLiveCells) { - if (state.equals("Alive") && numberOfLiveCells < 2){ - state = "Dead"; - }else{ - state = "Alive"; - } - } - - public String getState() { - return this.state; - } - - @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; - } -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class Cell { + String state; + int x; + int y; + + public Cell(String initialState) { + this.state = initialState; + } + + public Cell(int x, int y) { + this.x = x; + this.y = y; + } + + + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public void nextIteration(int numberOfLiveCells) { + if (state.equals("Alive") && numberOfLiveCells < 2){ + state = "Dead"; + }else{ + state = "Alive"; + } + } + + public String getState() { + return this.state; + } + + @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; + } +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java index 975cdf4..dbd5f88 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java @@ -1,5 +1,5 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -public class GameOfLife { - -} +package org.unioulu.tol.sqatlab.gameoflife; + +public class GameOfLife { + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java index 0a6114f..c1fce1d 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/Grid.java @@ -1,29 +1,29 @@ -package org.unioulu.tol.sqatlab.gameoflife; - -import java.util.HashSet; -import java.util.Set; - -public class Grid { - - private Set cells = new HashSet<>(); - - public int getNumNeighbors(Cell cell) { - int numNeighbors = 0; - Set neigborhood = new HashSet(); - - 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; - } - - public void addCell(Cell cell) { - cells.add(cell); - } - -} +package org.unioulu.tol.sqatlab.gameoflife; + +import java.util.HashSet; +import java.util.Set; + +public class Grid { + + private Set cells = new HashSet<>(); + + public int getNumNeighbors(Cell cell) { + int numNeighbors = 0; + Set neigborhood = new HashSet(); + + 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; + } + + public void addCell(Cell cell) { + cells.add(cell); + } + +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java index 4f246b9..aa1b07f 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java @@ -1,36 +1,36 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.unioulu.tol.sqatlab.gameoflife.Cell; - -public class TestCell { - - @Test - public void testLiveCellWithNoNeighborsShouldDie() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(0); - - assertEquals("Dead", cell.getState()); - } - - @Test - public void testLiveCellWithTwoNeighborsShouldLive() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(2); - - assertEquals("Alive", cell.getState()); - } - - @Test - public void testDeadCellWithNoLiveNeighborsShouldLive() { - Cell cell = new Cell("Alive"); - - cell.nextIteration(2); - - assertEquals("Alive", cell.getState()); - } -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.unioulu.tol.sqatlab.gameoflife.Cell; + +public class TestCell { + + @Test + public void testLiveCellWithNoNeighborsShouldDie() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(0); + + assertEquals("Dead", cell.getState()); + } + + @Test + public void testLiveCellWithTwoNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(2); + + assertEquals("Alive", cell.getState()); + } + + @Test + public void testDeadCellWithNoLiveNeighborsShouldLive() { + Cell cell = new Cell("Alive"); + + cell.nextIteration(2); + + assertEquals("Alive", cell.getState()); + } +} diff --git a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java index b2238d5..9600b6f 100644 --- a/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java +++ b/src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java @@ -1,56 +1,56 @@ -package org.unioulu.tol.sqatlab.gameoflife.test; - -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 testSingleCellOnGridHasNoNeighbors() { - //arrange - Grid grid = new Grid(); - Cell cell = new Cell(0,0); - - grid.addCell(cell); - - int numNeighbors = grid.getNumNeighbors(cell); - - assertEquals(0, numNeighbors); - } - - @Test - public void testTwoNeightborCellsShouldHaveOneNeighbor() { - //arrange - 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.getNumNeighbors(cell1); - - assertEquals(1, numNeighbors); - } - - @Test - public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { - //arrange - Grid grid = new Grid(); - Cell cell1 = new Cell(0,0); - Cell cell2 = new Cell(1,0); - - grid.addCell(cell1); - grid.addCell(cell2); - - int numNeighbors = grid.getNumNeighbors(cell1); - - assertEquals(1, numNeighbors); - } - - //adding State and live neighbor - - -} +package org.unioulu.tol.sqatlab.gameoflife.test; + +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 testSingleCellOnGridHasNoNeighbors() { + //arrange + Grid grid = new Grid(); + Cell cell = new Cell(0,0); + + grid.addCell(cell); + + int numNeighbors = grid.getNumNeighbors(cell); + + assertEquals(0, numNeighbors); + } + + @Test + public void testTwoNeightborCellsShouldHaveOneNeighbor() { + //arrange + 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.getNumNeighbors(cell1); + + assertEquals(1, numNeighbors); + } + + @Test + public void testTwoNeightborCellsOnDifferentRowsShouldHaveOneNeighbor() { + //arrange + Grid grid = new Grid(); + Cell cell1 = new Cell(0,0); + Cell cell2 = new Cell(1,0); + + grid.addCell(cell1); + grid.addCell(cell2); + + int numNeighbors = grid.getNumNeighbors(cell1); + + assertEquals(1, numNeighbors); + } + + //adding State and live neighbor + + +}