From 9bf489b6a15e00fb4422d323183e54ee72a7f26b Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 14:41:37 +0300 Subject: [PATCH 01/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 4 ++++ .besouro/20160929143900661/besouroEpisodes.txt | 0 .besouro/20160929143900661/disagreements.txt | 0 .besouro/20160929143900661/randomHeuristicEpisodes.txt | 0 .besouro/20160929143900661/userComments.txt | 0 .besouro/20160929143900661/zorroEpisodes.txt | 0 tests/TestRomanNumerals.java | 5 +++-- 7 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .besouro/20160929143900661/actions.txt create mode 100644 .besouro/20160929143900661/besouroEpisodes.txt create mode 100644 .besouro/20160929143900661/disagreements.txt create mode 100644 .besouro/20160929143900661/randomHeuristicEpisodes.txt create mode 100644 .besouro/20160929143900661/userComments.txt create mode 100644 .besouro/20160929143900661/zorroEpisodes.txt diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt new file mode 100644 index 0000000..8a5a4ae --- /dev/null +++ b/.besouro/20160929143900661/actions.txt @@ -0,0 +1,4 @@ +FileOpenedAction 1475149140876 RomanNumerals.java 121 1 1 0 +FileOpenedAction 1475149155805 TestRomanNumerals.java 159 1 1 0 +RefactoringAction 1475149169805 TestRomanNumerals.java RENAME test()=>void testObject() METHOD +EditAction 1475149297509 TestRomanNumerals.java 219 1 2 1 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929143900661/disagreements.txt b/.besouro/20160929143900661/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929143900661/userComments.txt b/.besouro/20160929143900661/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5d1de75..49d1488 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -5,8 +5,9 @@ public class TestRomanNumerals { @Test - public void test() { - fail("Not yet implemented"); + public void testObject() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertNotNull(romanNumerals); } } From e4e3185d301da552a0b02e1d2362f0440710da60 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:01:21 +0300 Subject: [PATCH 02/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 14 ++++++++++++++ .besouro/20160929143900661/besouroEpisodes.txt | 1 + .../20160929143900661/randomHeuristicEpisodes.txt | 1 + .besouro/20160929143900661/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 12 +++++++++++- 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 8a5a4ae..c17ac57 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -2,3 +2,17 @@ FileOpenedAction 1475149140876 RomanNumerals.java 121 1 1 0 FileOpenedAction 1475149155805 TestRomanNumerals.java 159 1 1 0 RefactoringAction 1475149169805 TestRomanNumerals.java RENAME test()=>void testObject() METHOD EditAction 1475149297509 TestRomanNumerals.java 219 1 2 1 +UnitTestCaseAction 1475149298801 TestRomanNumerals.java OK +UnitTestSessionAction 1475149298804 TestRomanNumerals.java OK +RefactoringAction 1475149308613 TestRomanNumerals.java RENAME testObject()=>void testObjectCreation() METHOD +RefactoringAction 1475149310628 TestRomanNumerals.java RENAME testObjectCreation()=>void testObjectCreatio() METHOD +RefactoringAction 1475149315144 TestRomanNumerals.java RENAME testObjectCreatio()=>void createObject() METHOD +RefactoringAction 1475149326178 TestRomanNumerals.java RENAME createObject()=>void createObjectRomanNumerals() METHOD +RefactoringAction 1475149339712 TestRomanNumerals.java ADD void createObjectRomanNumerals()/2 METHOD +RefactoringAction 1475149350231 TestRomanNumerals.java RENAME createObjectRomanNumerals()/2=>void test() METHOD +RefactoringAction 1475150263345 TestRomanNumerals.java RENAME test()=> null +RefactoringAction 1475150308864 TestRomanNumerals.java RENAME =>void conver() METHOD +RefactoringAction 1475150311880 TestRomanNumerals.java RENAME conver()=>void convertToInteger() METHOD +RefactoringAction 1475150314897 TestRomanNumerals.java RENAME convertToInteger()=>void convertToIntegerReturn() METHOD +RefactoringAction 1475150317417 TestRomanNumerals.java RENAME convertToIntegerReturn()=>void convertToIntegerReturns() METHOD +EditAction 1475150480720 TestRomanNumerals.java 407 2 4 2 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt index e69de29..b349ce7 100644 --- a/.besouro/20160929143900661/besouroEpisodes.txt +++ b/.besouro/20160929143900661/besouroEpisodes.txt @@ -0,0 +1 @@ +1475149298804 test-addition 1 157 true diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt index e69de29..6390f5b 100644 --- a/.besouro/20160929143900661/randomHeuristicEpisodes.txt +++ b/.besouro/20160929143900661/randomHeuristicEpisodes.txt @@ -0,0 +1 @@ +1475149298804 test-addition 1 157 false diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt index e69de29..6390f5b 100644 --- a/.besouro/20160929143900661/zorroEpisodes.txt +++ b/.besouro/20160929143900661/zorroEpisodes.txt @@ -0,0 +1 @@ +1475149298804 test-addition 1 157 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 49d1488..0085e1a 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -5,9 +5,19 @@ public class TestRomanNumerals { @Test - public void testObject() { + public void createObjectRomanNumerals() { RomanNumerals romanNumerals = new RomanNumerals(); assertNotNull(romanNumerals); } + + @Test + public void convertToIntegerReturns() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("0", 0, romanNumerals.convertToInteger("")); + } + + + + } From 393e738a2d2b5910ec1cf506e3c91e796b2e9fdf Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:01:22 +0300 Subject: [PATCH 03/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 1 + src/RomanNumerals.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index c17ac57..d67fe69 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -16,3 +16,4 @@ RefactoringAction 1475150311880 TestRomanNumerals.java RENAME conver()=>void con RefactoringAction 1475150314897 TestRomanNumerals.java RENAME convertToInteger()=>void convertToIntegerReturn() METHOD RefactoringAction 1475150317417 TestRomanNumerals.java RENAME convertToIntegerReturn()=>void convertToIntegerReturns() METHOD EditAction 1475150480720 TestRomanNumerals.java 407 2 4 2 +EditAction 1475150481935 RomanNumerals.java 148 1 2 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 20904f0..58a17ea 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,7 +1,11 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { - // To be Implemented + if(romanNum.isEmpty()) { + return 0; + } + + return 0; } From 3b2f5436090ae4c85d2581811acdfc6500da8e24 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:44:47 +0300 Subject: [PATCH 04/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 43 +++++++++++++++++++ .../20160929143900661/besouroEpisodes.txt | 2 + .../randomHeuristicEpisodes.txt | 1 + .besouro/20160929143900661/zorroEpisodes.txt | 3 +- tests/TestRomanNumerals.java | 15 ++++++- 5 files changed, 62 insertions(+), 2 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index d67fe69..8ac5c3d 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -17,3 +17,46 @@ RefactoringAction 1475150314897 TestRomanNumerals.java RENAME convertToInteger() RefactoringAction 1475150317417 TestRomanNumerals.java RENAME convertToIntegerReturn()=>void convertToIntegerReturns() METHOD EditAction 1475150480720 TestRomanNumerals.java 407 2 4 2 EditAction 1475150481935 RomanNumerals.java 148 1 2 0 +UnitTestCaseAction 1475150483390 TestRomanNumerals.java OK +UnitTestSessionAction 1475150483391 TestRomanNumerals.java OK +RefactoringAction 1475150492812 TestRomanNumerals.java RENAME convertToIntegerReturns()=>void convertToIntegerReturnsZeroWithEmptyString() METHOD +RefactoringAction 1475150498329 TestRomanNumerals.java ADD void convertToIntegerReturnsZeroWithEmptyString()/2 METHOD +RefactoringAction 1475150510349 TestRomanNumerals.java RENAME convertToIntegerReturnsZeroWithEmptyString()/2=>void convert() METHOD +RefactoringAction 1475150518367 TestRomanNumerals.java RENAME convert()=>void convertI() METHOD +RefactoringAction 1475150637433 RomanNumerals.java ADD Set conversions FIELD +RefactoringAction 1475150660005 RomanNumerals.java ADD import java.util.Set IMPORT +RefactoringAction 1475150663035 RomanNumerals.java ADD import java.util.HashSet IMPORT +RefactoringAction 1475150706566 RomanNumerals.java ADD void RomanNumerals FIELD +RefactoringAction 1475150707582 RomanNumerals.java RENAME RomanNumerals=>void RomanNumerals() METHOD +RefactoringAction 1475150943401 valuePair.java ADD valuePair.java CLASS +FileOpenedAction 1475150943689 valuePair.java 33 0 0 0 +RefactoringAction 1475150972710 valuePair.java ADD int decimal FIELD +RefactoringAction 1475150977229 valuePair.java ADD String roman FIELD +RefactoringAction 1475151000286 valuePair.java ADD void valuePair FIELD +RefactoringAction 1475151002795 valuePair.java RENAME valuePair=>void valuePair() METHOD +RefactoringAction 1475151013824 valuePair.java RENAME valuePair()=>void valuePair(int, String) METHOD +RefactoringAction 1475151095906 valuePair.java ADD int convert FIELD +RefactoringAction 1475151100920 valuePair.java RENAME convert=>int convertRoman FIELD +RefactoringAction 1475151102934 valuePair.java RENAME convertRoman=>int convertRoman() METHOD +RefactoringAction 1475151116955 valuePair.java RENAME convertRoman()=>int n() METHOD +RefactoringAction 1475151120966 valuePair.java RENAME n()=>int getDecimal() METHOD +RefactoringAction 1475151124477 valuePair.java RENAME getDecimal()=>int getDecimal(String) METHOD +RefactoringAction 1475151175159 valuePair.java REMOVE valuePair.java CLASS +RefactoringAction 1475151198130 RomanNumerals.java REMOVE conversions FIELD +RefactoringAction 1475151203171 RomanNumerals.java ADD int FIELD +RefactoringAction 1475151214208 RomanNumerals.java ADD String FIELD +RefactoringAction 1475151249758 RomanNumerals.java REMOVE romans FIELD +RefactoringAction 1475151249760 RomanNumerals.java REMOVE decimals FIELD +RefactoringAction 1475151262815 RomanNumerals.java ADD Set decimals FIELD +RefactoringAction 1475151272854 RomanNumerals.java ADD Set roman FIELD +RefactoringAction 1475151273866 RomanNumerals.java RENAME roman=>Set romans FIELD +RefactoringAction 1475151470020 RomanNumerals.java REMOVE romans FIELD +RefactoringAction 1475151470022 RomanNumerals.java REMOVE decimals FIELD +RefactoringAction 1475151485588 RomanNumerals.java ADD int FIELD +RefactoringAction 1475151489102 RomanNumerals.java ADD String FIELD +RefactoringAction 1475151530145 RomanNumerals.java REMOVE RomanNumerals() METHOD +RefactoringAction 1475152092908 RomanNumerals.java REMOVE romans FIELD +RefactoringAction 1475152092911 RomanNumerals.java REMOVE decimals FIELD +RefactoringAction 1475153070094 TestRomanNumerals.java ADD void convertI()/2 METHOD +RefactoringAction 1475153073606 TestRomanNumerals.java RENAME convertI()/2=>void convertX() METHOD +EditAction 1475153087288 TestRomanNumerals.java 732 4 8 4 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt index b349ce7..ce03e01 100644 --- a/.besouro/20160929143900661/besouroEpisodes.txt +++ b/.besouro/20160929143900661/besouroEpisodes.txt @@ -1 +1,3 @@ 1475149298804 test-addition 1 157 true +1475150483391 test-first 4 1174 true +1475150483392 test-first 4 1174 true diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt index 6390f5b..070948f 100644 --- a/.besouro/20160929143900661/randomHeuristicEpisodes.txt +++ b/.besouro/20160929143900661/randomHeuristicEpisodes.txt @@ -1 +1,2 @@ 1475149298804 test-addition 1 157 false +1475150483391 test-first 4 1174 true diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt index 6390f5b..80c456f 100644 --- a/.besouro/20160929143900661/zorroEpisodes.txt +++ b/.besouro/20160929143900661/zorroEpisodes.txt @@ -1 +1,2 @@ -1475149298804 test-addition 1 157 false +1475149298804 test-addition 1 157 true +1475150483391 test-first 4 1184 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 0085e1a..3a11a0c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -11,10 +11,23 @@ public void createObjectRomanNumerals() { } @Test - public void convertToIntegerReturns() { + public void convertToIntegerReturnsZeroWithEmptyString() { RomanNumerals romanNumerals = new RomanNumerals(); assertEquals("0", 0, romanNumerals.convertToInteger("")); } + + @Test + public void convertI() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("1", 1, romanNumerals.convertToInteger("I")); + } + + @Test + public void convertX() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("10", 10, romanNumerals.convertToInteger("X")); + } + From fbfefb2ddf663c479d506417f74d35825ce5ba0c Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:44:48 +0300 Subject: [PATCH 05/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 1 + src/RomanNumerals.java | 40 +++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 8ac5c3d..77c1a32 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -60,3 +60,4 @@ RefactoringAction 1475152092911 RomanNumerals.java REMOVE decimals FIELD RefactoringAction 1475153070094 TestRomanNumerals.java ADD void convertI()/2 METHOD RefactoringAction 1475153073606 TestRomanNumerals.java RENAME convertI()/2=>void convertX() METHOD EditAction 1475153087288 TestRomanNumerals.java 732 4 8 4 +EditAction 1475153088419 RomanNumerals.java 625 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 58a17ea..118e64d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,12 +1,50 @@ +import java.util.HashSet; +import java.util.Set; public class RomanNumerals { + public int convertToInteger(String romanNum) { + if(romanNum.isEmpty()) { return 0; } + int sum = 0; + + for(int i = 0; i < romanNum.length(); i++) { + char roman = romanNum.charAt(i); + + int value = 0; + + switch(roman) { + + case 'I': + value = 1; + + case 'V': + value = 5; + + case 'X': + value = 10; + + case 'L': + value = 50; + + case 'C': + value = 100; + + case 'D': + value = 500; + + case 'M': + value = 1000; + + + } + sum = sum + value; + } - return 0; + return sum; } } From 03546070fced5a124383861cbbcde3161585bb65 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:46:58 +0300 Subject: [PATCH 06/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 ++ src/RomanNumerals.java | 45 +++++++++++++++----------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 77c1a32..0dcdec5 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -61,3 +61,6 @@ RefactoringAction 1475153070094 TestRomanNumerals.java ADD void convertI()/2 MET RefactoringAction 1475153073606 TestRomanNumerals.java RENAME convertI()/2=>void convertX() METHOD EditAction 1475153087288 TestRomanNumerals.java 732 4 8 4 EditAction 1475153088419 RomanNumerals.java 625 1 4 0 +UnitTestCaseAction 1475153090659 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475153090660 TestRomanNumerals.java FAIL +EditAction 1475153218365 RomanNumerals.java 845 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 118e64d..e4a9e04 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -13,33 +13,42 @@ public int convertToInteger(String romanNum) { for(int i = 0; i < romanNum.length(); i++) { char roman = romanNum.charAt(i); - int value = 0; - switch(roman) { + switch(roman) { - case 'I': - value = 1; + case 'I': + value = 1; + break; - case 'V': - value = 5; + case 'V': + value = 5; + break; - case 'X': - value = 10; + case 'X': + value = 10; + break; - case 'L': - value = 50; + case 'L': + value = 50; + break; - case 'C': - value = 100; + case 'C': + value = 100; + break; - case 'D': - value = 500; - - case 'M': - value = 1000; - + case 'D': + value = 500; + break; + case 'M': + value = 1000; + break; + + default: + throw new IllegalArgumentException("Something went horribly wrong"); + break; + } sum = sum + value; } From ab75133f59c4c1b34dc0ac95a893b26989b14f21 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:47:44 +0300 Subject: [PATCH 07/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 8 ++++++++ .besouro/20160929143900661/besouroEpisodes.txt | 3 +++ .besouro/20160929143900661/randomHeuristicEpisodes.txt | 1 + .besouro/20160929143900661/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 1 - tests/TestRomanNumerals.java | 6 ++++++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 0dcdec5..7166a02 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -64,3 +64,11 @@ EditAction 1475153088419 RomanNumerals.java 625 1 4 0 UnitTestCaseAction 1475153090659 TestRomanNumerals.java FAIL UnitTestSessionAction 1475153090660 TestRomanNumerals.java FAIL EditAction 1475153218365 RomanNumerals.java 845 1 4 0 +CompilationAction 1475153219694 RomanNumerals.java +CompilationAction 1475153226596 RomanNumerals.java +UnitTestCaseAction 1475153226975 TestRomanNumerals.java OK +UnitTestSessionAction 1475153226976 TestRomanNumerals.java OK +RefactoringAction 1475153247176 TestRomanNumerals.java ADD void convertX()/2 METHOD +RefactoringAction 1475153250190 TestRomanNumerals.java RENAME convertX()/2=>void convertII() METHOD +RefactoringAction 1475153254706 TestRomanNumerals.java RENAME convertII()=>void convertIII() METHOD +EditAction 1475153264357 TestRomanNumerals.java 888 5 10 5 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt index ce03e01..5a2936f 100644 --- a/.besouro/20160929143900661/besouroEpisodes.txt +++ b/.besouro/20160929143900661/besouroEpisodes.txt @@ -1,3 +1,6 @@ 1475149298804 test-addition 1 157 true 1475150483391 test-first 4 1174 true 1475150483392 test-first 4 1174 true +1475153226976 test-first 3 2734 true +1475153226977 test-first 3 2734 true +1475153226978 test-first 3 2734 true diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt index 070948f..fe7e73f 100644 --- a/.besouro/20160929143900661/randomHeuristicEpisodes.txt +++ b/.besouro/20160929143900661/randomHeuristicEpisodes.txt @@ -1,2 +1,3 @@ 1475149298804 test-addition 1 157 false 1475150483391 test-first 4 1174 true +1475153226976 test-first 3 2734 true diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt index 80c456f..cc16566 100644 --- a/.besouro/20160929143900661/zorroEpisodes.txt +++ b/.besouro/20160929143900661/zorroEpisodes.txt @@ -1,2 +1,3 @@ 1475149298804 test-addition 1 157 true 1475150483391 test-first 4 1184 true +1475153226976 test-first 3 2743 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e4a9e04..d6ecb1e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -47,7 +47,6 @@ public int convertToInteger(String romanNum) { default: throw new IllegalArgumentException("Something went horribly wrong"); - break; } sum = sum + value; diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 3a11a0c..d122fa1 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -27,6 +27,12 @@ public void convertX() { RomanNumerals romanNumerals = new RomanNumerals(); assertEquals("10", 10, romanNumerals.convertToInteger("X")); } + + @Test + public void convertIII() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("3", 3, romanNumerals.convertToInteger("III")); + } From 97f5fcc1bac394ac925e95f481af79788787d0c0 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:00:11 +0300 Subject: [PATCH 08/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 10 ++++++++++ .besouro/20160929143900661/besouroEpisodes.txt | 2 ++ .../20160929143900661/randomHeuristicEpisodes.txt | 1 + .besouro/20160929143900661/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 12 ++++++++++++ 5 files changed, 26 insertions(+) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 7166a02..32b1ee4 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -72,3 +72,13 @@ RefactoringAction 1475153247176 TestRomanNumerals.java ADD void convertX()/2 MET RefactoringAction 1475153250190 TestRomanNumerals.java RENAME convertX()/2=>void convertII() METHOD RefactoringAction 1475153254706 TestRomanNumerals.java RENAME convertII()=>void convertIII() METHOD EditAction 1475153264357 TestRomanNumerals.java 888 5 10 5 +UnitTestCaseAction 1475153265621 TestRomanNumerals.java OK +UnitTestSessionAction 1475153265623 TestRomanNumerals.java OK +RefactoringAction 1475153314750 TestRomanNumerals.java ADD void convertIII()/2 METHOD +RefactoringAction 1475153322265 TestRomanNumerals.java RENAME convertIII()/2=>void convertIV() METHOD +RefactoringAction 1475153398283 TestRomanNumerals.java RENAME convertIV()=>void convertI()/2 METHOD +RefactoringAction 1475153399298 TestRomanNumerals.java RENAME convertI()/2=>void convertIIII() METHOD +RefactoringAction 1475153470161 TestRomanNumerals.java ADD ExpectedException expectedEx FIELD +RefactoringAction 1475153479334 TestRomanNumerals.java ADD import org.junit.Rule IMPORT +RefactoringAction 1475153483583 TestRomanNumerals.java ADD import org.junit.rules.ExpectedException IMPORT +EditAction 1475154011182 TestRomanNumerals.java 1339 6 14 5 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt index 5a2936f..59114fd 100644 --- a/.besouro/20160929143900661/besouroEpisodes.txt +++ b/.besouro/20160929143900661/besouroEpisodes.txt @@ -4,3 +4,5 @@ 1475153226976 test-first 3 2734 true 1475153226977 test-first 3 2734 true 1475153226978 test-first 3 2734 true +1475153265623 test-addition 1 18 true +1475153265624 test-addition 1 18 true diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt index fe7e73f..4e4e41c 100644 --- a/.besouro/20160929143900661/randomHeuristicEpisodes.txt +++ b/.besouro/20160929143900661/randomHeuristicEpisodes.txt @@ -1,3 +1,4 @@ 1475149298804 test-addition 1 157 false 1475150483391 test-first 4 1174 true 1475153226976 test-first 3 2734 true +1475153265623 test-addition 1 18 true diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt index cc16566..55c31d4 100644 --- a/.besouro/20160929143900661/zorroEpisodes.txt +++ b/.besouro/20160929143900661/zorroEpisodes.txt @@ -1,3 +1,4 @@ 1475149298804 test-addition 1 157 true 1475150483391 test-first 4 1184 true 1475153226976 test-first 3 2743 true +1475153265623 test-addition 1 38 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index d122fa1..bb51e0c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -1,8 +1,13 @@ import static org.junit.Assert.*; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; public class TestRomanNumerals { + + @Rule + public ExpectedException expectedEx = ExpectedException.none(); @Test public void createObjectRomanNumerals() { @@ -34,6 +39,13 @@ public void convertIII() { assertEquals("3", 3, romanNumerals.convertToInteger("III")); } + @Test + public void convertIIII() throws IllegalArgumentException { + expectedEx.expect(IllegalArgumentException.class); + expectedEx.expectMessage("This roman number can't be repeated over three times in a row"); + RomanNumerals romanNumerals = new RomanNumerals(); + romanNumerals.convertToInteger("IIII"); + } From 2f9cd131ffaa4a0fa8988b51149e2475990aa959 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:00:12 +0300 Subject: [PATCH 09/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 1 + src/RomanNumerals.java | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 32b1ee4..0f17293 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -82,3 +82,4 @@ RefactoringAction 1475153470161 TestRomanNumerals.java ADD ExpectedException exp RefactoringAction 1475153479334 TestRomanNumerals.java ADD import org.junit.Rule IMPORT RefactoringAction 1475153483583 TestRomanNumerals.java ADD import org.junit.rules.ExpectedException IMPORT EditAction 1475154011182 TestRomanNumerals.java 1339 6 14 5 +EditAction 1475154012456 RomanNumerals.java 1190 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index d6ecb1e..c33978b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -13,7 +13,20 @@ public int convertToInteger(String romanNum) { for(int i = 0; i < romanNum.length(); i++) { char roman = romanNum.charAt(i); - int value = 0; + int value = 0; + int lastValue = 0; + int counter = 0; + if(i > 1) { + lastValue = value; + if(value == lastValue) { + counter++; + if((value == 1 || value == 10 + || value == 100 || value == 1000) + && counter == 3 ) { + throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); + } + } + } switch(roman) { @@ -49,6 +62,7 @@ public int convertToInteger(String romanNum) { throw new IllegalArgumentException("Something went horribly wrong"); } + sum = sum + value; } From 5e8ebe3507a7a6baa047f7edb8e328e7ce5cdee9 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:01:50 +0300 Subject: [PATCH 10/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 0f17293..5e22076 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -83,3 +83,6 @@ RefactoringAction 1475153479334 TestRomanNumerals.java ADD import org.junit.Rule RefactoringAction 1475153483583 TestRomanNumerals.java ADD import org.junit.rules.ExpectedException IMPORT EditAction 1475154011182 TestRomanNumerals.java 1339 6 14 5 EditAction 1475154012456 RomanNumerals.java 1190 1 4 0 +UnitTestCaseAction 1475154014596 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154014598 TestRomanNumerals.java FAIL +EditAction 1475154110146 RomanNumerals.java 1198 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c33978b..ba60024 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -22,7 +22,7 @@ public int convertToInteger(String romanNum) { counter++; if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 3 ) { + && counter == 2 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } } @@ -62,8 +62,9 @@ public int convertToInteger(String romanNum) { throw new IllegalArgumentException("Something went horribly wrong"); } - + sum = sum + value; + } return sum; From 43af42d4031c66da48b5d45d1f73ae4fb987e0e5 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:01:57 +0300 Subject: [PATCH 11/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 5e22076..ec94164 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -86,3 +86,6 @@ EditAction 1475154012456 RomanNumerals.java 1190 1 4 0 UnitTestCaseAction 1475154014596 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154014598 TestRomanNumerals.java FAIL EditAction 1475154110146 RomanNumerals.java 1198 1 4 0 +UnitTestCaseAction 1475154111800 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154111802 TestRomanNumerals.java FAIL +EditAction 1475154117026 RomanNumerals.java 1198 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index ba60024..4a7be18 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -22,7 +22,7 @@ public int convertToInteger(String romanNum) { counter++; if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 2 ) { + && counter == 1 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } } From e742139905c720519ab9f2da82406174b8d7b65e Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:02:25 +0300 Subject: [PATCH 12/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index ec94164..6166854 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -89,3 +89,6 @@ EditAction 1475154110146 RomanNumerals.java 1198 1 4 0 UnitTestCaseAction 1475154111800 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154111802 TestRomanNumerals.java FAIL EditAction 1475154117026 RomanNumerals.java 1198 1 4 0 +UnitTestCaseAction 1475154118506 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154118507 TestRomanNumerals.java FAIL +EditAction 1475154145492 RomanNumerals.java 1198 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 4a7be18..0edd29c 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -16,7 +16,7 @@ public int convertToInteger(String romanNum) { int value = 0; int lastValue = 0; int counter = 0; - if(i > 1) { + if(i > 0) { lastValue = value; if(value == lastValue) { counter++; From 3b9a068b0cd0fbefdaddce7a56782065f617b764 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:08:38 +0300 Subject: [PATCH 13/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 6166854..29f9b35 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -92,3 +92,6 @@ EditAction 1475154117026 RomanNumerals.java 1198 1 4 0 UnitTestCaseAction 1475154118506 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154118507 TestRomanNumerals.java FAIL EditAction 1475154145492 RomanNumerals.java 1198 1 4 0 +UnitTestCaseAction 1475154147184 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154147185 TestRomanNumerals.java FAIL +EditAction 1475154518413 RomanNumerals.java 1258 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0edd29c..f10ffca 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -16,17 +16,11 @@ public int convertToInteger(String romanNum) { int value = 0; int lastValue = 0; int counter = 0; - if(i > 0) { - lastValue = value; - if(value == lastValue) { - counter++; - if((value == 1 || value == 10 - || value == 100 || value == 1000) - && counter == 1 ) { - throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); - } - } - } + if((value == 1 || value == 10 + || value == 100 || value == 1000) + && counter == 2 ) { + throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); + } switch(roman) { @@ -62,9 +56,14 @@ public int convertToInteger(String romanNum) { throw new IllegalArgumentException("Something went horribly wrong"); } - sum = sum + value; - + if(lastValue == value || i == 0) { + lastValue = value; + counter++; + } else if(lastValue != value && i != 0) { + lastValue = value; + counter = 0; + } } return sum; From 572c3394fc4e19ddda0fd28d7f4693556a10e128 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:08:55 +0300 Subject: [PATCH 14/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 29f9b35..84fc260 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -95,3 +95,6 @@ EditAction 1475154145492 RomanNumerals.java 1198 1 4 0 UnitTestCaseAction 1475154147184 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154147185 TestRomanNumerals.java FAIL EditAction 1475154518413 RomanNumerals.java 1258 1 4 0 +UnitTestCaseAction 1475154520074 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154520076 TestRomanNumerals.java FAIL +EditAction 1475154535500 RomanNumerals.java 1258 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index f10ffca..4c9a206 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -18,7 +18,7 @@ public int convertToInteger(String romanNum) { int counter = 0; if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 2 ) { + && counter == 1 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } From ad7becc32965bdd2dfddb6de6f07604e6f0ea6ae Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:09:26 +0300 Subject: [PATCH 15/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 84fc260..b59d1b6 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -98,3 +98,6 @@ EditAction 1475154518413 RomanNumerals.java 1258 1 4 0 UnitTestCaseAction 1475154520074 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154520076 TestRomanNumerals.java FAIL EditAction 1475154535500 RomanNumerals.java 1258 1 4 0 +UnitTestCaseAction 1475154536663 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154536664 TestRomanNumerals.java FAIL +EditAction 1475154565697 RomanNumerals.java 1266 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 4c9a206..0ce6875 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -16,12 +16,7 @@ public int convertToInteger(String romanNum) { int value = 0; int lastValue = 0; int counter = 0; - if((value == 1 || value == 10 - || value == 100 || value == 1000) - && counter == 1 ) { - throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); - } - + switch(roman) { case 'I': @@ -64,6 +59,12 @@ public int convertToInteger(String romanNum) { lastValue = value; counter = 0; } + + if((value == 1 || value == 10 + || value == 100 || value == 1000) + && counter == 1 ) { + throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); + } } return sum; From f3108a50fb451fcf8d770869ad7921e9052f24e2 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:09:38 +0300 Subject: [PATCH 16/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index b59d1b6..457e77f 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -101,3 +101,6 @@ EditAction 1475154535500 RomanNumerals.java 1258 1 4 0 UnitTestCaseAction 1475154536663 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154536664 TestRomanNumerals.java FAIL EditAction 1475154565697 RomanNumerals.java 1266 1 4 0 +UnitTestCaseAction 1475154567293 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154567294 TestRomanNumerals.java FAIL +EditAction 1475154577866 RomanNumerals.java 1266 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0ce6875..2b7caba 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -62,7 +62,7 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 1 ) { + && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } } From c8c1efa2fb1df8dd699e7cae8af851c37794cc93 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:09:45 +0300 Subject: [PATCH 17/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 457e77f..dd35db4 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -104,3 +104,6 @@ EditAction 1475154565697 RomanNumerals.java 1266 1 4 0 UnitTestCaseAction 1475154567293 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154567294 TestRomanNumerals.java FAIL EditAction 1475154577866 RomanNumerals.java 1266 1 4 0 +UnitTestCaseAction 1475154579305 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154579306 TestRomanNumerals.java FAIL +EditAction 1475154584844 RomanNumerals.java 1266 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 2b7caba..551140a 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -62,7 +62,7 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 3 ) { + && counter == 4 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } } From b5de901e54ec77fc903b8fbc97b28e399869937d Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:09:53 +0300 Subject: [PATCH 18/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index dd35db4..dd427e8 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -107,3 +107,6 @@ EditAction 1475154577866 RomanNumerals.java 1266 1 4 0 UnitTestCaseAction 1475154579305 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154579306 TestRomanNumerals.java FAIL EditAction 1475154584844 RomanNumerals.java 1266 1 4 0 +UnitTestCaseAction 1475154586749 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154586750 TestRomanNumerals.java FAIL +EditAction 1475154592635 RomanNumerals.java 1266 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 551140a..637318e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -62,7 +62,7 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 4 ) { + && counter == 2 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } } From dfc94d5a90ecf4a8598591a0347af01680a16156 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:10:03 +0300 Subject: [PATCH 19/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index dd427e8..0a58e55 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -110,3 +110,6 @@ EditAction 1475154584844 RomanNumerals.java 1266 1 4 0 UnitTestCaseAction 1475154586749 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154586750 TestRomanNumerals.java FAIL EditAction 1475154592635 RomanNumerals.java 1266 1 4 0 +UnitTestCaseAction 1475154594082 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154594083 TestRomanNumerals.java FAIL +EditAction 1475154602701 RomanNumerals.java 1266 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 637318e..0ce6875 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -62,7 +62,7 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 2 ) { + && counter == 1 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } } From 02acc84561536e17a467e18482afd174445cb34c Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:12:12 +0300 Subject: [PATCH 20/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 0a58e55..29b3ccc 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -113,3 +113,6 @@ EditAction 1475154592635 RomanNumerals.java 1266 1 4 0 UnitTestCaseAction 1475154594082 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154594083 TestRomanNumerals.java FAIL EditAction 1475154602701 RomanNumerals.java 1266 1 4 0 +UnitTestCaseAction 1475154604380 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154604381 TestRomanNumerals.java FAIL +EditAction 1475154731526 RomanNumerals.java 1256 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0ce6875..2298401 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -55,7 +55,7 @@ public int convertToInteger(String romanNum) { if(lastValue == value || i == 0) { lastValue = value; counter++; - } else if(lastValue != value && i != 0) { + } else if(lastValue != value) { lastValue = value; counter = 0; } From 4f13793641a584857db887261c0f892a9f202607 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:12:21 +0300 Subject: [PATCH 21/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 29b3ccc..b819e75 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -116,3 +116,6 @@ EditAction 1475154602701 RomanNumerals.java 1266 1 4 0 UnitTestCaseAction 1475154604380 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154604381 TestRomanNumerals.java FAIL EditAction 1475154731526 RomanNumerals.java 1256 1 4 0 +UnitTestCaseAction 1475154733162 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154733162 TestRomanNumerals.java FAIL +EditAction 1475154741257 RomanNumerals.java 1256 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 2298401..daa31da 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -62,7 +62,7 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 1 ) { + && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } } From 4e62961aaa388db5f3252c269e6693956f2e2920 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:12:58 +0300 Subject: [PATCH 22/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index b819e75..4f4c52d 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -119,3 +119,6 @@ EditAction 1475154731526 RomanNumerals.java 1256 1 4 0 UnitTestCaseAction 1475154733162 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154733162 TestRomanNumerals.java FAIL EditAction 1475154741257 RomanNumerals.java 1256 1 4 0 +UnitTestCaseAction 1475154742599 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154742600 TestRomanNumerals.java FAIL +EditAction 1475154778189 TestRomanNumerals.java 1341 6 13 5 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index bb51e0c..573de6d 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -42,7 +42,7 @@ public void convertIII() { @Test public void convertIIII() throws IllegalArgumentException { expectedEx.expect(IllegalArgumentException.class); - expectedEx.expectMessage("This roman number can't be repeated over three times in a row"); + //expectedEx.expectMessage("This roman number can't be repeated over three times in a row"); RomanNumerals romanNumerals = new RomanNumerals(); romanNumerals.convertToInteger("IIII"); } From 5b3c943766bc06ec483821ce052dac64e6133ca4 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:17:00 +0300 Subject: [PATCH 23/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 4f4c52d..7f22e42 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -122,3 +122,6 @@ EditAction 1475154741257 RomanNumerals.java 1256 1 4 0 UnitTestCaseAction 1475154742599 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154742600 TestRomanNumerals.java FAIL EditAction 1475154778189 TestRomanNumerals.java 1341 6 13 5 +UnitTestCaseAction 1475154779624 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475154779625 TestRomanNumerals.java FAIL +EditAction 1475155020020 RomanNumerals.java 1314 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index daa31da..0063804 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -65,6 +65,8 @@ public int convertToInteger(String romanNum) { && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } + System.out.println(sum); + System.out.println(value); } return sum; From ddb7b8840873fb6d093a4adc84f43c70e7629bcf Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:18:07 +0300 Subject: [PATCH 24/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 7f22e42..80a9aaa 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -125,3 +125,6 @@ EditAction 1475154778189 TestRomanNumerals.java 1341 6 13 5 UnitTestCaseAction 1475154779624 TestRomanNumerals.java FAIL UnitTestSessionAction 1475154779625 TestRomanNumerals.java FAIL EditAction 1475155020020 RomanNumerals.java 1314 1 4 0 +UnitTestCaseAction 1475155021601 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155021602 TestRomanNumerals.java FAIL +EditAction 1475155086729 RomanNumerals.java 1386 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0063804..18e755b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -65,8 +65,10 @@ public int convertToInteger(String romanNum) { && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } - System.out.println(sum); - System.out.println(value); + System.out.println("Sum: " + sum); + System.out.println("Value: " + value); + System.out.println("Counter: " + counter); + } return sum; From aa215592807bb2eeef92ee38a9e961fd351cd2dd Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:21:16 +0300 Subject: [PATCH 25/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 80a9aaa..a393e4d 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -128,3 +128,6 @@ EditAction 1475155020020 RomanNumerals.java 1314 1 4 0 UnitTestCaseAction 1475155021601 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155021602 TestRomanNumerals.java FAIL EditAction 1475155086729 RomanNumerals.java 1386 1 4 0 +UnitTestCaseAction 1475155088222 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155088223 TestRomanNumerals.java FAIL +EditAction 1475155276072 RomanNumerals.java 1384 1 0 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 18e755b..7f884fd 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -55,7 +55,7 @@ public int convertToInteger(String romanNum) { if(lastValue == value || i == 0) { lastValue = value; counter++; - } else if(lastValue != value) { + } else (lastValue != value) { lastValue = value; counter = 0; } From 444ab0bddb98fdbdbcf14ac271c3b917fe093309 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:21:38 +0300 Subject: [PATCH 26/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 9 +++++++++ src/RomanNumerals.java | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index a393e4d..f2a4b58 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -131,3 +131,12 @@ EditAction 1475155086729 RomanNumerals.java 1386 1 4 0 UnitTestCaseAction 1475155088222 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155088223 TestRomanNumerals.java FAIL EditAction 1475155276072 RomanNumerals.java 1384 1 0 0 +CompilationAction 1475155277233 RomanNumerals.java +CompilationAction 1475155277234 RomanNumerals.java +CompilationAction 1475155277235 RomanNumerals.java +UnitTestCaseAction 1475155280183 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155280184 TestRomanNumerals.java FAIL +CompilationAction 1475155287845 RomanNumerals.java +UnitTestCaseAction 1475155288231 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155288232 TestRomanNumerals.java FAIL +EditAction 1475155298423 RomanNumerals.java 1369 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7f884fd..94fcec1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -55,7 +55,7 @@ public int convertToInteger(String romanNum) { if(lastValue == value || i == 0) { lastValue = value; counter++; - } else (lastValue != value) { + } else { lastValue = value; counter = 0; } @@ -65,9 +65,9 @@ public int convertToInteger(String romanNum) { && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } - System.out.println("Sum: " + sum); - System.out.println("Value: " + value); - System.out.println("Counter: " + counter); + //System.out.println("Sum: " + sum); + //System.out.println("Value: " + value); + //System.out.println("Counter: " + counter); } From 092f4e85f1b552399d86574ba2eb2d8272797185 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:21:49 +0300 Subject: [PATCH 27/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index f2a4b58..af6d2ff 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -140,3 +140,6 @@ CompilationAction 1475155287845 RomanNumerals.java UnitTestCaseAction 1475155288231 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155288232 TestRomanNumerals.java FAIL EditAction 1475155298423 RomanNumerals.java 1369 1 4 0 +UnitTestCaseAction 1475155299846 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155299847 TestRomanNumerals.java FAIL +EditAction 1475155308795 RomanNumerals.java 1369 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 94fcec1..9825279 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -62,7 +62,7 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 3 ) { + && counter == 2 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } //System.out.println("Sum: " + sum); From e6d683fe0c885bb9733c0ccb43e5141b84c7a3ea Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:22:02 +0300 Subject: [PATCH 28/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index af6d2ff..386f501 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -143,3 +143,6 @@ EditAction 1475155298423 RomanNumerals.java 1369 1 4 0 UnitTestCaseAction 1475155299846 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155299847 TestRomanNumerals.java FAIL EditAction 1475155308795 RomanNumerals.java 1369 1 4 0 +UnitTestCaseAction 1475155310393 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155310394 TestRomanNumerals.java FAIL +EditAction 1475155321907 RomanNumerals.java 1363 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9825279..0421416 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -62,12 +62,12 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 2 ) { + && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } - //System.out.println("Sum: " + sum); - //System.out.println("Value: " + value); - //System.out.println("Counter: " + counter); + System.out.println("Sum: " + sum); + System.out.println("Value: " + value); + System.out.println("Counter: " + counter); } From 7a9b63403b33d5c0412526478b089688daa82dc7 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:23:10 +0300 Subject: [PATCH 29/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 386f501..3f5d858 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -146,3 +146,6 @@ EditAction 1475155308795 RomanNumerals.java 1369 1 4 0 UnitTestCaseAction 1475155310393 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155310394 TestRomanNumerals.java FAIL EditAction 1475155321907 RomanNumerals.java 1363 1 4 0 +UnitTestCaseAction 1475155323512 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155323513 TestRomanNumerals.java FAIL +EditAction 1475155389471 RomanNumerals.java 1364 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0421416..8923a90 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -52,12 +52,13 @@ public int convertToInteger(String romanNum) { } sum = sum + value; - if(lastValue == value || i == 0) { + if(lastValue != value || i == 0) { lastValue = value; - counter++; + counter = 0; + } else { lastValue = value; - counter = 0; + counter++; } if((value == 1 || value == 10 From d3911e65dbf1b7480efe2a7450d05fcddcfc705a Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:29:35 +0300 Subject: [PATCH 30/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 3f5d858..f65ba9b 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -149,3 +149,6 @@ EditAction 1475155321907 RomanNumerals.java 1363 1 4 0 UnitTestCaseAction 1475155323512 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155323513 TestRomanNumerals.java FAIL EditAction 1475155389471 RomanNumerals.java 1364 1 4 0 +UnitTestCaseAction 1475155391164 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155391165 TestRomanNumerals.java FAIL +EditAction 1475155774870 RomanNumerals.java 1360 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 8923a90..7194379 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -51,21 +51,27 @@ public int convertToInteger(String romanNum) { throw new IllegalArgumentException("Something went horribly wrong"); } - sum = sum + value; - if(lastValue != value || i == 0) { - lastValue = value; - counter = 0; - } else { + + if(i == 0) { lastValue = value; - counter++; } + if(value != lastValue) { + counter = 0; + } + + if((value == 1 || value == 10 || value == 100 || value == 1000) && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } + + + sum = sum + value; + counter++; + System.out.println("Sum: " + sum); System.out.println("Value: " + value); System.out.println("Counter: " + counter); From e69db5e7b2c84844db4b34313d121f689f318fc3 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:29:49 +0300 Subject: [PATCH 31/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index f65ba9b..e04e64f 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -152,3 +152,6 @@ EditAction 1475155389471 RomanNumerals.java 1364 1 4 0 UnitTestCaseAction 1475155391164 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155391165 TestRomanNumerals.java FAIL EditAction 1475155774870 RomanNumerals.java 1360 1 4 0 +UnitTestCaseAction 1475155776247 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155776248 TestRomanNumerals.java FAIL +EditAction 1475155789199 RomanNumerals.java 1360 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7194379..4d8ed6b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -64,7 +64,7 @@ public int convertToInteger(String romanNum) { if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 3 ) { + && counter == 2 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } From 77b9b86e8e2df31fafb1009e2abb8064521fe44d Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:30:54 +0300 Subject: [PATCH 32/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index e04e64f..f29e13f 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -155,3 +155,6 @@ EditAction 1475155774870 RomanNumerals.java 1360 1 4 0 UnitTestCaseAction 1475155776247 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155776248 TestRomanNumerals.java FAIL EditAction 1475155789199 RomanNumerals.java 1360 1 4 0 +UnitTestCaseAction 1475155790717 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155790718 TestRomanNumerals.java FAIL +EditAction 1475155854217 RomanNumerals.java 1305 1 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 4d8ed6b..be32d6b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -56,15 +56,10 @@ public int convertToInteger(String romanNum) { if(i == 0) { lastValue = value; } - - if(value != lastValue) { - counter = 0; - } - - + if((value == 1 || value == 10 || value == 100 || value == 1000) - && counter == 2 ) { + && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); } From 1f80420618cbaaa607dfcfb78cc4c6dc2118d3cc Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:32:34 +0300 Subject: [PATCH 33/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 5 + .../20160929143900661/besouroEpisodes.txt | 172 ++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20160929143900661/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 13 +- 5 files changed, 189 insertions(+), 3 deletions(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index f29e13f..b03ff49 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -158,3 +158,8 @@ EditAction 1475155789199 RomanNumerals.java 1360 1 4 0 UnitTestCaseAction 1475155790717 TestRomanNumerals.java FAIL UnitTestSessionAction 1475155790718 TestRomanNumerals.java FAIL EditAction 1475155854217 RomanNumerals.java 1305 1 4 0 +UnitTestCaseAction 1475155855809 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155855810 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475155896707 TestRomanNumerals.java OK +UnitTestSessionAction 1475155896708 TestRomanNumerals.java OK +EditAction 1475155954493 RomanNumerals.java 1368 1 7 0 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt index 59114fd..eac4771 100644 --- a/.besouro/20160929143900661/besouroEpisodes.txt +++ b/.besouro/20160929143900661/besouroEpisodes.txt @@ -6,3 +6,175 @@ 1475153226978 test-first 3 2734 true 1475153265623 test-addition 1 18 true 1475153265624 test-addition 1 18 true +1475155896708 test-first 3 2581 true +1475155896709 test-first 3 2581 true +1475155896710 test-first 3 2581 true +1475155896711 test-first 3 2581 true +1475155896712 test-first 3 2581 true +1475155896713 test-first 3 2581 true +1475155896714 test-first 3 2581 true +1475155896715 test-first 3 2581 true +1475155896716 test-first 3 2581 true +1475155896717 test-first 3 2581 true +1475155896718 test-first 3 2581 true +1475155896719 test-first 3 2581 true +1475155896720 test-first 3 2581 true +1475155896721 test-first 3 2581 true +1475155896722 test-first 3 2581 true +1475155896723 test-first 3 2581 true +1475155896724 test-first 3 2581 true +1475155896725 test-first 3 2581 true +1475155896726 test-first 3 2581 true +1475155896727 test-first 3 2581 true +1475155896728 test-first 3 2581 true +1475155896729 test-first 3 2581 true +1475155896730 test-first 3 2581 true +1475155896731 test-first 3 2581 true +1475155896732 test-first 3 2581 true +1475155896733 test-first 3 2581 true +1475155896734 test-first 3 2581 true +1475155896735 test-first 3 2581 true +1475155896736 test-first 3 2581 true +1475155896737 test-first 3 2581 true +1475155896738 test-first 3 2581 true +1475155896739 test-first 3 2581 true +1475155896740 test-first 3 2581 true +1475155896741 test-first 3 2581 true +1475155896742 test-first 3 2581 true +1475155896743 test-first 3 2581 true +1475155896744 test-first 3 2581 true +1475155896745 test-first 3 2581 true +1475155896746 test-first 3 2581 true +1475155896747 test-first 3 2581 true +1475155896748 test-first 3 2581 true +1475155896749 test-first 3 2581 true +1475155896750 test-first 3 2581 true +1475155896751 test-first 3 2581 true +1475155896752 test-first 3 2581 true +1475155896753 test-first 3 2581 true +1475155896754 test-first 3 2581 true +1475155896755 test-first 3 2581 true +1475155896756 test-first 3 2581 true +1475155896757 test-first 3 2581 true +1475155896758 test-first 3 2581 true +1475155896759 test-first 3 2581 true +1475155896760 test-first 3 2581 true +1475155896761 test-first 3 2581 true +1475155896762 test-first 3 2581 true +1475155896763 test-first 3 2581 true +1475155896764 test-first 3 2581 true +1475155896765 test-first 3 2581 true +1475155896766 test-first 3 2581 true +1475155896767 test-first 3 2581 true +1475155896768 test-first 3 2581 true +1475155896769 test-first 3 2581 true +1475155896770 test-first 3 2581 true +1475155896771 test-first 3 2581 true +1475155896772 test-first 3 2581 true +1475155896773 test-first 3 2581 true +1475155896774 test-first 3 2581 true +1475155896775 test-first 3 2581 true +1475155896776 test-first 3 2581 true +1475155896777 test-first 3 2581 true +1475155896778 test-first 3 2581 true +1475155896779 test-first 3 2581 true +1475155896780 test-first 3 2581 true +1475155896781 test-first 3 2581 true +1475155896782 test-first 3 2581 true +1475155896783 test-first 3 2581 true +1475155896784 test-first 3 2581 true +1475155896785 test-first 3 2581 true +1475155896786 test-first 3 2581 true +1475155896787 test-first 3 2581 true +1475155896788 test-first 3 2581 true +1475155896789 test-first 3 2581 true +1475155896790 test-first 3 2581 true +1475155896791 test-first 3 2581 true +1475155896792 test-first 3 2581 true +1475155896793 test-first 3 2581 true +1475155896794 test-first 3 2581 true +1475155896795 test-first 3 2581 true +1475155896796 test-first 3 2581 true +1475155896797 test-first 3 2581 true +1475155896798 test-first 3 2581 true +1475155896799 test-first 3 2581 true +1475155896800 test-first 3 2581 true +1475155896801 test-first 3 2581 true +1475155896802 test-first 3 2581 true +1475155896803 test-first 3 2581 true +1475155896804 test-first 3 2581 true +1475155896805 test-first 3 2581 true +1475155896806 test-first 3 2581 true +1475155896807 test-first 3 2581 true +1475155896808 test-first 3 2581 true +1475155896809 test-first 3 2581 true +1475155896810 test-first 3 2581 true +1475155896811 test-first 3 2581 true +1475155896812 test-first 3 2581 true +1475155896813 test-first 3 2581 true +1475155896814 test-first 3 2581 true +1475155896815 test-first 3 2581 true +1475155896816 test-first 3 2581 true +1475155896817 test-first 3 2581 true +1475155896818 test-first 3 2581 true +1475155896819 test-first 3 2581 true +1475155896820 test-first 3 2581 true +1475155896821 test-first 3 2581 true +1475155896822 test-first 3 2581 true +1475155896823 test-first 3 2581 true +1475155896824 test-first 3 2581 true +1475155896825 test-first 3 2581 true +1475155896826 test-first 3 2581 true +1475155896827 test-first 3 2581 true +1475155896828 test-first 3 2581 true +1475155896829 test-first 3 2581 true +1475155896830 test-first 3 2581 true +1475155896831 test-first 3 2581 true +1475155896832 test-first 3 2581 true +1475155896833 test-first 3 2581 true +1475155896834 test-first 3 2581 true +1475155896835 test-first 3 2581 true +1475155896836 test-first 3 2581 true +1475155896837 test-first 3 2581 true +1475155896838 test-first 3 2581 true +1475155896839 test-first 3 2581 true +1475155896840 test-first 3 2581 true +1475155896841 test-first 3 2581 true +1475155896842 test-first 3 2581 true +1475155896843 test-first 3 2581 true +1475155896844 test-first 3 2581 true +1475155896845 test-first 3 2581 true +1475155896846 test-first 3 2581 true +1475155896847 test-first 3 2581 true +1475155896848 test-first 3 2581 true +1475155896849 test-first 3 2581 true +1475155896850 test-first 3 2581 true +1475155896851 test-first 3 2581 true +1475155896852 test-first 3 2581 true +1475155896853 test-first 3 2581 true +1475155896854 test-first 3 2581 true +1475155896855 test-first 3 2581 true +1475155896856 test-first 3 2581 true +1475155896857 test-first 3 2581 true +1475155896858 test-first 3 2581 true +1475155896859 test-first 3 2581 true +1475155896860 test-first 3 2581 true +1475155896861 test-first 3 2581 true +1475155896862 test-first 3 2581 true +1475155896863 test-first 3 2581 true +1475155896864 test-first 3 2581 true +1475155896865 test-first 3 2581 true +1475155896866 test-first 3 2581 true +1475155896867 test-first 3 2581 true +1475155896868 test-first 3 2581 true +1475155896869 test-first 3 2581 true +1475155896870 test-first 3 2581 true +1475155896871 test-first 3 2581 true +1475155896872 test-first 3 2581 true +1475155896873 test-first 3 2581 true +1475155896874 test-first 3 2581 true +1475155896875 test-first 3 2581 true +1475155896876 test-first 3 2581 true +1475155896877 test-first 3 2581 true +1475155896878 test-first 3 2581 true +1475155896879 test-first 3 2581 true diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt index 4e4e41c..0dcdaa6 100644 --- a/.besouro/20160929143900661/randomHeuristicEpisodes.txt +++ b/.besouro/20160929143900661/randomHeuristicEpisodes.txt @@ -2,3 +2,4 @@ 1475150483391 test-first 4 1174 true 1475153226976 test-first 3 2734 true 1475153265623 test-addition 1 18 true +1475155896708 test-first 3 2581 true diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt index 55c31d4..c272072 100644 --- a/.besouro/20160929143900661/zorroEpisodes.txt +++ b/.besouro/20160929143900661/zorroEpisodes.txt @@ -2,3 +2,4 @@ 1475150483391 test-first 4 1184 true 1475153226976 test-first 3 2743 true 1475153265623 test-addition 1 38 true +1475155896708 test-first 3 2631 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index be32d6b..5c3ca58 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -10,12 +10,15 @@ public int convertToInteger(String romanNum) { } int sum = 0; + int counter = 0; + int lastValue = 0; + int value = 0; for(int i = 0; i < romanNum.length(); i++) { char roman = romanNum.charAt(i); - int value = 0; - int lastValue = 0; - int counter = 0; + + + switch(roman) { @@ -56,6 +59,10 @@ public int convertToInteger(String romanNum) { if(i == 0) { lastValue = value; } + + if(lastValue != value) { + counter = 0; + } if((value == 1 || value == 10 || value == 100 || value == 1000) From fde05f3725bcd41e9ccff7e945921cee9abd4e80 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:35:07 +0300 Subject: [PATCH 34/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 6 ++++++ .besouro/20160929143900661/besouroEpisodes.txt | 1 + .besouro/20160929143900661/randomHeuristicEpisodes.txt | 1 + .besouro/20160929143900661/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 10 +++++++++- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index b03ff49..47b1d41 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -163,3 +163,9 @@ UnitTestSessionAction 1475155855810 TestRomanNumerals.java FAIL UnitTestCaseAction 1475155896707 TestRomanNumerals.java OK UnitTestSessionAction 1475155896708 TestRomanNumerals.java OK EditAction 1475155954493 RomanNumerals.java 1368 1 7 0 +UnitTestCaseAction 1475155957257 TestRomanNumerals.java OK +UnitTestSessionAction 1475155957258 TestRomanNumerals.java OK +RefactoringAction 1475155982645 TestRomanNumerals.java ADD void convertIIII()/2 METHOD +RefactoringAction 1475155990171 TestRomanNumerals.java RENAME convertIIII()/2=>void convertIIVV() METHOD +RefactoringAction 1475155992188 TestRomanNumerals.java RENAME convertIIVV()=>void convertVV() METHOD +EditAction 1475156107160 TestRomanNumerals.java 1623 7 18 5 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt index eac4771..8e80c36 100644 --- a/.besouro/20160929143900661/besouroEpisodes.txt +++ b/.besouro/20160929143900661/besouroEpisodes.txt @@ -178,3 +178,4 @@ 1475155896877 test-first 3 2581 true 1475155896878 test-first 3 2581 true 1475155896879 test-first 3 2581 true +1475155957258 production 1 2 false diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt index 0dcdaa6..54c67af 100644 --- a/.besouro/20160929143900661/randomHeuristicEpisodes.txt +++ b/.besouro/20160929143900661/randomHeuristicEpisodes.txt @@ -3,3 +3,4 @@ 1475153226976 test-first 3 2734 true 1475153265623 test-addition 1 18 true 1475155896708 test-first 3 2581 true +1475155957258 production 1 2 false diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt index c272072..d2e5e9f 100644 --- a/.besouro/20160929143900661/zorroEpisodes.txt +++ b/.besouro/20160929143900661/zorroEpisodes.txt @@ -3,3 +3,4 @@ 1475153226976 test-first 3 2743 true 1475153265623 test-addition 1 38 true 1475155896708 test-first 3 2631 true +1475155957258 production 1 60 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 573de6d..de3c0d4 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -42,10 +42,18 @@ public void convertIII() { @Test public void convertIIII() throws IllegalArgumentException { expectedEx.expect(IllegalArgumentException.class); - //expectedEx.expectMessage("This roman number can't be repeated over three times in a row"); + expectedEx.expectMessage("This roman number can't be repeated over three times in a row"); RomanNumerals romanNumerals = new RomanNumerals(); romanNumerals.convertToInteger("IIII"); } + + @Test + public void convertVV() throws IllegalArgumentException { + expectedEx.expect(IllegalArgumentException.class); + expectedEx.expectMessage("This roman number can't be repeated"); + RomanNumerals romanNumerals = new RomanNumerals(); + romanNumerals.convertToInteger("VV"); + } From e92408f694e6fcdaa9b1ce22943caf59d7a475aa Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:35:09 +0300 Subject: [PATCH 35/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 1 + src/RomanNumerals.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 47b1d41..bbf5cbd 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -169,3 +169,4 @@ RefactoringAction 1475155982645 TestRomanNumerals.java ADD void convertIIII()/2 RefactoringAction 1475155990171 TestRomanNumerals.java RENAME convertIIII()/2=>void convertIIVV() METHOD RefactoringAction 1475155992188 TestRomanNumerals.java RENAME convertIIVV()=>void convertVV() METHOD EditAction 1475156107160 TestRomanNumerals.java 1623 7 18 5 +EditAction 1475156109197 RomanNumerals.java 1535 1 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 5c3ca58..e27fd30 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -68,7 +68,12 @@ public int convertToInteger(String romanNum) { || value == 100 || value == 1000) && counter == 3 ) { throw new IllegalArgumentException("This roman number can't be repeated over three times in a row"); - } + } + + if((value == 5 || value == 50 || value == 500) + && lastValue == value) { + throw new IllegalArgumentException("This roman number can't be repeated"); + } sum = sum + value; From daa5074dd93e8295196b6961e31da73af64f37cf Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:42:38 +0300 Subject: [PATCH 36/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 5 +++++ .besouro/20160929143900661/besouroEpisodes.txt | 1 + .besouro/20160929143900661/randomHeuristicEpisodes.txt | 1 + .besouro/20160929143900661/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 6 ++++++ 5 files changed, 14 insertions(+) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index bbf5cbd..4bd7fc7 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -170,3 +170,8 @@ RefactoringAction 1475155990171 TestRomanNumerals.java RENAME convertIIII()/2=>v RefactoringAction 1475155992188 TestRomanNumerals.java RENAME convertIIVV()=>void convertVV() METHOD EditAction 1475156107160 TestRomanNumerals.java 1623 7 18 5 EditAction 1475156109197 RomanNumerals.java 1535 1 7 0 +UnitTestCaseAction 1475156110655 TestRomanNumerals.java OK +UnitTestSessionAction 1475156110656 TestRomanNumerals.java OK +RefactoringAction 1475156542305 TestRomanNumerals.java ADD void convertIII()/2 METHOD +RefactoringAction 1475156545818 TestRomanNumerals.java RENAME convertIII()/2=>void convertIX() METHOD +EditAction 1475156557901 TestRomanNumerals.java 1777 8 20 6 diff --git a/.besouro/20160929143900661/besouroEpisodes.txt b/.besouro/20160929143900661/besouroEpisodes.txt index 8e80c36..7594a04 100644 --- a/.besouro/20160929143900661/besouroEpisodes.txt +++ b/.besouro/20160929143900661/besouroEpisodes.txt @@ -179,3 +179,4 @@ 1475155896878 test-first 3 2581 true 1475155896879 test-first 3 2581 true 1475155957258 production 1 2 false +1475156110656 test-first 4 128 true diff --git a/.besouro/20160929143900661/randomHeuristicEpisodes.txt b/.besouro/20160929143900661/randomHeuristicEpisodes.txt index 54c67af..e9d5e60 100644 --- a/.besouro/20160929143900661/randomHeuristicEpisodes.txt +++ b/.besouro/20160929143900661/randomHeuristicEpisodes.txt @@ -4,3 +4,4 @@ 1475153265623 test-addition 1 18 true 1475155896708 test-first 3 2581 true 1475155957258 production 1 2 false +1475156110656 test-first 4 128 true diff --git a/.besouro/20160929143900661/zorroEpisodes.txt b/.besouro/20160929143900661/zorroEpisodes.txt index d2e5e9f..974a735 100644 --- a/.besouro/20160929143900661/zorroEpisodes.txt +++ b/.besouro/20160929143900661/zorroEpisodes.txt @@ -4,3 +4,4 @@ 1475153265623 test-addition 1 38 true 1475155896708 test-first 3 2631 true 1475155957258 production 1 60 true +1475156110656 test-first 4 153 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index de3c0d4..f3f394d 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -54,6 +54,12 @@ public void convertVV() throws IllegalArgumentException { RomanNumerals romanNumerals = new RomanNumerals(); romanNumerals.convertToInteger("VV"); } + + @Test + public void convertIX() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("9", 9, romanNumerals.convertToInteger("IX")); + } From 3b8dd42e99e97489466d1f756fa0df4ae7de08f8 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:42:39 +0300 Subject: [PATCH 37/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 1 + src/RomanNumerals.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 4bd7fc7..96be28e 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -175,3 +175,4 @@ UnitTestSessionAction 1475156110656 TestRomanNumerals.java OK RefactoringAction 1475156542305 TestRomanNumerals.java ADD void convertIII()/2 METHOD RefactoringAction 1475156545818 TestRomanNumerals.java RENAME convertIII()/2=>void convertIX() METHOD EditAction 1475156557901 TestRomanNumerals.java 1777 8 20 6 +EditAction 1475156559071 RomanNumerals.java 1638 1 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e27fd30..94e5285 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -74,6 +74,10 @@ public int convertToInteger(String romanNum) { && lastValue == value) { throw new IllegalArgumentException("This roman number can't be repeated"); } + + if(((value == 5 || value == 10) && lastValue == 1)) { + sum = sum + (value - lastValue); + } sum = sum + value; From 4881614f35cd1cbaaa1cbecb45e8d178905dbdd3 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:43:28 +0300 Subject: [PATCH 38/56] besouro automatic message --- .besouro/20160929143900661/actions.txt | 3 +++ src/RomanNumerals.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index 96be28e..e021054 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -176,3 +176,6 @@ RefactoringAction 1475156542305 TestRomanNumerals.java ADD void convertIII()/2 M RefactoringAction 1475156545818 TestRomanNumerals.java RENAME convertIII()/2=>void convertIX() METHOD EditAction 1475156557901 TestRomanNumerals.java 1777 8 20 6 EditAction 1475156559071 RomanNumerals.java 1638 1 7 0 +UnitTestCaseAction 1475156560605 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475156560606 TestRomanNumerals.java FAIL +EditAction 1475156608153 RomanNumerals.java 1649 1 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 94e5285..520aaeb 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -79,8 +79,9 @@ public int convertToInteger(String romanNum) { sum = sum + (value - lastValue); } - + else { sum = sum + value; + } counter++; System.out.println("Sum: " + sum); From fa382af654796225cce99b56983908b424447faa Mon Sep 17 00:00:00 2001 From: skorkko Date: Thu, 29 Sep 2016 16:45:17 +0300 Subject: [PATCH 39/56] done --- .besouro/20160929143900661/actions.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.besouro/20160929143900661/actions.txt b/.besouro/20160929143900661/actions.txt index e021054..a20e2d7 100644 --- a/.besouro/20160929143900661/actions.txt +++ b/.besouro/20160929143900661/actions.txt @@ -179,3 +179,5 @@ EditAction 1475156559071 RomanNumerals.java 1638 1 7 0 UnitTestCaseAction 1475156560605 TestRomanNumerals.java FAIL UnitTestSessionAction 1475156560606 TestRomanNumerals.java FAIL EditAction 1475156608153 RomanNumerals.java 1649 1 7 0 +UnitTestCaseAction 1475156609689 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475156609690 TestRomanNumerals.java FAIL From 6018595e7d940664af363365041471ca54246c24 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 14:40:52 +0300 Subject: [PATCH 40/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 4 ++++ .besouro/20161006143245985/besouroEpisodes.txt | 0 .besouro/20161006143245985/disagreements.txt | 0 .../20161006143245985/randomHeuristicEpisodes.txt | 0 .besouro/20161006143245985/userComments.txt | 0 .besouro/20161006143245985/zorroEpisodes.txt | 0 src/RomanNumerals.java | 12 +++++------- 7 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 .besouro/20161006143245985/actions.txt create mode 100644 .besouro/20161006143245985/besouroEpisodes.txt create mode 100644 .besouro/20161006143245985/disagreements.txt create mode 100644 .besouro/20161006143245985/randomHeuristicEpisodes.txt create mode 100644 .besouro/20161006143245985/userComments.txt create mode 100644 .besouro/20161006143245985/zorroEpisodes.txt diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt new file mode 100644 index 0000000..6b282ea --- /dev/null +++ b/.besouro/20161006143245985/actions.txt @@ -0,0 +1,4 @@ +FileOpenedAction 1475753566234 TestRomanNumerals.java 1777 8 20 6 +UnitTestCaseAction 1475753609018 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475753609018 TestRomanNumerals.java FAIL +EditAction 1475754051533 RomanNumerals.java 1673 1 7 0 diff --git a/.besouro/20161006143245985/besouroEpisodes.txt b/.besouro/20161006143245985/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006143245985/disagreements.txt b/.besouro/20161006143245985/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006143245985/randomHeuristicEpisodes.txt b/.besouro/20161006143245985/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006143245985/userComments.txt b/.besouro/20161006143245985/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006143245985/zorroEpisodes.txt b/.besouro/20161006143245985/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 520aaeb..e4e69a2 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -15,11 +15,7 @@ public int convertToInteger(String romanNum) { int value = 0; for(int i = 0; i < romanNum.length(); i++) { - char roman = romanNum.charAt(i); - - - - + char roman = romanNum.charAt(i); switch(roman) { case 'I': @@ -54,7 +50,6 @@ public int convertToInteger(String romanNum) { throw new IllegalArgumentException("Something went horribly wrong"); } - if(i == 0) { lastValue = value; @@ -76,7 +71,10 @@ public int convertToInteger(String romanNum) { } if(((value == 5 || value == 10) && lastValue == 1)) { - sum = sum + (value - lastValue); + value = value - lastValue; + sum = sum + value; + lastValue = value; + } else { From 49dbce6f99f376bf06a41c04032f0db140883110 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 14:42:41 +0300 Subject: [PATCH 41/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 3 +++ src/RomanNumerals.java | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 6b282ea..e4351b9 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -2,3 +2,6 @@ FileOpenedAction 1475753566234 TestRomanNumerals.java 1777 8 20 6 UnitTestCaseAction 1475753609018 TestRomanNumerals.java FAIL UnitTestSessionAction 1475753609018 TestRomanNumerals.java FAIL EditAction 1475754051533 RomanNumerals.java 1673 1 7 0 +UnitTestCaseAction 1475754053861 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475754053861 TestRomanNumerals.java FAIL +EditAction 1475754160830 RomanNumerals.java 1680 1 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e4e69a2..fad624e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -71,10 +71,9 @@ public int convertToInteger(String romanNum) { } if(((value == 5 || value == 10) && lastValue == 1)) { - value = value - lastValue; + value = value - lastValue - lastValue; sum = sum + value; lastValue = value; - } else { From 9e6aba2a3f1890805b6736f256383472fb9b3880 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 14:43:41 +0300 Subject: [PATCH 42/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 5 +++++ .besouro/20161006143245985/besouroEpisodes.txt | 1 + .besouro/20161006143245985/randomHeuristicEpisodes.txt | 1 + .besouro/20161006143245985/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 6 ++++++ 5 files changed, 14 insertions(+) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index e4351b9..791b4f0 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -5,3 +5,8 @@ EditAction 1475754051533 RomanNumerals.java 1673 1 7 0 UnitTestCaseAction 1475754053861 TestRomanNumerals.java FAIL UnitTestSessionAction 1475754053861 TestRomanNumerals.java FAIL EditAction 1475754160830 RomanNumerals.java 1680 1 7 0 +UnitTestCaseAction 1475754162538 TestRomanNumerals.java OK +UnitTestSessionAction 1475754162538 TestRomanNumerals.java OK +RefactoringAction 1475754207482 TestRomanNumerals.java ADD void convertIX()/2 METHOD +RefactoringAction 1475754210087 TestRomanNumerals.java RENAME convertIX()/2=>void convertIV() METHOD +EditAction 1475754221007 TestRomanNumerals.java 1931 9 22 7 diff --git a/.besouro/20161006143245985/besouroEpisodes.txt b/.besouro/20161006143245985/besouroEpisodes.txt index e69de29..b99e583 100644 --- a/.besouro/20161006143245985/besouroEpisodes.txt +++ b/.besouro/20161006143245985/besouroEpisodes.txt @@ -0,0 +1 @@ +1475754162538 refactoring 2A 596 true diff --git a/.besouro/20161006143245985/randomHeuristicEpisodes.txt b/.besouro/20161006143245985/randomHeuristicEpisodes.txt index e69de29..1fc3b23 100644 --- a/.besouro/20161006143245985/randomHeuristicEpisodes.txt +++ b/.besouro/20161006143245985/randomHeuristicEpisodes.txt @@ -0,0 +1 @@ +1475754162538 refactoring 2A 596 false diff --git a/.besouro/20161006143245985/zorroEpisodes.txt b/.besouro/20161006143245985/zorroEpisodes.txt index e69de29..1fc3b23 100644 --- a/.besouro/20161006143245985/zorroEpisodes.txt +++ b/.besouro/20161006143245985/zorroEpisodes.txt @@ -0,0 +1 @@ +1475754162538 refactoring 2A 596 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index f3f394d..bc68a97 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -60,6 +60,12 @@ public void convertIX() { RomanNumerals romanNumerals = new RomanNumerals(); assertEquals("9", 9, romanNumerals.convertToInteger("IX")); } + + @Test + public void convertIV() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("4", 4, romanNumerals.convertToInteger("IV")); + } From 0465c55aff35554795bf8e8f96fe407d9c775005 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 14:50:47 +0300 Subject: [PATCH 43/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 7 +++++++ .besouro/20161006143245985/besouroEpisodes.txt | 2 ++ .besouro/20161006143245985/randomHeuristicEpisodes.txt | 1 + .besouro/20161006143245985/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 6 ++++-- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 791b4f0..c8c40a0 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -10,3 +10,10 @@ UnitTestSessionAction 1475754162538 TestRomanNumerals.java OK RefactoringAction 1475754207482 TestRomanNumerals.java ADD void convertIX()/2 METHOD RefactoringAction 1475754210087 TestRomanNumerals.java RENAME convertIX()/2=>void convertIV() METHOD EditAction 1475754221007 TestRomanNumerals.java 1931 9 22 7 +UnitTestCaseAction 1475754222945 TestRomanNumerals.java OK +UnitTestSessionAction 1475754222945 TestRomanNumerals.java OK +RefactoringAction 1475754574164 TestRomanNumerals.java ADD void convertIV()/2 METHOD +RefactoringAction 1475754597860 TestRomanNumerals.java RENAME convertIV()/2=>void convertXC() METHOD +RefactoringAction 1475754619591 TestRomanNumerals.java RENAME convertIV()=>void convert() METHOD +RefactoringAction 1475754632477 TestRomanNumerals.java RENAME convert()=>void convertCD() METHOD +EditAction 1475754646674 RomanNumerals.java 1804 1 7 0 diff --git a/.besouro/20161006143245985/besouroEpisodes.txt b/.besouro/20161006143245985/besouroEpisodes.txt index b99e583..4d9e8d1 100644 --- a/.besouro/20161006143245985/besouroEpisodes.txt +++ b/.besouro/20161006143245985/besouroEpisodes.txt @@ -1 +1,3 @@ 1475754162538 refactoring 2A 596 true +1475754222945 test-addition 1 15 true +1475754222946 test-addition 1 15 true diff --git a/.besouro/20161006143245985/randomHeuristicEpisodes.txt b/.besouro/20161006143245985/randomHeuristicEpisodes.txt index 1fc3b23..56ca10b 100644 --- a/.besouro/20161006143245985/randomHeuristicEpisodes.txt +++ b/.besouro/20161006143245985/randomHeuristicEpisodes.txt @@ -1 +1,2 @@ 1475754162538 refactoring 2A 596 false +1475754222945 test-addition 1 15 true diff --git a/.besouro/20161006143245985/zorroEpisodes.txt b/.besouro/20161006143245985/zorroEpisodes.txt index 1fc3b23..3f242bd 100644 --- a/.besouro/20161006143245985/zorroEpisodes.txt +++ b/.besouro/20161006143245985/zorroEpisodes.txt @@ -1 +1,2 @@ 1475754162538 refactoring 2A 596 false +1475754222945 test-addition 1 60 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index fad624e..1c63b98 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -70,11 +70,13 @@ public int convertToInteger(String romanNum) { throw new IllegalArgumentException("This roman number can't be repeated"); } - if(((value == 5 || value == 10) && lastValue == 1)) { + if(((value == 5 || value == 10) && lastValue == 1) + || ((value == 50 || value == 100) && lastValue == 10) + || ((value == 500 || value == 1000) && lastValue == 100)) { value = value - lastValue - lastValue; sum = sum + value; lastValue = value; - } + } else { sum = sum + value; From c73786d79d08305d80e71e7cb8a7d0763a5cca79 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 14:50:48 +0300 Subject: [PATCH 44/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 1 + tests/TestRomanNumerals.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index c8c40a0..87e1737 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -17,3 +17,4 @@ RefactoringAction 1475754597860 TestRomanNumerals.java RENAME convertIV()/2=>voi RefactoringAction 1475754619591 TestRomanNumerals.java RENAME convertIV()=>void convert() METHOD RefactoringAction 1475754632477 TestRomanNumerals.java RENAME convert()=>void convertCD() METHOD EditAction 1475754646674 RomanNumerals.java 1804 1 7 0 +EditAction 1475754648296 TestRomanNumerals.java 2091 10 24 8 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index bc68a97..1b4ff5a 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -62,9 +62,15 @@ public void convertIX() { } @Test - public void convertIV() { + public void convertXC() { RomanNumerals romanNumerals = new RomanNumerals(); - assertEquals("4", 4, romanNumerals.convertToInteger("IV")); + assertEquals("90", 90, romanNumerals.convertToInteger("XC")); + } + + @Test + public void convertCD() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("400", 400, romanNumerals.convertToInteger("CD")); } From 7109451b104ffed1b5cf5157ae412f66ed3b14c5 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:01:20 +0300 Subject: [PATCH 45/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 7 +++++++ .besouro/20161006143245985/besouroEpisodes.txt | 2 ++ .besouro/20161006143245985/randomHeuristicEpisodes.txt | 1 + .besouro/20161006143245985/zorroEpisodes.txt | 5 +++-- tests/TestRomanNumerals.java | 9 +++++++++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 87e1737..fd6c345 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -18,3 +18,10 @@ RefactoringAction 1475754619591 TestRomanNumerals.java RENAME convertIV()=>void RefactoringAction 1475754632477 TestRomanNumerals.java RENAME convert()=>void convertCD() METHOD EditAction 1475754646674 RomanNumerals.java 1804 1 7 0 EditAction 1475754648296 TestRomanNumerals.java 2091 10 24 8 +UnitTestCaseAction 1475754650171 TestRomanNumerals.java OK +UnitTestSessionAction 1475754650171 TestRomanNumerals.java OK +RefactoringAction 1475754761676 TestRomanNumerals.java ADD void convertCD()/2 METHOD +RefactoringAction 1475754773193 TestRomanNumerals.java REMOVE convertCD()/2 METHOD +RefactoringAction 1475754805217 TestRomanNumerals.java ADD void convertIIII()/2 METHOD +RefactoringAction 1475754809769 TestRomanNumerals.java RENAME convertIIII()/2=>void convertXXC() METHOD +EditAction 1475755280497 TestRomanNumerals.java 2371 11 28 8 diff --git a/.besouro/20161006143245985/besouroEpisodes.txt b/.besouro/20161006143245985/besouroEpisodes.txt index 4d9e8d1..0e90100 100644 --- a/.besouro/20161006143245985/besouroEpisodes.txt +++ b/.besouro/20161006143245985/besouroEpisodes.txt @@ -1,3 +1,5 @@ 1475754162538 refactoring 2A 596 true 1475754222945 test-addition 1 15 true 1475754222946 test-addition 1 15 true +1475754650171 test-first 4 76 true +1475754650172 test-last 1 76 false diff --git a/.besouro/20161006143245985/randomHeuristicEpisodes.txt b/.besouro/20161006143245985/randomHeuristicEpisodes.txt index 56ca10b..1dd6e7a 100644 --- a/.besouro/20161006143245985/randomHeuristicEpisodes.txt +++ b/.besouro/20161006143245985/randomHeuristicEpisodes.txt @@ -1,2 +1,3 @@ 1475754162538 refactoring 2A 596 false 1475754222945 test-addition 1 15 true +1475754650171 test-first 4 76 true diff --git a/.besouro/20161006143245985/zorroEpisodes.txt b/.besouro/20161006143245985/zorroEpisodes.txt index 3f242bd..2e27989 100644 --- a/.besouro/20161006143245985/zorroEpisodes.txt +++ b/.besouro/20161006143245985/zorroEpisodes.txt @@ -1,2 +1,3 @@ -1475754162538 refactoring 2A 596 false -1475754222945 test-addition 1 60 false +1475754162538 refactoring 2A 596 true +1475754222945 test-addition 1 60 true +1475754650171 test-first 4 427 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 1b4ff5a..4e8b751 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -72,6 +72,15 @@ public void convertCD() { RomanNumerals romanNumerals = new RomanNumerals(); assertEquals("400", 400, romanNumerals.convertToInteger("CD")); } + + @Test + public void convertXXC() throws IllegalArgumentException { + expectedEx.expect(IllegalArgumentException.class); + expectedEx.expectMessage("Can't be subtstracted twice"); + RomanNumerals romanNumerals = new RomanNumerals(); + romanNumerals.convertToInteger("XXC"); + } + From 646207b1189f2934d7f6d81271b0860588afb6c5 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:03:14 +0300 Subject: [PATCH 46/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 3 +++ src/RomanNumerals.java | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index fd6c345..1d43362 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -25,3 +25,6 @@ RefactoringAction 1475754773193 TestRomanNumerals.java REMOVE convertCD()/2 METH RefactoringAction 1475754805217 TestRomanNumerals.java ADD void convertIIII()/2 METHOD RefactoringAction 1475754809769 TestRomanNumerals.java RENAME convertIIII()/2=>void convertXXC() METHOD EditAction 1475755280497 TestRomanNumerals.java 2371 11 28 8 +UnitTestCaseAction 1475755281958 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755281959 TestRomanNumerals.java FAIL +EditAction 1475755394217 RomanNumerals.java 1955 1 8 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1c63b98..14be7f2 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -12,7 +12,8 @@ public int convertToInteger(String romanNum) { int sum = 0; int counter = 0; int lastValue = 0; - int value = 0; + int value = 0; + boolean subtracted = false; for(int i = 0; i < romanNum.length(); i++) { char roman = romanNum.charAt(i); @@ -73,9 +74,13 @@ public int convertToInteger(String romanNum) { if(((value == 5 || value == 10) && lastValue == 1) || ((value == 50 || value == 100) && lastValue == 10) || ((value == 500 || value == 1000) && lastValue == 100)) { + if(subtracted) { + throw new IllegalArgumentException("Can't be subtstracted twice"); + } value = value - lastValue - lastValue; sum = sum + value; lastValue = value; + subtracted = true; } else { From bae9065a6204c80e6d8b97302ef37f7f21a067fe Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:05:42 +0300 Subject: [PATCH 47/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 3 +++ src/RomanNumerals.java | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 1d43362..b8c8cba 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -28,3 +28,6 @@ EditAction 1475755280497 TestRomanNumerals.java 2371 11 28 8 UnitTestCaseAction 1475755281958 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755281959 TestRomanNumerals.java FAIL EditAction 1475755394217 RomanNumerals.java 1955 1 8 0 +UnitTestCaseAction 1475755395749 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755395749 TestRomanNumerals.java FAIL +EditAction 1475755542139 RomanNumerals.java 1903 1 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 14be7f2..0bc14e3 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -13,7 +13,6 @@ public int convertToInteger(String romanNum) { int counter = 0; int lastValue = 0; int value = 0; - boolean subtracted = false; for(int i = 0; i < romanNum.length(); i++) { char roman = romanNum.charAt(i); @@ -74,13 +73,12 @@ public int convertToInteger(String romanNum) { if(((value == 5 || value == 10) && lastValue == 1) || ((value == 50 || value == 100) && lastValue == 10) || ((value == 500 || value == 1000) && lastValue == 100)) { - if(subtracted) { + if(counter > 1) { throw new IllegalArgumentException("Can't be subtstracted twice"); } value = value - lastValue - lastValue; sum = sum + value; lastValue = value; - subtracted = true; } else { From f109727f84d375485899272371d7ea838fe220c2 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:10:32 +0300 Subject: [PATCH 48/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 5 +++++ src/RomanNumerals.java | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index b8c8cba..5d2b065 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -31,3 +31,8 @@ EditAction 1475755394217 RomanNumerals.java 1955 1 8 0 UnitTestCaseAction 1475755395749 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755395749 TestRomanNumerals.java FAIL EditAction 1475755542139 RomanNumerals.java 1903 1 7 0 +UnitTestCaseAction 1475755544248 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755544248 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475755562504 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755562504 Rerun TestRomanNumerals.convertXXC FAIL +EditAction 1475755831696 RomanNumerals.java 1994 1 8 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0bc14e3..b4aa709 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -13,6 +13,7 @@ public int convertToInteger(String romanNum) { int counter = 0; int lastValue = 0; int value = 0; + boolean unlawfulSubtraction = false; for(int i = 0; i < romanNum.length(); i++) { char roman = romanNum.charAt(i); @@ -57,6 +58,8 @@ public int convertToInteger(String romanNum) { if(lastValue != value) { counter = 0; + } else { + unlawfulSubtraction = true; } if((value == 1 || value == 10 @@ -73,7 +76,7 @@ public int convertToInteger(String romanNum) { if(((value == 5 || value == 10) && lastValue == 1) || ((value == 50 || value == 100) && lastValue == 10) || ((value == 500 || value == 1000) && lastValue == 100)) { - if(counter > 1) { + if(unlawfulSubtraction) { throw new IllegalArgumentException("Can't be subtstracted twice"); } value = value - lastValue - lastValue; From b8ea0810d47f766cb7193b4a0fe2b866a8316a43 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:11:10 +0300 Subject: [PATCH 49/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 3 +++ src/RomanNumerals.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 5d2b065..250124c 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -36,3 +36,6 @@ UnitTestSessionAction 1475755544248 TestRomanNumerals.java FAIL UnitTestCaseAction 1475755562504 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755562504 Rerun TestRomanNumerals.convertXXC FAIL EditAction 1475755831696 RomanNumerals.java 1994 1 8 0 +UnitTestCaseAction 1475755833696 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755833696 TestRomanNumerals.java FAIL +EditAction 1475755870075 RomanNumerals.java 2024 1 8 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index b4aa709..9075630 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -58,9 +58,11 @@ public int convertToInteger(String romanNum) { if(lastValue != value) { counter = 0; - } else { - unlawfulSubtraction = true; + } else if(lastValue == value) { + + unlawfulSubtraction = true; } + if((value == 1 || value == 10 || value == 100 || value == 1000) From d65d5436e060dcd45af96b29c7c0a3b0218fceb8 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:11:48 +0300 Subject: [PATCH 50/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 250124c..f9f4134 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -39,3 +39,6 @@ EditAction 1475755831696 RomanNumerals.java 1994 1 8 0 UnitTestCaseAction 1475755833696 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755833696 TestRomanNumerals.java FAIL EditAction 1475755870075 RomanNumerals.java 2024 1 8 0 +UnitTestCaseAction 1475755871669 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755871669 TestRomanNumerals.java FAIL +EditAction 1475755907861 RomanNumerals.java 2040 1 8 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9075630..3459bf5 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -58,7 +58,7 @@ public int convertToInteger(String romanNum) { if(lastValue != value) { counter = 0; - } else if(lastValue == value) { + } else if(lastValue == value && counter == 1) { unlawfulSubtraction = true; } From 11cd631fb6982c2f7e8a5f4a2787427322d27bde Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:13:10 +0300 Subject: [PATCH 51/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 5 +++ .../20161006143245985/besouroEpisodes.txt | 36 +++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20161006143245985/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 3 +- 5 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index f9f4134..9c66093 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -42,3 +42,8 @@ EditAction 1475755870075 RomanNumerals.java 2024 1 8 0 UnitTestCaseAction 1475755871669 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755871669 TestRomanNumerals.java FAIL EditAction 1475755907861 RomanNumerals.java 2040 1 8 0 +UnitTestCaseAction 1475755909690 TestRomanNumerals.java OK +UnitTestSessionAction 1475755909690 TestRomanNumerals.java OK +RefactoringAction 1475755960249 TestRomanNumerals.java ADD void convertCD()/2 METHOD +RefactoringAction 1475755973182 TestRomanNumerals.java RENAME convertCD()/2=>void convertMCMLXXXIV() METHOD +EditAction 1475755989999 RomanNumerals.java 2037 1 8 0 diff --git a/.besouro/20161006143245985/besouroEpisodes.txt b/.besouro/20161006143245985/besouroEpisodes.txt index 0e90100..36f18b9 100644 --- a/.besouro/20161006143245985/besouroEpisodes.txt +++ b/.besouro/20161006143245985/besouroEpisodes.txt @@ -3,3 +3,39 @@ 1475754222946 test-addition 1 15 true 1475754650171 test-first 4 76 true 1475754650172 test-last 1 76 false +1475755909690 test-first 3 1148 true +1475755909691 test-first 3 1148 true +1475755909692 test-first 3 1148 true +1475755909693 test-first 3 1148 true +1475755909694 test-first 3 1148 true +1475755909695 test-first 3 1148 true +1475755909696 test-first 3 1148 true +1475755909697 test-first 3 1148 true +1475755909698 test-first 3 1148 true +1475755909699 test-first 3 1148 true +1475755909700 test-first 3 1148 true +1475755909701 test-first 3 1148 true +1475755909702 test-first 3 1148 true +1475755909703 test-first 3 1148 true +1475755909704 test-first 3 1148 true +1475755909705 test-first 3 1148 true +1475755909706 test-first 3 1148 true +1475755909707 test-first 3 1148 true +1475755909708 test-first 3 1148 true +1475755909709 test-first 3 1148 true +1475755909710 test-first 3 1148 true +1475755909711 test-first 3 1148 true +1475755909712 test-first 3 1148 true +1475755909713 test-first 3 1148 true +1475755909714 test-first 3 1148 true +1475755909715 test-first 3 1148 true +1475755909716 test-first 3 1148 true +1475755909717 test-first 3 1148 true +1475755909718 test-first 3 1148 true +1475755909719 test-first 3 1148 true +1475755909720 test-first 3 1148 true +1475755909721 test-first 3 1148 true +1475755909722 test-first 3 1148 true +1475755909723 test-first 3 1148 true +1475755909724 test-first 3 1148 true +1475755909725 test-first 3 1148 true diff --git a/.besouro/20161006143245985/randomHeuristicEpisodes.txt b/.besouro/20161006143245985/randomHeuristicEpisodes.txt index 1dd6e7a..cef9fe9 100644 --- a/.besouro/20161006143245985/randomHeuristicEpisodes.txt +++ b/.besouro/20161006143245985/randomHeuristicEpisodes.txt @@ -1,3 +1,4 @@ 1475754162538 refactoring 2A 596 false 1475754222945 test-addition 1 15 true 1475754650171 test-first 4 76 true +1475755909690 test-first 3 1148 true diff --git a/.besouro/20161006143245985/zorroEpisodes.txt b/.besouro/20161006143245985/zorroEpisodes.txt index 2e27989..56c28bb 100644 --- a/.besouro/20161006143245985/zorroEpisodes.txt +++ b/.besouro/20161006143245985/zorroEpisodes.txt @@ -1,3 +1,4 @@ 1475754162538 refactoring 2A 596 true 1475754222945 test-addition 1 60 true 1475754650171 test-first 4 427 true +1475755909690 test-first 3 1259 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3459bf5..88bf8e7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -59,8 +59,7 @@ public int convertToInteger(String romanNum) { if(lastValue != value) { counter = 0; } else if(lastValue == value && counter == 1) { - - unlawfulSubtraction = true; + unlawfulSubtraction = true; } From 9ed062dea843fddcc6465aade53498c1a6858b1c Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:13:12 +0300 Subject: [PATCH 52/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 1 + tests/TestRomanNumerals.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 9c66093..13d7106 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -47,3 +47,4 @@ UnitTestSessionAction 1475755909690 TestRomanNumerals.java OK RefactoringAction 1475755960249 TestRomanNumerals.java ADD void convertCD()/2 METHOD RefactoringAction 1475755973182 TestRomanNumerals.java RENAME convertCD()/2=>void convertMCMLXXXIV() METHOD EditAction 1475755989999 RomanNumerals.java 2037 1 8 0 +EditAction 1475755991559 TestRomanNumerals.java 2543 12 30 9 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 4e8b751..826c8b3 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -81,6 +81,11 @@ public void convertXXC() throws IllegalArgumentException { romanNumerals.convertToInteger("XXC"); } + @Test + public void convertMCMLXXXIV() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("1984", 1984, romanNumerals.convertToInteger("MCMLXXXIV")); + } From d5e6f48783c0fe2ac582ea8b513556b04697a1e0 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:13:58 +0300 Subject: [PATCH 53/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 5 +++++ tests/TestRomanNumerals.java | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 13d7106..17d9f6e 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -48,3 +48,8 @@ RefactoringAction 1475755960249 TestRomanNumerals.java ADD void convertCD()/2 ME RefactoringAction 1475755973182 TestRomanNumerals.java RENAME convertCD()/2=>void convertMCMLXXXIV() METHOD EditAction 1475755989999 RomanNumerals.java 2037 1 8 0 EditAction 1475755991559 TestRomanNumerals.java 2543 12 30 9 +UnitTestCaseAction 1475755993710 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755993710 TestRomanNumerals.java FAIL +RefactoringAction 1475756017469 TestRomanNumerals.java ADD void convertMCMLXXXIV()/2 METHOD +RefactoringAction 1475756025206 TestRomanNumerals.java RENAME convertMCMLXXXIV()/2=>void convertMMXIV() METHOD +EditAction 1475756038201 TestRomanNumerals.java 2709 13 32 10 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 826c8b3..c2d8819 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -86,6 +86,12 @@ public void convertMCMLXXXIV() { RomanNumerals romanNumerals = new RomanNumerals(); assertEquals("1984", 1984, romanNumerals.convertToInteger("MCMLXXXIV")); } + + @Test + public void convertMMXIV() { + RomanNumerals romanNumerals = new RomanNumerals(); + assertEquals("2014", 2014, romanNumerals.convertToInteger("MMXIV")); + } From a60ac7e1ed9ca8d3aa3398f44f098e5c665d56b5 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:21:02 +0300 Subject: [PATCH 54/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 5 +++++ src/RomanNumerals.java | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 17d9f6e..e21d7f9 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -53,3 +53,8 @@ UnitTestSessionAction 1475755993710 TestRomanNumerals.java FAIL RefactoringAction 1475756017469 TestRomanNumerals.java ADD void convertMCMLXXXIV()/2 METHOD RefactoringAction 1475756025206 TestRomanNumerals.java RENAME convertMCMLXXXIV()/2=>void convertMMXIV() METHOD EditAction 1475756038201 TestRomanNumerals.java 2709 13 32 10 +UnitTestCaseAction 1475756040045 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756040045 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756055742 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756055742 Rerun TestRomanNumerals.convertMMXIV FAIL +EditAction 1475756461452 RomanNumerals.java 2098 1 8 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 88bf8e7..500fc6a 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -74,6 +74,12 @@ public int convertToInteger(String romanNum) { throw new IllegalArgumentException("This roman number can't be repeated"); } + + System.out.println("Sum: " + sum); + System.out.println("Value: " + value); + //System.out.println("Counter: " + counter); + System.out.println("LastValue: " + lastValue); + if(((value == 5 || value == 10) && lastValue == 1) || ((value == 50 || value == 100) && lastValue == 10) || ((value == 500 || value == 1000) && lastValue == 100)) { @@ -90,9 +96,7 @@ public int convertToInteger(String romanNum) { } counter++; - System.out.println("Sum: " + sum); - System.out.println("Value: " + value); - System.out.println("Counter: " + counter); + } From 5e24a814de8b529dc092abe84294604d34613471 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:21:47 +0300 Subject: [PATCH 55/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 5 +++++ src/RomanNumerals.java | 1 + 2 files changed, 6 insertions(+) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index e21d7f9..735f023 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -58,3 +58,8 @@ UnitTestSessionAction 1475756040045 TestRomanNumerals.java FAIL UnitTestCaseAction 1475756055742 TestRomanNumerals.java FAIL UnitTestSessionAction 1475756055742 Rerun TestRomanNumerals.convertMMXIV FAIL EditAction 1475756461452 RomanNumerals.java 2098 1 8 0 +UnitTestCaseAction 1475756463621 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756463621 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756471036 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756471036 Rerun TestRomanNumerals.convertMMXIV FAIL +EditAction 1475756506636 RomanNumerals.java 2120 1 8 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 500fc6a..215a1a1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -93,6 +93,7 @@ public int convertToInteger(String romanNum) { else { sum = sum + value; + lastValue = value; } counter++; From 254f2325c054810008b26e40852b56591a1f9b88 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:23:21 +0300 Subject: [PATCH 56/56] besouro automatic message --- .besouro/20161006143245985/actions.txt | 5 +++++ src/RomanNumerals.java | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.besouro/20161006143245985/actions.txt b/.besouro/20161006143245985/actions.txt index 735f023..a49c38c 100644 --- a/.besouro/20161006143245985/actions.txt +++ b/.besouro/20161006143245985/actions.txt @@ -63,3 +63,8 @@ UnitTestSessionAction 1475756463621 TestRomanNumerals.java FAIL UnitTestCaseAction 1475756471036 TestRomanNumerals.java FAIL UnitTestSessionAction 1475756471036 Rerun TestRomanNumerals.convertMMXIV FAIL EditAction 1475756506636 RomanNumerals.java 2120 1 8 0 +UnitTestCaseAction 1475756508386 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756508386 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756521618 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756521618 Rerun TestRomanNumerals.convertMMXIV FAIL +EditAction 1475756600772 RomanNumerals.java 2006 1 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 215a1a1..d6d524f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -13,7 +13,6 @@ public int convertToInteger(String romanNum) { int counter = 0; int lastValue = 0; int value = 0; - boolean unlawfulSubtraction = false; for(int i = 0; i < romanNum.length(); i++) { char roman = romanNum.charAt(i); @@ -58,11 +57,8 @@ public int convertToInteger(String romanNum) { if(lastValue != value) { counter = 0; - } else if(lastValue == value && counter == 1) { - unlawfulSubtraction = true; } - if((value == 1 || value == 10 || value == 100 || value == 1000) && counter == 3 ) { @@ -83,7 +79,7 @@ public int convertToInteger(String romanNum) { if(((value == 5 || value == 10) && lastValue == 1) || ((value == 50 || value == 100) && lastValue == 10) || ((value == 500 || value == 1000) && lastValue == 100)) { - if(unlawfulSubtraction) { + if(lastValue == value && counter == 1) { throw new IllegalArgumentException("Can't be subtstracted twice"); } value = value - lastValue - lastValue;