From 55f45c43427a4855342b617b563f001630502fd6 Mon Sep 17 00:00:00 2001 From: usern12 <> Date: Tue, 4 Oct 2016 08:09:36 +0300 Subject: [PATCH 01/22] Project finished --- src/RomanNumerals.java | 66 +++++++++++++++++++++++++++++++++--- tests/TestRomanNumerals.java | 58 +++++++++++++++++++++++++++++-- 2 files changed, 117 insertions(+), 7 deletions(-) diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 20904f0..fd367f7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,8 +1,66 @@ public class RomanNumerals { - public int convertToInteger(String romanNum) { - // To be Implemented - return 0; - + + private int totalArabic; + private int lastNumber; + + public RomanNumerals() { + this.totalArabic = 0; + this.lastNumber = 0; } + + public int convertToInteger(String romanNum) { + for (int i = romanNum.length() - 1; i >= 0 ; i--) { + handleRomanNumbers(romanNum, i); + } + return totalArabic; + } + + private void handleRomanNumbers(String romanNum, int i) { + switch (romanNum.charAt(i)) { + case 'M': + processtotalArabic(1000); + lastNumber = 1000; + break; + + case 'D': + processtotalArabic(500); + lastNumber = 500; + break; + + case 'C': + processtotalArabic(100); + lastNumber = 100; + break; + + case 'L': + processtotalArabic(50); + lastNumber = 50; + break; + + case 'X': + processtotalArabic(10); + lastNumber = 10; + break; + + case 'V': + processtotalArabic(5); + lastNumber = 5; + break; + + case 'I': + processtotalArabic(1); + lastNumber = 1; + break; + } + } + + private void processtotalArabic(int arabic) { + if (lastNumber > arabic) { + totalArabic -= arabic; + } else { + totalArabic += arabic; + } + } } + diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5d1de75..7ce02a3 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -4,9 +4,61 @@ public class TestRomanNumerals { - @Test - public void test() { - fail("Not yet implemented"); + RomanNumerals romanNumerals = new RomanNumerals(); + private void assertRomanNumerals(String roman, int expected) { + + assertEquals(expected, romanNumerals.convertToInteger(roman)); + } + @Test public void testRomanNumerals_I_1() { + assertRomanNumerals ("I", 1); } + @Test public void testRomanNumerals_V_5() { + assertRomanNumerals ("V", 5); + } + + @Test public void testRomanNumerals_X_10() { + assertRomanNumerals ("X", 10); + } + + @Test public void testRomanNumerals_L_50() { + assertRomanNumerals ("L", 50); + } + + @Test public void testRomanNumerals_C_100() { + assertRomanNumerals ("C", 100); + } + + @Test public void testRomanNumerals_D_500() { + assertRomanNumerals ("D", 500); + } + + @Test public void testRomanNumerals_M_1000() { + assertRomanNumerals ("M", 1000); + } + + @Test public void testRomanNumerals_II_2() { + assertRomanNumerals ("II", 2); + } + + @Test public void testRomanNumerals_IV_4() { + assertRomanNumerals("IV", 4); + } + + @Test public void testRomanNumerals_IX_9() { + assertRomanNumerals("IX", 9); + } + + @Test public void testRomanNumerals_LXXX_80() { + assertRomanNumerals("LXXX", 80); + } + + @Test public void testRomanNumerals_MCMLXXXIV_1984() { + assertRomanNumerals("MCMLXXXIV", 1984); + } + + @Test public void testRomanNumerals_MMXIV_2014() { + assertRomanNumerals("MMXIV", 2014); + } + } From b0dd70892155b0a73ec93c00a02a1ab628d717e6 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:26:51 +0300 Subject: [PATCH 02/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 16 ++++++++++++++++ .besouro/20161005142310907/besouroEpisodes.txt | 0 .besouro/20161005142310907/disagreements.txt | 0 .../randomHeuristicEpisodes.txt | 0 .besouro/20161005142310907/userComments.txt | 0 .besouro/20161005142310907/zorroEpisodes.txt | 0 src/RomanNumerals.java | 1 + src/RomanNumeralsException.java | 4 ++++ tests/TestRomanNumerals.java | 10 +++++++++- 9 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .besouro/20161005142310907/actions.txt create mode 100644 .besouro/20161005142310907/besouroEpisodes.txt create mode 100644 .besouro/20161005142310907/disagreements.txt create mode 100644 .besouro/20161005142310907/randomHeuristicEpisodes.txt create mode 100644 .besouro/20161005142310907/userComments.txt create mode 100644 .besouro/20161005142310907/zorroEpisodes.txt create mode 100644 src/RomanNumeralsException.java diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt new file mode 100644 index 0000000..dbc2934 --- /dev/null +++ b/.besouro/20161005142310907/actions.txt @@ -0,0 +1,16 @@ +FileOpenedAction 1475666591208 TestRomanNumerals.java 1504 15 15 15 +RefactoringAction 1475666606591 TestRomanNumerals.java ADD void testRomanNumerals FIELD +RefactoringAction 1475666607619 TestRomanNumerals.java RENAME testRomanNumerals=>void testRomanNumerals_ FIELD +RefactoringAction 1475666624139 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumeralsI_ FIELD +RefactoringAction 1475666625158 TestRomanNumerals.java RENAME testRomanNumeralsI_=>void testRomanNumerals_ FIELD +RefactoringAction 1475666627180 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumerals_I FIELD +RefactoringAction 1475666628688 TestRomanNumerals.java RENAME testRomanNumerals_I=>void testRomanNumerals_I_RE FIELD +RefactoringAction 1475666629705 TestRomanNumerals.java RENAME testRomanNumerals_I_RE=>void testRomanNumerals_I_Re FIELD +RefactoringAction 1475666633231 TestRomanNumerals.java RENAME testRomanNumerals_I_Re=>void testRomanNumerals_I_repeated FIELD +RefactoringAction 1475666637251 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated=>void testRomanNumerals_I_repeated_three_times FIELD +RefactoringAction 1475666638270 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_three_times=>void testRomanNumerals_I_repeated_three_times_ FIELD +RefactoringAction 1475666640288 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_three_times_=>void testRomanNumerals_I_repeated_three_times_III_ FIELD +RefactoringAction 1475666647806 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_three_times_III_=>void testRomanNumerals_I_repeated_four_times_III_ FIELD +RefactoringAction 1475666652824 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_III_=>void testRomanNumerals_I_repeated_four_times_IIII_ FIELD +RefactoringAction 1475666655842 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_IIII_=>void testRomanNumerals_I_repeated_four_times_IIII_() METHOD +EditAction 1475666811921 TestRomanNumerals.java 1654 16 16 16 diff --git a/.besouro/20161005142310907/besouroEpisodes.txt b/.besouro/20161005142310907/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142310907/disagreements.txt b/.besouro/20161005142310907/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142310907/randomHeuristicEpisodes.txt b/.besouro/20161005142310907/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142310907/userComments.txt b/.besouro/20161005142310907/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142310907/zorroEpisodes.txt b/.besouro/20161005142310907/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index fd367f7..55c4a45 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -14,6 +14,7 @@ public int convertToInteger(String romanNum) { handleRomanNumbers(romanNum, i); } return totalArabic; + } private void handleRomanNumbers(String romanNum, int i) { diff --git a/src/RomanNumeralsException.java b/src/RomanNumeralsException.java new file mode 100644 index 0000000..2692417 --- /dev/null +++ b/src/RomanNumeralsException.java @@ -0,0 +1,4 @@ + +public class RomanNumeralsException extends Exception { + +} diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 7ce02a3..7a4bee7 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -60,5 +60,13 @@ private void assertRomanNumerals(String roman, int expected) { @Test public void testRomanNumerals_MMXIV_2014() { assertRomanNumerals("MMXIV", 2014); } - + + @Test public void testRomanNumerals_DCCC_800() { + assertRomanNumerals("DCCC", 800); + } + + @Test (expected = IndexOutOfBoundsException.class) public void testRomanNumerals_I_repeated_four_times_IIII_() { + assertRomanNumerals("IIII", 4); + } + } From e5a6de6dff7f425fb340330d192e54db5435082d Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:49:59 +0300 Subject: [PATCH 03/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 14 +++++++++ src/RomanNumerals.java | 41 +++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index dbc2934..80a1c7e 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -14,3 +14,17 @@ RefactoringAction 1475666647806 TestRomanNumerals.java RENAME testRomanNumerals_ RefactoringAction 1475666652824 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_III_=>void testRomanNumerals_I_repeated_four_times_IIII_ FIELD RefactoringAction 1475666655842 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_IIII_=>void testRomanNumerals_I_repeated_four_times_IIII_() METHOD EditAction 1475666811921 TestRomanNumerals.java 1654 16 16 16 +UnitTestCaseAction 1475666813747 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475666813747 TestRomanNumerals.java FAIL +RefactoringAction 1475666876453 RomanNumerals.java ADD void check FIELD +RefactoringAction 1475666877968 RomanNumerals.java RENAME check=>void checkThe FIELD +RefactoringAction 1475666879985 RomanNumerals.java RENAME checkThe=>void checkTheRows FIELD +RefactoringAction 1475666882001 RomanNumerals.java RENAME checkTheRows=>void checkThe FIELD +RefactoringAction 1475666885010 RomanNumerals.java RENAME checkThe=>void checkTheRepetition() METHOD +RefactoringAction 1475666894040 RomanNumerals.java RENAME checkTheRepetition()=>void checkHowMany() METHOD +RefactoringAction 1475666902563 RomanNumerals.java RENAME checkHowMany()=>void checkHowManyRomanNums() METHOD +RefactoringAction 1475666909578 RomanNumerals.java RENAME checkHowManyRomanNums()=>void checkHowManySimilarRomanNums() METHOD +RefactoringAction 1475667044810 RomanNumerals.java RENAME checkHowManySimilarRomanNums()=>void checkHowManySimilarRomanNums(String) METHOD +RefactoringAction 1475667182226 RomanNumerals.java ADD int i FIELD +RefactoringAction 1475667184741 RomanNumerals.java REMOVE i FIELD +EditAction 1475668199858 RomanNumerals.java 2220 5 15 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 55c4a45..9075679 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -10,6 +10,7 @@ public RomanNumerals() { } public int convertToInteger(String romanNum) { + checkHowManySimilarRomanNums(romanNum); for (int i = romanNum.length() - 1; i >= 0 ; i--) { handleRomanNumbers(romanNum, i); } @@ -55,6 +56,7 @@ private void handleRomanNumbers(String romanNum, int i) { break; } } + private void processtotalArabic(int arabic) { if (lastNumber > arabic) { @@ -63,5 +65,42 @@ private void processtotalArabic(int arabic) { totalArabic += arabic; } } + + private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsException { + int romanD = 0; + int romanC = 0; + int romanL = 0; + int romanX = 0; + int romanV = 0; + int romanI = 0; + int romanM = 0; + for( int i = 0 ; i <= romanNum.length() ; i++ ) { + switch (romanNum.charAt(i)) { + case 'M': + romanM++; + break; + case 'D': + romanD++; + break; + case 'C': + romanC++; + break; + case 'L': + romanL++; + break; + case 'X': + romanX++; + break; + case 'V': + romanV++; + break; + + case 'I': + romanI++; + break; + } + if (romanI > 3 || romanX > 3 || romanC > 3 || romanM > 3 || romanV > 1 || romanL > 1 || romanD > 1) + throw new RomanNumeralsException(); + } + } } - From 9c5cf61000b5d6e2f9500b89562aa55e57c0eeb0 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 14:51:43 +0300 Subject: [PATCH 04/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 7 ++++++ src/RomanNumerals.java | 4 ++-- tests/TestRomanNumerals.java | 32 +++++++++++++------------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 80a1c7e..ffd9375 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -28,3 +28,10 @@ RefactoringAction 1475667044810 RomanNumerals.java RENAME checkHowManySimilarRom RefactoringAction 1475667182226 RomanNumerals.java ADD int i FIELD RefactoringAction 1475667184741 RomanNumerals.java REMOVE i FIELD EditAction 1475668199858 RomanNumerals.java 2220 5 15 0 +CompilationAction 1475668200122 RomanNumerals.java +CompilationAction 1475668215878 RomanNumerals.java +CompilationAction 1475668216054 TestRomanNumerals.java +CompilationAction 1475668274556 TestRomanNumerals.java +UnitTestCaseAction 1475668277992 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668277993 TestRomanNumerals.java FAIL +EditAction 1475668303719 RomanNumerals.java 2250 5 15 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9075679..ee3d096 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -9,7 +9,7 @@ public RomanNumerals() { this.lastNumber = 0; } - public int convertToInteger(String romanNum) { + public int convertToInteger(String romanNum) throws RomanNumeralsException { checkHowManySimilarRomanNums(romanNum); for (int i = romanNum.length() - 1; i >= 0 ; i--) { handleRomanNumbers(romanNum, i); @@ -74,7 +74,7 @@ private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsE int romanV = 0; int romanI = 0; int romanM = 0; - for( int i = 0 ; i <= romanNum.length() ; i++ ) { + for( int i = 1 ; i <= romanNum.length() ; i++ ) { switch (romanNum.charAt(i)) { case 'M': romanM++; diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 7a4bee7..8bef941 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -5,67 +5,67 @@ public class TestRomanNumerals { RomanNumerals romanNumerals = new RomanNumerals(); - private void assertRomanNumerals(String roman, int expected) { + private void assertRomanNumerals(String roman, int expected) throws RomanNumeralsException { assertEquals(expected, romanNumerals.convertToInteger(roman)); } - @Test public void testRomanNumerals_I_1() { + @Test public void testRomanNumerals_I_1() throws RomanNumeralsException { assertRomanNumerals ("I", 1); } - @Test public void testRomanNumerals_V_5() { + @Test public void testRomanNumerals_V_5() throws RomanNumeralsException { assertRomanNumerals ("V", 5); } - @Test public void testRomanNumerals_X_10() { + @Test public void testRomanNumerals_X_10() throws RomanNumeralsException { assertRomanNumerals ("X", 10); } - @Test public void testRomanNumerals_L_50() { + @Test public void testRomanNumerals_L_50() throws RomanNumeralsException { assertRomanNumerals ("L", 50); } - @Test public void testRomanNumerals_C_100() { + @Test public void testRomanNumerals_C_100() throws RomanNumeralsException { assertRomanNumerals ("C", 100); } - @Test public void testRomanNumerals_D_500() { + @Test public void testRomanNumerals_D_500() throws RomanNumeralsException { assertRomanNumerals ("D", 500); } - @Test public void testRomanNumerals_M_1000() { + @Test public void testRomanNumerals_M_1000() throws RomanNumeralsException { assertRomanNumerals ("M", 1000); } - @Test public void testRomanNumerals_II_2() { + @Test public void testRomanNumerals_II_2() throws RomanNumeralsException { assertRomanNumerals ("II", 2); } - @Test public void testRomanNumerals_IV_4() { + @Test public void testRomanNumerals_IV_4() throws RomanNumeralsException { assertRomanNumerals("IV", 4); } - @Test public void testRomanNumerals_IX_9() { + @Test public void testRomanNumerals_IX_9() throws RomanNumeralsException { assertRomanNumerals("IX", 9); } - @Test public void testRomanNumerals_LXXX_80() { + @Test public void testRomanNumerals_LXXX_80() throws RomanNumeralsException { assertRomanNumerals("LXXX", 80); } - @Test public void testRomanNumerals_MCMLXXXIV_1984() { + @Test public void testRomanNumerals_MCMLXXXIV_1984() throws RomanNumeralsException { assertRomanNumerals("MCMLXXXIV", 1984); } - @Test public void testRomanNumerals_MMXIV_2014() { + @Test public void testRomanNumerals_MMXIV_2014() throws RomanNumeralsException { assertRomanNumerals("MMXIV", 2014); } - @Test public void testRomanNumerals_DCCC_800() { + @Test public void testRomanNumerals_DCCC_800() throws RomanNumeralsException { assertRomanNumerals("DCCC", 800); } - @Test (expected = IndexOutOfBoundsException.class) public void testRomanNumerals_I_repeated_four_times_IIII_() { + @Test (expected = IndexOutOfBoundsException.class) public void testRomanNumerals_I_repeated_four_times_IIII_() throws RomanNumeralsException { assertRomanNumerals("IIII", 4); } From 9130b62cbbe2f475108881379288a98aa2d7141d Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:02:54 +0300 Subject: [PATCH 05/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 ++ src/RomanNumerals.java | 55 +++++++++++--------------- 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index ffd9375..0b7a2c5 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -35,3 +35,6 @@ CompilationAction 1475668274556 TestRomanNumerals.java UnitTestCaseAction 1475668277992 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668277993 TestRomanNumerals.java FAIL EditAction 1475668303719 RomanNumerals.java 2250 5 15 0 +UnitTestCaseAction 1475668307757 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668307758 TestRomanNumerals.java FAIL +EditAction 1475668974914 RomanNumerals.java 2187 5 13 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index ee3d096..3f1b99c 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -10,10 +10,10 @@ public RomanNumerals() { } public int convertToInteger(String romanNum) throws RomanNumeralsException { - checkHowManySimilarRomanNums(romanNum); - for (int i = romanNum.length() - 1; i >= 0 ; i--) { - handleRomanNumbers(romanNum, i); - } + checkHowManySimilarRomanNums(romanNum) + for (int i = romanNum.length() - 1; i >= 0 ; i--) { + handleRomanNumbers(romanNum, i); + } return totalArabic; } @@ -74,33 +74,24 @@ private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsE int romanV = 0; int romanI = 0; int romanM = 0; - for( int i = 1 ; i <= romanNum.length() ; i++ ) { - switch (romanNum.charAt(i)) { - case 'M': - romanM++; - break; - case 'D': - romanD++; - break; - case 'C': - romanC++; - break; - case 'L': - romanL++; - break; - case 'X': - romanX++; - break; - case 'V': - romanV++; - break; - - case 'I': - romanI++; - break; - } - if (romanI > 3 || romanX > 3 || romanC > 3 || romanM > 3 || romanV > 1 || romanL > 1 || romanD > 1) - throw new RomanNumeralsException(); - } + for(int i=0; i 3 || romanX > 3 || romanC > 3 || romanM > 3 || romanV > 1 || romanL > 1 || romanD > 1) + throw new RomanNumeralsException(); + } } From 6789c2ca132b418ff0273dbed81c741a1b12066c Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:03:00 +0300 Subject: [PATCH 06/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 2 ++ src/RomanNumerals.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 0b7a2c5..7fc4bb6 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -38,3 +38,5 @@ EditAction 1475668303719 RomanNumerals.java 2250 5 15 0 UnitTestCaseAction 1475668307757 TestRomanNumerals.java FAIL UnitTestSessionAction 1475668307758 TestRomanNumerals.java FAIL EditAction 1475668974914 RomanNumerals.java 2187 5 13 0 +CompilationAction 1475668975086 RomanNumerals.java +EditAction 1475668980021 RomanNumerals.java 2188 5 16 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3f1b99c..bdc35fd 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -10,7 +10,7 @@ public RomanNumerals() { } public int convertToInteger(String romanNum) throws RomanNumeralsException { - checkHowManySimilarRomanNums(romanNum) + checkHowManySimilarRomanNums(romanNum); for (int i = romanNum.length() - 1; i >= 0 ; i--) { handleRomanNumbers(romanNum, i); } From 33e9f510ed0cf4f9b076f72e5cc5b6eabd308b56 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:26:10 +0300 Subject: [PATCH 07/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 50 ++++ .../20161005142310907/besouroEpisodes.txt | 270 ++++++++++++++++++ .../randomHeuristicEpisodes.txt | 4 + .besouro/20161005142310907/zorroEpisodes.txt | 4 + src/RomanNumerals.java | 24 +- tests/TestRomanNumerals.java | 18 +- 6 files changed, 368 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 7fc4bb6..1aaaf5c 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -40,3 +40,53 @@ UnitTestSessionAction 1475668307758 TestRomanNumerals.java FAIL EditAction 1475668974914 RomanNumerals.java 2187 5 13 0 CompilationAction 1475668975086 RomanNumerals.java EditAction 1475668980021 RomanNumerals.java 2188 5 16 0 +UnitTestCaseAction 1475668982597 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668982597 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475669011195 TestRomanNumerals.java OK +UnitTestSessionAction 1475669011196 TestRomanNumerals.java OK +RefactoringAction 1475669051771 TestRomanNumerals.java ADD void testRomanNumerals_ FIELD +RefactoringAction 1475669053783 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumerals_X FIELD +RefactoringAction 1475669056796 TestRomanNumerals.java RENAME testRomanNumerals_X=>void testRomanNumerals_X_repeated FIELD +RefactoringAction 1475669058310 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated=>void testRomanNumerals_X_repeated_ FIELD +RefactoringAction 1475669062824 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_=>void testRomanNumerals_X_repeated_five_times_ FIELD +RefactoringAction 1475669064336 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_=>void testRomanNumerals_X_repeated_five_times_XXXXX FIELD +RefactoringAction 1475669068869 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_XXXXX=>void testRomanNumerals_X_repeated_five_times_XXXXX_ FIELD +RefactoringAction 1475669071383 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_XXXXX_=>void testRomanNumerals_X_repeated_five_times_XXXXX_exception FIELD +RefactoringAction 1475669078396 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_IIII_()=>void testRomanNumerals_I_repeated_four_times_IIII_exception() METHOD +RefactoringAction 1475669082910 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_XXXXX_exception=>void testRomanNumerals_X_repeated_five_times_XXXXX_exception() METHOD +UnitTestCaseAction 1475669109355 TestRomanNumerals.java OK +UnitTestSessionAction 1475669109355 TestRomanNumerals.java OK +RefactoringAction 1475669168576 TestRomanNumerals.java ADD void testRomanNumerals_ FIELD +RefactoringAction 1475669181591 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumerals_V_repeated FIELD +RefactoringAction 1475669186104 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated=>void testRomanNumerals_V_repeated_three_times_ FIELD +RefactoringAction 1475669188128 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_=>void testRomanNumerals_V_repeated_three_times_VVVVV_ FIELD +RefactoringAction 1475669191141 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_=>void testRomanNumerals_V_repeated_three_times_VVVVV_25 FIELD +RefactoringAction 1475669192152 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_25=>void testRomanNumerals_V_repeated_three_times_VVVVV_ FIELD +RefactoringAction 1475669193666 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_=>void testRomanNumerals_V_repeated_three_times_VVVVV_25 FIELD +RefactoringAction 1475669198189 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_25=>void testRomanNumerals_V_repeated_three_times_VVVVV_exception FIELD +RefactoringAction 1475669208204 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_exception=>void testRomanNumerals_V_repeated_three_times_VVVVV_exception() METHOD +UnitTestCaseAction 1475669226906 TestRomanNumerals.java OK +UnitTestSessionAction 1475669226906 TestRomanNumerals.java OK +RefactoringAction 1475669256818 TestRomanNumerals.java ADD void testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2 METHOD +RefactoringAction 1475669261832 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2=>void testRomanNumerals_D_repeated_three_times_VVVVV_exception() METHOD +RefactoringAction 1475669268348 TestRomanNumerals.java RENAME testRomanNumerals_D_repeated_three_times_VVVVV_exception()=>void testRomanNumerals_D_repeated_two_times_VVVVV_exception() METHOD +RefactoringAction 1475669273860 TestRomanNumerals.java RENAME testRomanNumerals_D_repeated_two_times_VVVVV_exception()=>void testRomanNumerals_D_repeated_two_times_DD_exception() METHOD +UnitTestCaseAction 1475669290363 TestRomanNumerals.java OK +UnitTestSessionAction 1475669290363 TestRomanNumerals.java OK +RefactoringAction 1475669323916 TestRomanNumerals.java ADD void testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2 METHOD +RefactoringAction 1475669327930 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2=>void testRomanNumerals__VVVVV_exception() METHOD +RefactoringAction 1475669333442 TestRomanNumerals.java RENAME testRomanNumerals__VVVVV_exception()=>void testRomanNumerals__I__exception() METHOD +RefactoringAction 1475669339960 TestRomanNumerals.java RENAME testRomanNumerals__I__exception()=>void testRomanNumerals__I_subtracted_exception() METHOD +RefactoringAction 1475669342973 TestRomanNumerals.java RENAME testRomanNumerals__I_subtracted_exception()=>void testRomanNumerals__I_subtractedF_exception() METHOD +RefactoringAction 1475669344986 TestRomanNumerals.java RENAME testRomanNumerals__I_subtractedF_exception()=>void testRomanNumerals__I_subtracted_exception() METHOD +RefactoringAction 1475669346997 TestRomanNumerals.java RENAME testRomanNumerals__I_subtracted_exception()=>void testRomanNumerals__I_subtractedFrom_exception() METHOD +RefactoringAction 1475669382513 TestRomanNumerals.java RENAME testRomanNumerals__I_subtractedFrom_exception()=>void testRomanNumerals__I_subtractedFromL_exception() METHOD +UnitTestCaseAction 1475669402534 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669402535 TestRomanNumerals.java FAIL +RefactoringAction 1475669503326 RomanNumerals.java ADD void checkIf FIELD +RefactoringAction 1475669505339 RomanNumerals.java RENAME checkIf=>void checkIfValid FIELD +RefactoringAction 1475669508351 RomanNumerals.java RENAME checkIfValid=>void checkIfValidSubtraction() METHOD +RefactoringAction 1475669541375 RomanNumerals.java RENAME checkIfValidSubtraction()=>void checkIfValidSubtraction(String) METHOD +RefactoringAction 1475669979311 RomanNumerals.java ADD void processTheChar(char) METHOD +RefactoringAction 1475670080684 RomanNumerals.java RENAME processTheChar(char)=>void processTheChar(char, char) METHOD +EditAction 1475670370080 RomanNumerals.java 2740 7 20 0 diff --git a/.besouro/20161005142310907/besouroEpisodes.txt b/.besouro/20161005142310907/besouroEpisodes.txt index e69de29..bcf53d7 100644 --- a/.besouro/20161005142310907/besouroEpisodes.txt +++ b/.besouro/20161005142310907/besouroEpisodes.txt @@ -0,0 +1,270 @@ +1475669011196 test-first 1 2419 true +1475669011197 test-first 1 2419 true +1475669011198 test-first 1 2419 true +1475669011199 test-first 1 2419 true +1475669011200 test-first 1 2419 true +1475669011201 test-first 1 2419 true +1475669011202 test-first 1 2419 true +1475669011203 test-first 1 2419 true +1475669011204 test-first 1 2419 true +1475669011205 test-first 1 2419 true +1475669011206 test-first 1 2419 true +1475669011207 test-first 1 2419 true +1475669011208 test-first 1 2419 true +1475669011209 test-first 1 2419 true +1475669011210 test-first 1 2419 true +1475669011211 test-first 1 2419 true +1475669011212 test-first 1 2419 true +1475669011213 test-first 1 2419 true +1475669011214 test-first 1 2419 true +1475669011215 test-first 1 2419 true +1475669011216 test-first 1 2419 true +1475669011217 test-first 1 2419 true +1475669011218 test-first 1 2419 true +1475669011219 test-first 1 2419 true +1475669011220 test-first 1 2419 true +1475669011221 test-first 1 2419 true +1475669011222 test-first 1 2419 true +1475669011223 test-first 1 2419 true +1475669011224 test-first 1 2419 true +1475669011225 test-first 1 2419 true +1475669011226 test-first 1 2419 true +1475669011227 test-first 1 2419 true +1475669011228 test-first 1 2419 true +1475669011229 test-first 1 2419 true +1475669011230 test-first 1 2419 true +1475669011231 test-first 1 2419 true +1475669011232 test-first 1 2419 true +1475669011233 test-first 1 2419 true +1475669011234 test-first 1 2419 true +1475669011235 test-first 1 2419 true +1475669011236 test-first 1 2419 true +1475669011237 test-first 1 2419 true +1475669011238 test-first 1 2419 true +1475669011239 test-first 1 2419 true +1475669011240 test-first 1 2419 true +1475669011241 test-first 1 2419 true +1475669011242 test-first 1 2419 true +1475669011243 test-first 1 2419 true +1475669109355 refactoring 2B 57 true +1475669109356 refactoring 3 57 true +1475669109357 refactoring 3 57 true +1475669109358 refactoring 3 57 true +1475669109359 refactoring 3 57 true +1475669109360 refactoring 1B 57 true +1475669109361 refactoring 3 57 true +1475669109362 refactoring 3 57 true +1475669109363 refactoring 3 57 true +1475669109364 refactoring 3 57 true +1475669109365 refactoring 3 57 true +1475669109366 refactoring 3 57 true +1475669109367 refactoring 3 57 true +1475669109368 refactoring 3 57 true +1475669109369 refactoring 3 57 true +1475669109370 refactoring 3 57 true +1475669109371 refactoring 2B 57 true +1475669109372 refactoring 3 57 true +1475669109373 refactoring 1B 57 true +1475669109374 refactoring 3 57 true +1475669109375 refactoring 3 57 true +1475669109376 refactoring 3 57 true +1475669109377 refactoring 3 57 true +1475669109378 refactoring 3 57 true +1475669109379 refactoring 3 57 true +1475669109380 refactoring 3 57 true +1475669109381 refactoring 3 57 true +1475669109382 refactoring 3 57 true +1475669109383 refactoring 3 57 true +1475669109384 refactoring 3 57 true +1475669109385 refactoring 3 57 true +1475669109386 refactoring 3 57 true +1475669109387 refactoring 2B 57 true +1475669109388 refactoring 3 57 true +1475669109389 refactoring 3 57 true +1475669109390 refactoring 1B 57 true +1475669109391 refactoring 3 57 true +1475669109392 refactoring 3 57 true +1475669109393 refactoring 3 57 true +1475669109394 refactoring 3 57 true +1475669109395 refactoring 3 57 true +1475669109396 refactoring 3 57 true +1475669109397 refactoring 3 57 true +1475669109398 refactoring 3 57 true +1475669109399 refactoring 3 57 true +1475669109400 refactoring 3 57 true +1475669109401 refactoring 3 57 true +1475669109402 refactoring 3 57 true +1475669109403 refactoring 3 57 true +1475669109404 refactoring 3 57 true +1475669109405 refactoring 3 57 true +1475669109406 refactoring 2B 57 true +1475669109407 refactoring 3 57 true +1475669109408 refactoring 3 57 true +1475669109409 refactoring 3 57 true +1475669109410 refactoring 3 57 true +1475669109411 refactoring 3 57 true +1475669109412 refactoring 1B 57 true +1475669109413 refactoring 3 57 true +1475669109414 refactoring 3 57 true +1475669109415 refactoring 3 57 true +1475669109416 refactoring 3 57 true +1475669109417 refactoring 3 57 true +1475669109418 refactoring 3 57 true +1475669109419 refactoring 3 57 true +1475669109420 refactoring 3 57 true +1475669109421 refactoring 3 57 true +1475669109422 refactoring 1B 57 true +1475669109423 refactoring 3 57 true +1475669109424 refactoring 3 57 true +1475669109425 refactoring 3 57 true +1475669109426 refactoring 3 57 true +1475669109427 refactoring 3 57 true +1475669109428 refactoring 3 57 true +1475669109429 refactoring 3 57 true +1475669109430 refactoring 2B 57 true +1475669109431 refactoring 3 57 true +1475669109432 refactoring 3 57 true +1475669109433 refactoring 3 57 true +1475669109434 refactoring 1B 57 true +1475669109435 refactoring 3 57 true +1475669109436 refactoring 3 57 true +1475669109437 refactoring 3 57 true +1475669109438 refactoring 3 57 true +1475669109439 refactoring 3 57 true +1475669109440 refactoring 3 57 true +1475669109441 refactoring 3 57 true +1475669109442 refactoring 2B 57 true +1475669109443 refactoring 3 57 true +1475669109444 refactoring 3 57 true +1475669109445 refactoring 3 57 true +1475669109446 refactoring 3 57 true +1475669109447 refactoring 3 57 true +1475669109448 refactoring 2B 57 true +1475669109449 refactoring 3 57 true +1475669109450 refactoring 3 57 true +1475669109451 refactoring 3 57 true +1475669109452 refactoring 1B 57 true +1475669109453 refactoring 3 57 true +1475669109454 refactoring 3 57 true +1475669109455 refactoring 3 57 true +1475669109456 refactoring 1B 57 true +1475669109457 refactoring 2B 57 true +1475669109458 refactoring 2B 57 true +1475669109459 refactoring 3 57 true +1475669109460 refactoring 3 57 true +1475669109461 refactoring 3 57 true +1475669109462 refactoring 3 57 true +1475669109463 refactoring 3 57 true +1475669109464 refactoring 3 57 true +1475669109465 refactoring 1B 57 true +1475669109466 refactoring 1B 57 true +1475669109467 refactoring 3 57 true +1475669109468 refactoring 2B 57 true +1475669109469 refactoring 3 57 true +1475669109470 regression 1 57 true +1475669109471 refactoring 3 57 true +1475669109472 refactoring 3 57 true +1475669109473 refactoring 3 57 true +1475669109474 refactoring 3 57 true +1475669109475 refactoring 3 57 true +1475669226906 refactoring 3 58 true +1475669226907 refactoring 1B 58 true +1475669226908 refactoring 2B 58 true +1475669226909 refactoring 3 58 true +1475669226910 refactoring 3 58 true +1475669226911 refactoring 3 58 true +1475669226912 refactoring 3 58 true +1475669226913 refactoring 3 58 true +1475669226914 refactoring 3 58 true +1475669226915 refactoring 3 58 true +1475669226916 refactoring 3 58 true +1475669226917 refactoring 3 58 true +1475669226918 refactoring 3 58 true +1475669226919 refactoring 3 58 true +1475669226920 refactoring 2B 58 true +1475669226921 refactoring 3 58 true +1475669226922 refactoring 3 58 true +1475669226923 refactoring 3 58 true +1475669226924 refactoring 3 58 true +1475669226925 refactoring 3 58 true +1475669226926 refactoring 1B 58 true +1475669226927 refactoring 3 58 true +1475669226928 refactoring 3 58 true +1475669226929 refactoring 3 58 true +1475669226930 refactoring 3 58 true +1475669226931 refactoring 3 58 true +1475669226932 refactoring 1B 58 true +1475669226933 refactoring 3 58 true +1475669226934 refactoring 3 58 true +1475669226935 refactoring 3 58 true +1475669226936 refactoring 3 58 true +1475669226937 refactoring 3 58 true +1475669226938 refactoring 3 58 true +1475669226939 refactoring 3 58 true +1475669226940 refactoring 2B 58 true +1475669226941 refactoring 3 58 true +1475669226942 refactoring 1B 58 true +1475669226943 refactoring 3 58 true +1475669226944 refactoring 3 58 true +1475669226945 refactoring 3 58 true +1475669226946 refactoring 3 58 true +1475669226947 refactoring 3 58 true +1475669226948 refactoring 2B 58 true +1475669226949 refactoring 3 58 true +1475669226950 refactoring 3 58 true +1475669226951 refactoring 3 58 true +1475669226952 refactoring 3 58 true +1475669226953 refactoring 3 58 true +1475669226954 refactoring 3 58 true +1475669226955 refactoring 3 58 true +1475669226956 refactoring 3 58 true +1475669226957 refactoring 3 58 true +1475669226958 refactoring 3 58 true +1475669226959 refactoring 3 58 true +1475669226960 refactoring 1B 58 true +1475669226961 refactoring 3 58 true +1475669226962 refactoring 2B 58 true +1475669226963 refactoring 3 58 true +1475669226964 refactoring 3 58 true +1475669226965 refactoring 3 58 true +1475669226966 refactoring 1B 58 true +1475669226967 refactoring 3 58 true +1475669226968 refactoring 3 58 true +1475669226969 refactoring 3 58 true +1475669226970 refactoring 2B 58 true +1475669226971 refactoring 3 58 true +1475669226972 refactoring 3 58 true +1475669226973 refactoring 3 58 true +1475669226974 refactoring 1B 58 true +1475669226975 refactoring 3 58 true +1475669226976 refactoring 2B 58 true +1475669226977 refactoring 3 58 true +1475669226978 regression 1 58 true +1475669226979 refactoring 3 58 true +1475669226980 refactoring 3 58 true +1475669226981 refactoring 3 58 true +1475669226982 refactoring 3 58 true +1475669226983 refactoring 3 58 true +1475669226984 refactoring 1B 58 true +1475669226985 refactoring 3 58 true +1475669226986 refactoring 3 58 true +1475669226987 refactoring 3 58 true +1475669226988 refactoring 3 58 true +1475669226989 refactoring 3 58 true +1475669226990 refactoring 3 58 true +1475669226991 refactoring 2B 58 true +1475669226992 refactoring 3 58 true +1475669226993 refactoring 3 58 true +1475669226994 refactoring 3 58 true +1475669226995 refactoring 3 58 true +1475669226996 refactoring 3 58 true +1475669226997 refactoring 3 58 true +1475669226998 refactoring 2B 58 true +1475669226999 refactoring 3 58 true +1475669227000 refactoring 1B 58 true +1475669227001 refactoring 3 58 true +1475669227002 refactoring 3 58 true +1475669227003 refactoring 3 58 true +1475669227004 refactoring 3 58 true +1475669227005 refactoring 3 58 true +1475669290363 test-addition 1 33 true diff --git a/.besouro/20161005142310907/randomHeuristicEpisodes.txt b/.besouro/20161005142310907/randomHeuristicEpisodes.txt index e69de29..2adb48a 100644 --- a/.besouro/20161005142310907/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142310907/randomHeuristicEpisodes.txt @@ -0,0 +1,4 @@ +1475669011196 test-first 1 2419 true +1475669109355 refactoring 2B 57 false +1475669226906 refactoring 3 58 false +1475669290363 test-addition 1 33 true diff --git a/.besouro/20161005142310907/zorroEpisodes.txt b/.besouro/20161005142310907/zorroEpisodes.txt index e69de29..c7a8186 100644 --- a/.besouro/20161005142310907/zorroEpisodes.txt +++ b/.besouro/20161005142310907/zorroEpisodes.txt @@ -0,0 +1,4 @@ +1475669011196 test-first 1 2419 true +1475669109355 refactoring 2B 98 true +1475669226906 refactoring 3 117 true +1475669290363 test-addition 1 63 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index bdc35fd..c000094 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -11,6 +11,7 @@ public RomanNumerals() { public int convertToInteger(String romanNum) throws RomanNumeralsException { checkHowManySimilarRomanNums(romanNum); + checkIfValidSubtraction(romanNum); for (int i = romanNum.length() - 1; i >= 0 ; i--) { handleRomanNumbers(romanNum, i); } @@ -93,5 +94,26 @@ private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsE if(romanI > 3 || romanX > 3 || romanC > 3 || romanM > 3 || romanV > 1 || romanL > 1 || romanD > 1) throw new RomanNumeralsException(); - } + } + + private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsException { + char lastChar = 0; + for(int i=0; i Date: Wed, 5 Oct 2016 15:26:36 +0300 Subject: [PATCH 08/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 +++ src/RomanNumerals.java | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 1aaaf5c..bd5381b 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -90,3 +90,6 @@ RefactoringAction 1475669541375 RomanNumerals.java RENAME checkIfValidSubtractio RefactoringAction 1475669979311 RomanNumerals.java ADD void processTheChar(char) METHOD RefactoringAction 1475670080684 RomanNumerals.java RENAME processTheChar(char)=>void processTheChar(char, char) METHOD EditAction 1475670370080 RomanNumerals.java 2740 7 20 0 +UnitTestCaseAction 1475670374460 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670374460 TestRomanNumerals.java FAIL +EditAction 1475670396268 RomanNumerals.java 2711 7 20 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c000094..38ede5e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -104,8 +104,6 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept processTheChar('L', lastChar); lastNumber = 50; break; - default: - break; } } From 7b11f92d39218dfd31cb483a204102bc7e93fa78 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:26:44 +0300 Subject: [PATCH 09/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index bd5381b..d1220bc 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -93,3 +93,4 @@ EditAction 1475670370080 RomanNumerals.java 2740 7 20 0 UnitTestCaseAction 1475670374460 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670374460 TestRomanNumerals.java FAIL EditAction 1475670396268 RomanNumerals.java 2711 7 20 0 +EditAction 1475670404417 RomanNumerals.java 2711 7 20 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 38ede5e..dc57f94 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -111,7 +111,7 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept private void processTheChar(char c, char lastChar) throws RomanNumeralsException { if( c == 'L' ) - if( lastChar != 'I') + if( lastChar == 'I') throw new RomanNumeralsException(); } } From f5a47e72caa123ae0ab81d0695a419604c80889d Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:27:39 +0300 Subject: [PATCH 10/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index d1220bc..1b24559 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -94,3 +94,6 @@ UnitTestCaseAction 1475670374460 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670374460 TestRomanNumerals.java FAIL EditAction 1475670396268 RomanNumerals.java 2711 7 20 0 EditAction 1475670404417 RomanNumerals.java 2711 7 20 0 +UnitTestCaseAction 1475670407566 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670407567 TestRomanNumerals.java FAIL +EditAction 1475670459665 RomanNumerals.java 2709 7 20 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index dc57f94..5429b95 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -102,7 +102,7 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept switch (romanNum.charAt(i)) { case 'L': processTheChar('L', lastChar); - lastNumber = 50; + lastChar = 50; break; } From 1a0c132e301b4ee0ebb7431b96aae2d4ee4e7d44 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:29:05 +0300 Subject: [PATCH 11/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 +++ src/RomanNumerals.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 1b24559..727ae79 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -97,3 +97,6 @@ EditAction 1475670404417 RomanNumerals.java 2711 7 20 0 UnitTestCaseAction 1475670407566 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670407567 TestRomanNumerals.java FAIL EditAction 1475670459665 RomanNumerals.java 2709 7 20 0 +UnitTestCaseAction 1475670462617 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670462617 TestRomanNumerals.java FAIL +EditAction 1475670545915 RomanNumerals.java 2801 7 20 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 5429b95..0a1eda4 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -102,8 +102,12 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept switch (romanNum.charAt(i)) { case 'L': processTheChar('L', lastChar); - lastChar = 50; + lastChar = 'L'; break; + case 'I': + processTheChar('I', lastChar); + lastChar = 'I'; + break; } } From a8ebc0fd8f949f4bb467a400bac74d526458636a Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:31:23 +0300 Subject: [PATCH 12/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 9 +++++++++ .besouro/20161005142310907/besouroEpisodes.txt | 10 ++++++++++ .besouro/20161005142310907/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142310907/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 9 ++++++++- tests/TestRomanNumerals.java | 3 +++ 6 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 727ae79..6cb0293 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -100,3 +100,12 @@ EditAction 1475670459665 RomanNumerals.java 2709 7 20 0 UnitTestCaseAction 1475670462617 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670462617 TestRomanNumerals.java FAIL EditAction 1475670545915 RomanNumerals.java 2801 7 20 0 +UnitTestCaseAction 1475670548437 TestRomanNumerals.java OK +UnitTestSessionAction 1475670548438 TestRomanNumerals.testRomanNumerals__I_subtractedFromL_exception OK +RefactoringAction 1475670560705 TestRomanNumerals.java ADD void testRomanNumerals__I_subtractedFromL_exception()/2 METHOD +RefactoringAction 1475670573732 TestRomanNumerals.java RENAME testRomanNumerals__I_subtractedFromL_exception()/2=>void testRomanNumerals__X_subtractedFromL_exception() METHOD +RefactoringAction 1475670577243 TestRomanNumerals.java RENAME testRomanNumerals__X_subtractedFromL_exception()=>void testRomanNumerals__X_subtractedFrom_exception() METHOD +RefactoringAction 1475670596755 TestRomanNumerals.java RENAME testRomanNumerals__X_subtractedFrom_exception()=>void testRomanNumerals__X_subtractedFromD_exception() METHOD +UnitTestCaseAction 1475670616568 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670616569 TestRomanNumerals.java FAIL +EditAction 1475670683607 RomanNumerals.java 2975 7 21 0 diff --git a/.besouro/20161005142310907/besouroEpisodes.txt b/.besouro/20161005142310907/besouroEpisodes.txt index bcf53d7..08a3020 100644 --- a/.besouro/20161005142310907/besouroEpisodes.txt +++ b/.besouro/20161005142310907/besouroEpisodes.txt @@ -268,3 +268,13 @@ 1475669227004 refactoring 3 58 true 1475669227005 refactoring 3 58 true 1475669290363 test-addition 1 33 true +1475670548438 test-first 3 1224 true +1475670548439 test-first 3 1224 true +1475670548440 test-first 3 1224 true +1475670548441 test-first 3 1224 true +1475670548442 test-first 3 1224 true +1475670548443 test-first 3 1224 true +1475670548444 test-first 3 1224 true +1475670548445 test-first 3 1224 true +1475670548446 test-first 3 1224 true +1475670548447 test-first 3 1224 true diff --git a/.besouro/20161005142310907/randomHeuristicEpisodes.txt b/.besouro/20161005142310907/randomHeuristicEpisodes.txt index 2adb48a..29156be 100644 --- a/.besouro/20161005142310907/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142310907/randomHeuristicEpisodes.txt @@ -2,3 +2,4 @@ 1475669109355 refactoring 2B 57 false 1475669226906 refactoring 3 58 false 1475669290363 test-addition 1 33 true +1475670548438 test-first 3 1224 true diff --git a/.besouro/20161005142310907/zorroEpisodes.txt b/.besouro/20161005142310907/zorroEpisodes.txt index c7a8186..e12fc90 100644 --- a/.besouro/20161005142310907/zorroEpisodes.txt +++ b/.besouro/20161005142310907/zorroEpisodes.txt @@ -2,3 +2,4 @@ 1475669109355 refactoring 2B 98 true 1475669226906 refactoring 3 117 true 1475669290363 test-addition 1 63 true +1475670548438 test-first 3 1258 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0a1eda4..14f8fb7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -108,6 +108,10 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept processTheChar('I', lastChar); lastChar = 'I'; break; + case 'X': + processTheChar('X', lastChar); + lastChar = 'X'; + break; } } @@ -115,7 +119,10 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept private void processTheChar(char c, char lastChar) throws RomanNumeralsException { if( c == 'L' ) - if( lastChar == 'I') + if( lastChar == 'I' ) + throw new RomanNumeralsException(); + if( c == 'D' ) + if( lastChar == 'X' ) throw new RomanNumeralsException(); } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index e704562..8a31d94 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -85,4 +85,7 @@ private void assertRomanNumerals(String roman, int expected) throws RomanNumeral assertRomanNumerals("IL", 49); } + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals__X_subtractedFromD_exception() throws RomanNumeralsException { + assertRomanNumerals("XD", 490); + } } From 0fe5f7372207614d7b12e76225403cc98db11fee Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:32:02 +0300 Subject: [PATCH 13/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 +++ src/RomanNumerals.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 6cb0293..2bfd1b7 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -109,3 +109,6 @@ RefactoringAction 1475670596755 TestRomanNumerals.java RENAME testRomanNumerals_ UnitTestCaseAction 1475670616568 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670616569 TestRomanNumerals.java FAIL EditAction 1475670683607 RomanNumerals.java 2975 7 21 0 +UnitTestCaseAction 1475670687247 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670687248 TestRomanNumerals.java FAIL +EditAction 1475670722735 RomanNumerals.java 3066 7 21 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 14f8fb7..ffc9374 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -112,6 +112,10 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept processTheChar('X', lastChar); lastChar = 'X'; break; + case 'D': + processTheChar('D', lastChar); + lastChar = 'D'; + break; } } From 9ee12a850b828b786a0cd70b601ebf8dded17a43 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:37:45 +0300 Subject: [PATCH 14/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 24 +++++++++++++ .../20161005142310907/besouroEpisodes.txt | 5 +++ .../randomHeuristicEpisodes.txt | 2 ++ .besouro/20161005142310907/zorroEpisodes.txt | 2 ++ src/RomanNumerals.java | 35 +++++++++---------- tests/TestRomanNumerals.java | 9 +++++ 6 files changed, 59 insertions(+), 18 deletions(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 2bfd1b7..2e42712 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -112,3 +112,27 @@ EditAction 1475670683607 RomanNumerals.java 2975 7 21 0 UnitTestCaseAction 1475670687247 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670687248 TestRomanNumerals.java FAIL EditAction 1475670722735 RomanNumerals.java 3066 7 21 0 +UnitTestCaseAction 1475670729189 TestRomanNumerals.java OK +UnitTestSessionAction 1475670729189 TestRomanNumerals.java OK +RefactoringAction 1475670741855 TestRomanNumerals.java ADD void testRomanNumerals__X_subtractedFromD_exception()/2 METHOD +RefactoringAction 1475670752868 TestRomanNumerals.java RENAME testRomanNumerals__X_subtractedFromD_exception()/2=>void testRomanNumerals__C_subtractedFromD_exception() METHOD +RefactoringAction 1475670755380 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromD_exception()=>void testRomanNumerals__C_subtractedFrom_exception() METHOD +RefactoringAction 1475670769393 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFrom_exception()=>void testRomanNumerals__C_subtractedFromM_exception() METHOD +RefactoringAction 1475670772907 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromM_exception()=>void testRomanNumerals__C_subtractedFromM_() METHOD +RefactoringAction 1475670777418 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromM_()=>void testRomanNumerals__C_subtractedFromM_900() METHOD +RefactoringAction 1475670800443 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromM_900()=>void testRomanNumerals__CM_900() METHOD +UnitTestCaseAction 1475670810502 TestRomanNumerals.java OK +UnitTestSessionAction 1475670810503 TestRomanNumerals.java OK +RefactoringAction 1475670831478 TestRomanNumerals.java ADD void testRomanNumerals__CM_900()/2 METHOD +RefactoringAction 1475670836490 TestRomanNumerals.java RENAME testRomanNumerals__CM_900()/2=>void testRomanNumerals__XCC_900() METHOD +RefactoringAction 1475670842509 TestRomanNumerals.java RENAME testRomanNumerals__XCC_900()=>void testRomanNumerals__XXC_900() METHOD +RefactoringAction 1475670846520 TestRomanNumerals.java RENAME testRomanNumerals__XXC_900()=>void testRomanNumerals__XXC_exception() METHOD +RefactoringAction 1475670852533 TestRomanNumerals.java RENAME testRomanNumerals__XXC_exception()=>void testRomanNumerals_multip_XXC_exception() METHOD +RefactoringAction 1475670854545 TestRomanNumerals.java RENAME testRomanNumerals_multip_XXC_exception()=>void testRomanNumerals_multiple_XXC_exception() METHOD +RefactoringAction 1475670856557 TestRomanNumerals.java RENAME testRomanNumerals_multiple_XXC_exception()=>void testRomanNumerals_multipleTimes_XXC_exception() METHOD +RefactoringAction 1475670862071 TestRomanNumerals.java RENAME testRomanNumerals_multipleTimes_XXC_exception()=>void testRomanNumerals_subtractionultipleTimes_XXC_exception() METHOD +RefactoringAction 1475670863082 TestRomanNumerals.java RENAME testRomanNumerals_subtractionultipleTimes_XXC_exception()=>void testRomanNumerals_subtractionMultipleTimes_XXC_exception() METHOD +RefactoringAction 1475670867095 TestRomanNumerals.java RENAME testRomanNumerals__CM_900()=>void testRomanNumerals_CM_900() METHOD +UnitTestCaseAction 1475670899819 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670899819 TestRomanNumerals.java FAIL +EditAction 1475671065081 RomanNumerals.java 3084 7 21 0 diff --git a/.besouro/20161005142310907/besouroEpisodes.txt b/.besouro/20161005142310907/besouroEpisodes.txt index 08a3020..dafcebe 100644 --- a/.besouro/20161005142310907/besouroEpisodes.txt +++ b/.besouro/20161005142310907/besouroEpisodes.txt @@ -278,3 +278,8 @@ 1475670548445 test-first 3 1224 true 1475670548446 test-first 3 1224 true 1475670548447 test-first 3 1224 true +1475670729189 test-first 3 168 true +1475670729190 test-first 3 168 true +1475670729191 test-first 3 168 true +1475670729192 production 1 168 false +1475670810503 test-addition 1 68 true diff --git a/.besouro/20161005142310907/randomHeuristicEpisodes.txt b/.besouro/20161005142310907/randomHeuristicEpisodes.txt index 29156be..7977a39 100644 --- a/.besouro/20161005142310907/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142310907/randomHeuristicEpisodes.txt @@ -3,3 +3,5 @@ 1475669226906 refactoring 3 58 false 1475669290363 test-addition 1 33 true 1475670548438 test-first 3 1224 true +1475670729189 test-first 3 168 true +1475670810503 test-addition 1 68 true diff --git a/.besouro/20161005142310907/zorroEpisodes.txt b/.besouro/20161005142310907/zorroEpisodes.txt index e12fc90..09f0bac 100644 --- a/.besouro/20161005142310907/zorroEpisodes.txt +++ b/.besouro/20161005142310907/zorroEpisodes.txt @@ -3,3 +3,5 @@ 1475669226906 refactoring 3 117 true 1475669290363 test-addition 1 63 true 1475670548438 test-first 3 1258 true +1475670729189 test-first 3 180 true +1475670810503 test-addition 1 81 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index ffc9374..37b5149 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -100,25 +100,24 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept char lastChar = 0; for(int i=0; i Date: Wed, 5 Oct 2016 16:12:42 +0300 Subject: [PATCH 15/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 1 + src/RomanNumerals.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 2e42712..a18f5d2 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -136,3 +136,4 @@ RefactoringAction 1475670867095 TestRomanNumerals.java RENAME testRomanNumerals_ UnitTestCaseAction 1475670899819 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670899819 TestRomanNumerals.java FAIL EditAction 1475671065081 RomanNumerals.java 3084 7 21 0 +EditAction 1475673162130 RomanNumerals.java 3254 7 24 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 37b5149..988ae8c 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -121,9 +121,16 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept } private void processTheChar(char c, char lastChar) throws RomanNumeralsException { + boolean x = false; if( c == 'L' ) if( lastChar == 'I' ) throw new RomanNumeralsException(); + if ( c == 'C' ) + if(lastChar == 'X' && x == true) + throw new RomanNumeralsException(); + if ( c == 'X' ) + if( lastChar == 'X' ) + x=true; if( c == 'D' ) if( lastChar == 'X' ) throw new RomanNumeralsException(); From fd782de59dd746278e9bc5975b5d399ee710d7bf Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:13:18 +0300 Subject: [PATCH 16/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 +++ src/RomanNumerals.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index a18f5d2..b73f981 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -137,3 +137,6 @@ UnitTestCaseAction 1475670899819 TestRomanNumerals.java FAIL UnitTestSessionAction 1475670899819 TestRomanNumerals.java FAIL EditAction 1475671065081 RomanNumerals.java 3084 7 21 0 EditAction 1475673162130 RomanNumerals.java 3254 7 24 0 +UnitTestCaseAction 1475673165664 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673165665 TestRomanNumerals.java FAIL +EditAction 1475673198743 RomanNumerals.java 3349 7 24 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 988ae8c..101b63d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -116,6 +116,10 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept processTheChar('D', lastChar); lastChar = 'D'; break; + case 'C': + processTheChar('C', lastChar); + lastChar = 'C'; + break; } } } From c7cc2188be365bf29644413ca1969d23c0cb9c36 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:14:25 +0300 Subject: [PATCH 17/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 4 ++++ src/RomanNumerals.java | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index b73f981..c92532a 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -140,3 +140,7 @@ EditAction 1475673162130 RomanNumerals.java 3254 7 24 0 UnitTestCaseAction 1475673165664 TestRomanNumerals.java FAIL UnitTestSessionAction 1475673165665 TestRomanNumerals.java FAIL EditAction 1475673198743 RomanNumerals.java 3349 7 24 0 +UnitTestCaseAction 1475673201082 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673201082 TestRomanNumerals.java FAIL +RefactoringAction 1475673252145 RomanNumerals.java ADD boolean x FIELD +EditAction 1475673265552 RomanNumerals.java 3359 7 23 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 101b63d..fc6ab5a 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -3,6 +3,7 @@ public class RomanNumerals { private int totalArabic; private int lastNumber; + private boolean x = false; public RomanNumerals() { this.totalArabic = 0; @@ -125,7 +126,7 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept } private void processTheChar(char c, char lastChar) throws RomanNumeralsException { - boolean x = false; + if( c == 'L' ) if( lastChar == 'I' ) throw new RomanNumeralsException(); @@ -134,7 +135,7 @@ private void processTheChar(char c, char lastChar) throws RomanNumeralsException throw new RomanNumeralsException(); if ( c == 'X' ) if( lastChar == 'X' ) - x=true; + x = true; if( c == 'D' ) if( lastChar == 'X' ) throw new RomanNumeralsException(); From 914ee132c5671961dc268bafdba8e0c3cffc087e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:15:45 +0300 Subject: [PATCH 18/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 +++ .besouro/20161005142310907/besouroEpisodes.txt | 8 ++++++++ .besouro/20161005142310907/randomHeuristicEpisodes.txt | 1 + .besouro/20161005142310907/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 2 ++ 5 files changed, 15 insertions(+) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index c92532a..c630d8e 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -144,3 +144,6 @@ UnitTestCaseAction 1475673201082 TestRomanNumerals.java FAIL UnitTestSessionAction 1475673201082 TestRomanNumerals.java FAIL RefactoringAction 1475673252145 RomanNumerals.java ADD boolean x FIELD EditAction 1475673265552 RomanNumerals.java 3359 7 23 0 +UnitTestCaseAction 1475673268506 TestRomanNumerals.java OK +UnitTestSessionAction 1475673268507 TestRomanNumerals.java OK +EditAction 1475673345697 RomanNumerals.java 3437 7 24 0 diff --git a/.besouro/20161005142310907/besouroEpisodes.txt b/.besouro/20161005142310907/besouroEpisodes.txt index dafcebe..54b652f 100644 --- a/.besouro/20161005142310907/besouroEpisodes.txt +++ b/.besouro/20161005142310907/besouroEpisodes.txt @@ -283,3 +283,11 @@ 1475670729191 test-first 3 168 true 1475670729192 production 1 168 false 1475670810503 test-addition 1 68 true +1475673268507 test-first 3 2437 true +1475673268508 test-first 3 2437 true +1475673268509 test-first 3 2437 true +1475673268510 test-first 3 2437 true +1475673268511 test-first 3 2437 true +1475673268512 test-first 3 2437 true +1475673268513 test-first 3 2437 true +1475673268514 production 1 2437 false diff --git a/.besouro/20161005142310907/randomHeuristicEpisodes.txt b/.besouro/20161005142310907/randomHeuristicEpisodes.txt index 7977a39..25008e1 100644 --- a/.besouro/20161005142310907/randomHeuristicEpisodes.txt +++ b/.besouro/20161005142310907/randomHeuristicEpisodes.txt @@ -5,3 +5,4 @@ 1475670548438 test-first 3 1224 true 1475670729189 test-first 3 168 true 1475670810503 test-addition 1 68 true +1475673268507 test-first 3 2437 true diff --git a/.besouro/20161005142310907/zorroEpisodes.txt b/.besouro/20161005142310907/zorroEpisodes.txt index 09f0bac..aec6425 100644 --- a/.besouro/20161005142310907/zorroEpisodes.txt +++ b/.besouro/20161005142310907/zorroEpisodes.txt @@ -5,3 +5,4 @@ 1475670548438 test-first 3 1258 true 1475670729189 test-first 3 180 true 1475670810503 test-addition 1 81 true +1475673268507 test-first 3 2458 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index fc6ab5a..d91b022 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -130,6 +130,8 @@ private void processTheChar(char c, char lastChar) throws RomanNumeralsException if( c == 'L' ) if( lastChar == 'I' ) throw new RomanNumeralsException(); + if ( lastChar == 'X' && x == true) + throw new RomanNumeralsException(); if ( c == 'C' ) if(lastChar == 'X' && x == true) throw new RomanNumeralsException(); From 289117e2786d7c50630022d21b374c3897360b53 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:17:30 +0300 Subject: [PATCH 19/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 5 +++++ src/RomanNumerals.java | 2 ++ tests/TestRomanNumerals.java | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index c630d8e..a85aa33 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -147,3 +147,8 @@ EditAction 1475673265552 RomanNumerals.java 3359 7 23 0 UnitTestCaseAction 1475673268506 TestRomanNumerals.java OK UnitTestSessionAction 1475673268507 TestRomanNumerals.java OK EditAction 1475673345697 RomanNumerals.java 3437 7 24 0 +RefactoringAction 1475673352857 TestRomanNumerals.java ADD void testRomanNumerals_subtractionMultipleTimes_XXC_exception()/2 METHOD +RefactoringAction 1475673367380 TestRomanNumerals.java RENAME testRomanNumerals_subtractionMultipleTimes_XXC_exception()/2=>void testRomanNumerals_subtractionMultipleTimes_XXL_exception() METHOD +UnitTestCaseAction 1475673378233 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673378233 TestRomanNumerals.java FAIL +EditAction 1475673450520 RomanNumerals.java 3467 7 26 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index d91b022..2ee119a 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -132,9 +132,11 @@ private void processTheChar(char c, char lastChar) throws RomanNumeralsException throw new RomanNumeralsException(); if ( lastChar == 'X' && x == true) throw new RomanNumeralsException(); + x = false; if ( c == 'C' ) if(lastChar == 'X' && x == true) throw new RomanNumeralsException(); + x = false; if ( c == 'X' ) if( lastChar == 'X' ) x = true; diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index e29b2d9..b0271aa 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -97,4 +97,8 @@ private void assertRomanNumerals(String roman, int expected) throws RomanNumeral assertRomanNumerals("XXC", 80); } + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals_subtractionMultipleTimes_XXL_exception() throws RomanNumeralsException { + assertRomanNumerals("XXL", 30); + } + } From 4ca0cc48a54fea1a94b72e99b661d60c99c6dc22 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:24:10 +0300 Subject: [PATCH 20/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 3 +++ src/RomanNumerals.java | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index a85aa33..3a727f9 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -152,3 +152,6 @@ RefactoringAction 1475673367380 TestRomanNumerals.java RENAME testRomanNumerals_ UnitTestCaseAction 1475673378233 TestRomanNumerals.java FAIL UnitTestSessionAction 1475673378233 TestRomanNumerals.java FAIL EditAction 1475673450520 RomanNumerals.java 3467 7 26 0 +UnitTestCaseAction 1475673452356 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673452357 TestRomanNumerals.java FAIL +EditAction 1475673850729 RomanNumerals.java 3485 7 26 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 2ee119a..6318a88 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -76,7 +76,7 @@ private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsE int romanV = 0; int romanI = 0; int romanM = 0; - for(int i=0; i= 0 ; i--) { if(romanNum.charAt(i) == 'I') romanI++; if(romanNum.charAt(i) == 'V') @@ -99,7 +99,7 @@ private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsE private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsException { char lastChar = 0; - for(int i=0; i= 0 ; i--) { switch (romanNum.charAt(i)) { case 'L': processTheChar('L', lastChar); @@ -127,21 +127,21 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept private void processTheChar(char c, char lastChar) throws RomanNumeralsException { - if( c == 'L' ) - if( lastChar == 'I' ) + if( c == 'I' ) + if( lastChar == 'L' ) throw new RomanNumeralsException(); - if ( lastChar == 'X' && x == true) + if ( c == 'X' ) + if(lastChar == 'X' && x == true) throw new RomanNumeralsException(); x = false; if ( c == 'C' ) - if(lastChar == 'X' && x == true) + if( lastChar == 'X' && x == true) throw new RomanNumeralsException(); x = false; - if ( c == 'X' ) - if( lastChar == 'X' ) - x = true; - if( c == 'D' ) - if( lastChar == 'X' ) + if( c == 'X' ) + if( lastChar == 'D' ) throw new RomanNumeralsException(); + if( lastChar == 'X') + x = true; } } From 18451a17c11b3cd7f8b828978aec26ad1124f2cf Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:25:47 +0300 Subject: [PATCH 21/22] besouro automatic message --- .besouro/20161005142310907/actions.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt index 3a727f9..2c12945 100644 --- a/.besouro/20161005142310907/actions.txt +++ b/.besouro/20161005142310907/actions.txt @@ -155,3 +155,5 @@ EditAction 1475673450520 RomanNumerals.java 3467 7 26 0 UnitTestCaseAction 1475673452356 TestRomanNumerals.java FAIL UnitTestSessionAction 1475673452357 TestRomanNumerals.java FAIL EditAction 1475673850729 RomanNumerals.java 3485 7 26 0 +UnitTestCaseAction 1475673852931 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673852931 TestRomanNumerals.java FAIL From 4cc3dbd1cd07a4ba0200e792af2a8e2d21105f6b Mon Sep 17 00:00:00 2001 From: usern12 <> Date: Wed, 5 Oct 2016 16:35:37 +0300 Subject: [PATCH 22/22] Project not finished --- src/RomanNumerals.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 6318a88..917a7e7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -97,7 +97,7 @@ private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsE } - private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsException { + public void checkIfValidSubtraction(String romanNum) throws RomanNumeralsException { char lastChar = 0; for(int i = romanNum.length() - 1; i >= 0 ; i--) { switch (romanNum.charAt(i)) { @@ -126,7 +126,6 @@ private void checkIfValidSubtraction(String romanNum) throws RomanNumeralsExcept } private void processTheChar(char c, char lastChar) throws RomanNumeralsException { - if( c == 'I' ) if( lastChar == 'L' ) throw new RomanNumeralsException();