Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c4e9f3c
besouro automatic message
Oct 12, 2016
ecb46cd
besouro automatic message
Oct 12, 2016
e685d15
besouro automatic message
Oct 12, 2016
0d28222
besouro automatic message
Oct 12, 2016
1cf6489
besouro automatic message
Oct 12, 2016
ae548e5
besouro automatic message
Oct 12, 2016
1991719
besouro automatic message
Oct 12, 2016
571ef44
besouro automatic message
Oct 12, 2016
2d7b709
besouro automatic message
Oct 12, 2016
b1f1531
besouro automatic message
Oct 12, 2016
4dd5d8a
besouro automatic message
Oct 12, 2016
bce4b22
besouro automatic message
Oct 12, 2016
0d7f9c9
besouro automatic message
Oct 12, 2016
94d4c3b
besouro automatic message
Oct 12, 2016
d2aa16f
besouro automatic message
Oct 12, 2016
4b22a19
besouro automatic message
Oct 12, 2016
6845553
besouro automatic message
Oct 12, 2016
55699c2
besouro automatic message
Oct 12, 2016
59e021a
besouro automatic message
Oct 12, 2016
bd1fb28
besouro automatic message
Oct 12, 2016
4769876
besouro automatic message
Oct 12, 2016
f225a24
besouro automatic message
Oct 12, 2016
3564acd
besouro automatic message
Oct 12, 2016
02f8eaf
besouro automatic message
Oct 12, 2016
3985499
besouro automatic message
Oct 12, 2016
1c7ae3f
besouro automatic message
Oct 12, 2016
977f6b1
besouro automatic message
Oct 12, 2016
faaa3e2
besouro automatic message
Oct 12, 2016
dbfc42c
besouro automatic message
Oct 12, 2016
b6d5034
besouro automatic message
Oct 12, 2016
ad1e2e0
besouro automatic message
Oct 12, 2016
0f89498
besouro automatic message
Oct 12, 2016
4861f39
besouro automatic message
Oct 12, 2016
a3f77a5
besouro automatic message
Oct 12, 2016
07bab00
besouro automatic message
Oct 12, 2016
1104751
besouro automatic message
Oct 12, 2016
46c5f46
besouro automatic message
Oct 12, 2016
a6d0c0f
besouro automatic message
Oct 12, 2016
a6d7391
besouro automatic message
Oct 12, 2016
410c6dd
besouro automatic message
Oct 12, 2016
a0865c8
Latest changes
Oct 12, 2016
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
151 changes: 151 additions & 0 deletions .besouro/20161012143355930/actions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
FileOpenedAction 1476272036140 Spreadsheet.java 264 3 2 0
RefactoringAction 1476274407337 Spreadsheet.java ADD Table table FIELD
RefactoringAction 1476274464033 Table.java ADD Table.java CLASS
FileOpenedAction 1476274464162 Table.java 29 0 0 0
RefactoringAction 1476274496059 Spreadsheet.java ADD void Spreatsheet() METHOD
RefactoringAction 1476274561464 Table.java ADD Table(int, int) METHOD
RefactoringAction 1476274654205 Table.java ADD string T FIELD
RefactoringAction 1476274656719 Table.java RENAME T=>string Table FIELD
RefactoringAction 1476274660234 Table.java RENAME Table=>string able FIELD
RefactoringAction 1476274661245 Table.java RENAME able=>string table FIELD
RefactoringAction 1476274672267 Table.java RENAME table=>String table8 FIELD
RefactoringAction 1476274673779 Table.java RENAME table8=>String table FIELD
RefactoringAction 1476275187833 Spreadsheet.java REMOVE table FIELD
RefactoringAction 1476275191875 Spreadsheet.java ADD Cell cell FIELD
RefactoringAction 1476275194902 Spreadsheet.java RENAME cell=>Cell cells FIELD
RefactoringAction 1476275226955 Spreadsheet.java RENAME Spreatsheet()=>Spreadsheet() METHOD
RefactoringAction 1476275296856 Cell.java ADD Cell.java CLASS
FileOpenedAction 1476275296990 Cell.java 28 0 0 0
RefactoringAction 1476275305506 Cell.java ADD string l FIELD
RefactoringAction 1476275308016 Cell.java RENAME l=>string location FIELD
RefactoringAction 1476275323548 Cell.java ADD String value FIELD
EditAction 1476275326796 Cell.java 61 0 0 0
EditAction 1476275355095 Cell.java 67 0 0 0
EditAction 1476275369587 Table.java 84 1 0 0
RefactoringAction 1476275485235 Spreadsheet.java RENAME Spreadsheet()=>Spreadsheet(int) METHOD
RefactoringAction 1476275498779 Spreadsheet.java RENAME Spreadsheet(int)=>Spreadsheet(int, int) METHOD
RefactoringAction 1476276089498 Cell.java ADD Cell(String) METHOD
EditAction 1476276122355 Cell.java 118 1 1 0
EditAction 1476276127966 Spreadsheet.java 529 4 5 0
CompilationAction 1476276129730 Spreadsheet.java
CompilationAction 1476276129731 Spreadsheet.java
CompilationAction 1476276137914 Spreadsheet.java
CompilationAction 1476276138102 Spreadsheet.java
RefactoringAction 1476276202584 Spreadsheet.java ADD int row FIELD
RefactoringAction 1476276202586 Spreadsheet.java ADD int column FIELD
RefactoringAction 1476276414895 Table.java REMOVE Table.java CLASS
RefactoringAction 1476276429402 SpreadsheetTest.java RENAME test()=>void testGet() METHOD
RefactoringAction 1476276430414 SpreadsheetTest.java RENAME testGet()=>void testGetCe() METHOD
RefactoringAction 1476276431425 SpreadsheetTest.java RENAME testGetCe()=>void testGetCell() METHOD
EditAction 1476276498388 Cell.java 119 1 1 0
EditAction 1476276507657 SpreadsheetTest.java 169 1 1 0
EditAction 1476276618588 SpreadsheetTest.java 213 1 2 1
UnitTestCaseAction 1476276624703 SpreadsheetTest.java OK
UnitTestSessionAction 1476276624704 SpreadsheetTest.java OK
EditAction 1476276674258 SpreadsheetTest.java 247 1 3 1
UnitTestCaseAction 1476276678517 SpreadsheetTest.java OK
UnitTestSessionAction 1476276678518 SpreadsheetTest.java OK
EditAction 1476276687193 Cell.java 119 1 1 0
UnitTestCaseAction 1476276691706 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476276691707 SpreadsheetTest.java FAIL
UnitTestCaseAction 1476276699447 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476276699448 SpreadsheetTest.java FAIL
EditAction 1476276720179 SpreadsheetTest.java 247 1 3 1
UnitTestCaseAction 1476276722657 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476276722658 SpreadsheetTest.java FAIL
EditAction 1476276749247 SpreadsheetTest.java 247 1 3 1
UnitTestCaseAction 1476276751949 SpreadsheetTest.java OK
UnitTestSessionAction 1476276751950 SpreadsheetTest.java OK
EditAction 1476276775238 SpreadsheetTest.java 247 1 3 1
UnitTestCaseAction 1476276777809 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476276777810 SpreadsheetTest.java FAIL
EditAction 1476276828232 SpreadsheetTest.java 247 1 3 1
UnitTestCaseAction 1476276830731 SpreadsheetTest.java OK
UnitTestSessionAction 1476276830732 SpreadsheetTest.java OK
EditAction 1476276856484 SpreadsheetTest.java 247 1 3 1
UnitTestCaseAction 1476276858747 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476276858748 SpreadsheetTest.java FAIL
RefactoringAction 1476276880592 SpreadsheetTest.java ADD void testGetCell()/2 METHOD
RefactoringAction 1476276886106 SpreadsheetTest.java RENAME testGetCell()/2=>void testSetGetCell() METHOD
RefactoringAction 1476276888118 SpreadsheetTest.java RENAME testSetGetCell()=>void testSetCell() METHOD
EditAction 1476276893097 SpreadsheetTest.java 400 2 6 2
RefactoringAction 1476277198096 Spreadsheet.java ADD find ce FIELD
RefactoringAction 1476277200113 Spreadsheet.java RENAME ce=>find cell FIELD
RefactoringAction 1476277206630 Spreadsheet.java REMOVE cell FIELD
RefactoringAction 1476277237212 Spreadsheet.java ADD void getCellIndex() METHOD
RefactoringAction 1476277243244 Spreadsheet.java RENAME getCellIndex()=>void getCellIndex(String) METHOD
RefactoringAction 1476277321262 Spreadsheet.java RENAME getCellIndex(String)=>void IndegetCellIndex(String) METHOD
RefactoringAction 1476277322274 Spreadsheet.java RENAME IndegetCellIndex(String)=>void IndexgetCellIndex(String) METHOD
RefactoringAction 1476277323298 Spreadsheet.java RENAME IndexgetCellIndex(String)=>Index getCellIndex(String) METHOD
RefactoringAction 1476277393091 Index.java ADD Index.java CLASS
FileOpenedAction 1476277393253 Index.java 29 0 0 0
RefactoringAction 1476277398749 Index.java ADD int i FIELD
RefactoringAction 1476277404254 Index.java ADD int j FIELD
EditAction 1476277407695 Index.java 45 0 0 0
RefactoringAction 1476277440451 Index.java ADD Index(int, int) METHOD
EditAction 1476277462787 Index.java 102 1 2 0
EditAction 1476277545581 Spreadsheet.java 1128 5 10 0
CompilationAction 1476277547750 Spreadsheet.java
CompilationAction 1476278353352 Spreadsheet.java
EditAction 1476278445597 SpreadsheetTest.java 421 2 7 2
UnitTestCaseAction 1476278447757 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476278447758 SpreadsheetTest.java FAIL
EditAction 1476278514189 SpreadsheetTest.java 421 2 7 2
UnitTestCaseAction 1476278516759 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476278516760 SpreadsheetTest.java FAIL
EditAction 1476278553288 SpreadsheetTest.java 423 2 6 2
UnitTestCaseAction 1476278555513 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476278555514 SpreadsheetTest.java FAIL
EditAction 1476278591859 SpreadsheetTest.java 423 2 6 2
UnitTestCaseAction 1476278594093 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476278594094 SpreadsheetTest.java FAIL
EditAction 1476278624606 SpreadsheetTest.java 421 2 7 2
UnitTestCaseAction 1476278626680 SpreadsheetTest.java OK
UnitTestSessionAction 1476278626681 SpreadsheetTest.java OK
EditAction 1476278674351 SpreadsheetTest.java 421 2 7 2
UnitTestCaseAction 1476278676583 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476278676584 SpreadsheetTest.java FAIL
EditAction 1476278683945 SpreadsheetTest.java 421 2 7 2
UnitTestCaseAction 1476278685944 SpreadsheetTest.java OK
UnitTestSessionAction 1476278685945 SpreadsheetTest.java OK
EditAction 1476278727891 SpreadsheetTest.java 422 2 7 2
UnitTestCaseAction 1476278730193 SpreadsheetTest.java OK
UnitTestSessionAction 1476278730195 SpreadsheetTest.java OK
EditAction 1476278746277 SpreadsheetTest.java 421 2 7 2
UnitTestCaseAction 1476278749269 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476278749270 SpreadsheetTest.java FAIL
EditAction 1476278763036 SpreadsheetTest.java 422 2 7 2
EditAction 1476278948429 Spreadsheet.java 1018 5 13 0
EditAction 1476278957537 Spreadsheet.java 1021 5 13 0
RefactoringAction 1476278983037 SpreadsheetTest.java ADD void testSetCell()/2 METHOD
RefactoringAction 1476278990049 SpreadsheetTest.java RENAME testSetCell()/2=>void testCell() METHOD
RefactoringAction 1476278994563 SpreadsheetTest.java RENAME testCell()=>void testEvaluationCell() METHOD
RefactoringAction 1476278999575 SpreadsheetTest.java RENAME testEvaluationCell()=>void testEvaluatCell() METHOD
RefactoringAction 1476279003088 SpreadsheetTest.java RENAME testEvaluatCell()=>void testEvaluateCell() METHOD
EditAction 1476279006866 SpreadsheetTest.java 600 3 11 3
RefactoringAction 1476279096105 SpreadsheetTest.java RENAME testEvaluateCell()=>void testEvaluateNCell() METHOD
RefactoringAction 1476279099618 SpreadsheetTest.java RENAME testEvaluateNCell()=>void testEvaluateNunmberCell() METHOD
RefactoringAction 1476279104631 SpreadsheetTest.java RENAME testEvaluateNunmberCell()=>void testEvaluateNunmberHandlingCell() METHOD
EditAction 1476279137262 SpreadsheetTest.java 616 3 11 3
UnitTestCaseAction 1476279139554 SpreadsheetTest.java OK
UnitTestSessionAction 1476279139555 SpreadsheetTest.java OK
EditAction 1476279166136 SpreadsheetTest.java 620 3 9 3
UnitTestCaseAction 1476279169037 SpreadsheetTest.java OK
UnitTestSessionAction 1476279169038 SpreadsheetTest.java OK
EditAction 1476279654583 Spreadsheet.java 1180 5 16 0
EditAction 1476279796656 Spreadsheet.java 1200 5 17 0
RefactoringAction 1476279813330 SpreadsheetTest.java ADD void testEvaluateNunmberHandlingCell()/2 METHOD
RefactoringAction 1476279848866 SpreadsheetTest.java RENAME testEvaluateNunmberHandlingCell()/2=>void testWrongly FIELD
RefactoringAction 1476279853881 SpreadsheetTest.java RENAME integersCell()=>void formattedntegersCell() METHOD
RefactoringAction 1476279854897 SpreadsheetTest.java RENAME formattedntegersCell()=>void formattedIntegersCell() METHOD
RefactoringAction 1476279859920 SpreadsheetTest.java RENAME testWronglyormattedIntegersCell()=>void testWronglyFormattedIntegersCell() METHOD
EditAction 1476279891032 SpreadsheetTest.java 821 4 13 4
UnitTestCaseAction 1476279897205 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476279897206 SpreadsheetTest.java FAIL
EditAction 1476279972051 SpreadsheetTest.java 823 4 12 4
UnitTestCaseAction 1476279975659 SpreadsheetTest.java FAIL
UnitTestSessionAction 1476279975660 SpreadsheetTest.java FAIL
EditAction 1476280009442 SpreadsheetTest.java 828 4 12 4
UnitTestCaseAction 1476280011860 SpreadsheetTest.java OK
UnitTestSessionAction 1476280011862 SpreadsheetTest.java OK
EditAction 1476280032154 SpreadsheetTest.java 833 4 12 4
9 changes: 9 additions & 0 deletions .besouro/20161012143355930/besouroEpisodes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1476276624704 test-last 1 4588 false
1476276624705 test-last 1 4588 false
1476276624706 test-last 1 4588 false
1476276624707 test-last 1 4588 false
1476276624708 test-last 1 4588 false
1476276624709 test-last 1 4588 false
1476276678518 refactoring 1A 4 true
1476276751950 regression 2 64 true
1476276830732 regression 2 55 true
Empty file.
4 changes: 4 additions & 0 deletions .besouro/20161012143355930/randomHeuristicEpisodes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1476276624704 test-last 1 4588 false
1476276678518 refactoring 1A 4 false
1476276751950 regression 2 64 true
1476276830732 regression 2 55 false
Empty file.
4 changes: 4 additions & 0 deletions .besouro/20161012143355930/zorroEpisodes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1476276624704 test-last 1 4588 false
1476276678518 refactoring 1A 53 false
1476276751950 regression 2 73 false
1476276830732 regression 2 78 false
5 changes: 5 additions & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/Spreadsheet.class
/SpreadsheetTest.class
/Table.class
/Cell.class
/Index.class
Binary file modified bin/Spreadsheet.class
Binary file not shown.
Binary file modified bin/SpreadsheetTest.class
Binary file not shown.
8 changes: 8 additions & 0 deletions src/Cell.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

