Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
2c9bec4
besouro automatic message
Oct 8, 2015
510c1a9
besouro automatic message
Oct 8, 2015
fe71c51
besouro automatic message
Oct 8, 2015
f5ed759
besouro automatic message
Oct 8, 2015
28f1d2e
besouro automatic message
Oct 8, 2015
e71bf10
besouro automatic message
Oct 8, 2015
c76972d
besouro automatic message
Oct 8, 2015
779a7ba
besouro automatic message
Oct 8, 2015
bc7697c
besouro automatic message
Oct 8, 2015
ea463c3
besouro automatic message
Oct 8, 2015
0c7b6ad
besouro automatic message
Oct 8, 2015
a4e0912
besouro automatic message
Oct 8, 2015
2cf6470
besouro automatic message
Oct 8, 2015
59e5069
besouro automatic message
Oct 8, 2015
736b738
besouro automatic message
Oct 8, 2015
0d650f8
besouro automatic message
Oct 8, 2015
a2f14bc
besouro automatic message
Oct 8, 2015
e8990fa
besouro automatic message
Oct 8, 2015
ea2f47d
besouro automatic message
Oct 8, 2015
547a04b
besouro automatic message
Oct 8, 2015
22c1585
besouro automatic message
Oct 8, 2015
3653578
besouro automatic message
Oct 8, 2015
7e86629
besouro automatic message
Oct 8, 2015
2d03aad
besouro automatic message
Oct 8, 2015
a82e1d0
besouro automatic message
Oct 8, 2015
098c834
besouro automatic message
Oct 8, 2015
d4ddfbf
besouro automatic message
Oct 8, 2015
8623f98
besouro automatic message
Oct 8, 2015
018d97b
besouro automatic message
Oct 8, 2015
4da215b
besouro automatic message
Oct 8, 2015
3ea05f3
besouro automatic message
Oct 8, 2015
dd6c7bd
besouro automatic message
Oct 8, 2015
616e65e
besouro automatic message
Oct 8, 2015
fee8463
besouro automatic message
Oct 8, 2015
720f622
besouro automatic message
Oct 8, 2015
365fe5e
besouro automatic message
Oct 8, 2015
a23c6b6
besouro automatic message
Oct 8, 2015
bf1ff28
besouro automatic message
Oct 8, 2015
984a14b
besouro automatic message
Oct 8, 2015
bb0e300
besouro automatic message
Oct 8, 2015
1421064
besouro automatic message
Oct 8, 2015
aaaab68
besouro automatic message
Oct 8, 2015
905948c
besouro automatic message
Oct 8, 2015
bf2aaa4
besouro automatic message
Oct 8, 2015
3c4f9f9
besouro automatic message
Oct 8, 2015
af3b078
besouro automatic message
Oct 8, 2015
ca7c615
besouro automatic message
Oct 8, 2015
fcf7b9d
besouro automatic message
Oct 8, 2015
1d1ea9d
besouro automatic message
Oct 8, 2015
a6a1ca4
besouro automatic message
Oct 8, 2015
bbfd1d4
besouro automatic message
Oct 8, 2015
6d69dea
besouro automatic message
Oct 8, 2015
eb1abf2
besouro automatic message
Oct 8, 2015
7f7ab09
besouro automatic message
Oct 8, 2015
3a461cf
besouro automatic message
Oct 8, 2015
97ffd69
besouro automatic message
Oct 8, 2015
bdaae02
besouro automatic message
Oct 8, 2015
225a4c7
besouro automatic message
Oct 8, 2015
e8a4a58
besouro automatic message
Oct 8, 2015
509480b
besouro automatic message
Oct 8, 2015
e18a7ff
besouro automatic message
Oct 8, 2015
7bbc6a4
besouro automatic message
Oct 8, 2015
596d929
besouro automatic message
Oct 8, 2015
9b60678
besouro automatic message
Oct 8, 2015
d1be3d9
besouro automatic message
Oct 8, 2015
71ca41c
besouro automatic message
Oct 8, 2015
82b86b3
besouro automatic message
Oct 8, 2015
46c9aa5
besouro automatic message
Oct 8, 2015
3ad6cf1
besouro automatic message
Oct 8, 2015
17b4207
besouro automatic message
Oct 8, 2015
ae1c540
besouro automatic message
Oct 8, 2015
8af7904
besouro automatic message
Oct 8, 2015
36ad04f
besouro automatic message
Oct 8, 2015
bf495c2
besouro automatic message
Oct 8, 2015
a32573e
besouro automatic message
Oct 8, 2015
b84a8c2
besouro automatic message
Oct 8, 2015
0e21cba
besouro automatic message
Oct 8, 2015
147cc99
besouro automatic message
Oct 8, 2015
d5f0c34
besouro automatic message
Oct 8, 2015
5c8fc45
besouro automatic message
Oct 8, 2015
5f3ce18
Commit
GhostTree Oct 8, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .besouro/20151008112510477/actions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FileOpenedAction 1444292711120 TestCell.java 214 1 1 0
RefactoringAction 1444292726004 TestCell.java ADD void test_isCellAlive FIELD
RefactoringAction 1444292728532 TestCell.java RENAME test_isCellAlive=>void test_isCellAlive() METHOD
RefactoringAction 1444292748358 TestCell.java ADD void initialize() METHOD
RefactoringAction 1444292765074 TestCell.java RENAME initialize()=>void initializeCell() METHOD
RefactoringAction 1444292789152 TestCell.java ADD Cell testCell FIELD
RefactoringAction 1444292801622 TestCell.java ADD import org.unioulu.tol.sqatlab.gameoflife.Cell IMPORT
EditAction 1444292831199 TestCell.java 471 3 3 0
EditAction 1444292896339 TestCell.java 511 3 4 0
CompilationAction 1444292899037 TestCell.java
EditAction 1444292925605 TestCell.java 545 3 5 1
CompilationAction 1444292928441 TestCell.java
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
421 changes: 421 additions & 0 deletions .besouro/20151008114825807/actions.txt

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions .besouro/20151008114825807/besouroEpisodes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
1444294453653 test-first 1 347 true
1444294453654 test-last 1 347 false
1444294561630 test-first 1 96 true
1444294561631 test-first 1 96 true
1444295254363 refactoring 3 677 true
1444295254364 refactoring 3 677 true
1444295254365 refactoring 3 677 true
1444295254366 refactoring 3 677 true
1444295254367 refactoring 3 677 true
1444295254368 refactoring 3 677 true
1444295254369 refactoring 3 677 true
1444295254370 refactoring 3 677 true
1444295254371 refactoring 3 677 true
1444295254372 refactoring 3 677 true
1444295254373 refactoring 3 677 true
1444295254374 refactoring 3 677 true
1444295254375 refactoring 3 677 true
1444295254376 refactoring 3 677 true
1444295254377 refactoring 3 677 true
1444295254378 refactoring 3 677 true
1444295254379 refactoring 3 677 true
1444295254380 refactoring 3 677 true
1444295254381 refactoring 3 677 true
1444295254382 refactoring 3 677 true
1444295254383 refactoring 3 677 true
1444295254384 refactoring 3 677 true
1444295254385 refactoring 3 677 true
1444295254386 refactoring 3 677 true
1444295254387 refactoring 3 677 true
1444295254388 refactoring 3 677 true
1444295254389 refactoring 3 677 true
1444295254390 refactoring 3 677 true
1444295254391 refactoring 3 677 true
1444295254392 refactoring 3 677 true
1444295254393 refactoring 3 677 true
1444295254394 refactoring 3 677 true
1444295254395 refactoring 3 677 true
1444295254396 refactoring 3 677 true
1444295254397 refactoring 3 677 true
1444295254398 refactoring 3 677 true
1444295254399 refactoring 3 677 true
1444295254400 refactoring 3 677 true
1444295254401 refactoring 3 677 true
1444295254402 refactoring 3 677 true
1444295254403 refactoring 3 677 true
1444295254404 refactoring 3 677 true
1444295254405 refactoring 3 677 true
1444295254406 refactoring 3 677 true
1444295254407 refactoring 3 677 true
1444295254408 refactoring 3 677 true
1444295254409 refactoring 3 677 true
1444295254410 refactoring 3 677 true
1444295254411 refactoring 3 677 true
1444295254412 refactoring 3 677 true
1444295254413 refactoring 3 677 true
1444295254414 refactoring 3 677 true
1444295254415 refactoring 3 677 true
1444295254416 refactoring 3 677 true
1444295254417 refactoring 3 677 true
1444295254418 refactoring 3 677 true
1444295254419 refactoring 3 677 true
1444295254420 refactoring 3 677 true
1444295254421 refactoring 3 677 true
1444295254422 refactoring 3 677 true
1444295254423 refactoring 3 677 true
1444295254424 refactoring 3 677 true
1444295254425 refactoring 3 677 true
1444295254426 refactoring 3 677 true
Empty file.
3 changes: 3 additions & 0 deletions .besouro/20151008114825807/randomHeuristicEpisodes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1444294453653 test-first 1 347 true
1444294561630 test-first 1 96 true
1444295254363 refactoring 3 677 true
Empty file.
3 changes: 3 additions & 0 deletions .besouro/20151008114825807/zorroEpisodes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1444294453653 test-first 1 347 true
1444294561630 test-first 1 107 true
1444295254363 refactoring 3 692 true
23 changes: 23 additions & 0 deletions src/org/unioulu/tol/sqatlab/gameoflife/Cell.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
package org.unioulu.tol.sqatlab.gameoflife;

