From 40db15fb152e38e2dc6bd772c7db79aed62ef0b0 Mon Sep 17 00:00:00 2001 From: Olli Hiekkaranta Date: Wed, 28 Sep 2016 16:42:57 +0300 Subject: [PATCH 001/101] add roman number conversion tests and logic --- src/RomanNumerals.java | 61 ++++++++++++++++++++++- tests/TestRomanNumerals.java | 93 ++++++++++++++++++++++++++++++++++-- 2 files changed, 150 insertions(+), 4 deletions(-) diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 20904f0..82b902d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,8 +1,67 @@ public class RomanNumerals { + private static final char I = 'I'; + private static final char V = 'V'; + private static final char X = 'X'; + private static final char L = 'L'; + private static final char C = 'C'; + private static final char D = 'D'; + private static final char M = 'M'; + public int convertToInteger(String romanNum) { // To be Implemented - return 0; + int value = 0; + int stringLength = romanNum.length(); + char currentChar, nextChar; + + if (stringLength > 0) + { + for (int i = stringLength - 1; i >= 0; i--) { + currentChar = romanNum.charAt(i); + if (i < stringLength - 1) { + nextChar = romanNum.charAt(i + 1); + if (currentChar == nextChar) { + value += getCharValue(currentChar); + } + else if (getCharValue(currentChar) < getCharValue(nextChar)) { + value -= getCharValue(currentChar); + } + else if (getCharValue(currentChar) > getCharValue(nextChar)) { + value += getCharValue(currentChar); + } + } + else { + value += getCharValue(currentChar); + } + } + } + return value; } + + private int getCharValue(char romanNum) { + if (romanNum == I) { + return 1; + } + else if (romanNum == V) { + return 5; + } + else if (romanNum == X) { + return 10; + } + else if (romanNum == L) { + return 50; + } + else if (romanNum == C) { + return 100; + } + else if (romanNum == D) { + return 500; + } + else if (romanNum == M) { + return 1000; + } + return 0; + } + } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5d1de75..27a871e 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -3,10 +3,97 @@ import org.junit.Test; public class TestRomanNumerals { + + private RomanNumerals rn = new RomanNumerals(); - @Test - public void test() { - fail("Not yet implemented"); + @Test public void testRomanNumerals_emptyString() { + int num = rn.convertToInteger(""); + assertEquals(0, num); + } + + @Test public void testRomanNumerals_I_1() { + int num = rn.convertToInteger("I"); + assertEquals(1, num); + } + + @Test public void testRomanNumerals_II_2() { + int num = rn.convertToInteger("II"); + assertEquals(2, num); + } + + @Test public void testRomanNumerals_III_3() { + int num = rn.convertToInteger("III"); + assertEquals(3, num); + } + + @Test public void testRomanNumerals_V_5() { + int num = rn.convertToInteger("V"); + assertEquals(5, num); + } + + @Test public void testRomanNumerals_IV_4() { + int num = rn.convertToInteger("IV"); + assertEquals(4, num); + } + + @Test public void testRomanNumerals_VI_6() { + int num = rn.convertToInteger("VI"); + assertEquals(6, num); + } + + @Test public void testRomanNumerals_X_10() { + int num = rn.convertToInteger("X"); + assertEquals(10, num); + } + + @Test public void testRomanNumerals_L_50() { + int num = rn.convertToInteger("L"); + assertEquals(50, num); + } + + @Test public void testRomanNumerals_C_100() { + int num = rn.convertToInteger("C"); + assertEquals(100, num); + } + + @Test public void testRomanNumerals_D_500() { + int num = rn.convertToInteger("D"); + assertEquals(500, num); + } + + @Test public void testRomanNumerals_M_1000() { + int num = rn.convertToInteger("M"); + assertEquals(1000, num); + } + + @Test public void testRomanNumerals_XX_20() { + int num = rn.convertToInteger("XX"); + assertEquals(20, num); + } + + @Test public void testRomanNumerals_XC_90() { + int num = rn.convertToInteger("XC"); + assertEquals(90, num); + } + + @Test public void testRomanNumerals_LXX_70() { + int num = rn.convertToInteger("LXX"); + assertEquals(70, num); + } + + @Test public void testRomanNumerals_CM_900() { + int num = rn.convertToInteger("CM"); + assertEquals(900, num); + } + + @Test public void testRomanNumerals_MCMLXXXIV_1984() { + int num = rn.convertToInteger("MCMLXXXIV"); + assertEquals(1984, num); + } + + @Test public void testRomanNumerals_MMXIV_2014() { + int num = rn.convertToInteger("MMXIV"); + assertEquals(2014, num); } } From 2e03922ded341d25601369e077061542a91245d4 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:23:10 +0300 Subject: [PATCH 002/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 2 + .../20161005142238292/besouroEpisodes.txt | 0 .besouro/20161005142238292/disagreements.txt | 0 .../randomHeuristicEpisodes.txt | 0 .besouro/20161005142238292/userComments.txt | 0 .besouro/20161005142238292/zorroEpisodes.txt | 0 .classpath | 16 +- .gitattributes | 34 +-- .gitignore | 96 ++++----- .project | 34 +-- src/RomanNumerals.java | 139 ++++++------ tests/TestRomanNumerals.java | 198 +++++++++--------- 12 files changed, 263 insertions(+), 256 deletions(-) create mode 100644 .besouro/20161005142238292/actions.txt create mode 100644 .besouro/20161005142238292/besouroEpisodes.txt create mode 100644 .besouro/20161005142238292/disagreements.txt create mode 100644 .besouro/20161005142238292/randomHeuristicEpisodes.txt create mode 100644 .besouro/20161005142238292/userComments.txt create mode 100644 .besouro/20161005142238292/zorroEpisodes.txt diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt new file mode 100644 index 0000000..1078e2d --- /dev/null +++ b/.besouro/20161005142238292/actions.txt @@ -0,0 +1,2 @@ +FileOpenedAction 1475666558557 RomanNumerals.java 1551 3 9 0 +EditAction 1475666589523 RomanNumerals.java 1553 3 9 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142238292/disagreements.txt b/.besouro/20161005142238292/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142238292/userComments.txt b/.besouro/20161005142238292/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.classpath b/.classpath index b85cb56..b49ab80 100644 --- a/.classpath +++ b/.classpath @@ -1,8 +1,8 @@ - - - - - - - - + + + + + + + + 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 daae7a9..0046b29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,48 +1,48 @@ -# 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 in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns - -# 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 in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +/bin/ diff --git a/.project b/.project index ae0e541..b749631 100644 --- a/.project +++ b/.project @@ -1,17 +1,17 @@ - - - RomanNumerals - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + + + RomanNumerals + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 82b902d..ed5a73b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,67 +1,72 @@ - -public class RomanNumerals { - private static final char I = 'I'; - private static final char V = 'V'; - private static final char X = 'X'; - private static final char L = 'L'; - private static final char C = 'C'; - private static final char D = 'D'; - private static final char M = 'M'; - - public int convertToInteger(String romanNum) { - // To be Implemented - int value = 0; - int stringLength = romanNum.length(); - char currentChar, nextChar; - - if (stringLength > 0) - { - for (int i = stringLength - 1; i >= 0; i--) { - currentChar = romanNum.charAt(i); - if (i < stringLength - 1) { - nextChar = romanNum.charAt(i + 1); - if (currentChar == nextChar) { - value += getCharValue(currentChar); - } - else if (getCharValue(currentChar) < getCharValue(nextChar)) { - value -= getCharValue(currentChar); - } - else if (getCharValue(currentChar) > getCharValue(nextChar)) { - value += getCharValue(currentChar); - } - } - else { - value += getCharValue(currentChar); - } - } - } - return value; - - } - - private int getCharValue(char romanNum) { - if (romanNum == I) { - return 1; - } - else if (romanNum == V) { - return 5; - } - else if (romanNum == X) { - return 10; - } - else if (romanNum == L) { - return 50; - } - else if (romanNum == C) { - return 100; - } - else if (romanNum == D) { - return 500; - } - else if (romanNum == M) { - return 1000; - } - return 0; - } - -} + +public class RomanNumerals { + private static final char I = 'I'; + private static final char V = 'V'; + private static final char X = 'X'; + private static final char L = 'L'; + private static final char C = 'C'; + private static final char D = 'D'; + private static final char M = 'M'; + + public int convertToInteger(String romanNum) { + // To be Implemented + int value = 0; + int stringLength = romanNum.length(); + int currentVal, nextVal; + + if (stringLength > 0) + { + for (int i = stringLength - 1; i >= 0; i--) { + currentVal = getCharValue(romanNum.charAt(i)); + try { + nextVal = getCharValue(romanNum.charAt(i + 1)); + value += getCurrentValue(currentVal, nextVal); + } + catch(Exception e) { // when trying to get next of last, it's intended to end up here + value += currentVal; + } + } + } + return value; + + } + + private int getCurrentValue(int currentVal, int nextVal) { + if (currentVal == nextVal) { + return currentVal; + } + else if (currentVal < nextVal) { + return -currentVal; + } + else if (currentVal > nextVal) { + return currentVal; + } + return 0; + } + + private int getCharValue(char romanNum) { + if (romanNum == I) { + return 1; + } + else if (romanNum == V) { + return 5; + } + else if (romanNum == X) { + return 10; + } + else if (romanNum == L) { + return 50; + } + else if (romanNum == C) { + return 100; + } + else if (romanNum == D) { + return 500; + } + else if (romanNum == M) { + return 1000; + } + return 0; + } + +} diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 27a871e..afd142b 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -1,99 +1,99 @@ -import static org.junit.Assert.*; - -import org.junit.Test; - -public class TestRomanNumerals { - - private RomanNumerals rn = new RomanNumerals(); - - @Test public void testRomanNumerals_emptyString() { - int num = rn.convertToInteger(""); - assertEquals(0, num); - } - - @Test public void testRomanNumerals_I_1() { - int num = rn.convertToInteger("I"); - assertEquals(1, num); - } - - @Test public void testRomanNumerals_II_2() { - int num = rn.convertToInteger("II"); - assertEquals(2, num); - } - - @Test public void testRomanNumerals_III_3() { - int num = rn.convertToInteger("III"); - assertEquals(3, num); - } - - @Test public void testRomanNumerals_V_5() { - int num = rn.convertToInteger("V"); - assertEquals(5, num); - } - - @Test public void testRomanNumerals_IV_4() { - int num = rn.convertToInteger("IV"); - assertEquals(4, num); - } - - @Test public void testRomanNumerals_VI_6() { - int num = rn.convertToInteger("VI"); - assertEquals(6, num); - } - - @Test public void testRomanNumerals_X_10() { - int num = rn.convertToInteger("X"); - assertEquals(10, num); - } - - @Test public void testRomanNumerals_L_50() { - int num = rn.convertToInteger("L"); - assertEquals(50, num); - } - - @Test public void testRomanNumerals_C_100() { - int num = rn.convertToInteger("C"); - assertEquals(100, num); - } - - @Test public void testRomanNumerals_D_500() { - int num = rn.convertToInteger("D"); - assertEquals(500, num); - } - - @Test public void testRomanNumerals_M_1000() { - int num = rn.convertToInteger("M"); - assertEquals(1000, num); - } - - @Test public void testRomanNumerals_XX_20() { - int num = rn.convertToInteger("XX"); - assertEquals(20, num); - } - - @Test public void testRomanNumerals_XC_90() { - int num = rn.convertToInteger("XC"); - assertEquals(90, num); - } - - @Test public void testRomanNumerals_LXX_70() { - int num = rn.convertToInteger("LXX"); - assertEquals(70, num); - } - - @Test public void testRomanNumerals_CM_900() { - int num = rn.convertToInteger("CM"); - assertEquals(900, num); - } - - @Test public void testRomanNumerals_MCMLXXXIV_1984() { - int num = rn.convertToInteger("MCMLXXXIV"); - assertEquals(1984, num); - } - - @Test public void testRomanNumerals_MMXIV_2014() { - int num = rn.convertToInteger("MMXIV"); - assertEquals(2014, num); - } - -} +import static org.junit.Assert.*; + +import org.junit.Test; + +public class TestRomanNumerals { + + private RomanNumerals rn = new RomanNumerals(); + + @Test public void testRomanNumerals_emptyString() { + int num = rn.convertToInteger(""); + assertEquals(0, num); + } + + @Test public void testRomanNumerals_I_1() { + int num = rn.convertToInteger("I"); + assertEquals(1, num); + } + + @Test public void testRomanNumerals_II_2() { + int num = rn.convertToInteger("II"); + assertEquals(2, num); + } + + @Test public void testRomanNumerals_III_3() { + int num = rn.convertToInteger("III"); + assertEquals(3, num); + } + + @Test public void testRomanNumerals_V_5() { + int num = rn.convertToInteger("V"); + assertEquals(5, num); + } + + @Test public void testRomanNumerals_IV_4() { + int num = rn.convertToInteger("IV"); + assertEquals(4, num); + } + + @Test public void testRomanNumerals_VI_6() { + int num = rn.convertToInteger("VI"); + assertEquals(6, num); + } + + @Test public void testRomanNumerals_X_10() { + int num = rn.convertToInteger("X"); + assertEquals(10, num); + } + + @Test public void testRomanNumerals_L_50() { + int num = rn.convertToInteger("L"); + assertEquals(50, num); + } + + @Test public void testRomanNumerals_C_100() { + int num = rn.convertToInteger("C"); + assertEquals(100, num); + } + + @Test public void testRomanNumerals_D_500() { + int num = rn.convertToInteger("D"); + assertEquals(500, num); + } + + @Test public void testRomanNumerals_M_1000() { + int num = rn.convertToInteger("M"); + assertEquals(1000, num); + } + + @Test public void testRomanNumerals_XX_20() { + int num = rn.convertToInteger("XX"); + assertEquals(20, num); + } + + @Test public void testRomanNumerals_XC_90() { + int num = rn.convertToInteger("XC"); + assertEquals(90, num); + } + + @Test public void testRomanNumerals_LXX_70() { + int num = rn.convertToInteger("LXX"); + assertEquals(70, num); + } + + @Test public void testRomanNumerals_CM_900() { + int num = rn.convertToInteger("CM"); + assertEquals(900, num); + } + + @Test public void testRomanNumerals_MCMLXXXIV_1984() { + int num = rn.convertToInteger("MCMLXXXIV"); + assertEquals(1984, num); + } + + @Test public void testRomanNumerals_MMXIV_2014() { + int num = rn.convertToInteger("MMXIV"); + assertEquals(2014, num); + } + +} From c297211bc1df8b19574cad29f5ad098e70a107c9 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:23:52 +0300 Subject: [PATCH 003/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 ++++ .../20161005142238292/besouroEpisodes.txt | 1 + .../randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 23 ++++++++++++------- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 1078e2d..72f2f41 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -1,2 +1,6 @@ FileOpenedAction 1475666558557 RomanNumerals.java 1551 3 9 0 EditAction 1475666589523 RomanNumerals.java 1553 3 9 0 +UnitTestCaseAction 1475666591102 TestRomanNumerals.java OK +UnitTestSessionAction 1475666591102 TestRomanNumerals.java OK +RefactoringAction 1475666632052 RomanNumerals.java ADD int parseCharacterToValue(String, int, int) METHOD +EditAction 1475666632052 RomanNumerals.java 1724 4 14 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index e69de29..c815873 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -0,0 +1 @@ +1475666591102 refactoring 2A 32 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index e69de29..e6e5530 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -0,0 +1 @@ +1475666591102 refactoring 2A 32 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index e69de29..e6e5530 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -0,0 +1 @@ +1475666591102 refactoring 2A 32 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index ed5a73b..8dc912e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -17,20 +17,27 @@ public int convertToInteger(String romanNum) { if (stringLength > 0) { for (int i = stringLength - 1; i >= 0; i--) { - currentVal = getCharValue(romanNum.charAt(i)); - try { - nextVal = getCharValue(romanNum.charAt(i + 1)); - value += getCurrentValue(currentVal, nextVal); - } - catch(Exception e) { // when trying to get next of last, it's intended to end up here - value += currentVal; - } + value = parseCharacterToValue(romanNum, value, i); } } return value; } + private int parseCharacterToValue(String romanNum, int value, int i) { + int currentVal; + int nextVal; + currentVal = getCharValue(romanNum.charAt(i)); + try { + nextVal = getCharValue(romanNum.charAt(i + 1)); + value += getCurrentValue(currentVal, nextVal); + } + catch(Exception e) { // when trying to get next of last, it's intended to end up here + value += currentVal; + } + return value; + } + private int getCurrentValue(int currentVal, int nextVal) { if (currentVal == nextVal) { return currentVal; From 47875c919e854f4806b1b3f58a3d58f06e6b5124 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:24:31 +0300 Subject: [PATCH 004/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 2 ++ src/RomanNumerals.java | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 72f2f41..720e96a 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -4,3 +4,5 @@ UnitTestCaseAction 1475666591102 TestRomanNumerals.java OK UnitTestSessionAction 1475666591102 TestRomanNumerals.java OK RefactoringAction 1475666632052 RomanNumerals.java ADD int parseCharacterToValue(String, int, int) METHOD EditAction 1475666632052 RomanNumerals.java 1724 4 14 0 +RefactoringAction 1475666670553 RomanNumerals.java RENAME parseCharacterToValue(String, int, int)=>int parseCharacterToValue(String, int) METHOD +EditAction 1475666670693 RomanNumerals.java 1686 4 13 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 8dc912e..c8838fb 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -17,25 +17,24 @@ public int convertToInteger(String romanNum) { if (stringLength > 0) { for (int i = stringLength - 1; i >= 0; i--) { - value = parseCharacterToValue(romanNum, value, i); + value += parseCharacterToValue(romanNum, i); } } return value; } - private int parseCharacterToValue(String romanNum, int value, int i) { + private int parseCharacterToValue(String romanNum, int i) { int currentVal; int nextVal; currentVal = getCharValue(romanNum.charAt(i)); try { nextVal = getCharValue(romanNum.charAt(i + 1)); - value += getCurrentValue(currentVal, nextVal); + return getCurrentValue(currentVal, nextVal); } catch(Exception e) { // when trying to get next of last, it's intended to end up here - value += currentVal; + return currentVal; } - return value; } private int getCurrentValue(int currentVal, int nextVal) { From 08ad22d034ff7941637ab041996fcd8ff12706ad Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:25:21 +0300 Subject: [PATCH 005/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ .besouro/20161005142238292/besouroEpisodes.txt | 3 +++ .besouro/20161005142238292/randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ src/RomanNumerals.java | 4 +--- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 720e96a..aaa2284 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -6,3 +6,8 @@ RefactoringAction 1475666632052 RomanNumerals.java ADD int parseCharacterToValue EditAction 1475666632052 RomanNumerals.java 1724 4 14 0 RefactoringAction 1475666670553 RomanNumerals.java RENAME parseCharacterToValue(String, int, int)=>int parseCharacterToValue(String, int) METHOD EditAction 1475666670693 RomanNumerals.java 1686 4 13 0 +UnitTestCaseAction 1475666673317 TestRomanNumerals.java OK +UnitTestSessionAction 1475666673317 TestRomanNumerals.java OK +UnitTestCaseAction 1475666687610 TestRomanNumerals.java OK +UnitTestSessionAction 1475666687610 TestRomanNumerals.java OK +EditAction 1475666720619 RomanNumerals.java 1651 4 11 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index c815873..7c7adf6 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -1 +1,4 @@ 1475666591102 refactoring 2A 32 true +1475666673317 refactoring 2A 41 true +1475666673318 production 3 41 false +1475666687610 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index e6e5530..cb7fc1c 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -1 +1,3 @@ 1475666591102 refactoring 2A 32 false +1475666673317 refactoring 2A 41 false +1475666687610 regression 1 0 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index e6e5530..4240530 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -1 +1,3 @@ 1475666591102 refactoring 2A 32 false +1475666673317 refactoring 2A 82 false +1475666687610 regression 1 14 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c8838fb..a0d357c 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -12,7 +12,6 @@ public int convertToInteger(String romanNum) { // To be Implemented int value = 0; int stringLength = romanNum.length(); - int currentVal, nextVal; if (stringLength > 0) { @@ -25,8 +24,7 @@ public int convertToInteger(String romanNum) { } private int parseCharacterToValue(String romanNum, int i) { - int currentVal; - int nextVal; + int currentVal, nextval; currentVal = getCharValue(romanNum.charAt(i)); try { nextVal = getCharValue(romanNum.charAt(i + 1)); From e3f65611bbba451c91f1188d4d20be78ce3675e8 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:25:23 +0300 Subject: [PATCH 006/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 2 ++ src/RomanNumerals.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index aaa2284..3131b43 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -11,3 +11,5 @@ UnitTestSessionAction 1475666673317 TestRomanNumerals.java OK UnitTestCaseAction 1475666687610 TestRomanNumerals.java OK UnitTestSessionAction 1475666687610 TestRomanNumerals.java OK EditAction 1475666720619 RomanNumerals.java 1651 4 11 0 +CompilationAction 1475666721758 RomanNumerals.java +EditAction 1475666723381 RomanNumerals.java 1651 4 11 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index a0d357c..6c8855f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -24,7 +24,7 @@ public int convertToInteger(String romanNum) { } private int parseCharacterToValue(String romanNum, int i) { - int currentVal, nextval; + int currentVal, nextVal; currentVal = getCharValue(romanNum.charAt(i)); try { nextVal = getCharValue(romanNum.charAt(i + 1)); From 63ecd08129f1323fd0b8e09aa0e578188d743b8e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:25:45 +0300 Subject: [PATCH 007/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 7 ++----- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 3131b43..f51f117 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -13,3 +13,6 @@ UnitTestSessionAction 1475666687610 TestRomanNumerals.java OK EditAction 1475666720619 RomanNumerals.java 1651 4 11 0 CompilationAction 1475666721758 RomanNumerals.java EditAction 1475666723381 RomanNumerals.java 1651 4 11 0 +UnitTestCaseAction 1475666726316 TestRomanNumerals.java OK +UnitTestSessionAction 1475666726316 TestRomanNumerals.java OK +EditAction 1475666745052 RomanNumerals.java 1613 4 11 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 7c7adf6..86bb495 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -2,3 +2,4 @@ 1475666673317 refactoring 2A 41 true 1475666673318 production 3 41 false 1475666687610 regression 1 0 true +1475666726316 refactoring 2A 5 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index cb7fc1c..738db7a 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -1,3 +1,4 @@ 1475666591102 refactoring 2A 32 false 1475666673317 refactoring 2A 41 false 1475666687610 regression 1 0 false +1475666726316 refactoring 2A 5 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 4240530..513fb76 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -1,3 +1,4 @@ 1475666591102 refactoring 2A 32 false 1475666673317 refactoring 2A 82 false 1475666687610 regression 1 14 false +1475666726316 refactoring 2A 38 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 6c8855f..5d1f3f8 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -13,11 +13,8 @@ public int convertToInteger(String romanNum) { int value = 0; int stringLength = romanNum.length(); - if (stringLength > 0) - { - for (int i = stringLength - 1; i >= 0; i--) { - value += parseCharacterToValue(romanNum, i); - } + for (int i = stringLength - 1; i >= 0; i--) { + value += parseCharacterToValue(romanNum, i); } return value; From e9a7e8c35441ff56e6b81c584e519f15cf450632 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:26:36 +0300 Subject: [PATCH 008/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ .besouro/20161005142238292/besouroEpisodes.txt | 2 ++ .besouro/20161005142238292/randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ src/RomanNumerals.java | 3 +-- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index f51f117..2519940 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -16,3 +16,8 @@ EditAction 1475666723381 RomanNumerals.java 1651 4 11 0 UnitTestCaseAction 1475666726316 TestRomanNumerals.java OK UnitTestSessionAction 1475666726316 TestRomanNumerals.java OK EditAction 1475666745052 RomanNumerals.java 1613 4 11 0 +UnitTestCaseAction 1475666747177 TestRomanNumerals.java OK +UnitTestSessionAction 1475666747177 TestRomanNumerals.java OK +UnitTestCaseAction 1475666748615 TestRomanNumerals.java OK +UnitTestSessionAction 1475666748615 TestRomanNumerals.java OK +EditAction 1475666796460 RomanNumerals.java 1610 4 11 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 86bb495..8d8a421 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -3,3 +3,5 @@ 1475666673318 production 3 41 false 1475666687610 regression 1 0 true 1475666726316 refactoring 2A 5 true +1475666747177 refactoring 2A 2 true +1475666748615 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 738db7a..1d82f4d 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -2,3 +2,5 @@ 1475666673317 refactoring 2A 41 false 1475666687610 regression 1 0 false 1475666726316 refactoring 2A 5 false +1475666747177 refactoring 2A 2 false +1475666748615 regression 1 0 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 513fb76..8b8ee8a 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -2,3 +2,5 @@ 1475666673317 refactoring 2A 82 false 1475666687610 regression 1 14 false 1475666726316 refactoring 2A 38 false +1475666747177 refactoring 2A 20 false +1475666748615 regression 1 1 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 5d1f3f8..55681f5 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -17,7 +17,6 @@ public int convertToInteger(String romanNum) { value += parseCharacterToValue(romanNum, i); } return value; - } private int parseCharacterToValue(String romanNum, int i) { @@ -27,7 +26,7 @@ private int parseCharacterToValue(String romanNum, int i) { nextVal = getCharValue(romanNum.charAt(i + 1)); return getCurrentValue(currentVal, nextVal); } - catch(Exception e) { // when trying to get next of last, it's intended to end up here + catch(Exception e) { // when trying to get next of last, it is intended to end up here return currentVal; } } From 5498403a7ac4e4536ca3bd12bba9c65896bb6152 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:26:57 +0300 Subject: [PATCH 009/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 1 - 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 2519940..398ff60 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -21,3 +21,6 @@ UnitTestSessionAction 1475666747177 TestRomanNumerals.java OK UnitTestCaseAction 1475666748615 TestRomanNumerals.java OK UnitTestSessionAction 1475666748615 TestRomanNumerals.java OK EditAction 1475666796460 RomanNumerals.java 1610 4 11 0 +UnitTestCaseAction 1475666798475 TestRomanNumerals.java OK +UnitTestSessionAction 1475666798475 TestRomanNumerals.java OK +EditAction 1475666817585 RomanNumerals.java 1586 4 11 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 8d8a421..0e81a9a 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -5,3 +5,4 @@ 1475666726316 refactoring 2A 5 true 1475666747177 refactoring 2A 2 true 1475666748615 regression 1 0 true +1475666798475 refactoring 2A 2 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 1d82f4d..e5ad05d 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -4,3 +4,4 @@ 1475666726316 refactoring 2A 5 false 1475666747177 refactoring 2A 2 false 1475666748615 regression 1 0 true +1475666798475 refactoring 2A 2 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 8b8ee8a..a0bc232 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -4,3 +4,4 @@ 1475666726316 refactoring 2A 38 false 1475666747177 refactoring 2A 20 false 1475666748615 regression 1 1 false +1475666798475 refactoring 2A 49 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 55681f5..428a018 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -9,7 +9,6 @@ public class RomanNumerals { private static final char M = 'M'; public int convertToInteger(String romanNum) { - // To be Implemented int value = 0; int stringLength = romanNum.length(); From 32507ca2c73fdc8f14ede35abbd885c8f233b5f2 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:27:14 +0300 Subject: [PATCH 010/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 3 +-- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 398ff60..572d41e 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -24,3 +24,6 @@ EditAction 1475666796460 RomanNumerals.java 1610 4 11 0 UnitTestCaseAction 1475666798475 TestRomanNumerals.java OK UnitTestSessionAction 1475666798475 TestRomanNumerals.java OK EditAction 1475666817585 RomanNumerals.java 1586 4 11 0 +UnitTestCaseAction 1475666821208 TestRomanNumerals.java OK +UnitTestSessionAction 1475666821208 TestRomanNumerals.java OK +EditAction 1475666833610 RomanNumerals.java 1550 4 10 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 0e81a9a..2cef01a 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -6,3 +6,4 @@ 1475666747177 refactoring 2A 2 true 1475666748615 regression 1 0 true 1475666798475 refactoring 2A 2 true +1475666821208 refactoring 2A 3 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index e5ad05d..c94b0bc 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -5,3 +5,4 @@ 1475666747177 refactoring 2A 2 false 1475666748615 regression 1 0 true 1475666798475 refactoring 2A 2 true +1475666821208 refactoring 2A 3 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index a0bc232..af619bc 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -5,3 +5,4 @@ 1475666747177 refactoring 2A 20 false 1475666748615 regression 1 1 false 1475666798475 refactoring 2A 49 false +1475666821208 refactoring 2A 22 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 428a018..91cc8cb 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -10,9 +10,8 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { int value = 0; - int stringLength = romanNum.length(); - for (int i = stringLength - 1; i >= 0; i--) { + for (int i = romanNum.length() - 1; i >= 0; i--) { value += parseCharacterToValue(romanNum, i); } return value; From 78969df3ab1ff313122c87b71d213001ad4b81aa Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:27:35 +0300 Subject: [PATCH 011/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 572d41e..a059d1e 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -27,3 +27,6 @@ EditAction 1475666817585 RomanNumerals.java 1586 4 11 0 UnitTestCaseAction 1475666821208 TestRomanNumerals.java OK UnitTestSessionAction 1475666821208 TestRomanNumerals.java OK EditAction 1475666833610 RomanNumerals.java 1550 4 10 0 +UnitTestCaseAction 1475666835282 TestRomanNumerals.java OK +UnitTestSessionAction 1475666835282 TestRomanNumerals.java OK +EditAction 1475666855234 RomanNumerals.java 1550 4 10 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 2cef01a..f9e6b72 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -7,3 +7,4 @@ 1475666748615 regression 1 0 true 1475666798475 refactoring 2A 2 true 1475666821208 refactoring 2A 3 true +1475666835282 refactoring 2A 1 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index c94b0bc..c004174 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -6,3 +6,4 @@ 1475666748615 regression 1 0 true 1475666798475 refactoring 2A 2 true 1475666821208 refactoring 2A 3 false +1475666835282 refactoring 2A 1 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index af619bc..1601e6a 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -6,3 +6,4 @@ 1475666748615 regression 1 1 false 1475666798475 refactoring 2A 49 false 1475666821208 refactoring 2A 22 false +1475666835282 refactoring 2A 14 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 91cc8cb..9620606 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -24,8 +24,8 @@ private int parseCharacterToValue(String romanNum, int i) { nextVal = getCharValue(romanNum.charAt(i + 1)); return getCurrentValue(currentVal, nextVal); } - catch(Exception e) { // when trying to get next of last, it is intended to end up here - return currentVal; + catch(Exception e) { + return currentVal; // when trying to get next of last, it is intended to end up here } } From 63724d797041b62d325c1d5aebee8347a5da37e7 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:30:18 +0300 Subject: [PATCH 012/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 8 ++++++++ .besouro/20161005142238292/besouroEpisodes.txt | 2 ++ .besouro/20161005142238292/randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ tests/TestRomanNumerals.java | 5 +++++ 5 files changed, 19 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a059d1e..f42dd17 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -30,3 +30,11 @@ EditAction 1475666833610 RomanNumerals.java 1550 4 10 0 UnitTestCaseAction 1475666835282 TestRomanNumerals.java OK UnitTestSessionAction 1475666835282 TestRomanNumerals.java OK EditAction 1475666855234 RomanNumerals.java 1550 4 10 0 +UnitTestCaseAction 1475666857136 TestRomanNumerals.java OK +UnitTestSessionAction 1475666857136 TestRomanNumerals.java OK +UnitTestCaseAction 1475666864175 TestRomanNumerals.java OK +UnitTestSessionAction 1475666864175 TestRomanNumerals.java OK +RefactoringAction 1475667005246 TestRomanNumerals.java ADD void testRomanNumerals_MMXIV_2014()/2 METHOD +RefactoringAction 1475667008849 TestRomanNumerals.java RENAME testRomanNumerals_MMXIV_2014()/2=>void testRomanNumerals_IIII_2014() METHOD +RefactoringAction 1475667011439 TestRomanNumerals.java RENAME testRomanNumerals_IIII_2014()=>void testRomanNumerals_IIII_err() METHOD +EditAction 1475667017726 TestRomanNumerals.java 2476 19 38 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index f9e6b72..4ad6bb8 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -8,3 +8,5 @@ 1475666798475 refactoring 2A 2 true 1475666821208 refactoring 2A 3 true 1475666835282 refactoring 2A 1 true +1475666857136 regression 1 1 true +1475666864175 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index c004174..f70899c 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -7,3 +7,5 @@ 1475666798475 refactoring 2A 2 true 1475666821208 refactoring 2A 3 false 1475666835282 refactoring 2A 1 true +1475666857136 regression 1 1 false +1475666864175 regression 1 0 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 1601e6a..3bf2249 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -7,3 +7,5 @@ 1475666798475 refactoring 2A 49 false 1475666821208 refactoring 2A 22 false 1475666835282 refactoring 2A 14 false +1475666857136 regression 1 21 false +1475666864175 regression 1 7 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index afd142b..bd766ec 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -95,5 +95,10 @@ public class TestRomanNumerals { int num = rn.convertToInteger("MMXIV"); assertEquals(2014, num); } + + @Test public void testRomanNumerals_IIII_err() { + int num = rn.convertToInteger("IIII"); + assertEquals(4, num); + } } From 84c7fc3109f0053ac385ef45cdc9b43756505489 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:30:27 +0300 Subject: [PATCH 013/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 2 +- 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index f42dd17..5f3d9bc 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -38,3 +38,6 @@ RefactoringAction 1475667005246 TestRomanNumerals.java ADD void testRomanNumeral RefactoringAction 1475667008849 TestRomanNumerals.java RENAME testRomanNumerals_MMXIV_2014()/2=>void testRomanNumerals_IIII_2014() METHOD RefactoringAction 1475667011439 TestRomanNumerals.java RENAME testRomanNumerals_IIII_2014()=>void testRomanNumerals_IIII_err() METHOD EditAction 1475667017726 TestRomanNumerals.java 2476 19 38 19 +UnitTestCaseAction 1475667019491 TestRomanNumerals.java OK +UnitTestSessionAction 1475667019491 TestRomanNumerals.java OK +EditAction 1475667027619 TestRomanNumerals.java 2477 19 38 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 4ad6bb8..32a967c 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -10,3 +10,4 @@ 1475666835282 refactoring 2A 1 true 1475666857136 regression 1 1 true 1475666864175 regression 1 0 true +1475667019491 test-addition 1 14 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index f70899c..df0bb72 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -9,3 +9,4 @@ 1475666835282 refactoring 2A 1 true 1475666857136 regression 1 1 false 1475666864175 regression 1 0 false +1475667019491 test-addition 1 14 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 3bf2249..4b45975 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -9,3 +9,4 @@ 1475666835282 refactoring 2A 14 false 1475666857136 regression 1 21 false 1475666864175 regression 1 7 false +1475667019491 test-addition 1 155 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index bd766ec..95900e4 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -97,7 +97,7 @@ public class TestRomanNumerals { } @Test public void testRomanNumerals_IIII_err() { - int num = rn.convertToInteger("IIII"); + int num = rn.convertToInteger("IIIII"); assertEquals(4, num); } From 964e21c16fc375c649c69af15c13a209f7173103 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:30:42 +0300 Subject: [PATCH 014/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 5f3d9bc..da1744a 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -41,3 +41,6 @@ EditAction 1475667017726 TestRomanNumerals.java 2476 19 38 19 UnitTestCaseAction 1475667019491 TestRomanNumerals.java OK UnitTestSessionAction 1475667019491 TestRomanNumerals.java OK EditAction 1475667027619 TestRomanNumerals.java 2477 19 38 19 +UnitTestCaseAction 1475667028824 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667028824 TestRomanNumerals.java FAIL +EditAction 1475667041928 TestRomanNumerals.java 2485 19 38 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 95900e4..d6b4e65 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -97,7 +97,7 @@ public class TestRomanNumerals { } @Test public void testRomanNumerals_IIII_err() { - int num = rn.convertToInteger("IIIII"); + int num = rn.convertToInteger("IIIIIIIIIIIII"); assertEquals(4, num); } From f4be38e6ced89648dc863298702e7746c0968725 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:31:05 +0300 Subject: [PATCH 015/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index da1744a..ed1243e 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -44,3 +44,6 @@ EditAction 1475667027619 TestRomanNumerals.java 2477 19 38 19 UnitTestCaseAction 1475667028824 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667028824 TestRomanNumerals.java FAIL EditAction 1475667041928 TestRomanNumerals.java 2485 19 38 19 +UnitTestCaseAction 1475667042867 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667042867 TestRomanNumerals.java FAIL +EditAction 1475667065051 TestRomanNumerals.java 2477 19 37 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index d6b4e65..74c5125 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -96,9 +96,8 @@ public class TestRomanNumerals { assertEquals(2014, num); } - @Test public void testRomanNumerals_IIII_err() { - int num = rn.convertToInteger("IIIIIIIIIIIII"); - assertEquals(4, num); + @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() { + int num = rn.convertToInteger("IIII"); } } From 2a52be6c9d5f233617938fcbe0ef83044a1cd15f Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:35:40 +0300 Subject: [PATCH 016/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 10 ++++++++++ src/RomanNumerals.java | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index ed1243e..1595c16 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -47,3 +47,13 @@ EditAction 1475667041928 TestRomanNumerals.java 2485 19 38 19 UnitTestCaseAction 1475667042867 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667042867 TestRomanNumerals.java FAIL EditAction 1475667065051 TestRomanNumerals.java 2477 19 37 18 +UnitTestCaseAction 1475667067082 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667067082 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475667075602 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667075602 TestRomanNumerals.java FAIL +RefactoringAction 1475667239293 RomanNumerals.java ADD int occurencies FIELD +RefactoringAction 1475667253754 RomanNumerals.java RENAME occurencies=> null +RefactoringAction 1475667260462 RomanNumerals.java RENAME =>int occurencies FIELD +RefactoringAction 1475667274378 RomanNumerals.java RENAME occurencies=> null +RefactoringAction 1475667278496 RomanNumerals.java RENAME =>int FIELD +EditAction 1475667339789 RomanNumerals.java 1742 4 10 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9620606..392c175 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,6 +7,8 @@ public class RomanNumerals { private static final char C = 'C'; private static final char D = 'D'; private static final char M = 'M'; + + private int[] occurencies = {0}; public int convertToInteger(String romanNum) { int value = 0; @@ -44,24 +46,31 @@ else if (currentVal > nextVal) { private int getCharValue(char romanNum) { if (romanNum == I) { + occurencies[0]++; return 1; } else if (romanNum == V) { + occurencies[1]++; return 5; } else if (romanNum == X) { + occurencies[2]++; return 10; } else if (romanNum == L) { + occurencies[3]++; return 50; } else if (romanNum == C) { + occurencies[4]++; return 100; } else if (romanNum == D) { + occurencies[5]++; return 500; } else if (romanNum == M) { + occurencies[6]++; return 1000; } return 0; From c615e2eab1cff0cbd71988eab51650de1ca821a1 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:36:06 +0300 Subject: [PATCH 017/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 1595c16..76370c4 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -57,3 +57,6 @@ RefactoringAction 1475667260462 RomanNumerals.java RENAME =>int RefactoringAction 1475667274378 RomanNumerals.java RENAME occurencies=> null RefactoringAction 1475667278496 RomanNumerals.java RENAME =>int FIELD EditAction 1475667339789 RomanNumerals.java 1742 4 10 0 +UnitTestCaseAction 1475667342194 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667342194 TestRomanNumerals.java FAIL +EditAction 1475667366031 RomanNumerals.java 1754 4 10 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 392c175..fcac0f1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -8,7 +8,7 @@ public class RomanNumerals { private static final char D = 'D'; private static final char M = 'M'; - private int[] occurencies = {0}; + private int[] occurencies = {0,0,0,0,0,0,0}; public int convertToInteger(String romanNum) { int value = 0; From 05db897fb889fd0a7e39b21b77ab72fa6d8ce7e0 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:37:03 +0300 Subject: [PATCH 018/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ src/RomanNumerals.java | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 76370c4..ff9dcae 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -60,3 +60,10 @@ EditAction 1475667339789 RomanNumerals.java 1742 4 10 0 UnitTestCaseAction 1475667342194 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667342194 TestRomanNumerals.java FAIL EditAction 1475667366031 RomanNumerals.java 1754 4 10 0 +UnitTestCaseAction 1475667367751 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667367751 TestRomanNumerals.java FAIL +RefactoringAction 1475667383554 RomanNumerals.java ADD int value FIELD +RefactoringAction 1475667383554 RomanNumerals.java ADD int i FIELD +RefactoringAction 1475667390324 RomanNumerals.java REMOVE i FIELD +RefactoringAction 1475667390324 RomanNumerals.java REMOVE value FIELD +EditAction 1475667423131 RomanNumerals.java 1770 4 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index fcac0f1..1d07327 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -8,9 +8,10 @@ public class RomanNumerals { private static final char D = 'D'; private static final char M = 'M'; - private int[] occurencies = {0,0,0,0,0,0,0}; + private int[] occurencies; public int convertToInteger(String romanNum) { + occurencies = [0,0,0,0,0,0,0]; int value = 0; for (int i = romanNum.length() - 1; i >= 0; i--) { From b5e1145cadc273babd9eb30de63e8e80d8fb222d Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:38:08 +0300 Subject: [PATCH 019/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 9 +++++++++ src/RomanNumerals.java | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index ff9dcae..59d3c82 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -67,3 +67,12 @@ RefactoringAction 1475667383554 RomanNumerals.java ADD int i FIELD RefactoringAction 1475667390324 RomanNumerals.java REMOVE i FIELD RefactoringAction 1475667390324 RomanNumerals.java REMOVE value FIELD EditAction 1475667423131 RomanNumerals.java 1770 4 7 0 +CompilationAction 1475667424254 RomanNumerals.java +CompilationAction 1475667424254 RomanNumerals.java +CompilationAction 1475667424254 RomanNumerals.java +CompilationAction 1475667472351 RomanNumerals.java +CompilationAction 1475667472351 RomanNumerals.java +CompilationAction 1475667472351 RomanNumerals.java +UnitTestCaseAction 1475667473634 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667473634 TestRomanNumerals.java FAIL +EditAction 1475667487627 RomanNumerals.java 1816 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1d07327..b5c5b5e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -11,12 +11,13 @@ public class RomanNumerals { private int[] occurencies; public int convertToInteger(String romanNum) { - occurencies = [0,0,0,0,0,0,0]; + occurencies = new int[] {0,0,0,0,0,0,0}; int value = 0; for (int i = romanNum.length() - 1; i >= 0; i--) { value += parseCharacterToValue(romanNum, i); } + System.out.println(occurencies); return value; } From 14c274c08671e27ac0f780af3e6f538b6e5c424a Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:38:21 +0300 Subject: [PATCH 020/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 59d3c82..1d11983 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -76,3 +76,6 @@ CompilationAction 1475667472351 RomanNumerals.java UnitTestCaseAction 1475667473634 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667473634 TestRomanNumerals.java FAIL EditAction 1475667487627 RomanNumerals.java 1816 4 12 0 +UnitTestCaseAction 1475667491046 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667491046 TestRomanNumerals.java FAIL +EditAction 1475667501373 RomanNumerals.java 1819 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index b5c5b5e..3ba807f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -17,7 +17,7 @@ public int convertToInteger(String romanNum) { for (int i = romanNum.length() - 1; i >= 0; i--) { value += parseCharacterToValue(romanNum, i); } - System.out.println(occurencies); + System.out.println(occurencies[0]); return value; } From 0efbe03712138bc9c28679ffe68aa5efb6d66117 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:38:55 +0300 Subject: [PATCH 021/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 ++++ src/RomanNumerals.java | 11 ----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 1d11983..d5de696 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -79,3 +79,7 @@ EditAction 1475667487627 RomanNumerals.java 1816 4 12 0 UnitTestCaseAction 1475667491046 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667491046 TestRomanNumerals.java FAIL EditAction 1475667501373 RomanNumerals.java 1819 4 12 0 +UnitTestCaseAction 1475667503358 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667503358 TestRomanNumerals.java FAIL +RefactoringAction 1475667521017 RomanNumerals.java REMOVE occurencies FIELD +EditAction 1475667534901 RomanNumerals.java 1550 4 10 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3ba807f..9620606 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,17 +7,13 @@ public class RomanNumerals { private static final char C = 'C'; private static final char D = 'D'; private static final char M = 'M'; - - private int[] occurencies; public int convertToInteger(String romanNum) { - occurencies = new int[] {0,0,0,0,0,0,0}; int value = 0; for (int i = romanNum.length() - 1; i >= 0; i--) { value += parseCharacterToValue(romanNum, i); } - System.out.println(occurencies[0]); return value; } @@ -48,31 +44,24 @@ else if (currentVal > nextVal) { private int getCharValue(char romanNum) { if (romanNum == I) { - occurencies[0]++; return 1; } else if (romanNum == V) { - occurencies[1]++; return 5; } else if (romanNum == X) { - occurencies[2]++; return 10; } else if (romanNum == L) { - occurencies[3]++; return 50; } else if (romanNum == C) { - occurencies[4]++; return 100; } else if (romanNum == D) { - occurencies[5]++; return 500; } else if (romanNum == M) { - occurencies[6]++; return 1000; } return 0; From a7b81cae4d8d4052ac0c88a8fab1d7af18f0d2d1 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:45:47 +0300 Subject: [PATCH 022/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index d5de696..12aaeab 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -83,3 +83,6 @@ UnitTestCaseAction 1475667503358 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667503358 TestRomanNumerals.java FAIL RefactoringAction 1475667521017 RomanNumerals.java REMOVE occurencies FIELD EditAction 1475667534901 RomanNumerals.java 1550 4 10 0 +UnitTestCaseAction 1475667536948 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667536948 TestRomanNumerals.java FAIL +EditAction 1475667946682 RomanNumerals.java 1797 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9620606..02cfb9e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -9,9 +9,19 @@ public class RomanNumerals { private static final char M = 'M'; public int convertToInteger(String romanNum) { + int repeated; int value = 0; + int lastIndexOfNum = romanNum.length() - 1; - for (int i = romanNum.length() - 1; i >= 0; i--) { + for (int i = lastIndexOfNum; i >= 0; i--) { + repeated = 0; + if (i < lastIndexOfNum) { + for (int j = i; j < lastIndexOfNum; j++) { + if (romanNum.charAt(i) == romanNum.charAt(j)) { + repeated++; + } + } + } value += parseCharacterToValue(romanNum, i); } return value; From 05c6ec398c937f28b7ff1c82f19bf330b9b91d6f Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:46:04 +0300 Subject: [PATCH 023/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 12aaeab..ae326cd 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -86,3 +86,6 @@ EditAction 1475667534901 RomanNumerals.java 1550 4 10 0 UnitTestCaseAction 1475667536948 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667536948 TestRomanNumerals.java FAIL EditAction 1475667946682 RomanNumerals.java 1797 4 12 0 +UnitTestCaseAction 1475667949197 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667949197 TestRomanNumerals.java FAIL +EditAction 1475667963798 RomanNumerals.java 1831 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 02cfb9e..34ea296 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -23,6 +23,7 @@ public int convertToInteger(String romanNum) { } } value += parseCharacterToValue(romanNum, i); + System.err.println(repeated); } return value; } From 9eb078b6c7ee3af5a7444eeac1f833d23e6eeac3 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:47:05 +0300 Subject: [PATCH 024/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ src/RomanNumerals.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index ae326cd..ce7155f 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -89,3 +89,10 @@ EditAction 1475667946682 RomanNumerals.java 1797 4 12 0 UnitTestCaseAction 1475667949197 TestRomanNumerals.java FAIL UnitTestSessionAction 1475667949197 TestRomanNumerals.java FAIL EditAction 1475667963798 RomanNumerals.java 1831 4 12 0 +UnitTestCaseAction 1475667965876 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667965876 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475667992009 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475667992009 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475668001404 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668001404 TestRomanNumerals.testRomanNumerals_IIII_err FAIL +EditAction 1475668025053 RomanNumerals.java 1831 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 34ea296..e43507e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -14,7 +14,7 @@ public int convertToInteger(String romanNum) { int lastIndexOfNum = romanNum.length() - 1; for (int i = lastIndexOfNum; i >= 0; i--) { - repeated = 0; + repeated = 1; if (i < lastIndexOfNum) { for (int j = i; j < lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { From 52d56b195895348f865c5f8eb7323871df696be7 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:47:49 +0300 Subject: [PATCH 025/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index ce7155f..6eb0733 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -96,3 +96,6 @@ UnitTestSessionAction 1475667992009 TestRomanNumerals.java FAIL UnitTestCaseAction 1475668001404 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668001404 TestRomanNumerals.testRomanNumerals_IIII_err FAIL EditAction 1475668025053 RomanNumerals.java 1831 4 12 0 +UnitTestCaseAction 1475668027272 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668027272 TestRomanNumerals.testRomanNumerals_IIII_err FAIL +EditAction 1475668068534 RomanNumerals.java 1911 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e43507e..cff7ef9 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -8,7 +8,7 @@ public class RomanNumerals { private static final char D = 'D'; private static final char M = 'M'; - public int convertToInteger(String romanNum) { + public int convertToInteger(String romanNum) throws Exception { int repeated; int value = 0; int lastIndexOfNum = romanNum.length() - 1; @@ -22,6 +22,9 @@ public int convertToInteger(String romanNum) { } } } + if (repeated < 3) { + throw new Exception("err"); + } value += parseCharacterToValue(romanNum, i); System.err.println(repeated); } From 3752e9e73cff277fc471166599ab2adb4f3d0ee1 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:49:06 +0300 Subject: [PATCH 026/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++ src/RomanNumerals.java | 2 +- tests/TestRomanNumerals.java | 38 +++++++++++++------------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 6eb0733..7899640 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -99,3 +99,10 @@ EditAction 1475668025053 RomanNumerals.java 1831 4 12 0 UnitTestCaseAction 1475668027272 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668027272 TestRomanNumerals.testRomanNumerals_IIII_err FAIL EditAction 1475668068534 RomanNumerals.java 1911 4 12 0 +CompilationAction 1475668069814 TestRomanNumerals.java +UnitTestCaseAction 1475668073233 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668073233 TestRomanNumerals.testRomanNumerals_IIII_err FAIL +CompilationAction 1475668132544 TestRomanNumerals.java +UnitTestCaseAction 1475668132912 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668132912 TestRomanNumerals.java FAIL +EditAction 1475668145470 RomanNumerals.java 1911 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index cff7ef9..44f263f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -22,7 +22,7 @@ public int convertToInteger(String romanNum) throws Exception { } } } - if (repeated < 3) { + if (repeated > 3) { throw new Exception("err"); } value += parseCharacterToValue(romanNum, i); diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 74c5125..bfda5ca 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -6,97 +6,97 @@ public class TestRomanNumerals { private RomanNumerals rn = new RomanNumerals(); - @Test public void testRomanNumerals_emptyString() { + @Test public void testRomanNumerals_emptyString() throws Exception { int num = rn.convertToInteger(""); assertEquals(0, num); } - @Test public void testRomanNumerals_I_1() { + @Test public void testRomanNumerals_I_1() throws Exception { int num = rn.convertToInteger("I"); assertEquals(1, num); } - @Test public void testRomanNumerals_II_2() { + @Test public void testRomanNumerals_II_2() throws Exception { int num = rn.convertToInteger("II"); assertEquals(2, num); } - @Test public void testRomanNumerals_III_3() { + @Test public void testRomanNumerals_III_3() throws Exception { int num = rn.convertToInteger("III"); assertEquals(3, num); } - @Test public void testRomanNumerals_V_5() { + @Test public void testRomanNumerals_V_5() throws Exception { int num = rn.convertToInteger("V"); assertEquals(5, num); } - @Test public void testRomanNumerals_IV_4() { + @Test public void testRomanNumerals_IV_4() throws Exception { int num = rn.convertToInteger("IV"); assertEquals(4, num); } - @Test public void testRomanNumerals_VI_6() { + @Test public void testRomanNumerals_VI_6() throws Exception { int num = rn.convertToInteger("VI"); assertEquals(6, num); } - @Test public void testRomanNumerals_X_10() { + @Test public void testRomanNumerals_X_10() throws Exception { int num = rn.convertToInteger("X"); assertEquals(10, num); } - @Test public void testRomanNumerals_L_50() { + @Test public void testRomanNumerals_L_50() throws Exception { int num = rn.convertToInteger("L"); assertEquals(50, num); } - @Test public void testRomanNumerals_C_100() { + @Test public void testRomanNumerals_C_100() throws Exception { int num = rn.convertToInteger("C"); assertEquals(100, num); } - @Test public void testRomanNumerals_D_500() { + @Test public void testRomanNumerals_D_500() throws Exception { int num = rn.convertToInteger("D"); assertEquals(500, num); } - @Test public void testRomanNumerals_M_1000() { + @Test public void testRomanNumerals_M_1000() throws Exception { int num = rn.convertToInteger("M"); assertEquals(1000, num); } - @Test public void testRomanNumerals_XX_20() { + @Test public void testRomanNumerals_XX_20() throws Exception { int num = rn.convertToInteger("XX"); assertEquals(20, num); } - @Test public void testRomanNumerals_XC_90() { + @Test public void testRomanNumerals_XC_90() throws Exception { int num = rn.convertToInteger("XC"); assertEquals(90, num); } - @Test public void testRomanNumerals_LXX_70() { + @Test public void testRomanNumerals_LXX_70() throws Exception { int num = rn.convertToInteger("LXX"); assertEquals(70, num); } - @Test public void testRomanNumerals_CM_900() { + @Test public void testRomanNumerals_CM_900() throws Exception { int num = rn.convertToInteger("CM"); assertEquals(900, num); } - @Test public void testRomanNumerals_MCMLXXXIV_1984() { + @Test public void testRomanNumerals_MCMLXXXIV_1984() throws Exception { int num = rn.convertToInteger("MCMLXXXIV"); assertEquals(1984, num); } - @Test public void testRomanNumerals_MMXIV_2014() { + @Test public void testRomanNumerals_MMXIV_2014() throws Exception { int num = rn.convertToInteger("MMXIV"); assertEquals(2014, num); } - @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() { + @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() throws Exception { int num = rn.convertToInteger("IIII"); } From b6aec38012aea9db8c8ffc983100cd8988437629 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:49:23 +0300 Subject: [PATCH 027/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 7899640..5f46403 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -106,3 +106,6 @@ CompilationAction 1475668132544 TestRomanNumerals.java UnitTestCaseAction 1475668132912 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668132912 TestRomanNumerals.java FAIL EditAction 1475668145470 RomanNumerals.java 1911 4 12 0 +UnitTestCaseAction 1475668159342 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668159342 TestRomanNumerals.java FAIL +EditAction 1475668163132 RomanNumerals.java 1877 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 44f263f..b10ceca 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -26,7 +26,6 @@ public int convertToInteger(String romanNum) throws Exception { throw new Exception("err"); } value += parseCharacterToValue(romanNum, i); - System.err.println(repeated); } return value; } From 9ad0a7e306a5d22dd6d6534973cade46e80a4a58 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:50:26 +0300 Subject: [PATCH 028/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 5f46403..cb31a3e 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -109,3 +109,6 @@ EditAction 1475668145470 RomanNumerals.java 1911 4 12 0 UnitTestCaseAction 1475668159342 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668159342 TestRomanNumerals.java FAIL EditAction 1475668163132 RomanNumerals.java 1877 4 12 0 +UnitTestCaseAction 1475668165820 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668165820 TestRomanNumerals.java FAIL +EditAction 1475668226239 RomanNumerals.java 1911 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index b10ceca..2655384 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -25,6 +25,7 @@ public int convertToInteger(String romanNum) throws Exception { if (repeated > 3) { throw new Exception("err"); } + System.err.println(repeated); value += parseCharacterToValue(romanNum, i); } return value; From 93f913372143c5e0996a6b811554fbcb08aa7e4b Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:50:37 +0300 Subject: [PATCH 029/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index cb31a3e..2574af9 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -112,3 +112,4 @@ EditAction 1475668163132 RomanNumerals.java 1877 4 12 0 UnitTestCaseAction 1475668165820 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668165820 TestRomanNumerals.java FAIL EditAction 1475668226239 RomanNumerals.java 1911 4 12 0 +EditAction 1475668237408 RomanNumerals.java 1938 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 2655384..bf6c967 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -23,7 +23,7 @@ public int convertToInteger(String romanNum) throws Exception { } } if (repeated > 3) { - throw new Exception("err"); + throw new Exception("Symbol repeated too many times"); } System.err.println(repeated); value += parseCharacterToValue(romanNum, i); From e44105be1450f2c168f4a7ec8f5a77841c0b1f71 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:51:18 +0300 Subject: [PATCH 030/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 2574af9..a7a484b 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -113,3 +113,4 @@ UnitTestCaseAction 1475668165820 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668165820 TestRomanNumerals.java FAIL EditAction 1475668226239 RomanNumerals.java 1911 4 12 0 EditAction 1475668237408 RomanNumerals.java 1938 4 12 0 +EditAction 1475668278545 RomanNumerals.java 1938 4 12 0 From eb9d5eb3eb53dc18375468f2f29673c9638281f8 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:52:00 +0300 Subject: [PATCH 031/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 9 ++++++++ .../20161005142238292/besouroEpisodes.txt | 23 +++++++++++++++++++ .../randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ src/RomanNumerals.java | 1 - 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a7a484b..2778e08 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -114,3 +114,12 @@ UnitTestSessionAction 1475668165820 TestRomanNumerals.java FAIL EditAction 1475668226239 RomanNumerals.java 1911 4 12 0 EditAction 1475668237408 RomanNumerals.java 1938 4 12 0 EditAction 1475668278545 RomanNumerals.java 1938 4 12 0 +UnitTestCaseAction 1475668280519 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668280519 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475668292927 TestRomanNumerals.java OK +UnitTestSessionAction 1475668292927 TestRomanNumerals.testRomanNumerals_IIII_err OK +UnitTestCaseAction 1475668308062 TestRomanNumerals.java OK +UnitTestSessionAction 1475668308062 TestRomanNumerals.testRomanNumerals_MMXIV_2014 OK +UnitTestCaseAction 1475668312737 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668312737 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL +EditAction 1475668319663 RomanNumerals.java 1904 4 12 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 32a967c..b929e77 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -11,3 +11,26 @@ 1475666857136 regression 1 1 true 1475666864175 regression 1 0 true 1475667019491 test-addition 1 14 true +1475668292927 refactoring 3 1265 true +1475668292928 refactoring 3 1265 true +1475668292929 refactoring 3 1265 true +1475668292930 refactoring 3 1265 true +1475668292931 refactoring 3 1265 true +1475668292932 refactoring 3 1265 true +1475668292933 refactoring 3 1265 true +1475668292934 refactoring 3 1265 true +1475668292935 refactoring 3 1265 true +1475668292936 refactoring 3 1265 true +1475668292937 refactoring 3 1265 true +1475668292938 refactoring 3 1265 true +1475668292939 refactoring 3 1265 true +1475668292940 refactoring 3 1265 true +1475668292941 refactoring 3 1265 true +1475668292942 refactoring 3 1265 true +1475668292943 refactoring 3 1265 true +1475668292944 refactoring 3 1265 true +1475668292945 refactoring 3 1265 true +1475668292946 refactoring 3 1265 true +1475668292947 refactoring 3 1265 true +1475668292948 refactoring 3 1265 true +1475668308062 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index df0bb72..9a2bb41 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -10,3 +10,5 @@ 1475666857136 regression 1 1 false 1475666864175 regression 1 0 false 1475667019491 test-addition 1 14 false +1475668292927 refactoring 3 1265 false +1475668308062 regression 1 0 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 4b45975..c8e4661 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -10,3 +10,5 @@ 1475666857136 regression 1 21 false 1475666864175 regression 1 7 false 1475667019491 test-addition 1 155 false +1475668292927 refactoring 3 1273 false +1475668308062 regression 1 15 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index bf6c967..99a7a65 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -25,7 +25,6 @@ public int convertToInteger(String romanNum) throws Exception { if (repeated > 3) { throw new Exception("Symbol repeated too many times"); } - System.err.println(repeated); value += parseCharacterToValue(romanNum, i); } return value; From 4e5de31bbfabe0cd980fafb853853dd922d3be3a Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:52:27 +0300 Subject: [PATCH 032/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 2778e08..f5722a2 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -123,3 +123,6 @@ UnitTestSessionAction 1475668308062 TestRomanNumerals.testRomanNumerals_MMXIV_20 UnitTestCaseAction 1475668312737 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668312737 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL EditAction 1475668319663 RomanNumerals.java 1904 4 12 0 +UnitTestCaseAction 1475668321725 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668321725 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL +EditAction 1475668347184 RomanNumerals.java 1939 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 99a7a65..7a1c2f8 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -20,6 +20,9 @@ public int convertToInteger(String romanNum) throws Exception { if (romanNum.charAt(i) == romanNum.charAt(j)) { repeated++; } + else { + break; + } } } if (repeated > 3) { From 7a4bc27010d9af92b03d7961ce49a3faa788a0a4 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:53:33 +0300 Subject: [PATCH 033/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ src/RomanNumerals.java | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index f5722a2..a0349cb 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -126,3 +126,10 @@ EditAction 1475668319663 RomanNumerals.java 1904 4 12 0 UnitTestCaseAction 1475668321725 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668321725 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL EditAction 1475668347184 RomanNumerals.java 1939 4 12 0 +UnitTestCaseAction 1475668349405 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668349405 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL +UnitTestCaseAction 1475668380645 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668380645 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL +UnitTestCaseAction 1475668394891 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668394891 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL +EditAction 1475668412597 RomanNumerals.java 1942 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7a1c2f8..05e7298 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -24,9 +24,9 @@ public int convertToInteger(String romanNum) throws Exception { break; } } - } - if (repeated > 3) { - throw new Exception("Symbol repeated too many times"); + if (repeated > 3) { + throw new Exception("Symbol repeated too many times"); + } } value += parseCharacterToValue(romanNum, i); } From 3bd0ea896a506df386c8245a8bbfeac25401f1d7 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:54:00 +0300 Subject: [PATCH 034/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a0349cb..a1a8a81 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -133,3 +133,6 @@ UnitTestSessionAction 1475668380645 TestRomanNumerals.testRomanNumerals_MCMLXXXI UnitTestCaseAction 1475668394891 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668394891 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL EditAction 1475668412597 RomanNumerals.java 1942 4 12 0 +UnitTestCaseAction 1475668414410 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668414410 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL +EditAction 1475668440618 RomanNumerals.java 1946 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 05e7298..7ba0b66 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -16,7 +16,7 @@ public int convertToInteger(String romanNum) throws Exception { for (int i = lastIndexOfNum; i >= 0; i--) { repeated = 1; if (i < lastIndexOfNum) { - for (int j = i; j < lastIndexOfNum; j++) { + for (int j = i + 1; j < lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { repeated++; } From 32ded5615c221a0eaaf495c26ff9ce3b1acfc8e3 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:54:40 +0300 Subject: [PATCH 035/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a1a8a81..c8d18c7 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -136,3 +136,8 @@ EditAction 1475668412597 RomanNumerals.java 1942 4 12 0 UnitTestCaseAction 1475668414410 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668414410 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 FAIL EditAction 1475668440618 RomanNumerals.java 1946 4 12 0 +UnitTestCaseAction 1475668442259 TestRomanNumerals.java OK +UnitTestSessionAction 1475668442259 TestRomanNumerals.testRomanNumerals_MCMLXXXIV_1984 OK +UnitTestCaseAction 1475668445351 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668445351 TestRomanNumerals.java FAIL +EditAction 1475668480045 TestRomanNumerals.java 2819 19 37 18 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index b929e77..119fff1 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -34,3 +34,4 @@ 1475668292947 refactoring 3 1265 true 1475668292948 refactoring 3 1265 true 1475668308062 regression 1 0 true +1475668442259 refactoring 2A 129 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 9a2bb41..92fbb02 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -12,3 +12,4 @@ 1475667019491 test-addition 1 14 false 1475668292927 refactoring 3 1265 false 1475668308062 regression 1 0 false +1475668442259 refactoring 2A 129 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index c8e4661..6169d1b 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -12,3 +12,4 @@ 1475667019491 test-addition 1 155 false 1475668292927 refactoring 3 1273 false 1475668308062 regression 1 15 false +1475668442259 refactoring 2A 134 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index bfda5ca..5c8724c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -97,7 +97,7 @@ public class TestRomanNumerals { } @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() throws Exception { - int num = rn.convertToInteger("IIII"); + int num = rn.convertToInteger("IIIII"); } } From 12dd086c27a31a9a9cd0b1311a18fe6eb017568a Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:54:49 +0300 Subject: [PATCH 036/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 2 +- 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index c8d18c7..42fed07 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -141,3 +141,6 @@ UnitTestSessionAction 1475668442259 TestRomanNumerals.testRomanNumerals_MCMLXXXI UnitTestCaseAction 1475668445351 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668445351 TestRomanNumerals.java FAIL EditAction 1475668480045 TestRomanNumerals.java 2819 19 37 18 +UnitTestCaseAction 1475668482482 TestRomanNumerals.java OK +UnitTestSessionAction 1475668482482 TestRomanNumerals.java OK +EditAction 1475668489080 TestRomanNumerals.java 2818 19 37 18 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 119fff1..dde4a88 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -35,3 +35,4 @@ 1475668292948 refactoring 3 1265 true 1475668308062 regression 1 0 true 1475668442259 refactoring 2A 129 true +1475668482482 regression 2 37 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 92fbb02..6bc93be 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -13,3 +13,4 @@ 1475668292927 refactoring 3 1265 false 1475668308062 regression 1 0 false 1475668442259 refactoring 2A 129 true +1475668482482 regression 2 37 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 6169d1b..4d5cb5c 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -13,3 +13,4 @@ 1475668292927 refactoring 3 1273 false 1475668308062 regression 1 15 false 1475668442259 refactoring 2A 134 false +1475668482482 regression 2 40 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5c8724c..bfda5ca 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -97,7 +97,7 @@ public class TestRomanNumerals { } @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() throws Exception { - int num = rn.convertToInteger("IIIII"); + int num = rn.convertToInteger("IIII"); } } From 8ce62c0258537123725d4f67ccd2117171e7bbd3 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:57:36 +0300 Subject: [PATCH 037/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ src/RomanNumerals.java | 1 + 2 files changed, 8 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 42fed07..c7bcb1b 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -144,3 +144,10 @@ EditAction 1475668480045 TestRomanNumerals.java 2819 19 37 18 UnitTestCaseAction 1475668482482 TestRomanNumerals.java OK UnitTestSessionAction 1475668482482 TestRomanNumerals.java OK EditAction 1475668489080 TestRomanNumerals.java 2818 19 37 18 +UnitTestCaseAction 1475668491252 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668491252 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475668593297 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668593297 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475668636730 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668636730 TestRomanNumerals.java FAIL +EditAction 1475668656496 RomanNumerals.java 1980 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7ba0b66..e0271b1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -28,6 +28,7 @@ public int convertToInteger(String romanNum) throws Exception { throw new Exception("Symbol repeated too many times"); } } + System.err.println(repeated); value += parseCharacterToValue(romanNum, i); } return value; From c5bd196e62bf84450d325eb7df8f830834079263 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:58:55 +0300 Subject: [PATCH 038/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index c7bcb1b..0b6dd2f 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -151,3 +151,6 @@ UnitTestSessionAction 1475668593297 TestRomanNumerals.java FAIL UnitTestCaseAction 1475668636730 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668636730 TestRomanNumerals.java FAIL EditAction 1475668656496 RomanNumerals.java 1980 4 12 0 +UnitTestCaseAction 1475668659681 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668659681 TestRomanNumerals.testRomanNumerals_IIII_err FAIL +EditAction 1475668734608 RomanNumerals.java 1980 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e0271b1..c6d70c7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -16,7 +16,7 @@ public int convertToInteger(String romanNum) throws Exception { for (int i = lastIndexOfNum; i >= 0; i--) { repeated = 1; if (i < lastIndexOfNum) { - for (int j = i + 1; j < lastIndexOfNum; j++) { + for (int j = i + 1; i < lastIndexOfNum; i++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { repeated++; } From 27a4ffd456dc0aa627ddbb5d5d62476b9e45c700 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:59:23 +0300 Subject: [PATCH 039/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 0b6dd2f..ad30acd 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -154,3 +154,4 @@ EditAction 1475668656496 RomanNumerals.java 1980 4 12 0 UnitTestCaseAction 1475668659681 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668659681 TestRomanNumerals.testRomanNumerals_IIII_err FAIL EditAction 1475668734608 RomanNumerals.java 1980 4 12 0 +EditAction 1475668763366 RomanNumerals.java 1980 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c6d70c7..e0271b1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -16,7 +16,7 @@ public int convertToInteger(String romanNum) throws Exception { for (int i = lastIndexOfNum; i >= 0; i--) { repeated = 1; if (i < lastIndexOfNum) { - for (int j = i + 1; i < lastIndexOfNum; i++) { + for (int j = i + 1; j < lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { repeated++; } From 41a000f32ba76fbafc85a453513a3f3a2ab96445 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:00:17 +0300 Subject: [PATCH 040/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index ad30acd..ed38f06 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -155,3 +155,6 @@ UnitTestCaseAction 1475668659681 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668659681 TestRomanNumerals.testRomanNumerals_IIII_err FAIL EditAction 1475668734608 RomanNumerals.java 1980 4 12 0 EditAction 1475668763366 RomanNumerals.java 1980 4 12 0 +UnitTestCaseAction 1475668764976 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668764976 TestRomanNumerals.testRomanNumerals_IIII_err FAIL +EditAction 1475668816783 RomanNumerals.java 1981 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e0271b1..7105fc4 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -16,7 +16,7 @@ public int convertToInteger(String romanNum) throws Exception { for (int i = lastIndexOfNum; i >= 0; i--) { repeated = 1; if (i < lastIndexOfNum) { - for (int j = i + 1; j < lastIndexOfNum; j++) { + for (int j = i + 1; j <= lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { repeated++; } From cc4d41feae0c896bbcb5d0103de86b38223dd660 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:01:38 +0300 Subject: [PATCH 041/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 11 +++++++++++ .besouro/20161005142238292/besouroEpisodes.txt | 2 ++ .../20161005142238292/randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ tests/TestRomanNumerals.java | 6 ++++++ 5 files changed, 23 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index ed38f06..00c25fc 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -158,3 +158,14 @@ EditAction 1475668763366 RomanNumerals.java 1980 4 12 0 UnitTestCaseAction 1475668764976 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668764976 TestRomanNumerals.testRomanNumerals_IIII_err FAIL EditAction 1475668816783 RomanNumerals.java 1981 4 12 0 +UnitTestCaseAction 1475668818799 TestRomanNumerals.java OK +UnitTestSessionAction 1475668818799 TestRomanNumerals.testRomanNumerals_IIII_err OK +UnitTestCaseAction 1475668826789 TestRomanNumerals.java OK +UnitTestSessionAction 1475668826789 TestRomanNumerals.java OK +RefactoringAction 1475668845618 TestRomanNumerals.java ADD void testRomanNumerals_IIII_err()/2 METHOD +RefactoringAction 1475668861078 TestRomanNumerals.java RENAME testRomanNumerals_IIII_err()/2=>void testRomanNumerals__err() METHOD +RefactoringAction 1475668863153 TestRomanNumerals.java RENAME testRomanNumerals__err()=>void testRomanNumerals_LX_err() METHOD +RefactoringAction 1475668864713 TestRomanNumerals.java RENAME testRomanNumerals_LX_err()=>void testRomanNumerals_LX_60() METHOD +RefactoringAction 1475668878628 TestRomanNumerals.java RENAME testRomanNumerals_LX_60()=>void testRomanNumerals_CL_60() METHOD +RefactoringAction 1475668887395 TestRomanNumerals.java RENAME testRomanNumerals_CL_60()=>void testRomanNumerals_CL_err() METHOD +EditAction 1475668897832 TestRomanNumerals.java 2986 20 39 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index dde4a88..ddccfd1 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -36,3 +36,5 @@ 1475668308062 regression 1 0 true 1475668442259 refactoring 2A 129 true 1475668482482 regression 2 37 true +1475668818799 refactoring 2A 329 true +1475668826789 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 6bc93be..ad2ade3 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -14,3 +14,5 @@ 1475668308062 regression 1 0 false 1475668442259 refactoring 2A 129 true 1475668482482 regression 2 37 true +1475668818799 refactoring 2A 329 false +1475668826789 regression 1 0 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 4d5cb5c..c0c1858 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -14,3 +14,5 @@ 1475668308062 regression 1 15 false 1475668442259 refactoring 2A 134 false 1475668482482 regression 2 40 false +1475668818799 refactoring 2A 336 false +1475668826789 regression 1 7 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index bfda5ca..4b77226 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -99,5 +99,11 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() throws Exception { int num = rn.convertToInteger("IIII"); } + + @Test(expected=Exception.class) public void testRomanNumerals_CL_err() throws Exception { + int num = rn.convertToInteger("CL"); + assertEquals(50, num); + + } } From b7afcf2f816dd906fad02248ad6a3e3390c5cfe4 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:01:45 +0300 Subject: [PATCH 042/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 00c25fc..df73620 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -169,3 +169,6 @@ RefactoringAction 1475668864713 TestRomanNumerals.java RENAME testRomanNumerals_ RefactoringAction 1475668878628 TestRomanNumerals.java RENAME testRomanNumerals_LX_60()=>void testRomanNumerals_CL_60() METHOD RefactoringAction 1475668887395 TestRomanNumerals.java RENAME testRomanNumerals_CL_60()=>void testRomanNumerals_CL_err() METHOD EditAction 1475668897832 TestRomanNumerals.java 2986 20 39 19 +UnitTestCaseAction 1475668899675 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668899675 TestRomanNumerals.java FAIL +EditAction 1475668905182 RomanNumerals.java 1947 4 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7105fc4..d271582 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -28,7 +28,6 @@ public int convertToInteger(String romanNum) throws Exception { throw new Exception("Symbol repeated too many times"); } } - System.err.println(repeated); value += parseCharacterToValue(romanNum, i); } return value; From af9f3e5de79c0a14900d62c350cf8d66e8a7b846 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:02:15 +0300 Subject: [PATCH 043/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 ++++ tests/TestRomanNumerals.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index df73620..a67d4b5 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -172,3 +172,7 @@ EditAction 1475668897832 TestRomanNumerals.java 2986 20 39 19 UnitTestCaseAction 1475668899675 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668899675 TestRomanNumerals.java FAIL EditAction 1475668905182 RomanNumerals.java 1947 4 12 0 +UnitTestCaseAction 1475668907107 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668907107 TestRomanNumerals.java FAIL +RefactoringAction 1475668934750 TestRomanNumerals.java RENAME testRomanNumerals_CL_err()=>void testRomanNumerals_LC_err() METHOD +EditAction 1475668935140 TestRomanNumerals.java 2986 20 39 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 4b77226..c775f58 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -100,8 +100,8 @@ public class TestRomanNumerals { int num = rn.convertToInteger("IIII"); } - @Test(expected=Exception.class) public void testRomanNumerals_CL_err() throws Exception { - int num = rn.convertToInteger("CL"); + @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { + int num = rn.convertToInteger("LC"); assertEquals(50, num); } From 895696db08c06889304259e2d2336a7d4ffb18c2 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:02:26 +0300 Subject: [PATCH 044/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a67d4b5..8c0fdf7 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -176,3 +176,6 @@ UnitTestCaseAction 1475668907107 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668907107 TestRomanNumerals.java FAIL RefactoringAction 1475668934750 TestRomanNumerals.java RENAME testRomanNumerals_CL_err()=>void testRomanNumerals_LC_err() METHOD EditAction 1475668935140 TestRomanNumerals.java 2986 20 39 19 +UnitTestCaseAction 1475668936812 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668936812 TestRomanNumerals.testRomanNumerals_LC_err FAIL +EditAction 1475668946282 TestRomanNumerals.java 2960 20 39 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index c775f58..33fe87e 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -100,7 +100,7 @@ public class TestRomanNumerals { int num = rn.convertToInteger("IIII"); } - @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { + @Test public void testRomanNumerals_LC_err() throws Exception { int num = rn.convertToInteger("LC"); assertEquals(50, num); From d9ea7206c5ec8d9c7d5845977282636f3d1733ae Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:02:33 +0300 Subject: [PATCH 045/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 ++ .../20161005142238292/besouroEpisodes.txt | 2 + .../randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 37 ++++++++++--------- tests/TestRomanNumerals.java | 2 +- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 8c0fdf7..b42295a 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -179,3 +179,6 @@ EditAction 1475668935140 TestRomanNumerals.java 2986 20 39 19 UnitTestCaseAction 1475668936812 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668936812 TestRomanNumerals.testRomanNumerals_LC_err FAIL EditAction 1475668946282 TestRomanNumerals.java 2960 20 39 19 +UnitTestCaseAction 1475668948047 TestRomanNumerals.java OK +UnitTestSessionAction 1475668948047 TestRomanNumerals.java OK +EditAction 1475668953071 TestRomanNumerals.java 2986 20 39 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index ddccfd1..6521f98 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -38,3 +38,5 @@ 1475668482482 regression 2 37 true 1475668818799 refactoring 2A 329 true 1475668826789 regression 1 0 true +1475668948047 test-first 3 102 true +1475668948048 test-first 3 102 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index ad2ade3..2537b92 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -16,3 +16,4 @@ 1475668482482 regression 2 37 true 1475668818799 refactoring 2A 329 false 1475668826789 regression 1 0 true +1475668948047 test-first 3 102 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index c0c1858..569e533 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -1,18 +1,19 @@ -1475666591102 refactoring 2A 32 false -1475666673317 refactoring 2A 82 false -1475666687610 regression 1 14 false -1475666726316 refactoring 2A 38 false -1475666747177 refactoring 2A 20 false -1475666748615 regression 1 1 false -1475666798475 refactoring 2A 49 false -1475666821208 refactoring 2A 22 false -1475666835282 refactoring 2A 14 false -1475666857136 regression 1 21 false -1475666864175 regression 1 7 false -1475667019491 test-addition 1 155 false -1475668292927 refactoring 3 1273 false -1475668308062 regression 1 15 false -1475668442259 refactoring 2A 134 false -1475668482482 regression 2 40 false -1475668818799 refactoring 2A 336 false -1475668826789 regression 1 7 false +1475666591102 refactoring 2A 32 true +1475666673317 refactoring 2A 82 true +1475666687610 regression 1 14 true +1475666726316 refactoring 2A 38 true +1475666747177 refactoring 2A 20 true +1475666748615 regression 1 1 true +1475666798475 refactoring 2A 49 true +1475666821208 refactoring 2A 22 true +1475666835282 refactoring 2A 14 true +1475666857136 regression 1 21 true +1475666864175 regression 1 7 true +1475667019491 test-addition 1 155 true +1475668292927 refactoring 3 1273 true +1475668308062 regression 1 15 true +1475668442259 refactoring 2A 134 true +1475668482482 regression 2 40 true +1475668818799 refactoring 2A 336 true +1475668826789 regression 1 7 true +1475668948047 test-first 3 121 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 33fe87e..c775f58 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -100,7 +100,7 @@ public class TestRomanNumerals { int num = rn.convertToInteger("IIII"); } - @Test public void testRomanNumerals_LC_err() throws Exception { + @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { int num = rn.convertToInteger("LC"); assertEquals(50, num); From cbb549c04a870583c2f762bdd8517ad693e466e1 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:02:39 +0300 Subject: [PATCH 046/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + tests/TestRomanNumerals.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index b42295a..9110f8b 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -182,3 +182,4 @@ EditAction 1475668946282 TestRomanNumerals.java 2960 20 39 19 UnitTestCaseAction 1475668948047 TestRomanNumerals.java OK UnitTestSessionAction 1475668948047 TestRomanNumerals.java OK EditAction 1475668953071 TestRomanNumerals.java 2986 20 39 19 +EditAction 1475668958733 TestRomanNumerals.java 2958 20 38 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index c775f58..f8df91f 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -102,8 +102,6 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { int num = rn.convertToInteger("LC"); - assertEquals(50, num); - } } From f83e5760da3e0f63027694357cbe2e3fd098b4db Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:03:58 +0300 Subject: [PATCH 047/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 6 +++++ src/RomanNumerals.java | 31 +++++++++++++++----------- tests/TestRomanNumerals.java | 4 ++-- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 9110f8b..35d07bd 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -183,3 +183,9 @@ UnitTestCaseAction 1475668948047 TestRomanNumerals.java OK UnitTestSessionAction 1475668948047 TestRomanNumerals.java OK EditAction 1475668953071 TestRomanNumerals.java 2986 20 39 19 EditAction 1475668958733 TestRomanNumerals.java 2958 20 38 18 +UnitTestCaseAction 1475668960218 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668960218 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475668967241 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668967241 TestRomanNumerals.java FAIL +RefactoringAction 1475669038409 RomanNumerals.java ADD void checkRepetition(String, int, int) METHOD +EditAction 1475669038424 RomanNumerals.java 2100 5 15 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index d271582..0c715d9 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -14,23 +14,28 @@ public int convertToInteger(String romanNum) throws Exception { int lastIndexOfNum = romanNum.length() - 1; for (int i = lastIndexOfNum; i >= 0; i--) { - repeated = 1; - if (i < lastIndexOfNum) { - for (int j = i + 1; j <= lastIndexOfNum; j++) { - if (romanNum.charAt(i) == romanNum.charAt(j)) { - repeated++; - } - else { - break; - } + checkRepetition(romanNum, lastIndexOfNum, i); + value += parseCharacterToValue(romanNum, i); + } + return value; + } + + private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { + int repeated; + repeated = 1; + if (i < lastIndexOfNum) { + for (int j = i + 1; j <= lastIndexOfNum; j++) { + if (romanNum.charAt(i) == romanNum.charAt(j)) { + repeated++; } - if (repeated > 3) { - throw new Exception("Symbol repeated too many times"); + else { + break; } } - value += parseCharacterToValue(romanNum, i); + if (repeated > 3) { + throw new Exception("Symbol repeated too many times"); + } } - return value; } private int parseCharacterToValue(String romanNum, int i) { diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index f8df91f..3ff609e 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -97,11 +97,11 @@ public class TestRomanNumerals { } @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() throws Exception { - int num = rn.convertToInteger("IIII"); + rn.convertToInteger("IIII"); } @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { - int num = rn.convertToInteger("LC"); + rn.convertToInteger("LC"); } } From 958b4c979ffce0d02859dd1efd72dfe3473e1ccd Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:04:20 +0300 Subject: [PATCH 048/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 35d07bd..6f2ef53 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -189,3 +189,6 @@ UnitTestCaseAction 1475668967241 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668967241 TestRomanNumerals.java FAIL RefactoringAction 1475669038409 RomanNumerals.java ADD void checkRepetition(String, int, int) METHOD EditAction 1475669038424 RomanNumerals.java 2100 5 15 0 +UnitTestCaseAction 1475669048895 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669048895 TestRomanNumerals.java FAIL +EditAction 1475669060299 RomanNumerals.java 2087 5 14 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0c715d9..3767106 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -21,8 +21,7 @@ public int convertToInteger(String romanNum) throws Exception { } private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { - int repeated; - repeated = 1; + int repeated = 1; if (i < lastIndexOfNum) { for (int j = i + 1; j <= lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { From 8bce63492bebc3fe2d9253fd15e0537472363233 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:05:56 +0300 Subject: [PATCH 049/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 21 ++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 6f2ef53..dd76f17 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -192,3 +192,6 @@ EditAction 1475669038424 RomanNumerals.java 2100 5 15 0 UnitTestCaseAction 1475669048895 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669048895 TestRomanNumerals.java FAIL EditAction 1475669060299 RomanNumerals.java 2087 5 14 0 +UnitTestCaseAction 1475669062392 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669062392 TestRomanNumerals.java FAIL +EditAction 1475669156273 RomanNumerals.java 2184 5 12 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3767106..3265bc1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -22,18 +22,21 @@ public int convertToInteger(String romanNum) throws Exception { private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { int repeated = 1; - if (i < lastIndexOfNum) { - for (int j = i + 1; j <= lastIndexOfNum; j++) { - if (romanNum.charAt(i) == romanNum.charAt(j)) { - repeated++; + char c = romanNum.charAt(i): + if (c == I || c == X || c == C || c == M) { + if (i < lastIndexOfNum) { + for (int j = i + 1; j <= lastIndexOfNum; j++) { + if (romanNum.charAt(i) == romanNum.charAt(j)) { + repeated++; + } + else { + break; + } } - else { - break; + if (repeated > 3) { + throw new Exception("Symbol repeated too many times"); } } - if (repeated > 3) { - throw new Exception("Symbol repeated too many times"); - } } } From 11b5dbbec2b927161d3adf47779523b63e695a41 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:07:24 +0300 Subject: [PATCH 050/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ src/RomanNumerals.java | 23 ++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index dd76f17..6f5d5e8 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -195,3 +195,10 @@ EditAction 1475669060299 RomanNumerals.java 2087 5 14 0 UnitTestCaseAction 1475669062392 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669062392 TestRomanNumerals.java FAIL EditAction 1475669156273 RomanNumerals.java 2184 5 12 0 +CompilationAction 1475669157646 RomanNumerals.java +CompilationAction 1475669162841 RomanNumerals.java +UnitTestCaseAction 1475669165074 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669165074 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475669173189 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669173189 TestRomanNumerals.java FAIL +EditAction 1475669244029 RomanNumerals.java 2139 5 15 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3265bc1..8d5a304 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -9,7 +9,6 @@ public class RomanNumerals { private static final char M = 'M'; public int convertToInteger(String romanNum) throws Exception { - int repeated; int value = 0; int lastIndexOfNum = romanNum.length() - 1; @@ -22,22 +21,20 @@ public int convertToInteger(String romanNum) throws Exception { private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { int repeated = 1; - char c = romanNum.charAt(i): - if (c == I || c == X || c == C || c == M) { - if (i < lastIndexOfNum) { - for (int j = i + 1; j <= lastIndexOfNum; j++) { - if (romanNum.charAt(i) == romanNum.charAt(j)) { - repeated++; - } - else { - break; - } + char c = romanNum.charAt(i); + if (i < lastIndexOfNum) { + for (int j = i + 1; j <= lastIndexOfNum; j++) { + if (romanNum.charAt(i) == romanNum.charAt(j)) { + repeated++; } - if (repeated > 3) { - throw new Exception("Symbol repeated too many times"); + else { + break; } } } + if (c == I || c == X || c == C || c == M && repeated > 3) { + throw new Exception("Symbol repeated too many times"); + } } private int parseCharacterToValue(String romanNum, int i) { From 2145f3e1cd51b80b0d7ab1fe15e7ff4e367cf510 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:07:45 +0300 Subject: [PATCH 051/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 6f5d5e8..a7286c7 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -202,3 +202,6 @@ UnitTestSessionAction 1475669165074 TestRomanNumerals.java FAIL UnitTestCaseAction 1475669173189 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669173189 TestRomanNumerals.java FAIL EditAction 1475669244029 RomanNumerals.java 2139 5 15 0 +UnitTestCaseAction 1475669245811 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669245811 TestRomanNumerals.java FAIL +EditAction 1475669265373 RomanNumerals.java 2141 5 15 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 8d5a304..d2c6756 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -32,7 +32,7 @@ private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws } } } - if (c == I || c == X || c == C || c == M && repeated > 3) { + if ((c == I || c == X || c == C || c == M) && repeated > 3) { throw new Exception("Symbol repeated too many times"); } } From e5623a33f3e50392bf35f53dcfc3870d4220bda1 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:08:40 +0300 Subject: [PATCH 052/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a7286c7..fa0a9bf 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -205,3 +205,6 @@ EditAction 1475669244029 RomanNumerals.java 2139 5 15 0 UnitTestCaseAction 1475669245811 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669245811 TestRomanNumerals.java FAIL EditAction 1475669265373 RomanNumerals.java 2141 5 15 0 +UnitTestCaseAction 1475669267295 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669267295 TestRomanNumerals.java FAIL +EditAction 1475669320054 RomanNumerals.java 2258 5 15 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index d2c6756..c5878c9 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -35,6 +35,9 @@ private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws if ((c == I || c == X || c == C || c == M) && repeated > 3) { throw new Exception("Symbol repeated too many times"); } + else if ((c == V || c == L || c == D) && repeated > 1) { + throw new Exception("Invalid symbol repeated"); + } } private int parseCharacterToValue(String romanNum, int i) { From c8caa5386f228c1cf4a59db45ad2ab844faadf4f Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:09:33 +0300 Subject: [PATCH 053/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 ++++ src/RomanNumerals.java | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index fa0a9bf..749c023 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -208,3 +208,7 @@ EditAction 1475669265373 RomanNumerals.java 2141 5 15 0 UnitTestCaseAction 1475669267295 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669267295 TestRomanNumerals.java FAIL EditAction 1475669320054 RomanNumerals.java 2258 5 15 0 +UnitTestCaseAction 1475669337545 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669337545 TestRomanNumerals.java FAIL +RefactoringAction 1475669372660 RomanNumerals.java ADD int getRepetition(String, int, int, int) METHOD +EditAction 1475669372660 RomanNumerals.java 2440 6 17 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c5878c9..a1f0623 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -22,6 +22,16 @@ public int convertToInteger(String romanNum) throws Exception { private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { int repeated = 1; char c = romanNum.charAt(i); + repeated = getRepetition(romanNum, lastIndexOfNum, i, repeated); + if ((c == I || c == X || c == C || c == M) && repeated > 3) { + throw new Exception("Symbol repeated too many times"); + } + else if ((c == V || c == L || c == D) && repeated > 1) { + throw new Exception("Invalid symbol repeated"); + } + } + + private int getRepetition(String romanNum, int lastIndexOfNum, int i, int repeated) { if (i < lastIndexOfNum) { for (int j = i + 1; j <= lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { @@ -32,12 +42,7 @@ private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws } } } - if ((c == I || c == X || c == C || c == M) && repeated > 3) { - throw new Exception("Symbol repeated too many times"); - } - else if ((c == V || c == L || c == D) && repeated > 1) { - throw new Exception("Invalid symbol repeated"); - } + return repeated; } private int parseCharacterToValue(String romanNum, int i) { From 74ef762e2e74e6a47e565afa23502a3a3eb6e288 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:10:02 +0300 Subject: [PATCH 054/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + src/RomanNumerals.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 749c023..3a0a431 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -212,3 +212,4 @@ UnitTestCaseAction 1475669337545 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669337545 TestRomanNumerals.java FAIL RefactoringAction 1475669372660 RomanNumerals.java ADD int getRepetition(String, int, int, int) METHOD EditAction 1475669372660 RomanNumerals.java 2440 6 17 0 +EditAction 1475669402222 RomanNumerals.java 2416 6 17 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index a1f0623..155c1c1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -20,9 +20,8 @@ public int convertToInteger(String romanNum) throws Exception { } private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { - int repeated = 1; char c = romanNum.charAt(i); - repeated = getRepetition(romanNum, lastIndexOfNum, i, repeated); + int repeated = getRepetition(romanNum, lastIndexOfNum, i); if ((c == I || c == X || c == C || c == M) && repeated > 3) { throw new Exception("Symbol repeated too many times"); } @@ -31,7 +30,8 @@ else if ((c == V || c == L || c == D) && repeated > 1) { } } - private int getRepetition(String romanNum, int lastIndexOfNum, int i, int repeated) { + private int getRepetition(String romanNum, int lastIndexOfNum, int i) { + repeated = 1; if (i < lastIndexOfNum) { for (int j = i + 1; j <= lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { From b76a32e77a5b2eeae6ceb2661f20e53712a3191e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:10:41 +0300 Subject: [PATCH 055/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ src/RomanNumerals.java | 2 +- tests/TestRomanNumerals.java | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 3a0a431..8a6b045 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -213,3 +213,10 @@ UnitTestSessionAction 1475669337545 TestRomanNumerals.java FAIL RefactoringAction 1475669372660 RomanNumerals.java ADD int getRepetition(String, int, int, int) METHOD EditAction 1475669372660 RomanNumerals.java 2440 6 17 0 EditAction 1475669402222 RomanNumerals.java 2416 6 17 0 +CompilationAction 1475669403658 RomanNumerals.java +CompilationAction 1475669406325 RomanNumerals.java +UnitTestCaseAction 1475669410057 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669410057 TestRomanNumerals.java FAIL +RefactoringAction 1475669435032 TestRomanNumerals.java ADD void testRomanNumerals_LC_err()/2 METHOD +RefactoringAction 1475669437622 TestRomanNumerals.java RENAME testRomanNumerals_LC_err()/2=>void testRomanNumerals_VV_err() METHOD +EditAction 1475669440680 TestRomanNumerals.java 3068 21 39 18 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 155c1c1..b7cdf3b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -31,7 +31,7 @@ else if ((c == V || c == L || c == D) && repeated > 1) { } private int getRepetition(String romanNum, int lastIndexOfNum, int i) { - repeated = 1; + int repeated = 1; if (i < lastIndexOfNum) { for (int j = i + 1; j <= lastIndexOfNum; j++) { if (romanNum.charAt(i) == romanNum.charAt(j)) { diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 3ff609e..9ebd7f6 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -103,5 +103,9 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { rn.convertToInteger("LC"); } + + @Test(expected=Exception.class) public void testRomanNumerals_VV_err() throws Exception { + rn.convertToInteger("VV"); + } } From 2552d2e54250374f5ac7015899df04cac8f091f6 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:11:27 +0300 Subject: [PATCH 056/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ tests/TestRomanNumerals.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 8a6b045..06de151 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -220,3 +220,8 @@ UnitTestSessionAction 1475669410057 TestRomanNumerals.java FAIL RefactoringAction 1475669435032 TestRomanNumerals.java ADD void testRomanNumerals_LC_err()/2 METHOD RefactoringAction 1475669437622 TestRomanNumerals.java RENAME testRomanNumerals_LC_err()/2=>void testRomanNumerals_VV_err() METHOD EditAction 1475669440680 TestRomanNumerals.java 3068 21 39 18 +UnitTestCaseAction 1475669442742 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669442742 TestRomanNumerals.java FAIL +RefactoringAction 1475669482912 TestRomanNumerals.java ADD void testRomanNumerals_VV_err()/2 METHOD +RefactoringAction 1475669485486 TestRomanNumerals.java RENAME testRomanNumerals_VV_err()/2=>void testRomanNumerals_DD_err() METHOD +EditAction 1475669487498 TestRomanNumerals.java 3198 22 40 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 9ebd7f6..8fd0dcd 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -107,5 +107,9 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_VV_err() throws Exception { rn.convertToInteger("VV"); } + + @Test(expected=Exception.class) public void testRomanNumerals_DD_err() throws Exception { + rn.convertToInteger("DD"); + } } From f62afb1d9834e9c9c184e77405cf89ccb5c95913 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:14:16 +0300 Subject: [PATCH 057/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 06de151..1d953e9 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -225,3 +225,6 @@ UnitTestSessionAction 1475669442742 TestRomanNumerals.java FAIL RefactoringAction 1475669482912 TestRomanNumerals.java ADD void testRomanNumerals_VV_err()/2 METHOD RefactoringAction 1475669485486 TestRomanNumerals.java RENAME testRomanNumerals_VV_err()/2=>void testRomanNumerals_DD_err() METHOD EditAction 1475669487498 TestRomanNumerals.java 3198 22 40 18 +UnitTestCaseAction 1475669489467 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669489467 TestRomanNumerals.java FAIL +EditAction 1475669656169 RomanNumerals.java 2536 6 17 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index b7cdf3b..461cc8d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -57,11 +57,14 @@ private int parseCharacterToValue(String romanNum, int i) { } } - private int getCurrentValue(int currentVal, int nextVal) { + private int getCurrentValue(int currentVal, int nextVal) throws Exception { if (currentVal == nextVal) { return currentVal; } else if (currentVal < nextVal) { + if (currentVal == 1 && nextVal > 10) { + throw new Exception("invalid substraction"); + } return -currentVal; } else if (currentVal > nextVal) { From 74d0de1907455bb5b8192825962c6bca3236447e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:15:30 +0300 Subject: [PATCH 058/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 1d953e9..fc82b92 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -228,3 +228,6 @@ EditAction 1475669487498 TestRomanNumerals.java 3198 22 40 18 UnitTestCaseAction 1475669489467 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669489467 TestRomanNumerals.java FAIL EditAction 1475669656169 RomanNumerals.java 2536 6 17 0 +UnitTestCaseAction 1475669659962 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669659962 TestRomanNumerals.java FAIL +EditAction 1475669729585 RomanNumerals.java 2607 6 17 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 461cc8d..acde766 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -65,6 +65,7 @@ else if (currentVal < nextVal) { if (currentVal == 1 && nextVal > 10) { throw new Exception("invalid substraction"); } + else if (currentVal == 5 || currentVal == 50 || currentVal == 500) return -currentVal; } else if (currentVal > nextVal) { From b18c1e61775ab345f2fa0fc430afe242cc963e56 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:15:37 +0300 Subject: [PATCH 059/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + src/RomanNumerals.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index fc82b92..d382749 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -231,3 +231,4 @@ EditAction 1475669656169 RomanNumerals.java 2536 6 17 0 UnitTestCaseAction 1475669659962 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669659962 TestRomanNumerals.java FAIL EditAction 1475669729585 RomanNumerals.java 2607 6 17 0 +EditAction 1475669737120 RomanNumerals.java 2665 6 17 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index acde766..c5cb042 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -65,7 +65,9 @@ else if (currentVal < nextVal) { if (currentVal == 1 && nextVal > 10) { throw new Exception("invalid substraction"); } - else if (currentVal == 5 || currentVal == 50 || currentVal == 500) + else if (currentVal == 5 || currentVal == 50 || currentVal == 500) { + throw new Exception("invalid substraction"); + } return -currentVal; } else if (currentVal > nextVal) { From 9aa5deacd7445836d5db934ffceedee2800e6c6c Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:16:16 +0300 Subject: [PATCH 060/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index d382749..2ab133c 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -232,3 +232,6 @@ UnitTestCaseAction 1475669659962 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669659962 TestRomanNumerals.java FAIL EditAction 1475669729585 RomanNumerals.java 2607 6 17 0 EditAction 1475669737120 RomanNumerals.java 2665 6 17 0 +UnitTestCaseAction 1475669738870 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669738870 TestRomanNumerals.java FAIL +EditAction 1475669775842 TestRomanNumerals.java 3224 22 41 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 8fd0dcd..7ad8fca 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -102,6 +102,7 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { rn.convertToInteger("LC"); + assertEquals(50, num); } @Test(expected=Exception.class) public void testRomanNumerals_VV_err() throws Exception { From 0c1859eab512c4d1057ac01b567316a02f32c3b5 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:18:45 +0300 Subject: [PATCH 061/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ src/RomanNumerals.java | 9 +++++++-- tests/TestRomanNumerals.java | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 2ab133c..970879c 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -235,3 +235,8 @@ EditAction 1475669737120 RomanNumerals.java 2665 6 17 0 UnitTestCaseAction 1475669738870 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669738870 TestRomanNumerals.java FAIL EditAction 1475669775842 TestRomanNumerals.java 3224 22 41 19 +CompilationAction 1475669777106 TestRomanNumerals.java +CompilationAction 1475669781474 TestRomanNumerals.java +UnitTestCaseAction 1475669783178 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669783178 TestRomanNumerals.java FAIL +EditAction 1475669924623 RomanNumerals.java 2772 6 17 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c5cb042..168c938 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -45,7 +45,7 @@ private int getRepetition(String romanNum, int lastIndexOfNum, int i) { return repeated; } - private int parseCharacterToValue(String romanNum, int i) { + private int parseCharacterToValue(String romanNum, int i) throws Exception { int currentVal, nextVal; currentVal = getCharValue(romanNum.charAt(i)); try { @@ -53,7 +53,12 @@ private int parseCharacterToValue(String romanNum, int i) { return getCurrentValue(currentVal, nextVal); } catch(Exception e) { - return currentVal; // when trying to get next of last, it is intended to end up here + if (e.getMessage() == "invalid substraction") { + throw e; + } + else { + return currentVal; // when trying to get next of last, it is intended to end up here + } } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 7ad8fca..56e0be0 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -101,7 +101,7 @@ public class TestRomanNumerals { } @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { - rn.convertToInteger("LC"); + int num = rn.convertToInteger("LC"); assertEquals(50, num); } From f7d1188cd2ac92a39da80b3618217c5caea656fc Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:21:09 +0300 Subject: [PATCH 062/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 + .../20161005142238292/besouroEpisodes.txt | 73 +++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 6 ++ 5 files changed, 84 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 970879c..c81585d 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -240,3 +240,6 @@ CompilationAction 1475669781474 TestRomanNumerals.java UnitTestCaseAction 1475669783178 TestRomanNumerals.java FAIL UnitTestSessionAction 1475669783178 TestRomanNumerals.java FAIL EditAction 1475669924623 RomanNumerals.java 2772 6 17 0 +UnitTestCaseAction 1475669926607 TestRomanNumerals.java OK +UnitTestSessionAction 1475669926607 TestRomanNumerals.java OK +EditAction 1475670068692 RomanNumerals.java 2986 6 17 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 6521f98..4936d31 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -40,3 +40,76 @@ 1475668826789 regression 1 0 true 1475668948047 test-first 3 102 true 1475668948048 test-first 3 102 true +1475669926607 test-first 1 973 true +1475669926608 test-first 1 973 true +1475669926609 test-first 1 973 true +1475669926610 test-first 1 973 true +1475669926611 test-first 1 973 true +1475669926612 test-first 1 973 true +1475669926613 test-first 1 973 true +1475669926614 test-last 1 973 false +1475669926615 test-first 1 973 true +1475669926616 test-last 1 973 false +1475669926617 test-first 1 973 true +1475669926618 test-last 1 973 false +1475669926619 test-first 1 973 true +1475669926620 test-last 1 973 false +1475669926621 test-first 1 973 true +1475669926622 test-last 1 973 false +1475669926623 test-first 1 973 true +1475669926624 test-last 1 973 false +1475669926625 test-first 1 973 true +1475669926626 test-last 1 973 false +1475669926627 test-first 1 973 true +1475669926628 test-last 1 973 false +1475669926629 test-first 1 973 true +1475669926630 test-first 1 973 true +1475669926631 test-first 1 973 true +1475669926632 test-first 1 973 true +1475669926633 test-first 1 973 true +1475669926634 test-last 1 973 false +1475669926635 test-first 1 973 true +1475669926636 test-last 1 973 false +1475669926637 test-first 1 973 true +1475669926638 test-last 1 973 false +1475669926639 test-first 1 973 true +1475669926640 test-last 1 973 false +1475669926641 test-last 1 973 false +1475669926642 test-last 1 973 false +1475669926643 test-last 1 973 false +1475669926644 test-last 1 973 false +1475669926645 test-last 1 973 false +1475669926646 test-last 1 973 false +1475669926647 test-last 1 973 false +1475669926648 test-last 1 973 false +1475669926649 test-last 1 973 false +1475669926650 test-last 1 973 false +1475669926651 test-last 1 973 false +1475669926652 test-last 1 973 false +1475669926653 test-last 1 973 false +1475669926654 test-last 1 973 false +1475669926655 test-last 1 973 false +1475669926656 test-first 1 973 true +1475669926657 test-first 1 973 true +1475669926658 test-first 1 973 true +1475669926659 test-first 1 973 true +1475669926660 test-first 1 973 true +1475669926661 test-first 1 973 true +1475669926662 test-first 1 973 true +1475669926663 test-first 1 973 true +1475669926664 test-first 1 973 true +1475669926665 test-first 1 973 true +1475669926666 test-first 1 973 true +1475669926667 test-first 1 973 true +1475669926668 test-first 1 973 true +1475669926669 test-first 1 973 true +1475669926670 test-first 1 973 true +1475669926671 test-first 1 973 true +1475669926672 test-first 1 973 true +1475669926673 test-first 1 973 true +1475669926674 test-first 1 973 true +1475669926675 test-first 1 973 true +1475669926676 test-first 1 973 true +1475669926677 test-first 1 973 true +1475669926678 test-first 1 973 true +1475669926679 test-first 1 973 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 2537b92..2482cb6 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -17,3 +17,4 @@ 1475668818799 refactoring 2A 329 false 1475668826789 regression 1 0 true 1475668948047 test-first 3 102 true +1475669926607 test-first 1 973 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 569e533..6514145 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -17,3 +17,4 @@ 1475668818799 refactoring 2A 336 true 1475668826789 regression 1 7 true 1475668948047 test-first 3 121 true +1475669926607 test-first 1 978 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 168c938..3b992c0 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -70,6 +70,12 @@ else if (currentVal < nextVal) { if (currentVal == 1 && nextVal > 10) { throw new Exception("invalid substraction"); } + else if (currentVal == 10 && nextVal > 100) { + throw new Exception("invalid substraction"); + } + else if (currentVal == 100 && nextVal > 1000) { + throw new Exception("invalid substraction"); + } else if (currentVal == 5 || currentVal == 50 || currentVal == 500) { throw new Exception("invalid substraction"); } From da193ecb8d30db90ccdea7654441154e37c863d3 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:21:40 +0300 Subject: [PATCH 063/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 4 ++++ 5 files changed, 14 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index c81585d..eb560ae 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -243,3 +243,10 @@ EditAction 1475669924623 RomanNumerals.java 2772 6 17 0 UnitTestCaseAction 1475669926607 TestRomanNumerals.java OK UnitTestSessionAction 1475669926607 TestRomanNumerals.java OK EditAction 1475670068692 RomanNumerals.java 2986 6 17 0 +UnitTestCaseAction 1475670071488 TestRomanNumerals.java OK +UnitTestSessionAction 1475670071488 TestRomanNumerals.java OK +RefactoringAction 1475670093905 TestRomanNumerals.java ADD void testRomanNumerals_DD_err()/2 METHOD +RefactoringAction 1475670096479 TestRomanNumerals.java RENAME testRomanNumerals_DD_err()/2=>void testRomanNumerals_D_err() METHOD +RefactoringAction 1475670097508 TestRomanNumerals.java RENAME testRomanNumerals_D_err()=>void testRomanNumerals__err() METHOD +RefactoringAction 1475670098538 TestRomanNumerals.java RENAME testRomanNumerals__err()=>void testRomanNumerals_XM_err() METHOD +EditAction 1475670100129 TestRomanNumerals.java 3364 23 42 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 4936d31..7bcb63b 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -113,3 +113,4 @@ 1475669926677 test-first 1 973 true 1475669926678 test-first 1 973 true 1475669926679 test-first 1 973 true +1475670071488 refactoring 2A 2 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 2482cb6..ca652e3 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -18,3 +18,4 @@ 1475668826789 regression 1 0 true 1475668948047 test-first 3 102 true 1475669926607 test-first 1 973 true +1475670071488 refactoring 2A 2 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 6514145..410382f 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -18,3 +18,4 @@ 1475668826789 regression 1 7 true 1475668948047 test-first 3 121 true 1475669926607 test-first 1 978 true +1475670071488 refactoring 2A 144 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 56e0be0..56ed443 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -112,5 +112,9 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_DD_err() throws Exception { rn.convertToInteger("DD"); } + + @Test(expected=Exception.class) public void testRomanNumerals_XM_err() throws Exception { + rn.convertToInteger("XM"); + } } From 08bd1e499c41c46413b93e3c5b54e46f7efcc03f Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:21:44 +0300 Subject: [PATCH 064/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + tests/TestRomanNumerals.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index eb560ae..70b9a9d 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -250,3 +250,4 @@ RefactoringAction 1475670096479 TestRomanNumerals.java RENAME testRomanNumerals_ RefactoringAction 1475670097508 TestRomanNumerals.java RENAME testRomanNumerals_D_err()=>void testRomanNumerals__err() METHOD RefactoringAction 1475670098538 TestRomanNumerals.java RENAME testRomanNumerals__err()=>void testRomanNumerals_XM_err() METHOD EditAction 1475670100129 TestRomanNumerals.java 3364 23 42 19 +EditAction 1475670104248 TestRomanNumerals.java 3338 23 41 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 56ed443..03ea8f1 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -102,7 +102,6 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { int num = rn.convertToInteger("LC"); - assertEquals(50, num); } @Test(expected=Exception.class) public void testRomanNumerals_VV_err() throws Exception { From 35536ce21ba5a3a3caf20b1975ea24e7135c9692 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:22:31 +0300 Subject: [PATCH 065/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 +++ .../20161005142238292/besouroEpisodes.txt | 1 + .../randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 28 +++++++++++-------- tests/TestRomanNumerals.java | 2 +- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 70b9a9d..4c4487c 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -251,3 +251,7 @@ RefactoringAction 1475670097508 TestRomanNumerals.java RENAME testRomanNumerals_ RefactoringAction 1475670098538 TestRomanNumerals.java RENAME testRomanNumerals__err()=>void testRomanNumerals_XM_err() METHOD EditAction 1475670100129 TestRomanNumerals.java 3364 23 42 19 EditAction 1475670104248 TestRomanNumerals.java 3338 23 41 18 +UnitTestCaseAction 1475670109461 TestRomanNumerals.java OK +UnitTestSessionAction 1475670109461 TestRomanNumerals.java OK +RefactoringAction 1475670151051 RomanNumerals.java ADD void validateSubstraction(int, int) METHOD +EditAction 1475670151051 RomanNumerals.java 3111 7 18 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 7bcb63b..2fa1294 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -114,3 +114,4 @@ 1475669926678 test-first 1 973 true 1475669926679 test-first 1 973 true 1475670071488 refactoring 2A 2 true +1475670109461 test-addition 1 15 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index ca652e3..719ad94 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -19,3 +19,4 @@ 1475668948047 test-first 3 102 true 1475669926607 test-first 1 973 true 1475670071488 refactoring 2A 2 false +1475670109461 test-addition 1 15 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 410382f..a1212dc 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -19,3 +19,4 @@ 1475668948047 test-first 3 121 true 1475669926607 test-first 1 978 true 1475670071488 refactoring 2A 144 true +1475670109461 test-addition 1 37 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3b992c0..346ab0a 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -67,18 +67,7 @@ private int getCurrentValue(int currentVal, int nextVal) throws Exception { return currentVal; } else if (currentVal < nextVal) { - if (currentVal == 1 && nextVal > 10) { - throw new Exception("invalid substraction"); - } - else if (currentVal == 10 && nextVal > 100) { - throw new Exception("invalid substraction"); - } - else if (currentVal == 100 && nextVal > 1000) { - throw new Exception("invalid substraction"); - } - else if (currentVal == 5 || currentVal == 50 || currentVal == 500) { - throw new Exception("invalid substraction"); - } + validateSubstraction(currentVal, nextVal); return -currentVal; } else if (currentVal > nextVal) { @@ -86,6 +75,21 @@ else if (currentVal > nextVal) { } return 0; } + + private void validateSubstraction(int currentVal, int nextVal) throws Exception { + if (currentVal == 1 && nextVal > 10) { + throw new Exception("invalid substraction"); + } + else if (currentVal == 10 && nextVal > 100) { + throw new Exception("invalid substraction"); + } + else if (currentVal == 100 && nextVal > 1000) { + throw new Exception("invalid substraction"); + } + else if (currentVal == 5 || currentVal == 50 || currentVal == 500) { + throw new Exception("invalid substraction"); + } + } private int getCharValue(char romanNum) { if (romanNum == I) { diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 03ea8f1..6a8f02c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -101,7 +101,7 @@ public class TestRomanNumerals { } @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { - int num = rn.convertToInteger("LC"); + rn.convertToInteger("LC"); } @Test(expected=Exception.class) public void testRomanNumerals_VV_err() throws Exception { From acb39ce1005f0ffbd7e774eaa53870a476239965 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:24:01 +0300 Subject: [PATCH 066/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 2 ++ tests/TestRomanNumerals.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 4c4487c..4212007 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -255,3 +255,5 @@ UnitTestCaseAction 1475670109461 TestRomanNumerals.java OK UnitTestSessionAction 1475670109461 TestRomanNumerals.java OK RefactoringAction 1475670151051 RomanNumerals.java ADD void validateSubstraction(int, int) METHOD EditAction 1475670151051 RomanNumerals.java 3111 7 18 0 +RefactoringAction 1475670231836 TestRomanNumerals.java ADD void testRomanNumerals_XM_err()/2 METHOD +EditAction 1475670241087 TestRomanNumerals.java 3460 24 42 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 6a8f02c..b306576 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -115,5 +115,9 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_XM_err() throws Exception { rn.convertToInteger("XM"); } + + @Test(expected=Exception.class) public void testRomanNumerals_XXC_err() throws Exception { + rn.convertToInteger("XXC"); + } } From d03e9ec340d249ef7b2c6f0247f994008b932679 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:26:00 +0300 Subject: [PATCH 067/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 4212007..d25bb60 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -257,3 +257,6 @@ RefactoringAction 1475670151051 RomanNumerals.java ADD void validateSubstraction EditAction 1475670151051 RomanNumerals.java 3111 7 18 0 RefactoringAction 1475670231836 TestRomanNumerals.java ADD void testRomanNumerals_XM_err()/2 METHOD EditAction 1475670241087 TestRomanNumerals.java 3460 24 42 18 +UnitTestCaseAction 1475670251760 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670251760 TestRomanNumerals.java FAIL +EditAction 1475670360024 RomanNumerals.java 3183 7 18 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 346ab0a..400b356 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -64,6 +64,9 @@ private int parseCharacterToValue(String romanNum, int i) throws Exception { private int getCurrentValue(int currentVal, int nextVal) throws Exception { if (currentVal == nextVal) { + if (true) { + throw new Exception("invalid substraction"); + } return currentVal; } else if (currentVal < nextVal) { From 6f2203984afea565fb856a5fee7df59764d90be5 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:26:59 +0300 Subject: [PATCH 068/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ src/RomanNumerals.java | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index d25bb60..c3896eb 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -260,3 +260,8 @@ EditAction 1475670241087 TestRomanNumerals.java 3460 24 42 18 UnitTestCaseAction 1475670251760 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670251760 TestRomanNumerals.java FAIL EditAction 1475670360024 RomanNumerals.java 3183 7 18 0 +UnitTestCaseAction 1475670362274 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670362274 TestRomanNumerals.java FAIL +RefactoringAction 1475670398310 RomanNumerals.java ADD boolean sub FIELD +RefactoringAction 1475670401929 RomanNumerals.java RENAME sub=>boolean subd FIELD +EditAction 1475670419354 RomanNumerals.java 3235 7 18 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 400b356..6d0f0bc 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,6 +7,8 @@ public class RomanNumerals { private static final char C = 'C'; private static final char D = 'D'; private static final char M = 'M'; + + private boolean subd = false; public int convertToInteger(String romanNum) throws Exception { int value = 0; @@ -64,13 +66,14 @@ private int parseCharacterToValue(String romanNum, int i) throws Exception { private int getCurrentValue(int currentVal, int nextVal) throws Exception { if (currentVal == nextVal) { - if (true) { + if (subd) { throw new Exception("invalid substraction"); } return currentVal; } else if (currentVal < nextVal) { validateSubstraction(currentVal, nextVal); + subd = true; return -currentVal; } else if (currentVal > nextVal) { From a3f080a9b1ace196a331e95b0de81736a9e5d560 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:27:33 +0300 Subject: [PATCH 069/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index c3896eb..c8e8906 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -265,3 +265,6 @@ UnitTestSessionAction 1475670362274 TestRomanNumerals.java FAIL RefactoringAction 1475670398310 RomanNumerals.java ADD boolean sub FIELD RefactoringAction 1475670401929 RomanNumerals.java RENAME sub=>boolean subd FIELD EditAction 1475670419354 RomanNumerals.java 3235 7 18 0 +UnitTestCaseAction 1475670425390 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670425390 TestRomanNumerals.java FAIL +EditAction 1475670453267 RomanNumerals.java 3271 7 18 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 6d0f0bc..ad429c7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -69,6 +69,7 @@ private int getCurrentValue(int currentVal, int nextVal) throws Exception { if (subd) { throw new Exception("invalid substraction"); } + subd = false; return currentVal; } else if (currentVal < nextVal) { @@ -77,6 +78,7 @@ else if (currentVal < nextVal) { return -currentVal; } else if (currentVal > nextVal) { + subd = false; return currentVal; } return 0; From a80e3d5244153c0e9ad71fb68b7ccd8feecce61e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:28:54 +0300 Subject: [PATCH 070/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ .besouro/20161005142238292/besouroEpisodes.txt | 8 ++++++++ .besouro/20161005142238292/randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ src/RomanNumerals.java | 2 +- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index c8e8906..414e860 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -268,3 +268,8 @@ EditAction 1475670419354 RomanNumerals.java 3235 7 18 0 UnitTestCaseAction 1475670425390 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670425390 TestRomanNumerals.java FAIL EditAction 1475670453267 RomanNumerals.java 3271 7 18 0 +UnitTestCaseAction 1475670455331 TestRomanNumerals.java OK +UnitTestSessionAction 1475670455331 TestRomanNumerals.java OK +UnitTestCaseAction 1475670530371 TestRomanNumerals.java OK +UnitTestSessionAction 1475670530371 TestRomanNumerals.java OK +EditAction 1475670534006 RomanNumerals.java 3278 7 18 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 2fa1294..5cb2c35 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -115,3 +115,11 @@ 1475669926679 test-first 1 973 true 1475670071488 refactoring 2A 2 true 1475670109461 test-addition 1 15 true +1475670455331 test-first 3 304 true +1475670455332 test-first 3 304 true +1475670455333 test-first 3 304 true +1475670455334 test-first 3 304 true +1475670455335 test-first 3 304 true +1475670455336 test-first 3 304 true +1475670455337 test-last 1 304 false +1475670530371 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 719ad94..3b0f1d8 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -20,3 +20,5 @@ 1475669926607 test-first 1 973 true 1475670071488 refactoring 2A 2 false 1475670109461 test-addition 1 15 false +1475670455331 test-first 3 304 true +1475670530371 regression 1 0 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index a1212dc..1c4d855 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -20,3 +20,5 @@ 1475669926607 test-first 1 978 true 1475670071488 refactoring 2A 144 true 1475670109461 test-addition 1 37 true +1475670455331 test-first 3 345 true +1475670530371 regression 1 75 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index ad429c7..1fd59f6 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -59,7 +59,7 @@ private int parseCharacterToValue(String romanNum, int i) throws Exception { throw e; } else { - return currentVal; // when trying to get next of last, it is intended to end up here + return currentVal; // when trying to get next of last, it is intended to end up here @hacks } } } From dbaa788f43873c6b23f8c7da2bed4351978cc4fd Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:29:01 +0300 Subject: [PATCH 071/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 414e860..95030a3 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -273,3 +273,4 @@ UnitTestSessionAction 1475670455331 TestRomanNumerals.java OK UnitTestCaseAction 1475670530371 TestRomanNumerals.java OK UnitTestSessionAction 1475670530371 TestRomanNumerals.java OK EditAction 1475670534006 RomanNumerals.java 3278 7 18 0 +EditAction 1475670541307 RomanNumerals.java 3279 7 18 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1fd59f6..48cf9d1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -59,7 +59,7 @@ private int parseCharacterToValue(String romanNum, int i) throws Exception { throw e; } else { - return currentVal; // when trying to get next of last, it is intended to end up here @hacks + return currentVal; // @hacks, when trying to get next of last, it is intended to end up here } } } From a1bed50ea985f8249aeb37ea56b6e2435cf454b3 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:29:11 +0300 Subject: [PATCH 072/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 95030a3..8257a9e 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -274,3 +274,6 @@ UnitTestCaseAction 1475670530371 TestRomanNumerals.java OK UnitTestSessionAction 1475670530371 TestRomanNumerals.java OK EditAction 1475670534006 RomanNumerals.java 3278 7 18 0 EditAction 1475670541307 RomanNumerals.java 3279 7 18 0 +UnitTestCaseAction 1475670543197 TestRomanNumerals.java OK +UnitTestSessionAction 1475670543197 TestRomanNumerals.java OK +EditAction 1475670550997 RomanNumerals.java 3281 7 18 0 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 5cb2c35..3acb483 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -123,3 +123,4 @@ 1475670455336 test-first 3 304 true 1475670455337 test-last 1 304 false 1475670530371 regression 1 0 true +1475670543197 refactoring 2A 9 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 3b0f1d8..9f2052c 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -22,3 +22,4 @@ 1475670109461 test-addition 1 15 false 1475670455331 test-first 3 304 true 1475670530371 regression 1 0 false +1475670543197 refactoring 2A 9 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 1c4d855..cd355a0 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -22,3 +22,4 @@ 1475670109461 test-addition 1 37 true 1475670455331 test-first 3 345 true 1475670530371 regression 1 75 true +1475670543197 refactoring 2A 12 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 48cf9d1..e919cce 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -54,12 +54,12 @@ private int parseCharacterToValue(String romanNum, int i) throws Exception { nextVal = getCharValue(romanNum.charAt(i + 1)); return getCurrentValue(currentVal, nextVal); } - catch(Exception e) { + catch(Exception e) { // @hacks if (e.getMessage() == "invalid substraction") { throw e; } else { - return currentVal; // @hacks, when trying to get next of last, it is intended to end up here + return currentVal; // when trying to get next of last, it is intended to end up here } } } From b422648183be86f09485a789d0763015a308da28 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:29:48 +0300 Subject: [PATCH 073/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 2 ++ tests/TestRomanNumerals.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 8257a9e..9eba120 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -277,3 +277,5 @@ EditAction 1475670541307 RomanNumerals.java 3279 7 18 0 UnitTestCaseAction 1475670543197 TestRomanNumerals.java OK UnitTestSessionAction 1475670543197 TestRomanNumerals.java OK EditAction 1475670550997 RomanNumerals.java 3281 7 18 0 +RefactoringAction 1475670580840 TestRomanNumerals.java ADD void testRomanNumerals_XXC_err()/2 METHOD +EditAction 1475670587673 TestRomanNumerals.java 3590 25 43 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index b306576..be4babd 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -119,5 +119,9 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_XXC_err() throws Exception { rn.convertToInteger("XXC"); } + + @Test(expected=Exception.class) public void testRomanNumerals_VX_err() throws Exception { + rn.convertToInteger("VX"); + } } From 792abcc4504eb0d4ab4825893f2058d8e85c71f8 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:30:13 +0300 Subject: [PATCH 074/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 7 +++++++ .besouro/20161005142238292/besouroEpisodes.txt | 2 ++ .besouro/20161005142238292/randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ tests/TestRomanNumerals.java | 4 ++++ 5 files changed, 17 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 9eba120..8e05257 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -279,3 +279,10 @@ UnitTestSessionAction 1475670543197 TestRomanNumerals.java OK EditAction 1475670550997 RomanNumerals.java 3281 7 18 0 RefactoringAction 1475670580840 TestRomanNumerals.java ADD void testRomanNumerals_XXC_err()/2 METHOD EditAction 1475670587673 TestRomanNumerals.java 3590 25 43 18 +UnitTestCaseAction 1475670590110 TestRomanNumerals.java OK +UnitTestSessionAction 1475670590110 TestRomanNumerals.testRomanNumerals_VX_err OK +UnitTestCaseAction 1475670593155 TestRomanNumerals.java OK +UnitTestSessionAction 1475670593155 TestRomanNumerals.java OK +RefactoringAction 1475670608614 TestRomanNumerals.java ADD void testRomanNumerals_VX_err()/2 METHOD +RefactoringAction 1475670610674 TestRomanNumerals.java RENAME testRomanNumerals_VX_err()/2=>void testRomanNumerals_LC_err()/2 METHOD +EditAction 1475670612780 TestRomanNumerals.java 3720 26 44 18 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 3acb483..3773a52 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -124,3 +124,5 @@ 1475670455337 test-last 1 304 false 1475670530371 regression 1 0 true 1475670543197 refactoring 2A 9 true +1475670590110 test-last 1 39 false +1475670593155 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 9f2052c..f86d2d6 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -23,3 +23,5 @@ 1475670455331 test-first 3 304 true 1475670530371 regression 1 0 false 1475670543197 refactoring 2A 9 false +1475670590110 test-last 1 39 false +1475670593155 regression 1 0 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index cd355a0..d321b60 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -23,3 +23,5 @@ 1475670455331 test-first 3 345 true 1475670530371 regression 1 75 true 1475670543197 refactoring 2A 12 true +1475670590110 test-last 1 46 false +1475670593155 regression 1 3 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index be4babd..5194143 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -123,5 +123,9 @@ public class TestRomanNumerals { @Test(expected=Exception.class) public void testRomanNumerals_VX_err() throws Exception { rn.convertToInteger("VX"); } + + @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { + rn.convertToInteger("LC"); + } } From 7c9dbad88f4ecdd0641378d97fe53203432d16cf Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:30:31 +0300 Subject: [PATCH 075/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 8e05257..15b8993 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -286,3 +286,6 @@ UnitTestSessionAction 1475670593155 TestRomanNumerals.java OK RefactoringAction 1475670608614 TestRomanNumerals.java ADD void testRomanNumerals_VX_err()/2 METHOD RefactoringAction 1475670610674 TestRomanNumerals.java RENAME testRomanNumerals_VX_err()/2=>void testRomanNumerals_LC_err()/2 METHOD EditAction 1475670612780 TestRomanNumerals.java 3720 26 44 18 +CompilationAction 1475670614277 TestRomanNumerals.java +RefactoringAction 1475670630751 TestRomanNumerals.java RENAME testRomanNumerals_LC_err()/2=>void testRomanNumerals_DM_err() METHOD +EditAction 1475670630954 TestRomanNumerals.java 3720 26 44 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5194143..1d7910c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -124,8 +124,8 @@ public class TestRomanNumerals { rn.convertToInteger("VX"); } - @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { - rn.convertToInteger("LC"); + @Test(expected=Exception.class) public void testRomanNumerals_DM_err() throws Exception { + rn.convertToInteger("DM"); } } From 525c6070875b4b4fd0f1baaf21049096b152ecb8 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:32:49 +0300 Subject: [PATCH 076/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ .besouro/20161005142238292/besouroEpisodes.txt | 2 ++ .../20161005142238292/randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142238292/zorroEpisodes.txt | 2 ++ tests/TestRomanNumerals.java | 11 +++++++++++ 5 files changed, 22 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 15b8993..fc5859a 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -289,3 +289,8 @@ EditAction 1475670612780 TestRomanNumerals.java 3720 26 44 18 CompilationAction 1475670614277 TestRomanNumerals.java RefactoringAction 1475670630751 TestRomanNumerals.java RENAME testRomanNumerals_LC_err()/2=>void testRomanNumerals_DM_err() METHOD EditAction 1475670630954 TestRomanNumerals.java 3720 26 44 18 +UnitTestCaseAction 1475670633203 TestRomanNumerals.java OK +UnitTestSessionAction 1475670633203 TestRomanNumerals.testRomanNumerals_DM_err OK +UnitTestCaseAction 1475670636950 TestRomanNumerals.java OK +UnitTestSessionAction 1475670636950 TestRomanNumerals.java OK +EditAction 1475670769269 TestRomanNumerals.java 3877 27 45 18 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 3773a52..d9093ed 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -126,3 +126,5 @@ 1475670543197 refactoring 2A 9 true 1475670590110 test-last 1 39 false 1475670593155 regression 1 0 true +1475670633203 test-addition 1 24 true +1475670636950 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index f86d2d6..d1be8e6 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -25,3 +25,5 @@ 1475670543197 refactoring 2A 9 false 1475670590110 test-last 1 39 false 1475670593155 regression 1 0 true +1475670633203 test-addition 1 24 false +1475670636950 regression 1 0 false diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index d321b60..7e742d2 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -25,3 +25,5 @@ 1475670543197 refactoring 2A 12 true 1475670590110 test-last 1 46 false 1475670593155 regression 1 3 false +1475670633203 test-addition 1 40 false +1475670636950 regression 1 3 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 1d7910c..31ce3a7 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -1,9 +1,20 @@ import static org.junit.Assert.*; + + import org.junit.Test; public class TestRomanNumerals { + enum Roman{ + i(1),iv(4),v(5), ix(9), x(10); + int weight; + + private Roman(int weight) { + this.weight = weight; + } + }; + private RomanNumerals rn = new RomanNumerals(); @Test public void testRomanNumerals_emptyString() throws Exception { From 0cf9a87af0bf86f05204b468cacd19062a32fb8e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:34:43 +0300 Subject: [PATCH 077/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 6 ++++++ tests/TestRomanNumerals.java | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index fc5859a..e520bc8 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -294,3 +294,9 @@ UnitTestSessionAction 1475670633203 TestRomanNumerals.testRomanNumerals_DM_err O UnitTestCaseAction 1475670636950 TestRomanNumerals.java OK UnitTestSessionAction 1475670636950 TestRomanNumerals.java OK EditAction 1475670769269 TestRomanNumerals.java 3877 27 45 18 +RefactoringAction 1475670784994 TestRomanNumerals.java ADD static String decToRoman(int) METHOD +RefactoringAction 1475670799424 TestRomanNumerals.java ADD void testRomanNumerals_DM_err()/2 METHOD +RefactoringAction 1475670811358 TestRomanNumerals.java RENAME testRomanNumerals_DM_err()/2=>void testRomanNumerals_2014_err() METHOD +RefactoringAction 1475670813433 TestRomanNumerals.java RENAME testRomanNumerals_2014_err()=>void testRomanNumerals_2014_() METHOD +RefactoringAction 1475670814525 TestRomanNumerals.java RENAME testRomanNumerals_2014_()=>void testRomanNumerals_2014_2014() METHOD +EditAction 1475670882884 TestRomanNumerals.java 4414 29 53 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 31ce3a7..248fb42 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -15,6 +15,18 @@ private Roman(int weight) { } }; + static String decToRoman(int dec){ + String roman=""; + Roman[] values=Roman.values(); + for (int i = values.length-1; i>=0; i--) { + while(dec>=values[i].weight){ + roman+=values[i]; + dec=dec-values[i].weight; + } + } + return roman; + } + private RomanNumerals rn = new RomanNumerals(); @Test public void testRomanNumerals_emptyString() throws Exception { @@ -138,5 +150,12 @@ private Roman(int weight) { @Test(expected=Exception.class) public void testRomanNumerals_DM_err() throws Exception { rn.convertToInteger("DM"); } + + @Test public void testRomanNumerals_2014_2014() throws Exception { + int testValue = 2014; + String roman = decToRoman(2014); + int converted = rn.convertToInteger(roman); + assertEquals(testValue, converted); + } } From f472e185d887fa2c1ec3651f43135dbc91845d93 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:35:00 +0300 Subject: [PATCH 078/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index e520bc8..e7632c1 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -300,3 +300,6 @@ RefactoringAction 1475670811358 TestRomanNumerals.java RENAME testRomanNumerals_ RefactoringAction 1475670813433 TestRomanNumerals.java RENAME testRomanNumerals_2014_err()=>void testRomanNumerals_2014_() METHOD RefactoringAction 1475670814525 TestRomanNumerals.java RENAME testRomanNumerals_2014_()=>void testRomanNumerals_2014_2014() METHOD EditAction 1475670882884 TestRomanNumerals.java 4414 29 53 19 +UnitTestCaseAction 1475670885617 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670885617 TestRomanNumerals.java FAIL +EditAction 1475670900531 TestRomanNumerals.java 4444 29 54 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 248fb42..d873d6f 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -154,6 +154,7 @@ static String decToRoman(int dec){ @Test public void testRomanNumerals_2014_2014() throws Exception { int testValue = 2014; String roman = decToRoman(2014); + System.err.println(roman); int converted = rn.convertToInteger(roman); assertEquals(testValue, converted); } From 722107003bd3ae67985b8581801fd9e4355808d6 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:36:17 +0300 Subject: [PATCH 079/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++ tests/TestRomanNumerals.java | 54 ++++++++++++++++---------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index e7632c1..460d5fe 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -303,3 +303,8 @@ EditAction 1475670882884 TestRomanNumerals.java 4414 29 53 19 UnitTestCaseAction 1475670885617 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670885617 TestRomanNumerals.java FAIL EditAction 1475670900531 TestRomanNumerals.java 4444 29 54 19 +UnitTestCaseAction 1475670902297 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670902297 TestRomanNumerals.java FAIL +RefactoringAction 1475670971218 TestRomanNumerals.java ADD static int decodeSingle(char) METHOD +RefactoringAction 1475670971218 TestRomanNumerals.java ADD static int decode(String) METHOD +EditAction 1475670976803 TestRomanNumerals.java 5069 29 55 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index d873d6f..a44f787 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -6,26 +6,40 @@ public class TestRomanNumerals { - enum Roman{ - i(1),iv(4),v(5), ix(9), x(10); - int weight; + private static int decodeSingle(char letter) { + switch (letter) { + case 'M': + return 1000; + case 'D': + return 500; + case 'C': + return 100; + case 'L': + return 50; + case 'X': + return 10; + case 'V': + return 5; + case 'I': + return 1; + default: + return 0; + } + } - private Roman(int weight) { - this.weight = weight; - } - }; - - static String decToRoman(int dec){ - String roman=""; - Roman[] values=Roman.values(); - for (int i = values.length-1; i>=0; i--) { - while(dec>=values[i].weight){ - roman+=values[i]; - dec=dec-values[i].weight; - } - } - return roman; - } + public static int decode(String roman) { + int result = 0; + String uRoman = roman.toUpperCase(); //case-insensitive + for (int i = 0; i < uRoman.length() - 1; i++) {//loop over all but the last character + if (decodeSingle(uRoman.charAt(i)) < decodeSingle(uRoman.charAt(i + 1))) { + result -= decodeSingle(uRoman.charAt(i)); + } else { + result += decodeSingle(uRoman.charAt(i)); + } + } + result += decodeSingle(uRoman.charAt(uRoman.length() - 1)); + return result; + } private RomanNumerals rn = new RomanNumerals(); @@ -153,7 +167,7 @@ static String decToRoman(int dec){ @Test public void testRomanNumerals_2014_2014() throws Exception { int testValue = 2014; - String roman = decToRoman(2014); + String roman = decode(2014); System.err.println(roman); int converted = rn.convertToInteger(roman); assertEquals(testValue, converted); From 328f35653b7c2587ed831b3bf7a98bb231a80c41 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:39:11 +0300 Subject: [PATCH 080/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 39 +++++++ tests/RomanNumeral.java | 137 +++++++++++++++++++++++++ tests/TestRomanNumerals.java | 36 ------- 3 files changed, 176 insertions(+), 36 deletions(-) create mode 100644 tests/RomanNumeral.java diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 460d5fe..2381e4e 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -308,3 +308,42 @@ UnitTestSessionAction 1475670902297 TestRomanNumerals.java FAIL RefactoringAction 1475670971218 TestRomanNumerals.java ADD static int decodeSingle(char) METHOD RefactoringAction 1475670971218 TestRomanNumerals.java ADD static int decode(String) METHOD EditAction 1475670976803 TestRomanNumerals.java 5069 29 55 19 +CompilationAction 1475670978394 TestRomanNumerals.java +RefactoringAction 1475671006817 TestRomanNumerals.java REMOVE decode(String) METHOD +RefactoringAction 1475671006817 TestRomanNumerals.java REMOVE decodeSingle(char) METHOD +CompilationAction 1475671007067 TestRomanNumerals.java +CompilationAction 1475671007223 TestRomanNumerals.java +CompilationAction 1475671011216 TestRomanNumerals.java +RefactoringAction 1475671038662 TestRomanNumerals.java ADD def to_roman() METHOD +CompilationAction 1475671038911 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039083 TestRomanNumerals.java +CompilationAction 1475671039099 TestRomanNumerals.java +CompilationAction 1475671044122 TestRomanNumerals.java +CompilationAction 1475671044262 TestRomanNumerals.java +RefactoringAction 1475671143525 RomanNumeral.java ADD RomanNumeral.java CLASS +FileOpenedAction 1475671143665 RomanNumeral.java 36 0 0 0 +RefactoringAction 1475671146255 RomanNumeral.java ADD int num FIELD +RefactoringAction 1475671146255 RomanNumeral.java ADD int FIELD +RefactoringAction 1475671146255 RomanNumeral.java ADD String FIELD +RefactoringAction 1475671146255 RomanNumeral.java ADD RomanNumeral(int) METHOD +RefactoringAction 1475671146255 RomanNumeral.java ADD RomanNumeral(String) METHOD +RefactoringAction 1475671146255 RomanNumeral.java ADD int letterToNumber(char) METHOD +RefactoringAction 1475671146270 RomanNumeral.java ADD String toString() METHOD +RefactoringAction 1475671146270 RomanNumeral.java ADD int toInt() METHOD +EditAction 1475671150966 RomanNumeral.java 5727 5 16 0 diff --git a/tests/RomanNumeral.java b/tests/RomanNumeral.java new file mode 100644 index 0000000..f68a881 --- /dev/null +++ b/tests/RomanNumeral.java @@ -0,0 +1,137 @@ + /** + * An object of type RomanNumeral is an integer between 1 and 3999. It can + * be constructed either from an integer or from a string that represents + * a Roman numeral in this range. The function toString() will return a + * standardized Roman numeral representation of the number. The function + * toInt() will return the number as a value of type int. + */ + public class RomanNumeral { + + private final int num; // The number represented by this Roman numeral. + + /* The following arrays are used by the toString() function to construct + the standard Roman numeral representation of the number. For each i, + the number numbers[i] is represented by the corresponding string, letters[i]. + */ + + private static int[] numbers = { 1000, 900, 500, 400, 100, 90, + 50, 40, 10, 9, 5, 4, 1 }; + + private static String[] letters = { "M", "CM", "D", "CD", "C", "XC", + "L", "XL", "X", "IX", "V", "IV", "I" }; + + /** + * Constructor. Creates the Roman number with the int value specified + * by the parameter. Throws a NumberFormatException if arabic is + * not in the range 1 to 3999 inclusive. + */ + public RomanNumeral(int arabic) { + if (arabic < 1) + throw new NumberFormatException("Value of RomanNumeral must be positive."); + if (arabic > 3999) + throw new NumberFormatException("Value of RomanNumeral must be 3999 or less."); + num = arabic; + } + + + /* + * Constructor. Creates the Roman number with the given representation. + * For example, RomanNumeral("xvii") is 17. If the parameter is not a + * legal Roman numeral, a NumberFormatException is thrown. Both upper and + * lower case letters are allowed. + */ + public RomanNumeral(String roman) { + + if (roman.length() == 0) + throw new NumberFormatException("An empty string does not define a Roman numeral."); + + roman = roman.toUpperCase(); // Convert to upper case letters. + + int i = 0; // A position in the string, roman; + int arabic = 0; // Arabic numeral equivalent of the part of the string that has + // been converted so far. + + while (i < roman.length()) { + + char letter = roman.charAt(i); // Letter at current position in string. + int number = letterToNumber(letter); // Numerical equivalent of letter. + + i++; // Move on to next position in the string + + if (i == roman.length()) { + // There is no letter in the string following the one we have just processed. + // So just add the number corresponding to the single letter to arabic. + arabic += number; + } + else { + // Look at the next letter in the string. If it has a larger Roman numeral + // equivalent than number, then the two letters are counted together as + // a Roman numeral with value (nextNumber - number). + int nextNumber = letterToNumber(roman.charAt(i)); + if (nextNumber > number) { + // Combine the two letters to get one value, and move on to next position in string. + arabic += (nextNumber - number); + i++; + } + else { + // Don't combine the letters. Just add the value of the one letter onto the number. + arabic += number; + } + } + + } // end while + + if (arabic > 3999) + throw new NumberFormatException("Roman numeral must have value 3999 or less."); + + num = arabic; + + } // end constructor + + + /** + * Find the integer value of letter considered as a Roman numeral. Throws + * NumberFormatException if letter is not a legal Roman numeral. The letter + * must be upper case. + */ + private int letterToNumber(char letter) { + switch (letter) { + case 'I': return 1; + case 'V': return 5; + case 'X': return 10; + case 'L': return 50; + case 'C': return 100; + case 'D': return 500; + case 'M': return 1000; + default: throw new NumberFormatException( + "Illegal character \"" + letter + "\" in Roman numeral"); + } + } + + + /** + * Return the standard representation of this Roman numeral. + */ + public String toString() { + String roman = ""; // The roman numeral. + int N = num; // N represents the part of num that still has + // to be converted to Roman numeral representation. + for (int i = 0; i < numbers.length; i++) { + while (N >= numbers[i]) { + roman += letters[i]; + N -= numbers[i]; + } + } + return roman; + } + + + /** + * Return the value of this Roman numeral as an int. + */ + public int toInt() { + return num; + } + + + } \ No newline at end of file diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index a44f787..bb56c21 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -6,41 +6,6 @@ public class TestRomanNumerals { - private static int decodeSingle(char letter) { - switch (letter) { - case 'M': - return 1000; - case 'D': - return 500; - case 'C': - return 100; - case 'L': - return 50; - case 'X': - return 10; - case 'V': - return 5; - case 'I': - return 1; - default: - return 0; - } - } - - public static int decode(String roman) { - int result = 0; - String uRoman = roman.toUpperCase(); //case-insensitive - for (int i = 0; i < uRoman.length() - 1; i++) {//loop over all but the last character - if (decodeSingle(uRoman.charAt(i)) < decodeSingle(uRoman.charAt(i + 1))) { - result -= decodeSingle(uRoman.charAt(i)); - } else { - result += decodeSingle(uRoman.charAt(i)); - } - } - result += decodeSingle(uRoman.charAt(uRoman.length() - 1)); - return result; - } - private RomanNumerals rn = new RomanNumerals(); @Test public void testRomanNumerals_emptyString() throws Exception { @@ -167,7 +132,6 @@ public static int decode(String roman) { @Test public void testRomanNumerals_2014_2014() throws Exception { int testValue = 2014; - String roman = decode(2014); System.err.println(roman); int converted = rn.convertToInteger(roman); assertEquals(testValue, converted); From f03ad139ce9ce816e99efbbeb72e940e37d4aeae Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:39:19 +0300 Subject: [PATCH 081/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + tests/RomanNumeral.java | 274 ++++++++++++------------- 2 files changed, 138 insertions(+), 137 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 2381e4e..933eae9 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -347,3 +347,4 @@ RefactoringAction 1475671146255 RomanNumeral.java ADD int letterToNumber(char) M RefactoringAction 1475671146270 RomanNumeral.java ADD String toString() METHOD RefactoringAction 1475671146270 RomanNumeral.java ADD int toInt() METHOD EditAction 1475671150966 RomanNumeral.java 5727 5 16 0 +EditAction 1475671159109 RomanNumeral.java 5283 5 16 0 diff --git a/tests/RomanNumeral.java b/tests/RomanNumeral.java index f68a881..e82f2e8 100644 --- a/tests/RomanNumeral.java +++ b/tests/RomanNumeral.java @@ -1,137 +1,137 @@ - /** - * An object of type RomanNumeral is an integer between 1 and 3999. It can - * be constructed either from an integer or from a string that represents - * a Roman numeral in this range. The function toString() will return a - * standardized Roman numeral representation of the number. The function - * toInt() will return the number as a value of type int. - */ - public class RomanNumeral { - - private final int num; // The number represented by this Roman numeral. - - /* The following arrays are used by the toString() function to construct - the standard Roman numeral representation of the number. For each i, - the number numbers[i] is represented by the corresponding string, letters[i]. - */ - - private static int[] numbers = { 1000, 900, 500, 400, 100, 90, - 50, 40, 10, 9, 5, 4, 1 }; - - private static String[] letters = { "M", "CM", "D", "CD", "C", "XC", - "L", "XL", "X", "IX", "V", "IV", "I" }; - - /** - * Constructor. Creates the Roman number with the int value specified - * by the parameter. Throws a NumberFormatException if arabic is - * not in the range 1 to 3999 inclusive. - */ - public RomanNumeral(int arabic) { - if (arabic < 1) - throw new NumberFormatException("Value of RomanNumeral must be positive."); - if (arabic > 3999) - throw new NumberFormatException("Value of RomanNumeral must be 3999 or less."); - num = arabic; - } - - - /* - * Constructor. Creates the Roman number with the given representation. - * For example, RomanNumeral("xvii") is 17. If the parameter is not a - * legal Roman numeral, a NumberFormatException is thrown. Both upper and - * lower case letters are allowed. - */ - public RomanNumeral(String roman) { - - if (roman.length() == 0) - throw new NumberFormatException("An empty string does not define a Roman numeral."); - - roman = roman.toUpperCase(); // Convert to upper case letters. - - int i = 0; // A position in the string, roman; - int arabic = 0; // Arabic numeral equivalent of the part of the string that has - // been converted so far. - - while (i < roman.length()) { - - char letter = roman.charAt(i); // Letter at current position in string. - int number = letterToNumber(letter); // Numerical equivalent of letter. - - i++; // Move on to next position in the string - - if (i == roman.length()) { - // There is no letter in the string following the one we have just processed. - // So just add the number corresponding to the single letter to arabic. - arabic += number; - } - else { - // Look at the next letter in the string. If it has a larger Roman numeral - // equivalent than number, then the two letters are counted together as - // a Roman numeral with value (nextNumber - number). - int nextNumber = letterToNumber(roman.charAt(i)); - if (nextNumber > number) { - // Combine the two letters to get one value, and move on to next position in string. - arabic += (nextNumber - number); - i++; - } - else { - // Don't combine the letters. Just add the value of the one letter onto the number. - arabic += number; - } - } - - } // end while - - if (arabic > 3999) - throw new NumberFormatException("Roman numeral must have value 3999 or less."); - - num = arabic; - - } // end constructor - - - /** - * Find the integer value of letter considered as a Roman numeral. Throws - * NumberFormatException if letter is not a legal Roman numeral. The letter - * must be upper case. - */ - private int letterToNumber(char letter) { - switch (letter) { - case 'I': return 1; - case 'V': return 5; - case 'X': return 10; - case 'L': return 50; - case 'C': return 100; - case 'D': return 500; - case 'M': return 1000; - default: throw new NumberFormatException( - "Illegal character \"" + letter + "\" in Roman numeral"); - } - } - - - /** - * Return the standard representation of this Roman numeral. - */ - public String toString() { - String roman = ""; // The roman numeral. - int N = num; // N represents the part of num that still has - // to be converted to Roman numeral representation. - for (int i = 0; i < numbers.length; i++) { - while (N >= numbers[i]) { - roman += letters[i]; - N -= numbers[i]; - } - } - return roman; - } - - - /** - * Return the value of this Roman numeral as an int. - */ - public int toInt() { - return num; - } - - - } \ No newline at end of file + /** + * An object of type RomanNumeral is an integer between 1 and 3999. It can + * be constructed either from an integer or from a string that represents + * a Roman numeral in this range. The function toString() will return a + * standardized Roman numeral representation of the number. The function + * toInt() will return the number as a value of type int. + */ + public class RomanNumeral { + + private final int num; // The number represented by this Roman numeral. + + /* The following arrays are used by the toString() function to construct + the standard Roman numeral representation of the number. For each i, + the number numbers[i] is represented by the corresponding string, letters[i]. + */ + + private static int[] numbers = { 1000, 900, 500, 400, 100, 90, + 50, 40, 10, 9, 5, 4, 1 }; + + private static String[] letters = { "M", "CM", "D", "CD", "C", "XC", + "L", "XL", "X", "IX", "V", "IV", "I" }; + + /** + * Constructor. Creates the Roman number with the int value specified + * by the parameter. Throws a NumberFormatException if arabic is + * not in the range 1 to 3999 inclusive. + */ + public RomanNumeral(int arabic) { + if (arabic < 1) + throw new NumberFormatException("Value of RomanNumeral must be positive."); + if (arabic > 3999) + throw new NumberFormatException("Value of RomanNumeral must be 3999 or less."); + num = arabic; + } + + + /* + * Constructor. Creates the Roman number with the given representation. + * For example, RomanNumeral("xvii") is 17. If the parameter is not a + * legal Roman numeral, a NumberFormatException is thrown. Both upper and + * lower case letters are allowed. + */ + public RomanNumeral(String roman) { + + if (roman.length() == 0) + throw new NumberFormatException("An empty string does not define a Roman numeral."); + + roman = roman.toUpperCase(); // Convert to upper case letters. + + int i = 0; // A position in the string, roman; + int arabic = 0; // Arabic numeral equivalent of the part of the string that has + // been converted so far. + + while (i < roman.length()) { + + char letter = roman.charAt(i); // Letter at current position in string. + int number = letterToNumber(letter); // Numerical equivalent of letter. + + i++; // Move on to next position in the string + + if (i == roman.length()) { + // There is no letter in the string following the one we have just processed. + // So just add the number corresponding to the single letter to arabic. + arabic += number; + } + else { + // Look at the next letter in the string. If it has a larger Roman numeral + // equivalent than number, then the two letters are counted together as + // a Roman numeral with value (nextNumber - number). + int nextNumber = letterToNumber(roman.charAt(i)); + if (nextNumber > number) { + // Combine the two letters to get one value, and move on to next position in string. + arabic += (nextNumber - number); + i++; + } + else { + // Don't combine the letters. Just add the value of the one letter onto the number. + arabic += number; + } + } + + } // end while + + if (arabic > 3999) + throw new NumberFormatException("Roman numeral must have value 3999 or less."); + + num = arabic; + + } // end constructor + + + /** + * Find the integer value of letter considered as a Roman numeral. Throws + * NumberFormatException if letter is not a legal Roman numeral. The letter + * must be upper case. + */ + private int letterToNumber(char letter) { + switch (letter) { + case 'I': return 1; + case 'V': return 5; + case 'X': return 10; + case 'L': return 50; + case 'C': return 100; + case 'D': return 500; + case 'M': return 1000; + default: throw new NumberFormatException( + "Illegal character \"" + letter + "\" in Roman numeral"); + } + } + + + /** + * Return the standard representation of this Roman numeral. + */ + public String toString() { + String roman = ""; // The roman numeral. + int N = num; // N represents the part of num that still has + // to be converted to Roman numeral representation. + for (int i = 0; i < numbers.length; i++) { + while (N >= numbers[i]) { + roman += letters[i]; + N -= numbers[i]; + } + } + return roman; + } + + + /** + * Return the value of this Roman numeral as an int. + */ + public int toInt() { + return num; + } + + + } \ No newline at end of file From e936a1113ac8fd223f93b97c41192fd626f8e49d Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:41:17 +0300 Subject: [PATCH 082/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 + .../20161005142238292/besouroEpisodes.txt | 84 ------------------- .../randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 7 +- tests/TestRomanNumerals.java | 7 +- 5 files changed, 13 insertions(+), 90 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 933eae9..bd50b91 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -348,3 +348,7 @@ RefactoringAction 1475671146270 RomanNumeral.java ADD String toString() METHOD RefactoringAction 1475671146270 RomanNumeral.java ADD int toInt() METHOD EditAction 1475671150966 RomanNumeral.java 5727 5 16 0 EditAction 1475671159109 RomanNumeral.java 5283 5 16 0 +CompilationAction 1475671237359 TestRomanNumerals.java +UnitTestCaseAction 1475671240466 TestRomanNumerals.java OK +UnitTestSessionAction 1475671240466 TestRomanNumerals.java OK +EditAction 1475671276830 TestRomanNumerals.java 4041 27 49 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index d9093ed..8b99b64 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -44,87 +44,3 @@ 1475669926608 test-first 1 973 true 1475669926609 test-first 1 973 true 1475669926610 test-first 1 973 true -1475669926611 test-first 1 973 true -1475669926612 test-first 1 973 true -1475669926613 test-first 1 973 true -1475669926614 test-last 1 973 false -1475669926615 test-first 1 973 true -1475669926616 test-last 1 973 false -1475669926617 test-first 1 973 true -1475669926618 test-last 1 973 false -1475669926619 test-first 1 973 true -1475669926620 test-last 1 973 false -1475669926621 test-first 1 973 true -1475669926622 test-last 1 973 false -1475669926623 test-first 1 973 true -1475669926624 test-last 1 973 false -1475669926625 test-first 1 973 true -1475669926626 test-last 1 973 false -1475669926627 test-first 1 973 true -1475669926628 test-last 1 973 false -1475669926629 test-first 1 973 true -1475669926630 test-first 1 973 true -1475669926631 test-first 1 973 true -1475669926632 test-first 1 973 true -1475669926633 test-first 1 973 true -1475669926634 test-last 1 973 false -1475669926635 test-first 1 973 true -1475669926636 test-last 1 973 false -1475669926637 test-first 1 973 true -1475669926638 test-last 1 973 false -1475669926639 test-first 1 973 true -1475669926640 test-last 1 973 false -1475669926641 test-last 1 973 false -1475669926642 test-last 1 973 false -1475669926643 test-last 1 973 false -1475669926644 test-last 1 973 false -1475669926645 test-last 1 973 false -1475669926646 test-last 1 973 false -1475669926647 test-last 1 973 false -1475669926648 test-last 1 973 false -1475669926649 test-last 1 973 false -1475669926650 test-last 1 973 false -1475669926651 test-last 1 973 false -1475669926652 test-last 1 973 false -1475669926653 test-last 1 973 false -1475669926654 test-last 1 973 false -1475669926655 test-last 1 973 false -1475669926656 test-first 1 973 true -1475669926657 test-first 1 973 true -1475669926658 test-first 1 973 true -1475669926659 test-first 1 973 true -1475669926660 test-first 1 973 true -1475669926661 test-first 1 973 true -1475669926662 test-first 1 973 true -1475669926663 test-first 1 973 true -1475669926664 test-first 1 973 true -1475669926665 test-first 1 973 true -1475669926666 test-first 1 973 true -1475669926667 test-first 1 973 true -1475669926668 test-first 1 973 true -1475669926669 test-first 1 973 true -1475669926670 test-first 1 973 true -1475669926671 test-first 1 973 true -1475669926672 test-first 1 973 true -1475669926673 test-first 1 973 true -1475669926674 test-first 1 973 true -1475669926675 test-first 1 973 true -1475669926676 test-first 1 973 true -1475669926677 test-first 1 973 true -1475669926678 test-first 1 973 true -1475669926679 test-first 1 973 true -1475670071488 refactoring 2A 2 true -1475670109461 test-addition 1 15 true -1475670455331 test-first 3 304 true -1475670455332 test-first 3 304 true -1475670455333 test-first 3 304 true -1475670455334 test-first 3 304 true -1475670455335 test-first 3 304 true -1475670455336 test-first 3 304 true -1475670455337 test-last 1 304 false -1475670530371 regression 1 0 true -1475670543197 refactoring 2A 9 true -1475670590110 test-last 1 39 false -1475670593155 regression 1 0 true -1475670633203 test-addition 1 24 true -1475670636950 regression 1 0 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index d1be8e6..443085e 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -27,3 +27,4 @@ 1475670593155 regression 1 0 true 1475670633203 test-addition 1 24 false 1475670636950 regression 1 0 false +1475671240466 test-first 1 471 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 7e742d2..2866ea6 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -24,6 +24,7 @@ 1475670530371 regression 1 75 true 1475670543197 refactoring 2A 12 true 1475670590110 test-last 1 46 false -1475670593155 regression 1 3 false -1475670633203 test-addition 1 40 false -1475670636950 regression 1 3 false +1475670593155 regression 1 3 true +1475670633203 test-addition 1 40 true +1475670636950 regression 1 3 true +1475671240466 test-first 1 603 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index bb56c21..254331c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -131,9 +131,10 @@ public class TestRomanNumerals { } @Test public void testRomanNumerals_2014_2014() throws Exception { - int testValue = 2014; - System.err.println(roman); - int converted = rn.convertToInteger(roman); + RomanNumeral testValue = new RomanNumeral(2014); + System.err.println(testValue.toInt()); + System.err.println(testValue.toString()); + int converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue, converted); } From 38a13b150ff49f4d458fea2792f7c4e097107c24 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:41:23 +0300 Subject: [PATCH 083/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 + .../20161005142238292/besouroEpisodes.txt | 151 ++++++++++++++++++ tests/TestRomanNumerals.java | 2 - 3 files changed, 154 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index bd50b91..589f502 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -352,3 +352,6 @@ CompilationAction 1475671237359 TestRomanNumerals.java UnitTestCaseAction 1475671240466 TestRomanNumerals.java OK UnitTestSessionAction 1475671240466 TestRomanNumerals.java OK EditAction 1475671276830 TestRomanNumerals.java 4041 27 49 19 +UnitTestCaseAction 1475671278580 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671278580 TestRomanNumerals.java FAIL +EditAction 1475671283260 TestRomanNumerals.java 3954 27 47 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 8b99b64..d10b92e 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -44,3 +44,154 @@ 1475669926608 test-first 1 973 true 1475669926609 test-first 1 973 true 1475669926610 test-first 1 973 true +1475669926611 test-first 1 973 true +1475669926612 test-first 1 973 true +1475669926613 test-first 1 973 true +1475669926614 test-last 1 973 false +1475669926615 test-first 1 973 true +1475669926616 test-last 1 973 false +1475669926617 test-first 1 973 true +1475669926618 test-last 1 973 false +1475669926619 test-first 1 973 true +1475669926620 test-last 1 973 false +1475669926621 test-first 1 973 true +1475669926622 test-last 1 973 false +1475669926623 test-first 1 973 true +1475669926624 test-last 1 973 false +1475669926625 test-first 1 973 true +1475669926626 test-last 1 973 false +1475669926627 test-first 1 973 true +1475669926628 test-last 1 973 false +1475669926629 test-first 1 973 true +1475669926630 test-first 1 973 true +1475669926631 test-first 1 973 true +1475669926632 test-first 1 973 true +1475669926633 test-first 1 973 true +1475669926634 test-last 1 973 false +1475669926635 test-first 1 973 true +1475669926636 test-last 1 973 false +1475669926637 test-first 1 973 true +1475669926638 test-last 1 973 false +1475669926639 test-first 1 973 true +1475669926640 test-last 1 973 false +1475669926641 test-last 1 973 false +1475669926642 test-last 1 973 false +1475669926643 test-last 1 973 false +1475669926644 test-last 1 973 false +1475669926645 test-last 1 973 false +1475669926646 test-last 1 973 false +1475669926647 test-last 1 973 false +1475669926648 test-last 1 973 false +1475669926649 test-last 1 973 false +1475669926650 test-last 1 973 false +1475669926651 test-last 1 973 false +1475669926652 test-last 1 973 false +1475669926653 test-last 1 973 false +1475669926654 test-last 1 973 false +1475669926655 test-last 1 973 false +1475669926656 test-first 1 973 true +1475669926657 test-first 1 973 true +1475669926658 test-first 1 973 true +1475669926659 test-first 1 973 true +1475669926660 test-first 1 973 true +1475669926661 test-first 1 973 true +1475669926662 test-first 1 973 true +1475669926663 test-first 1 973 true +1475669926664 test-first 1 973 true +1475669926665 test-first 1 973 true +1475669926666 test-first 1 973 true +1475669926667 test-first 1 973 true +1475669926668 test-first 1 973 true +1475669926669 test-first 1 973 true +1475669926670 test-first 1 973 true +1475669926671 test-first 1 973 true +1475669926672 test-first 1 973 true +1475669926673 test-first 1 973 true +1475669926674 test-first 1 973 true +1475669926675 test-first 1 973 true +1475669926676 test-first 1 973 true +1475669926677 test-first 1 973 true +1475669926678 test-first 1 973 true +1475669926679 test-first 1 973 true +1475670071488 refactoring 2A 2 true +1475670109461 test-addition 1 15 true +1475670455331 test-first 3 304 true +1475670455332 test-first 3 304 true +1475670455333 test-first 3 304 true +1475670455334 test-first 3 304 true +1475670455335 test-first 3 304 true +1475670455336 test-first 3 304 true +1475670455337 test-last 1 304 false +1475670530371 regression 1 0 true +1475670543197 refactoring 2A 9 true +1475670590110 test-last 1 39 false +1475670593155 regression 1 0 true +1475670633203 test-addition 1 24 true +1475670636950 regression 1 0 true +1475671240466 test-first 1 471 true +1475671240467 test-first 1 471 true +1475671240468 test-first 1 471 true +1475671240469 test-first 1 471 true +1475671240470 test-first 1 471 true +1475671240471 test-first 1 471 true +1475671240472 test-first 1 471 true +1475671240473 test-first 1 471 true +1475671240474 test-first 1 471 true +1475671240475 test-first 1 471 true +1475671240476 test-first 1 471 true +1475671240477 test-first 1 471 true +1475671240478 test-first 1 471 true +1475671240479 test-first 1 471 true +1475671240480 test-first 1 471 true +1475671240481 test-first 1 471 true +1475671240482 test-first 1 471 true +1475671240483 test-first 1 471 true +1475671240484 test-first 1 471 true +1475671240485 test-first 1 471 true +1475671240486 test-first 1 471 true +1475671240487 test-first 1 471 true +1475671240488 test-first 1 471 true +1475671240489 test-first 1 471 true +1475671240490 test-first 1 471 true +1475671240491 test-first 1 471 true +1475671240492 test-first 1 471 true +1475671240493 test-first 1 471 true +1475671240494 test-first 1 471 true +1475671240495 test-first 1 471 true +1475671240496 test-first 1 471 true +1475671240497 test-first 1 471 true +1475671240498 test-first 1 471 true +1475671240499 test-first 1 471 true +1475671240500 test-first 1 471 true +1475671240501 test-first 1 471 true +1475671240502 test-first 1 471 true +1475671240503 test-first 1 471 true +1475671240504 test-first 1 471 true +1475671240505 test-first 1 471 true +1475671240506 test-first 1 471 true +1475671240507 test-first 1 471 true +1475671240508 test-first 1 471 true +1475671240509 test-first 1 471 true +1475671240510 test-first 1 471 true +1475671240511 test-first 1 471 true +1475671240512 test-first 1 471 true +1475671240513 test-first 1 471 true +1475671240514 test-first 1 471 true +1475671240515 test-first 1 471 true +1475671240516 test-first 1 471 true +1475671240517 test-first 1 471 true +1475671240518 test-first 1 471 true +1475671240519 test-first 1 471 true +1475671240520 test-first 1 471 true +1475671240521 test-first 1 471 true +1475671240522 test-first 1 471 true +1475671240523 test-first 1 471 true +1475671240524 test-first 1 471 true +1475671240525 test-first 1 471 true +1475671240526 test-first 1 471 true +1475671240527 test-first 1 471 true +1475671240528 test-first 1 471 true +1475671240529 test-first 1 471 true +1475671240530 test-first 1 471 true +1475671240531 test-first 1 471 true +1475671240532 test-first 1 471 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 254331c..8bb8d92 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -132,8 +132,6 @@ public class TestRomanNumerals { @Test public void testRomanNumerals_2014_2014() throws Exception { RomanNumeral testValue = new RomanNumeral(2014); - System.err.println(testValue.toInt()); - System.err.println(testValue.toString()); int converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue, converted); } From 4520c61fe714257ea52004ce71e84813e5e3df3c Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:41:38 +0300 Subject: [PATCH 084/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 + .../20161005142238292/besouroEpisodes.txt | 114 ++++++++++++++++++ tests/TestRomanNumerals.java | 2 +- 3 files changed, 118 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 589f502..e50ce85 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -355,3 +355,6 @@ EditAction 1475671276830 TestRomanNumerals.java 4041 27 49 19 UnitTestCaseAction 1475671278580 TestRomanNumerals.java FAIL UnitTestSessionAction 1475671278580 TestRomanNumerals.java FAIL EditAction 1475671283260 TestRomanNumerals.java 3954 27 47 19 +UnitTestCaseAction 1475671285697 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671285697 TestRomanNumerals.java FAIL +EditAction 1475671298161 TestRomanNumerals.java 3962 27 47 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index d10b92e..a6766c0 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -195,3 +195,117 @@ 1475671240530 test-first 1 471 true 1475671240531 test-first 1 471 true 1475671240532 test-first 1 471 true +1475671240533 test-first 1 471 true +1475671240534 test-first 1 471 true +1475671240535 test-first 1 471 true +1475671240536 test-first 1 471 true +1475671240537 test-first 1 471 true +1475671240538 test-first 1 471 true +1475671240539 test-first 1 471 true +1475671240540 test-first 1 471 true +1475671240541 test-first 1 471 true +1475671240542 test-first 1 471 true +1475671240543 test-first 1 471 true +1475671240544 test-first 1 471 true +1475671240545 test-first 1 471 true +1475671240546 test-first 1 471 true +1475671240547 test-first 1 471 true +1475671240548 test-first 1 471 true +1475671240549 test-first 1 471 true +1475671240550 test-first 1 471 true +1475671240551 test-first 1 471 true +1475671240552 test-first 1 471 true +1475671240553 test-first 1 471 true +1475671240554 test-first 1 471 true +1475671240555 test-first 1 471 true +1475671240556 test-first 1 471 true +1475671240557 test-first 1 471 true +1475671240558 test-first 1 471 true +1475671240559 test-first 1 471 true +1475671240560 test-first 1 471 true +1475671240561 test-first 1 471 true +1475671240562 test-first 1 471 true +1475671240563 test-first 1 471 true +1475671240564 test-first 1 471 true +1475671240565 test-first 1 471 true +1475671240566 test-first 1 471 true +1475671240567 test-first 1 471 true +1475671240568 test-first 1 471 true +1475671240569 test-first 1 471 true +1475671240570 test-first 1 471 true +1475671240571 test-first 1 471 true +1475671240572 test-first 1 471 true +1475671240573 test-first 1 471 true +1475671240574 test-first 1 471 true +1475671240575 test-first 1 471 true +1475671240576 test-first 1 471 true +1475671240577 test-first 1 471 true +1475671240578 test-first 1 471 true +1475671240579 test-first 1 471 true +1475671240580 test-first 1 471 true +1475671240581 test-first 1 471 true +1475671240582 test-first 1 471 true +1475671240583 test-first 1 471 true +1475671240584 test-first 1 471 true +1475671240585 test-first 1 471 true +1475671240586 test-first 1 471 true +1475671240587 test-first 1 471 true +1475671240588 test-first 1 471 true +1475671240589 test-first 1 471 true +1475671240590 test-first 1 471 true +1475671240591 test-first 1 471 true +1475671240592 test-first 1 471 true +1475671240593 test-first 1 471 true +1475671240594 test-first 1 471 true +1475671240595 test-first 1 471 true +1475671240596 test-first 1 471 true +1475671240597 test-first 1 471 true +1475671240598 test-first 1 471 true +1475671240599 test-first 1 471 true +1475671240600 test-first 1 471 true +1475671240601 test-first 1 471 true +1475671240602 test-first 1 471 true +1475671240603 test-first 1 471 true +1475671240604 test-first 1 471 true +1475671240605 test-first 1 471 true +1475671240606 test-first 1 471 true +1475671240607 test-first 1 471 true +1475671240608 test-first 1 471 true +1475671240609 test-first 1 471 true +1475671240610 test-first 1 471 true +1475671240611 test-first 1 471 true +1475671240612 test-first 1 471 true +1475671240613 test-first 1 471 true +1475671240614 test-first 1 471 true +1475671240615 test-first 1 471 true +1475671240616 test-first 1 471 true +1475671240617 test-first 1 471 true +1475671240618 test-first 1 471 true +1475671240619 test-first 1 471 true +1475671240620 test-first 1 471 true +1475671240621 test-first 1 471 true +1475671240622 test-first 1 471 true +1475671240623 test-first 1 471 true +1475671240624 test-first 1 471 true +1475671240625 test-first 1 471 true +1475671240626 test-first 1 471 true +1475671240627 test-first 1 471 true +1475671240628 test-first 1 471 true +1475671240629 test-first 1 471 true +1475671240630 test-first 1 471 true +1475671240631 test-first 1 471 true +1475671240632 test-first 1 471 true +1475671240633 test-first 1 471 true +1475671240634 test-first 1 471 true +1475671240635 test-first 1 471 true +1475671240636 test-first 1 471 true +1475671240637 test-first 1 471 true +1475671240638 test-first 1 471 true +1475671240639 test-first 1 471 true +1475671240640 test-first 1 471 true +1475671240641 test-first 1 471 true +1475671240642 test-first 1 471 true +1475671240643 test-first 1 471 true +1475671240644 test-first 1 471 true +1475671240645 test-first 1 471 true +1475671240646 test-first 1 471 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 8bb8d92..5dfdff8 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -133,7 +133,7 @@ public class TestRomanNumerals { @Test public void testRomanNumerals_2014_2014() throws Exception { RomanNumeral testValue = new RomanNumeral(2014); int converted = rn.convertToInteger(testValue.toString()); - assertEquals(testValue, converted); + assertEquals(testValue.toInt(), converted); } } From 6406b30d79fd76e01d592d9b7beb32decb27c557 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:43:39 +0300 Subject: [PATCH 085/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 + .../20161005142238292/besouroEpisodes.txt | 147 ++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 9 +- 5 files changed, 158 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index e50ce85..e1ce03e 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -358,3 +358,6 @@ EditAction 1475671283260 TestRomanNumerals.java 3954 27 47 19 UnitTestCaseAction 1475671285697 TestRomanNumerals.java FAIL UnitTestSessionAction 1475671285697 TestRomanNumerals.java FAIL EditAction 1475671298161 TestRomanNumerals.java 3962 27 47 19 +UnitTestCaseAction 1475671301191 TestRomanNumerals.java OK +UnitTestSessionAction 1475671301191 TestRomanNumerals.java OK +EditAction 1475671419287 TestRomanNumerals.java 4017 27 46 18 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index a6766c0..b637949 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -309,3 +309,150 @@ 1475671240644 test-first 1 471 true 1475671240645 test-first 1 471 true 1475671240646 test-first 1 471 true +1475671240647 test-first 1 471 true +1475671240648 test-first 1 471 true +1475671240649 test-first 1 471 true +1475671240650 test-first 1 471 true +1475671240651 test-first 1 471 true +1475671240652 test-first 1 471 true +1475671240653 test-first 1 471 true +1475671240654 test-first 1 471 true +1475671240655 test-first 1 471 true +1475671240656 test-first 1 471 true +1475671240657 test-first 1 471 true +1475671240658 test-first 1 471 true +1475671240659 test-first 1 471 true +1475671240660 test-first 1 471 true +1475671240661 test-first 1 471 true +1475671240662 test-first 1 471 true +1475671240663 test-first 1 471 true +1475671240664 test-first 1 471 true +1475671240665 test-first 1 471 true +1475671240666 test-first 1 471 true +1475671240667 test-first 1 471 true +1475671240668 test-first 1 471 true +1475671240669 test-first 1 471 true +1475671240670 test-first 1 471 true +1475671240671 test-first 1 471 true +1475671240672 test-first 1 471 true +1475671240673 test-first 1 471 true +1475671240674 test-first 1 471 true +1475671240675 test-first 1 471 true +1475671240676 test-first 1 471 true +1475671240677 test-first 1 471 true +1475671240678 test-first 1 471 true +1475671240679 test-first 1 471 true +1475671240680 test-first 1 471 true +1475671240681 test-first 1 471 true +1475671240682 test-first 1 471 true +1475671240683 test-first 1 471 true +1475671240684 test-first 1 471 true +1475671240685 test-first 1 471 true +1475671240686 test-first 1 471 true +1475671240687 test-first 1 471 true +1475671240688 test-first 1 471 true +1475671240689 test-first 1 471 true +1475671240690 test-first 1 471 true +1475671240691 test-first 1 471 true +1475671240692 test-first 1 471 true +1475671240693 test-first 1 471 true +1475671240694 test-first 1 471 true +1475671240695 test-first 1 471 true +1475671240696 test-first 1 471 true +1475671240697 test-first 1 471 true +1475671240698 test-first 1 471 true +1475671240699 test-first 1 471 true +1475671240700 test-first 1 471 true +1475671240701 test-first 1 471 true +1475671240702 test-first 1 471 true +1475671240703 test-first 1 471 true +1475671240704 test-first 1 471 true +1475671240705 test-first 1 471 true +1475671240706 test-first 1 471 true +1475671240707 test-first 1 471 true +1475671240708 test-first 1 471 true +1475671240709 test-first 1 471 true +1475671240710 test-first 1 471 true +1475671240711 test-first 1 471 true +1475671240712 test-first 1 471 true +1475671240713 test-first 1 471 true +1475671240714 test-first 1 471 true +1475671240715 test-first 1 471 true +1475671240716 test-first 1 471 true +1475671240717 test-first 1 471 true +1475671240718 test-first 1 471 true +1475671240719 test-first 1 471 true +1475671240720 test-first 1 471 true +1475671240721 test-first 1 471 true +1475671240722 test-first 1 471 true +1475671240723 test-first 1 471 true +1475671240724 test-first 1 471 true +1475671240725 test-first 1 471 true +1475671240726 test-first 1 471 true +1475671240727 test-first 1 471 true +1475671240728 test-first 1 471 true +1475671240729 test-first 1 471 true +1475671240730 test-first 1 471 true +1475671240731 test-first 1 471 true +1475671240732 test-first 1 471 true +1475671240733 test-first 1 471 true +1475671240734 test-first 1 471 true +1475671240735 test-first 1 471 true +1475671240736 test-first 1 471 true +1475671240737 test-first 1 471 true +1475671240738 test-first 1 471 true +1475671240739 test-first 1 471 true +1475671240740 test-first 1 471 true +1475671240741 test-first 1 471 true +1475671240742 test-first 1 471 true +1475671240743 test-first 1 471 true +1475671240744 test-first 1 471 true +1475671240745 test-first 1 471 true +1475671240746 test-first 1 471 true +1475671240747 test-first 1 471 true +1475671240748 test-first 1 471 true +1475671240749 test-first 1 471 true +1475671240750 test-first 1 471 true +1475671240751 test-first 1 471 true +1475671240752 test-first 1 471 true +1475671240753 test-first 1 471 true +1475671240754 test-first 1 471 true +1475671240755 test-first 1 471 true +1475671240756 test-first 1 471 true +1475671240757 test-first 1 471 true +1475671240758 test-first 1 471 true +1475671240759 test-first 1 471 true +1475671240760 test-first 1 471 true +1475671240761 test-first 1 471 true +1475671240762 test-first 1 471 true +1475671240763 test-first 1 471 true +1475671240764 test-first 1 471 true +1475671240765 test-first 1 471 true +1475671240766 test-first 1 471 true +1475671240767 test-first 1 471 true +1475671240768 test-first 1 471 true +1475671240769 test-first 1 471 true +1475671240770 test-first 1 471 true +1475671240771 test-first 1 471 true +1475671240772 test-first 1 471 true +1475671240773 test-first 1 471 true +1475671240774 test-first 1 471 true +1475671240775 test-first 1 471 true +1475671240776 test-first 1 471 true +1475671240777 test-first 1 471 true +1475671240778 test-first 1 471 true +1475671240779 test-first 1 471 true +1475671240780 test-first 1 471 true +1475671240781 test-first 1 471 true +1475671240782 test-first 1 471 true +1475671240783 test-first 1 471 true +1475671240784 test-first 1 471 true +1475671240785 test-first 1 471 true +1475671240786 test-first 1 471 true +1475671240787 test-first 1 471 true +1475671240788 test-first 1 471 true +1475671240789 test-first 1 471 true +1475671240790 test-first 1 471 true +1475671240791 test-first 1 471 true +1475671301191 refactoring 1A 24 true +1475671301192 refactoring 1A 24 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 443085e..eb01c60 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -28,3 +28,4 @@ 1475670633203 test-addition 1 24 false 1475670636950 regression 1 0 false 1475671240466 test-first 1 471 true +1475671301191 refactoring 1A 24 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index 2866ea6..c403289 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -28,3 +28,4 @@ 1475670633203 test-addition 1 40 true 1475670636950 regression 1 3 true 1475671240466 test-first 1 603 true +1475671301191 refactoring 1A 60 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5dfdff8..8b6c62c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -131,9 +131,12 @@ public class TestRomanNumerals { } @Test public void testRomanNumerals_2014_2014() throws Exception { - RomanNumeral testValue = new RomanNumeral(2014); - int converted = rn.convertToInteger(testValue.toString()); - assertEquals(testValue.toInt(), converted); + RomanNumeral testValue; + for (int i = 0; i < 4000; i++) { + testValue = new RomanNumeral(i); + int converted = rn.convertToInteger(testValue.toString()); + assertEquals(testValue.toInt(), converted); + } } } From 029293cb9dcf9e3d96e3c29acd158b96e84a8e6e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:43:48 +0300 Subject: [PATCH 086/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index e1ce03e..6e8ea36 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -361,3 +361,6 @@ EditAction 1475671298161 TestRomanNumerals.java 3962 27 47 19 UnitTestCaseAction 1475671301191 TestRomanNumerals.java OK UnitTestSessionAction 1475671301191 TestRomanNumerals.java OK EditAction 1475671419287 TestRomanNumerals.java 4017 27 46 18 +UnitTestCaseAction 1475671421100 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671421100 TestRomanNumerals.java FAIL +EditAction 1475671428026 TestRomanNumerals.java 4017 27 46 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 8b6c62c..fa1d453 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -132,7 +132,7 @@ public class TestRomanNumerals { @Test public void testRomanNumerals_2014_2014() throws Exception { RomanNumeral testValue; - for (int i = 0; i < 4000; i++) { + for (int i = 1; i < 4000; i++) { testValue = new RomanNumeral(i); int converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); From 769826be857703e0ae8f693e9ced1b8181dd432e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:44:19 +0300 Subject: [PATCH 087/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 6e8ea36..88a15a6 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -364,3 +364,6 @@ EditAction 1475671419287 TestRomanNumerals.java 4017 27 46 18 UnitTestCaseAction 1475671421100 TestRomanNumerals.java FAIL UnitTestSessionAction 1475671421100 TestRomanNumerals.java FAIL EditAction 1475671428026 TestRomanNumerals.java 4017 27 46 18 +UnitTestCaseAction 1475671430229 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671430245 TestRomanNumerals.java FAIL +EditAction 1475671458481 TestRomanNumerals.java 4044 27 46 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index fa1d453..755ecec 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -134,6 +134,7 @@ public class TestRomanNumerals { RomanNumeral testValue; for (int i = 1; i < 4000; i++) { testValue = new RomanNumeral(i); + System.err.println(i); int converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); } From 84fb5a6b5b7958be710eb7db84133f54ff30f8f4 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:44:44 +0300 Subject: [PATCH 088/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 6 ++++++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 88a15a6..cae2f1b 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -367,3 +367,9 @@ EditAction 1475671428026 TestRomanNumerals.java 4017 27 46 18 UnitTestCaseAction 1475671430229 TestRomanNumerals.java FAIL UnitTestSessionAction 1475671430245 TestRomanNumerals.java FAIL EditAction 1475671458481 TestRomanNumerals.java 4044 27 46 18 +UnitTestCaseAction 1475671461822 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671461822 TestRomanNumerals.java FAIL +RefactoringAction 1475671477828 TestRomanNumerals.java RENAME testRomanNumerals_2014_2014()=>void testRomanNumerals_1_2014() METHOD +RefactoringAction 1475671480417 TestRomanNumerals.java RENAME testRomanNumerals_1_2014()=>void testRomanNumerals_1_3999() METHOD +RefactoringAction 1475671484036 TestRomanNumerals.java RENAME testRomanNumerals_1_3999()=>void testRomanNumerals_1_to_3999() METHOD +EditAction 1475671484083 TestRomanNumerals.java 4044 27 46 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 755ecec..5ee8463 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -130,7 +130,7 @@ public class TestRomanNumerals { rn.convertToInteger("DM"); } - @Test public void testRomanNumerals_2014_2014() throws Exception { + @Test public void testRomanNumerals_1_to_3999() throws Exception { RomanNumeral testValue; for (int i = 1; i < 4000; i++) { testValue = new RomanNumeral(i); From c5e0378ccdd38268075e7afc5133ecca4955e984 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:45:41 +0300 Subject: [PATCH 089/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 6 ++++++ tests/TestRomanNumerals.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index cae2f1b..1d3d530 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -373,3 +373,9 @@ RefactoringAction 1475671477828 TestRomanNumerals.java RENAME testRomanNumerals_ RefactoringAction 1475671480417 TestRomanNumerals.java RENAME testRomanNumerals_1_2014()=>void testRomanNumerals_1_3999() METHOD RefactoringAction 1475671484036 TestRomanNumerals.java RENAME testRomanNumerals_1_3999()=>void testRomanNumerals_1_to_3999() METHOD EditAction 1475671484083 TestRomanNumerals.java 4044 27 46 18 +UnitTestCaseAction 1475671499203 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671499218 TestRomanNumerals.java FAIL +RefactoringAction 1475671533445 TestRomanNumerals.java ADD void testRomanNumerals_DM_err()/2 METHOD +RefactoringAction 1475671536549 TestRomanNumerals.java RENAME testRomanNumerals_DM_err()/2=>void testRomanNumerals_XLII_err() METHOD +RefactoringAction 1475671538109 TestRomanNumerals.java RENAME testRomanNumerals_XLII_err()=>void testRomanNumerals_XLII_42() METHOD +EditAction 1475671541136 TestRomanNumerals.java 4177 28 47 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5ee8463..9728bc9 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -130,6 +130,10 @@ public class TestRomanNumerals { rn.convertToInteger("DM"); } + @Test(expected=Exception.class) public void testRomanNumerals_XLII_42() throws Exception { + rn.convertToInteger("XLII"); + } + @Test public void testRomanNumerals_1_to_3999() throws Exception { RomanNumeral testValue; for (int i = 1; i < 4000; i++) { From feec292d7d39ea8f8336a3cde26c0806704d6602 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:46:46 +0300 Subject: [PATCH 090/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 ++++ tests/TestRomanNumerals.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 1d3d530..a20a5a1 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -379,3 +379,7 @@ RefactoringAction 1475671533445 TestRomanNumerals.java ADD void testRomanNumeral RefactoringAction 1475671536549 TestRomanNumerals.java RENAME testRomanNumerals_DM_err()/2=>void testRomanNumerals_XLII_err() METHOD RefactoringAction 1475671538109 TestRomanNumerals.java RENAME testRomanNumerals_XLII_err()=>void testRomanNumerals_XLII_42() METHOD EditAction 1475671541136 TestRomanNumerals.java 4177 28 47 18 +UnitTestCaseAction 1475671543417 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671543417 TestRomanNumerals.java FAIL +RefactoringAction 1475671603956 TestRomanNumerals.java REMOVE testRomanNumerals_1_to_3999() METHOD +EditAction 1475671605610 TestRomanNumerals.java 4184 27 45 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 9728bc9..8a6e92c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -134,6 +134,7 @@ public class TestRomanNumerals { rn.convertToInteger("XLII"); } + /* @Test public void testRomanNumerals_1_to_3999() throws Exception { RomanNumeral testValue; for (int i = 1; i < 4000; i++) { @@ -142,6 +143,6 @@ public class TestRomanNumerals { int converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); } - } + }*/ } From 001ab7e1543d1893c5e770d7f48cfc7aec834d16 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:47:01 +0300 Subject: [PATCH 091/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a20a5a1..6fe96b9 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -383,3 +383,6 @@ UnitTestCaseAction 1475671543417 TestRomanNumerals.java FAIL UnitTestSessionAction 1475671543417 TestRomanNumerals.java FAIL RefactoringAction 1475671603956 TestRomanNumerals.java REMOVE testRomanNumerals_1_to_3999() METHOD EditAction 1475671605610 TestRomanNumerals.java 4184 27 45 18 +UnitTestCaseAction 1475671607688 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671607688 TestRomanNumerals.java FAIL +EditAction 1475671620480 TestRomanNumerals.java 4158 27 45 18 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 8a6e92c..0d76c7d 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -130,7 +130,7 @@ public class TestRomanNumerals { rn.convertToInteger("DM"); } - @Test(expected=Exception.class) public void testRomanNumerals_XLII_42() throws Exception { + @Test public void testRomanNumerals_XLII_42() throws Exception { rn.convertToInteger("XLII"); } From d7939fe1c582eb0c5ff0e5c0d5164eedb2b4968b Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:47:13 +0300 Subject: [PATCH 092/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 3 +++ .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 1 + 5 files changed, 9 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 6fe96b9..a713741 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -386,3 +386,6 @@ EditAction 1475671605610 TestRomanNumerals.java 4184 27 45 18 UnitTestCaseAction 1475671607688 TestRomanNumerals.java FAIL UnitTestSessionAction 1475671607688 TestRomanNumerals.java FAIL EditAction 1475671620480 TestRomanNumerals.java 4158 27 45 18 +UnitTestCaseAction 1475671623088 TestRomanNumerals.java OK +UnitTestSessionAction 1475671623088 TestRomanNumerals.java OK +EditAction 1475671632760 TestRomanNumerals.java 4184 27 46 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index b637949..3253f94 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -456,3 +456,6 @@ 1475671240791 test-first 1 471 true 1475671301191 refactoring 1A 24 true 1475671301192 refactoring 1A 24 true +1475671623088 test-addition 2 203 true +1475671623089 test-addition 2 203 true +1475671623090 test-addition 1 203 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index eb01c60..45388d6 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -29,3 +29,4 @@ 1475670636950 regression 1 0 false 1475671240466 test-first 1 471 true 1475671301191 refactoring 1A 24 true +1475671623088 test-addition 2 203 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index c403289..f87343e 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -29,3 +29,4 @@ 1475670636950 regression 1 3 true 1475671240466 test-first 1 603 true 1475671301191 refactoring 1A 60 true +1475671623088 test-addition 2 321 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 0d76c7d..2777ba8 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -132,6 +132,7 @@ public class TestRomanNumerals { @Test public void testRomanNumerals_XLII_42() throws Exception { rn.convertToInteger("XLII"); + assertEquals(42, num); } /* From 70f1599e098c2c897501245504761c7b09c0c871 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:47:49 +0300 Subject: [PATCH 093/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 5 +++++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 4 ++-- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index a713741..595ec15 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -389,3 +389,8 @@ EditAction 1475671620480 TestRomanNumerals.java 4158 27 45 18 UnitTestCaseAction 1475671623088 TestRomanNumerals.java OK UnitTestSessionAction 1475671623088 TestRomanNumerals.java OK EditAction 1475671632760 TestRomanNumerals.java 4184 27 46 19 +CompilationAction 1475671634242 TestRomanNumerals.java +CompilationAction 1475671640232 TestRomanNumerals.java +UnitTestCaseAction 1475671642139 TestRomanNumerals.java OK +UnitTestSessionAction 1475671642139 TestRomanNumerals.java OK +EditAction 1475671669267 TestRomanNumerals.java 4195 27 46 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 3253f94..faab5b3 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -459,3 +459,4 @@ 1475671623088 test-addition 2 203 true 1475671623089 test-addition 2 203 true 1475671623090 test-addition 1 203 true +1475671642139 test-addition 1 9 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 45388d6..6a70ecf 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -30,3 +30,4 @@ 1475671240466 test-first 1 471 true 1475671301191 refactoring 1A 24 true 1475671623088 test-addition 2 203 true +1475671642139 test-addition 1 9 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index f87343e..cd8ce79 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -30,3 +30,4 @@ 1475671240466 test-first 1 603 true 1475671301191 refactoring 1A 60 true 1475671623088 test-addition 2 321 true +1475671642139 test-addition 1 19 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 2777ba8..e2b71ba 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -131,8 +131,8 @@ public class TestRomanNumerals { } @Test public void testRomanNumerals_XLII_42() throws Exception { - rn.convertToInteger("XLII"); - assertEquals(42, num); + int num = rn.convertToInteger("XLIII"); + assertEquals(43, num); } /* From 53742c0a7b2d6993001068ef2c21bb54c846add8 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:47:59 +0300 Subject: [PATCH 094/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 4 ++++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 3 +-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 595ec15..ac5e273 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -394,3 +394,7 @@ CompilationAction 1475671640232 TestRomanNumerals.java UnitTestCaseAction 1475671642139 TestRomanNumerals.java OK UnitTestSessionAction 1475671642139 TestRomanNumerals.java OK EditAction 1475671669267 TestRomanNumerals.java 4195 27 46 19 +UnitTestCaseAction 1475671671159 TestRomanNumerals.java OK +UnitTestSessionAction 1475671671159 TestRomanNumerals.java OK +RefactoringAction 1475671679099 TestRomanNumerals.java ADD void testRomanNumerals_1_to_3999() METHOD +EditAction 1475671679442 TestRomanNumerals.java 4188 28 48 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index faab5b3..fa9b56d 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -460,3 +460,4 @@ 1475671623089 test-addition 2 203 true 1475671623090 test-addition 1 203 true 1475671642139 test-addition 1 9 true +1475671671159 regression 1 1 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 6a70ecf..4685e57 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -31,3 +31,4 @@ 1475671301191 refactoring 1A 24 true 1475671623088 test-addition 2 203 true 1475671642139 test-addition 1 9 true +1475671671159 regression 1 1 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index cd8ce79..a342003 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -31,3 +31,4 @@ 1475671301191 refactoring 1A 60 true 1475671623088 test-addition 2 321 true 1475671642139 test-addition 1 19 true +1475671671159 regression 1 29 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index e2b71ba..bc32b26 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -135,7 +135,6 @@ public class TestRomanNumerals { assertEquals(43, num); } - /* @Test public void testRomanNumerals_1_to_3999() throws Exception { RomanNumeral testValue; for (int i = 1; i < 4000; i++) { @@ -144,6 +143,6 @@ public class TestRomanNumerals { int converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); } - }*/ + } } From 15e357801f32b9d7b1174d0845d51184d329e4fa Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:48:11 +0300 Subject: [PATCH 095/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 1 + tests/TestRomanNumerals.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index ac5e273..f3c8e2d 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -398,3 +398,4 @@ UnitTestCaseAction 1475671671159 TestRomanNumerals.java OK UnitTestSessionAction 1475671671159 TestRomanNumerals.java OK RefactoringAction 1475671679099 TestRomanNumerals.java ADD void testRomanNumerals_1_to_3999() METHOD EditAction 1475671679442 TestRomanNumerals.java 4188 28 48 19 +EditAction 1475671690549 TestRomanNumerals.java 4202 28 49 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index bc32b26..67b3528 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -137,10 +137,11 @@ public class TestRomanNumerals { @Test public void testRomanNumerals_1_to_3999() throws Exception { RomanNumeral testValue; + int converted; for (int i = 1; i < 4000; i++) { testValue = new RomanNumeral(i); System.err.println(i); - int converted = rn.convertToInteger(testValue.toString()); + converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); } } From 0bbd9a53df9a2bc0740fb78dbcfe401fd9e9b8b6 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:48:47 +0300 Subject: [PATCH 096/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ src/RomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index f3c8e2d..c9e55f1 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -399,3 +399,6 @@ UnitTestSessionAction 1475671671159 TestRomanNumerals.java OK RefactoringAction 1475671679099 TestRomanNumerals.java ADD void testRomanNumerals_1_to_3999() METHOD EditAction 1475671679442 TestRomanNumerals.java 4188 28 48 19 EditAction 1475671690549 TestRomanNumerals.java 4202 28 49 19 +UnitTestCaseAction 1475671692534 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671692534 TestRomanNumerals.java FAIL +EditAction 1475671727322 RomanNumerals.java 3300 7 18 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e919cce..9a4e8f3 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -59,6 +59,7 @@ private int parseCharacterToValue(String romanNum, int i) throws Exception { throw e; } else { + subd = false; return currentVal; // when trying to get next of last, it is intended to end up here } } From 7f0e67de95108f5ec31fbc1bb4685bd5c8c71fe6 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:48:59 +0300 Subject: [PATCH 097/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 1 - 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index c9e55f1..71b8e1c 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -402,3 +402,6 @@ EditAction 1475671690549 TestRomanNumerals.java 4202 28 49 19 UnitTestCaseAction 1475671692534 TestRomanNumerals.java FAIL UnitTestSessionAction 1475671692534 TestRomanNumerals.java FAIL EditAction 1475671727322 RomanNumerals.java 3300 7 18 0 +UnitTestCaseAction 1475671729696 TestRomanNumerals.java OK +UnitTestSessionAction 1475671729712 TestRomanNumerals.java OK +EditAction 1475671739087 TestRomanNumerals.java 4175 28 49 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index fa9b56d..53e1ecf 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -461,3 +461,4 @@ 1475671623090 test-addition 1 203 true 1475671642139 test-addition 1 9 true 1475671671159 regression 1 1 true +1475671729712 test-first 3 50 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 4685e57..8796444 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -32,3 +32,4 @@ 1475671623088 test-addition 2 203 true 1475671642139 test-addition 1 9 true 1475671671159 regression 1 1 true +1475671729712 test-first 3 50 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index a342003..b065b09 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -32,3 +32,4 @@ 1475671623088 test-addition 2 321 true 1475671642139 test-addition 1 19 true 1475671671159 regression 1 29 true +1475671729712 test-first 3 58 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 67b3528..31564ac 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -140,7 +140,6 @@ public class TestRomanNumerals { int converted; for (int i = 1; i < 4000; i++) { testValue = new RomanNumeral(i); - System.err.println(i); converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); } From a682cf789ee81f53d8150004d027b4771c1969e0 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:51:46 +0300 Subject: [PATCH 098/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ .besouro/20161005142238292/besouroEpisodes.txt | 1 + .besouro/20161005142238292/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142238292/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 2 +- 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 71b8e1c..05aa027 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -405,3 +405,6 @@ EditAction 1475671727322 RomanNumerals.java 3300 7 18 0 UnitTestCaseAction 1475671729696 TestRomanNumerals.java OK UnitTestSessionAction 1475671729712 TestRomanNumerals.java OK EditAction 1475671739087 TestRomanNumerals.java 4175 28 49 19 +UnitTestCaseAction 1475671740993 TestRomanNumerals.java OK +UnitTestSessionAction 1475671740993 TestRomanNumerals.java OK +EditAction 1475671906104 TestRomanNumerals.java 4175 28 49 19 diff --git a/.besouro/20161005142238292/besouroEpisodes.txt b/.besouro/20161005142238292/besouroEpisodes.txt index 53e1ecf..cd15e6f 100644 --- a/.besouro/20161005142238292/besouroEpisodes.txt +++ b/.besouro/20161005142238292/besouroEpisodes.txt @@ -462,3 +462,4 @@ 1475671642139 test-addition 1 9 true 1475671671159 regression 1 1 true 1475671729712 test-first 3 50 true +1475671740993 regression 1 1 true diff --git a/.besouro/20161005142238292/randomHeuristicEpisodes.txt b/.besouro/20161005142238292/randomHeuristicEpisodes.txt index 8796444..52f129d 100644 --- a/.besouro/20161005142238292/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142238292/randomHeuristicEpisodes.txt @@ -33,3 +33,4 @@ 1475671642139 test-addition 1 9 true 1475671671159 regression 1 1 true 1475671729712 test-first 3 50 true +1475671740993 regression 1 1 true diff --git a/.besouro/20161005142238292/zorroEpisodes.txt b/.besouro/20161005142238292/zorroEpisodes.txt index b065b09..f65c78a 100644 --- a/.besouro/20161005142238292/zorroEpisodes.txt +++ b/.besouro/20161005142238292/zorroEpisodes.txt @@ -33,3 +33,4 @@ 1475671642139 test-addition 1 19 true 1475671671159 regression 1 29 true 1475671729712 test-first 3 58 true +1475671740993 regression 1 11 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 31564ac..ef2081c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -138,7 +138,7 @@ public class TestRomanNumerals { @Test public void testRomanNumerals_1_to_3999() throws Exception { RomanNumeral testValue; int converted; - for (int i = 1; i < 4000; i++) { + for (int i = 1; i < 4001; i++) { testValue = new RomanNumeral(i); converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); From eff5611424029b17fe0166afb54ca0da68398f51 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:51:54 +0300 Subject: [PATCH 099/101] besouro automatic message --- .besouro/20161005142238292/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142238292/actions.txt b/.besouro/20161005142238292/actions.txt index 05aa027..2d74a86 100644 --- a/.besouro/20161005142238292/actions.txt +++ b/.besouro/20161005142238292/actions.txt @@ -408,3 +408,6 @@ EditAction 1475671739087 TestRomanNumerals.java 4175 28 49 19 UnitTestCaseAction 1475671740993 TestRomanNumerals.java OK UnitTestSessionAction 1475671740993 TestRomanNumerals.java OK EditAction 1475671906104 TestRomanNumerals.java 4175 28 49 19 +UnitTestCaseAction 1475671908416 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475671908416 TestRomanNumerals.java FAIL +EditAction 1475671913657 TestRomanNumerals.java 4175 28 49 19 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index ef2081c..31564ac 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -138,7 +138,7 @@ public class TestRomanNumerals { @Test public void testRomanNumerals_1_to_3999() throws Exception { RomanNumeral testValue; int converted; - for (int i = 1; i < 4001; i++) { + for (int i = 1; i < 4000; i++) { testValue = new RomanNumeral(i); converted = rn.convertToInteger(testValue.toString()); assertEquals(testValue.toInt(), converted); From f77b308b980ec179f309198f089cdf72c0005983 Mon Sep 17 00:00:00 2001 From: Olli Hiekkaranta Date: Wed, 5 Oct 2016 15:53:11 +0300 Subject: [PATCH 100/101] add another RomanNumeral class for testing --- tests/RomanNumeral.java | 272 ++++++++++++++++++++-------------------- 1 file changed, 136 insertions(+), 136 deletions(-) diff --git a/tests/RomanNumeral.java b/tests/RomanNumeral.java index e82f2e8..68b90fb 100644 --- a/tests/RomanNumeral.java +++ b/tests/RomanNumeral.java @@ -1,137 +1,137 @@ - /** - * An object of type RomanNumeral is an integer between 1 and 3999. It can - * be constructed either from an integer or from a string that represents - * a Roman numeral in this range. The function toString() will return a - * standardized Roman numeral representation of the number. The function - * toInt() will return the number as a value of type int. - */ - public class RomanNumeral { - - private final int num; // The number represented by this Roman numeral. - - /* The following arrays are used by the toString() function to construct - the standard Roman numeral representation of the number. For each i, - the number numbers[i] is represented by the corresponding string, letters[i]. - */ - - private static int[] numbers = { 1000, 900, 500, 400, 100, 90, - 50, 40, 10, 9, 5, 4, 1 }; - - private static String[] letters = { "M", "CM", "D", "CD", "C", "XC", - "L", "XL", "X", "IX", "V", "IV", "I" }; - - /** - * Constructor. Creates the Roman number with the int value specified - * by the parameter. Throws a NumberFormatException if arabic is - * not in the range 1 to 3999 inclusive. - */ - public RomanNumeral(int arabic) { - if (arabic < 1) - throw new NumberFormatException("Value of RomanNumeral must be positive."); - if (arabic > 3999) - throw new NumberFormatException("Value of RomanNumeral must be 3999 or less."); - num = arabic; - } - - - /* - * Constructor. Creates the Roman number with the given representation. - * For example, RomanNumeral("xvii") is 17. If the parameter is not a - * legal Roman numeral, a NumberFormatException is thrown. Both upper and - * lower case letters are allowed. - */ - public RomanNumeral(String roman) { - - if (roman.length() == 0) - throw new NumberFormatException("An empty string does not define a Roman numeral."); - - roman = roman.toUpperCase(); // Convert to upper case letters. - - int i = 0; // A position in the string, roman; - int arabic = 0; // Arabic numeral equivalent of the part of the string that has - // been converted so far. - - while (i < roman.length()) { - - char letter = roman.charAt(i); // Letter at current position in string. - int number = letterToNumber(letter); // Numerical equivalent of letter. - - i++; // Move on to next position in the string - - if (i == roman.length()) { - // There is no letter in the string following the one we have just processed. - // So just add the number corresponding to the single letter to arabic. - arabic += number; - } - else { - // Look at the next letter in the string. If it has a larger Roman numeral - // equivalent than number, then the two letters are counted together as - // a Roman numeral with value (nextNumber - number). - int nextNumber = letterToNumber(roman.charAt(i)); - if (nextNumber > number) { - // Combine the two letters to get one value, and move on to next position in string. - arabic += (nextNumber - number); - i++; - } - else { - // Don't combine the letters. Just add the value of the one letter onto the number. - arabic += number; - } - } - - } // end while - - if (arabic > 3999) - throw new NumberFormatException("Roman numeral must have value 3999 or less."); - - num = arabic; - - } // end constructor - - - /** - * Find the integer value of letter considered as a Roman numeral. Throws - * NumberFormatException if letter is not a legal Roman numeral. The letter - * must be upper case. - */ - private int letterToNumber(char letter) { - switch (letter) { - case 'I': return 1; - case 'V': return 5; - case 'X': return 10; - case 'L': return 50; - case 'C': return 100; - case 'D': return 500; - case 'M': return 1000; - default: throw new NumberFormatException( - "Illegal character \"" + letter + "\" in Roman numeral"); - } - } - - - /** - * Return the standard representation of this Roman numeral. - */ - public String toString() { - String roman = ""; // The roman numeral. - int N = num; // N represents the part of num that still has - // to be converted to Roman numeral representation. - for (int i = 0; i < numbers.length; i++) { - while (N >= numbers[i]) { - roman += letters[i]; - N -= numbers[i]; - } - } - return roman; - } - - - /** - * Return the value of this Roman numeral as an int. - */ - public int toInt() { - return num; - } - - + /** + * An object of type RomanNumeral is an integer between 1 and 3999. It can + * be constructed either from an integer or from a string that represents + * a Roman numeral in this range. The function toString() will return a + * standardized Roman numeral representation of the number. The function + * toInt() will return the number as a value of type int. + */ + public class RomanNumeral { + + private final int num; // The number represented by this Roman numeral. + + /* The following arrays are used by the toString() function to construct + the standard Roman numeral representation of the number. For each i, + the number numbers[i] is represented by the corresponding string, letters[i]. + */ + + private static int[] numbers = { 1000, 900, 500, 400, 100, 90, + 50, 40, 10, 9, 5, 4, 1 }; + + private static String[] letters = { "M", "CM", "D", "CD", "C", "XC", + "L", "XL", "X", "IX", "V", "IV", "I" }; + + /** + * Constructor. Creates the Roman number with the int value specified + * by the parameter. Throws a NumberFormatException if arabic is + * not in the range 1 to 3999 inclusive. + */ + public RomanNumeral(int arabic) { + if (arabic < 1) + throw new NumberFormatException("Value of RomanNumeral must be positive."); + if (arabic > 3999) + throw new NumberFormatException("Value of RomanNumeral must be 3999 or less."); + num = arabic; + } + + + /* + * Constructor. Creates the Roman number with the given representation. + * For example, RomanNumeral("xvii") is 17. If the parameter is not a + * legal Roman numeral, a NumberFormatException is thrown. Both upper and + * lower case letters are allowed. + */ + public RomanNumeral(String roman) { + + if (roman.length() == 0) + throw new NumberFormatException("An empty string does not define a Roman numeral."); + + roman = roman.toUpperCase(); // Convert to upper case letters. + + int i = 0; // A position in the string, roman; + int arabic = 0; // Arabic numeral equivalent of the part of the string that has + // been converted so far. + + while (i < roman.length()) { + + char letter = roman.charAt(i); // Letter at current position in string. + int number = letterToNumber(letter); // Numerical equivalent of letter. + + i++; // Move on to next position in the string + + if (i == roman.length()) { + // There is no letter in the string following the one we have just processed. + // So just add the number corresponding to the single letter to arabic. + arabic += number; + } + else { + // Look at the next letter in the string. If it has a larger Roman numeral + // equivalent than number, then the two letters are counted together as + // a Roman numeral with value (nextNumber - number). + int nextNumber = letterToNumber(roman.charAt(i)); + if (nextNumber > number) { + // Combine the two letters to get one value, and move on to next position in string. + arabic += (nextNumber - number); + i++; + } + else { + // Don't combine the letters. Just add the value of the one letter onto the number. + arabic += number; + } + } + + } // end while + + if (arabic > 3999) + throw new NumberFormatException("Roman numeral must have value 3999 or less."); + + num = arabic; + + } // end constructor + + + /** + * Find the integer value of letter considered as a Roman numeral. Throws + * NumberFormatException if letter is not a legal Roman numeral. The letter + * must be upper case. + */ + private int letterToNumber(char letter) { + switch (letter) { + case 'I': return 1; + case 'V': return 5; + case 'X': return 10; + case 'L': return 50; + case 'C': return 100; + case 'D': return 500; + case 'M': return 1000; + default: throw new NumberFormatException( + "Illegal character \"" + letter + "\" in Roman numeral"); + } + } + + + /** + * Return the standard representation of this Roman numeral. + */ + public String toString() { + String roman = ""; // The roman numeral. + int N = num; // N represents the part of num that still has + // to be converted to Roman numeral representation. + for (int i = 0; i < numbers.length; i++) { + while (N >= numbers[i]) { + roman += letters[i]; + N -= numbers[i]; + } + } + return roman; + } + + + /** + * Return the value of this Roman numeral as an int. + */ + public int toInt() { + return num; + } + + } \ No newline at end of file From 053bb4c1d7b28f856110b0843e187341155afcfc Mon Sep 17 00:00:00 2001 From: Olli Hiekkaranta Date: Wed, 5 Oct 2016 15:54:37 +0300 Subject: [PATCH 101/101] refactoring, add tests and logic for invalid roman numbers, test numbers 1-3999 --- src/RomanNumerals.java | 256 +++++++++++++++--------------- tests/TestRomanNumerals.java | 296 +++++++++++++++++------------------ 2 files changed, 276 insertions(+), 276 deletions(-) diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9a4e8f3..e20900d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,128 +1,128 @@ - -public class RomanNumerals { - private static final char I = 'I'; - private static final char V = 'V'; - private static final char X = 'X'; - private static final char L = 'L'; - private static final char C = 'C'; - private static final char D = 'D'; - private static final char M = 'M'; - - private boolean subd = false; - - public int convertToInteger(String romanNum) throws Exception { - int value = 0; - int lastIndexOfNum = romanNum.length() - 1; - - for (int i = lastIndexOfNum; i >= 0; i--) { - checkRepetition(romanNum, lastIndexOfNum, i); - value += parseCharacterToValue(romanNum, i); - } - return value; - } - - private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { - char c = romanNum.charAt(i); - int repeated = getRepetition(romanNum, lastIndexOfNum, i); - if ((c == I || c == X || c == C || c == M) && repeated > 3) { - throw new Exception("Symbol repeated too many times"); - } - else if ((c == V || c == L || c == D) && repeated > 1) { - throw new Exception("Invalid symbol repeated"); - } - } - - private int getRepetition(String romanNum, int lastIndexOfNum, int i) { - int repeated = 1; - if (i < lastIndexOfNum) { - for (int j = i + 1; j <= lastIndexOfNum; j++) { - if (romanNum.charAt(i) == romanNum.charAt(j)) { - repeated++; - } - else { - break; - } - } - } - return repeated; - } - - private int parseCharacterToValue(String romanNum, int i) throws Exception { - int currentVal, nextVal; - currentVal = getCharValue(romanNum.charAt(i)); - try { - nextVal = getCharValue(romanNum.charAt(i + 1)); - return getCurrentValue(currentVal, nextVal); - } - catch(Exception e) { // @hacks - if (e.getMessage() == "invalid substraction") { - throw e; - } - else { - subd = false; - return currentVal; // when trying to get next of last, it is intended to end up here - } - } - } - - private int getCurrentValue(int currentVal, int nextVal) throws Exception { - if (currentVal == nextVal) { - if (subd) { - throw new Exception("invalid substraction"); - } - subd = false; - return currentVal; - } - else if (currentVal < nextVal) { - validateSubstraction(currentVal, nextVal); - subd = true; - return -currentVal; - } - else if (currentVal > nextVal) { - subd = false; - return currentVal; - } - return 0; - } - - private void validateSubstraction(int currentVal, int nextVal) throws Exception { - if (currentVal == 1 && nextVal > 10) { - throw new Exception("invalid substraction"); - } - else if (currentVal == 10 && nextVal > 100) { - throw new Exception("invalid substraction"); - } - else if (currentVal == 100 && nextVal > 1000) { - throw new Exception("invalid substraction"); - } - else if (currentVal == 5 || currentVal == 50 || currentVal == 500) { - throw new Exception("invalid substraction"); - } - } - - private int getCharValue(char romanNum) { - if (romanNum == I) { - return 1; - } - else if (romanNum == V) { - return 5; - } - else if (romanNum == X) { - return 10; - } - else if (romanNum == L) { - return 50; - } - else if (romanNum == C) { - return 100; - } - else if (romanNum == D) { - return 500; - } - else if (romanNum == M) { - return 1000; - } - return 0; - } - -} + +public class RomanNumerals { + private static final char I = 'I'; + private static final char V = 'V'; + private static final char X = 'X'; + private static final char L = 'L'; + private static final char C = 'C'; + private static final char D = 'D'; + private static final char M = 'M'; + + private boolean subd = false; + + public int convertToInteger(String romanNum) throws Exception { + int value = 0; + int lastIndexOfNum = romanNum.length() - 1; + + for (int i = lastIndexOfNum; i >= 0; i--) { + checkRepetition(romanNum, lastIndexOfNum, i); + value += parseCharacterToValue(romanNum, i); + } + return value; + } + + private void checkRepetition(String romanNum, int lastIndexOfNum, int i) throws Exception { + char c = romanNum.charAt(i); + int repeated = getRepetition(romanNum, lastIndexOfNum, i); + if ((c == I || c == X || c == C || c == M) && repeated > 3) { + throw new Exception("Symbol repeated too many times"); + } + else if ((c == V || c == L || c == D) && repeated > 1) { + throw new Exception("Invalid symbol repeated"); + } + } + + private int getRepetition(String romanNum, int lastIndexOfNum, int i) { + int repeated = 1; + if (i < lastIndexOfNum) { + for (int j = i + 1; j <= lastIndexOfNum; j++) { + if (romanNum.charAt(i) == romanNum.charAt(j)) { + repeated++; + } + else { + break; + } + } + } + return repeated; + } + + private int parseCharacterToValue(String romanNum, int i) throws Exception { + int currentVal, nextVal; + currentVal = getCharValue(romanNum.charAt(i)); + try { + nextVal = getCharValue(romanNum.charAt(i + 1)); + return getCurrentValue(currentVal, nextVal); + } + catch(Exception e) { // @hacks + if (e.getMessage() == "invalid substraction") { + throw e; + } + else { + subd = false; + return currentVal; // when trying to get next of last, it is intended to end up here + } + } + } + + private int getCurrentValue(int currentVal, int nextVal) throws Exception { + if (currentVal == nextVal) { + if (subd) { + throw new Exception("invalid substraction"); + } + subd = false; + return currentVal; + } + else if (currentVal < nextVal) { + validateSubstraction(currentVal, nextVal); + subd = true; + return -currentVal; + } + else if (currentVal > nextVal) { + subd = false; + return currentVal; + } + return 0; + } + + private void validateSubstraction(int currentVal, int nextVal) throws Exception { + if (currentVal == 1 && nextVal > 10) { + throw new Exception("invalid substraction"); + } + else if (currentVal == 10 && nextVal > 100) { + throw new Exception("invalid substraction"); + } + else if (currentVal == 100 && nextVal > 1000) { + throw new Exception("invalid substraction"); + } + else if (currentVal == 5 || currentVal == 50 || currentVal == 500) { + throw new Exception("invalid substraction"); + } + } + + private int getCharValue(char romanNum) { + if (romanNum == I) { + return 1; + } + else if (romanNum == V) { + return 5; + } + else if (romanNum == X) { + return 10; + } + else if (romanNum == L) { + return 50; + } + else if (romanNum == C) { + return 100; + } + else if (romanNum == D) { + return 500; + } + else if (romanNum == M) { + return 1000; + } + return 0; + } + +} diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 31564ac..25a8daf 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -1,148 +1,148 @@ -import static org.junit.Assert.*; - - - -import org.junit.Test; - -public class TestRomanNumerals { - - private RomanNumerals rn = new RomanNumerals(); - - @Test public void testRomanNumerals_emptyString() throws Exception { - int num = rn.convertToInteger(""); - assertEquals(0, num); - } - - @Test public void testRomanNumerals_I_1() throws Exception { - int num = rn.convertToInteger("I"); - assertEquals(1, num); - } - - @Test public void testRomanNumerals_II_2() throws Exception { - int num = rn.convertToInteger("II"); - assertEquals(2, num); - } - - @Test public void testRomanNumerals_III_3() throws Exception { - int num = rn.convertToInteger("III"); - assertEquals(3, num); - } - - @Test public void testRomanNumerals_V_5() throws Exception { - int num = rn.convertToInteger("V"); - assertEquals(5, num); - } - - @Test public void testRomanNumerals_IV_4() throws Exception { - int num = rn.convertToInteger("IV"); - assertEquals(4, num); - } - - @Test public void testRomanNumerals_VI_6() throws Exception { - int num = rn.convertToInteger("VI"); - assertEquals(6, num); - } - - @Test public void testRomanNumerals_X_10() throws Exception { - int num = rn.convertToInteger("X"); - assertEquals(10, num); - } - - @Test public void testRomanNumerals_L_50() throws Exception { - int num = rn.convertToInteger("L"); - assertEquals(50, num); - } - - @Test public void testRomanNumerals_C_100() throws Exception { - int num = rn.convertToInteger("C"); - assertEquals(100, num); - } - - @Test public void testRomanNumerals_D_500() throws Exception { - int num = rn.convertToInteger("D"); - assertEquals(500, num); - } - - @Test public void testRomanNumerals_M_1000() throws Exception { - int num = rn.convertToInteger("M"); - assertEquals(1000, num); - } - - @Test public void testRomanNumerals_XX_20() throws Exception { - int num = rn.convertToInteger("XX"); - assertEquals(20, num); - } - - @Test public void testRomanNumerals_XC_90() throws Exception { - int num = rn.convertToInteger("XC"); - assertEquals(90, num); - } - - @Test public void testRomanNumerals_LXX_70() throws Exception { - int num = rn.convertToInteger("LXX"); - assertEquals(70, num); - } - - @Test public void testRomanNumerals_CM_900() throws Exception { - int num = rn.convertToInteger("CM"); - assertEquals(900, num); - } - - @Test public void testRomanNumerals_MCMLXXXIV_1984() throws Exception { - int num = rn.convertToInteger("MCMLXXXIV"); - assertEquals(1984, num); - } - - @Test public void testRomanNumerals_MMXIV_2014() throws Exception { - int num = rn.convertToInteger("MMXIV"); - assertEquals(2014, num); - } - - @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() throws Exception { - rn.convertToInteger("IIII"); - } - - @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { - rn.convertToInteger("LC"); - } - - @Test(expected=Exception.class) public void testRomanNumerals_VV_err() throws Exception { - rn.convertToInteger("VV"); - } - - @Test(expected=Exception.class) public void testRomanNumerals_DD_err() throws Exception { - rn.convertToInteger("DD"); - } - - @Test(expected=Exception.class) public void testRomanNumerals_XM_err() throws Exception { - rn.convertToInteger("XM"); - } - - @Test(expected=Exception.class) public void testRomanNumerals_XXC_err() throws Exception { - rn.convertToInteger("XXC"); - } - - @Test(expected=Exception.class) public void testRomanNumerals_VX_err() throws Exception { - rn.convertToInteger("VX"); - } - - @Test(expected=Exception.class) public void testRomanNumerals_DM_err() throws Exception { - rn.convertToInteger("DM"); - } - - @Test public void testRomanNumerals_XLII_42() throws Exception { - int num = rn.convertToInteger("XLIII"); - assertEquals(43, num); - } - - @Test public void testRomanNumerals_1_to_3999() throws Exception { - RomanNumeral testValue; - int converted; - for (int i = 1; i < 4000; i++) { - testValue = new RomanNumeral(i); - converted = rn.convertToInteger(testValue.toString()); - assertEquals(testValue.toInt(), converted); - } - } - -} +import static org.junit.Assert.*; + + + +import org.junit.Test; + +public class TestRomanNumerals { + + private RomanNumerals rn = new RomanNumerals(); + + @Test public void testRomanNumerals_emptyString() throws Exception { + int num = rn.convertToInteger(""); + assertEquals(0, num); + } + + @Test public void testRomanNumerals_I_1() throws Exception { + int num = rn.convertToInteger("I"); + assertEquals(1, num); + } + + @Test public void testRomanNumerals_II_2() throws Exception { + int num = rn.convertToInteger("II"); + assertEquals(2, num); + } + + @Test public void testRomanNumerals_III_3() throws Exception { + int num = rn.convertToInteger("III"); + assertEquals(3, num); + } + + @Test public void testRomanNumerals_V_5() throws Exception { + int num = rn.convertToInteger("V"); + assertEquals(5, num); + } + + @Test public void testRomanNumerals_IV_4() throws Exception { + int num = rn.convertToInteger("IV"); + assertEquals(4, num); + } + + @Test public void testRomanNumerals_VI_6() throws Exception { + int num = rn.convertToInteger("VI"); + assertEquals(6, num); + } + + @Test public void testRomanNumerals_X_10() throws Exception { + int num = rn.convertToInteger("X"); + assertEquals(10, num); + } + + @Test public void testRomanNumerals_L_50() throws Exception { + int num = rn.convertToInteger("L"); + assertEquals(50, num); + } + + @Test public void testRomanNumerals_C_100() throws Exception { + int num = rn.convertToInteger("C"); + assertEquals(100, num); + } + + @Test public void testRomanNumerals_D_500() throws Exception { + int num = rn.convertToInteger("D"); + assertEquals(500, num); + } + + @Test public void testRomanNumerals_M_1000() throws Exception { + int num = rn.convertToInteger("M"); + assertEquals(1000, num); + } + + @Test public void testRomanNumerals_XX_20() throws Exception { + int num = rn.convertToInteger("XX"); + assertEquals(20, num); + } + + @Test public void testRomanNumerals_XC_90() throws Exception { + int num = rn.convertToInteger("XC"); + assertEquals(90, num); + } + + @Test public void testRomanNumerals_LXX_70() throws Exception { + int num = rn.convertToInteger("LXX"); + assertEquals(70, num); + } + + @Test public void testRomanNumerals_CM_900() throws Exception { + int num = rn.convertToInteger("CM"); + assertEquals(900, num); + } + + @Test public void testRomanNumerals_MCMLXXXIV_1984() throws Exception { + int num = rn.convertToInteger("MCMLXXXIV"); + assertEquals(1984, num); + } + + @Test public void testRomanNumerals_MMXIV_2014() throws Exception { + int num = rn.convertToInteger("MMXIV"); + assertEquals(2014, num); + } + + @Test(expected=Exception.class) public void testRomanNumerals_IIII_err() throws Exception { + rn.convertToInteger("IIII"); + } + + @Test(expected=Exception.class) public void testRomanNumerals_LC_err() throws Exception { + rn.convertToInteger("LC"); + } + + @Test(expected=Exception.class) public void testRomanNumerals_VV_err() throws Exception { + rn.convertToInteger("VV"); + } + + @Test(expected=Exception.class) public void testRomanNumerals_DD_err() throws Exception { + rn.convertToInteger("DD"); + } + + @Test(expected=Exception.class) public void testRomanNumerals_XM_err() throws Exception { + rn.convertToInteger("XM"); + } + + @Test(expected=Exception.class) public void testRomanNumerals_XXC_err() throws Exception { + rn.convertToInteger("XXC"); + } + + @Test(expected=Exception.class) public void testRomanNumerals_VX_err() throws Exception { + rn.convertToInteger("VX"); + } + + @Test(expected=Exception.class) public void testRomanNumerals_DM_err() throws Exception { + rn.convertToInteger("DM"); + } + + @Test public void testRomanNumerals_XLII_42() throws Exception { + int num = rn.convertToInteger("XLIII"); + assertEquals(43, num); + } + + @Test public void testRomanNumerals_1_to_3999() throws Exception { + RomanNumeral testValue; + int converted; + for (int i = 1; i < 4000; i++) { + testValue = new RomanNumeral(i); + converted = rn.convertToInteger(testValue.toString()); + assertEquals(testValue.toInt(), converted); + } + } + +}