public class Cell {
public Cell(String loc) {
location = loc;
}
String location="";
String value="7";
}
9 changes: 9 additions & 0 deletions src/Index.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

public class Index {
public Index(int i2, int j2) {
i = i2;
j=j2;
}
int i;
int j;
}
63 changes: 58 additions & 5 deletions src/Spreadsheet.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,71 @@

public class Spreadsheet {

Cell[][] cells;
int row;
int column;

Spreadsheet(int row,int column) {
this.row=row;
this.column=column;
cells = new Cell[row][column];

for(int i=0; i<row;++i) {
char col = 'A';
for(int j=0; j<column;++j, ++col) {

cells[i][j] = new Cell(Character.toString(col)+Integer.toString(i+1));
}
}

}

public String get(String cell) {
// to be implemented

Index index = this.getCellIndex(cell);

if(index != null)
return cells[index.i][index.j].value;

return null;

}

public void set(String cell, String value) {
// to be implemented

Index index = this.getCellIndex(cell);

if(index != null)
cells[index.i][index.j].value = value;

}

Index getCellIndex(String cell){
Index index = null;
for(int i=0; i<row;++i) {
for(int j=0; j<column;++j) {

if(cells[i][j].location.equals(cell)) {
index = new Index(i,j);
return index;
}

}
}
return index;
}

public String evaluate(String cell) {
// to be implemented
return null;
String errorMessg = "#Error";
int op1;
String value = get(cell);
try {
op1 = Integer.parseInt(value);
} catch (NumberFormatException e) {
return errorMessg;
}

return value;

}

}
32 changes: 30 additions & 2 deletions tests/SpreadsheetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,37 @@
public class SpreadsheetTest {

@Test
public void test() {
fail("Not yet implemented");
public void testGetCell() {
Spreadsheet sh = new Spreadsheet(5,5);
//System.out.print(sh.get("D5"));
assertEquals(sh.get("D5"),"7");

}

@Test
public void testSetCell() {
Spreadsheet sh = new Spreadsheet(5,5);
sh.set("A7", "6");
//System.out.print(sh.get("A7"));
assertEquals(sh.get("A7"),null);

}

@Test
public void testEvaluateNunmberHandlingCell() {
Spreadsheet sh = new Spreadsheet(5,5);
sh.set("A1", "-1");
//System.out.print(sh.get("A1"));
assertEquals(sh.evaluate("A1"),"-1");

}

@Test
public void testWronglyFormattedIntegersCell() {
Spreadsheet sh = new Spreadsheet(5,5);
sh.set("A1", "1A");
System.out.print(sh.get("A1"));
assertEquals(sh.evaluate("A1"),"#Error");

}
}