public class Cell {

//Initially start with dead status
private static String Life = "-";

public Cell () {
if ( Math.random() < 0.5 ) {
Life = "-";
} else {
Life = "*";
}
}

public String getStatus () {
return Life;
}

public void setToAlive () {
Life = "*";
}

public void setToDead () {
Life = "-";
}

}
35 changes: 35 additions & 0 deletions src/org/unioulu/tol/sqatlab/gameoflife/GameOfLife.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
package org.unioulu.tol.sqatlab.gameoflife;

import java.util.Scanner;

public class GameOfLife {

private static Boolean running = true;
private static Grid gameGrid;

public static void main(String [] args) {
while (running) {


gameGrid = new Grid(50,50);
int w = gameGrid.getWidth();
int h = gameGrid.getHeight();

//Turns out all cells in the grid are only * (alive) or - (dead)
//Ran out of time for the excercises, so oh well.
for (int i = 0; i < w; i++) {
for (int b = 0; b < h; b++) {
print(gameGrid.getCellStatus(i,b));
}
println("");
}

running = false;
}
}


public static void println(String str) {
System.out.println(str);
}

public static void print(String str) {
System.out.print(str);
}

}
40 changes: 40 additions & 0 deletions src/org/unioulu/tol/sqatlab/gameoflife/Grid.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
package org.unioulu.tol.sqatlab.gameoflife;

import java.util.Arrays;

public class Grid {

private static Cell[][] gridArray = new Cell[1][1];

public Grid() {
// ...
}

public Grid(int width, int height) {
gridArray = new Cell[width][height];
int i = 0;

while ( i < width) {
Arrays.fill(gridArray[i], new Cell());
i++;
}

}

public String getSize () {
String str = gridArray.length + "x" + gridArray[0].length;
return str;
}

public int getWidth() {
return gridArray.length;
}

public int getHeight() {
return gridArray[0].length;
}

public Cell getCell (int x, int y) {
return gridArray[x][y];
}

public String getCellStatus ( int x, int y ) {
return getCell(x,y).getStatus();
}

}
48 changes: 46 additions & 2 deletions src/org/unioulu/tol/sqatlab/gameoflife/test/TestCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,56 @@
import static org.junit.Assert.*;

import org.junit.Test;
import org.unioulu.tol.sqatlab.gameoflife.Cell;

public class TestCell {

private Cell testCell = new Cell();

//Initialization function
public void initializeCell() {
testCell = new Cell();
}

@Test
public void test_getCellStatus () {
initializeCell();
String r = testCell.getStatus();
assertEquals( ((Object)r).getClass().getName(), "java.lang.String" );
}

@Test
public void test_setToAliveAndReturnStatus() {
initializeCell();
testCell.setToAlive();
String r = testCell.getStatus();
assertEquals ( r, "*" );
}

@Test
public void test_setToAliveAndThenToDeadAndReturnStatus() {
initializeCell();
testCell.setToAlive();
testCell.setToDead();
String r = testCell.getStatus();
assertEquals ( r, "-" );
}

@Test
public void test() {
fail("Not yet implemented");
//Test to make sure that the cell can get both dead and alive
//status when it is created. Essentially, perform a while-
//loop up until both statuses are recognized.
public void test_randomCellStatusInitialization () {
boolean dead = false;
boolean alive = false;
while ( dead == false && alive == false ) {
initializeCell();
if (testCell.getStatus() == "*") {
alive = true;
} else {
dead = true;
}
}
}

}
41 changes: 38 additions & 3 deletions src/org/unioulu/tol/sqatlab/gameoflife/test/TestGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,47 @@

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 {

private Grid testGrid = new Grid();

//Initialization function
public void initializeGrid ( int w, int h ) {
testGrid = new Grid(w,h);
}

@Test
public void test() {
fail("Not yet implemented");
public void test_createA10By10Grid () {
initializeGrid ( 10, 10 );
String size = testGrid.getSize();
assertEquals(size, "10x10");
}


@Test
public void test_createA50By43Grid () {
initializeGrid ( 50, 43 );
String size = testGrid.getSize();
assertEquals(size, "50x43");
}

@Test
public void test_getCellFromGrid () {
initializeGrid ( 50, 50 );
testGrid.getCell(10,10);
}

@Test
public void test_getCellStatusFromGrid () {
initializeGrid ( 50, 50 );
String str = testGrid.getCellStatus ( 20, 10 );
if (str == "*" || str == "-") {
assert(true);
} else {
fail("Life of a cell was not * or -.");
}
}

}