From 191223a67d2625932730fab3c962ca3513a3f6a9 Mon Sep 17 00:00:00 2001 From: abackman Date: Wed, 28 Sep 2016 16:39:20 +0300 Subject: [PATCH 01/79] Added first test --- src/RomanNumeralException.java | 7 +++++++ src/RomanNumerals.java | 8 ++++++-- tests/TestRomanNumerals.java | 6 ++++-- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 src/RomanNumeralException.java diff --git a/src/RomanNumeralException.java b/src/RomanNumeralException.java new file mode 100644 index 0000000..dd84880 --- /dev/null +++ b/src/RomanNumeralException.java @@ -0,0 +1,7 @@ +import java.lang.Exception; + +public class RomanNumeralException extends Exception { + public RomanNumeralException (String msg) { + super(msg); + } +} diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 20904f0..c4398f9 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,8 +1,12 @@ public class RomanNumerals { - public int convertToInteger(String romanNum) { + public int convertToInteger(String romanNum) throws RomanNumeralException { // To be Implemented - return 0; + if (romanNum.equals("I")) + return 1; + throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); } + + } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5d1de75..a2f6e3e 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -3,10 +3,12 @@ import org.junit.Test; public class TestRomanNumerals { + //private RomanNumerals = new RomanNumerals(); @Test - public void test() { - fail("Not yet implemented"); + public void number_1_Generated() throws RomanNumeralException { + RomanNumerals numerals = new RomanNumerals(); + assertTrue(1 == numerals.convertToInteger("I")); } } From 645b2e4571040cea1f92e310e447852f7ed68edf Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:17:08 +0300 Subject: [PATCH 02/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 9 +++++++++ .besouro/20161005150110246/besouroEpisodes.txt | 0 .besouro/20161005150110246/disagreements.txt | 0 .besouro/20161005150110246/randomHeuristicEpisodes.txt | 0 .besouro/20161005150110246/userComments.txt | 0 .besouro/20161005150110246/zorroEpisodes.txt | 0 tests/TestRomanNumerals.java | 7 +++++++ 7 files changed, 16 insertions(+) create mode 100644 .besouro/20161005150110246/actions.txt create mode 100644 .besouro/20161005150110246/besouroEpisodes.txt create mode 100644 .besouro/20161005150110246/disagreements.txt create mode 100644 .besouro/20161005150110246/randomHeuristicEpisodes.txt create mode 100644 .besouro/20161005150110246/userComments.txt create mode 100644 .besouro/20161005150110246/zorroEpisodes.txt diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt new file mode 100644 index 0000000..0945b10 --- /dev/null +++ b/.besouro/20161005150110246/actions.txt @@ -0,0 +1,9 @@ +FileOpenedAction 1475668870473 TestRomanNumerals.java 318 1 2 1 +RefactoringAction 1475669518241 TestRomanNumerals.java ADD void is FIELD +RefactoringAction 1475669527273 TestRomanNumerals.java RENAME is=>void is_subtraction FIELD +RefactoringAction 1475669532803 TestRomanNumerals.java RENAME is_subtraction=>void issubtraction FIELD +RefactoringAction 1475669534332 TestRomanNumerals.java RENAME issubtraction=>void isSubtraction FIELD +RefactoringAction 1475669536361 TestRomanNumerals.java RENAME isSubtraction=>void isSubtraction() METHOD +RefactoringAction 1475669814220 TestRomanNumerals.java ADD import org.junit.runner.RunWith IMPORT +RefactoringAction 1475669822533 TestRomanNumerals.java ADD import org.junit.runners.Parameterized IMPORT +EditAction 1475669828562 TestRomanNumerals.java 465 2 2 1 diff --git a/.besouro/20161005150110246/besouroEpisodes.txt b/.besouro/20161005150110246/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005150110246/disagreements.txt b/.besouro/20161005150110246/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005150110246/randomHeuristicEpisodes.txt b/.besouro/20161005150110246/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005150110246/userComments.txt b/.besouro/20161005150110246/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005150110246/zorroEpisodes.txt b/.besouro/20161005150110246/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index a2f6e3e..6bc77f1 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -1,7 +1,10 @@ import static org.junit.Assert.*; import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +@RunWith(Parameterized.class) public class TestRomanNumerals { //private RomanNumerals = new RomanNumerals(); @@ -11,4 +14,8 @@ public void number_1_Generated() throws RomanNumeralException { assertTrue(1 == numerals.convertToInteger("I")); } + @Test + public void isSubtraction() { + + } } From 758feed0d24ba3dbb4418a85fb0e7d48ebeb537f Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:22:55 +0300 Subject: [PATCH 03/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 6 ++++++ tests/TestRomanNumerals.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index 0945b10..ce91b70 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -7,3 +7,9 @@ RefactoringAction 1475669536361 TestRomanNumerals.java RENAME isSubtraction=>voi RefactoringAction 1475669814220 TestRomanNumerals.java ADD import org.junit.runner.RunWith IMPORT RefactoringAction 1475669822533 TestRomanNumerals.java ADD import org.junit.runners.Parameterized IMPORT EditAction 1475669828562 TestRomanNumerals.java 465 2 2 1 +RefactoringAction 1475670082177 TestRomanNumerals.java ADD TestRomanNumerals() METHOD +RefactoringAction 1475670131215 TestRomanNumerals.java ADD String test FIELD +RefactoringAction 1475670138237 TestRomanNumerals.java RENAME test=>String roman FIELD +RefactoringAction 1475670144264 TestRomanNumerals.java RENAME roman=>String romanTestNum FIELD +RefactoringAction 1475670167359 TestRomanNumerals.java RENAME TestRomanNumerals()=>TestRomanNumerals(String) METHOD +EditAction 1475670175862 TestRomanNumerals.java 578 3 3 1 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 6bc77f1..c595a40 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -7,7 +7,13 @@ @RunWith(Parameterized.class) public class TestRomanNumerals { //private RomanNumerals = new RomanNumerals(); + + private String romanTestNum; + public TestRomanNumerals(String parTestNum) { + romanTestNum = parTestNum; + } + @Test public void number_1_Generated() throws RomanNumeralException { RomanNumerals numerals = new RomanNumerals(); From 8169f707e6fa84cd93074484d8b0ee57f17decdd Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:25:47 +0300 Subject: [PATCH 04/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 2 ++ tests/TestRomanNumerals.java | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index ce91b70..e0dd2b4 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -13,3 +13,5 @@ RefactoringAction 1475670138237 TestRomanNumerals.java RENAME test=>String roman RefactoringAction 1475670144264 TestRomanNumerals.java RENAME roman=>String romanTestNum FIELD RefactoringAction 1475670167359 TestRomanNumerals.java RENAME TestRomanNumerals()=>TestRomanNumerals(String) METHOD EditAction 1475670175862 TestRomanNumerals.java 578 3 3 1 +RefactoringAction 1475670267647 TestRomanNumerals.java ADD static Collection testData() { + return Arrays.asList(new Object [][] { + {"I"}, + {"II"}, + {"CM"}, + }); + } + @Test public void number_1_Generated() throws RomanNumeralException { RomanNumerals numerals = new RomanNumerals(); From a4b395933e6fa3ad912f4f097ae93511ebb90ac7 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:28:53 +0300 Subject: [PATCH 05/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 13 +++++++++++++ tests/TestRomanNumerals.java | 10 ++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index e0dd2b4..613b56d 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -15,3 +15,16 @@ RefactoringAction 1475670167359 TestRomanNumerals.java RENAME TestRomanNumerals( EditAction 1475670175862 TestRomanNumerals.java 578 3 3 1 RefactoringAction 1475670267647 TestRomanNumerals.java ADD static Collectionvoid sub() METHOD +RefactoringAction 1475670481152 TestRomanNumerals.java RENAME sub()=>void subtraction() METHOD +RefactoringAction 1475670489167 TestRomanNumerals.java RENAME subtraction()=>void findSubtraction() METHOD +EditAction 1475670533560 TestRomanNumerals.java 756 2 3 1 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 3ce630c..b6afed9 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -8,7 +8,7 @@ public class TestRomanNumerals { //private RomanNumerals = new RomanNumerals(); - private String romanTestNum; + /*private String romanTestNum; public TestRomanNumerals(String parTestNum) { romanTestNum = parTestNum; @@ -21,7 +21,7 @@ public static Collection testData() { {"II"}, {"CM"}, }); - } + }*/ @Test public void number_1_Generated() throws RomanNumeralException { @@ -30,7 +30,9 @@ public void number_1_Generated() throws RomanNumeralException { } @Test - public void isSubtraction() { - + public void findSubtraction() { + String[8] = { + " " + }; } } From 0586d0d2d4689c6248881d152add4cf2eb161cd7 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:38:32 +0300 Subject: [PATCH 06/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 18 ++++++++++++++++++ tests/TestRomanNumerals.java | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index 613b56d..688dbb6 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -28,3 +28,21 @@ RefactoringAction 1475670478138 TestRomanNumerals.java RENAME isSubtraction()=>v RefactoringAction 1475670481152 TestRomanNumerals.java RENAME sub()=>void subtraction() METHOD RefactoringAction 1475670489167 TestRomanNumerals.java RENAME subtraction()=>void findSubtraction() METHOD EditAction 1475670533560 TestRomanNumerals.java 756 2 3 1 +CompilationAction 1475670533798 TestRomanNumerals.java +CompilationAction 1475670533799 TestRomanNumerals.java +CompilationAction 1475670594345 TestRomanNumerals.java +CompilationAction 1475670594510 TestRomanNumerals.java +CompilationAction 1475670609518 TestRomanNumerals.java +RefactoringAction 1475670759716 TestRomanNumerals.java RENAME findSubtraction()=>void subtractionOccurs() METHOD +CompilationAction 1475671016290 TestRomanNumerals.java +CompilationAction 1475671016452 TestRomanNumerals.java +CompilationAction 1475671016452 TestRomanNumerals.java +CompilationAction 1475671016452 TestRomanNumerals.java +CompilationAction 1475671036851 TestRomanNumerals.java +CompilationAction 1475671036851 TestRomanNumerals.java +CompilationAction 1475671037013 TestRomanNumerals.java +CompilationAction 1475671037014 TestRomanNumerals.java +CompilationAction 1475671070421 TestRomanNumerals.java +CompilationAction 1475671070421 TestRomanNumerals.java +CompilationAction 1475671070580 TestRomanNumerals.java +EditAction 1475671112065 TestRomanNumerals.java 1127 2 2 1 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index b6afed9..9b0807b 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -30,9 +30,24 @@ public void number_1_Generated() throws RomanNumeralException { } @Test - public void findSubtraction() { - String[8] = { - " " + public void subtractionOccurs() { + RomanNumerals romans = new RomanNumerals(); + boolean caseFailed = false; + int i = 0; + + String[] testCases = { + "IV", "y", + "CM", "y", + "II", "n", }; + + for (i = 0; i < testCases.length; i = i + 2) { + if (romans.isSubtraction(testCases[i])) { + caseFailed = true; + break; + } + } + + assertTrue(false == caseFailed, "Subtraction not detected. Failed case: " + testCases[i], ); } } From bdcca477debfcbd789f2346c561dd0730d69fd7a Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 15:38:52 +0300 Subject: [PATCH 07/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 6 ++++++ tests/TestRomanNumerals.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index 688dbb6..b831720 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -46,3 +46,9 @@ CompilationAction 1475671070421 TestRomanNumerals.java CompilationAction 1475671070421 TestRomanNumerals.java CompilationAction 1475671070580 TestRomanNumerals.java EditAction 1475671112065 TestRomanNumerals.java 1127 2 2 1 +CompilationAction 1475671112303 TestRomanNumerals.java +CompilationAction 1475671112303 TestRomanNumerals.java +CompilationAction 1475671118230 TestRomanNumerals.java +CompilationAction 1475671118399 TestRomanNumerals.java +CompilationAction 1475671118405 TestRomanNumerals.java +EditAction 1475671132497 TestRomanNumerals.java 1130 2 8 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 9b0807b..c859d41 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,6 +48,7 @@ public void subtractionOccurs() { } } - assertTrue(false == caseFailed, "Subtraction not detected. Failed case: " + testCases[i], ); + assertTrue("Subtraction not detected. Failed case: " + testCases[i], + false == caseFailed); } } From 37ae0b5d79b061e0a83a8c2228b17fa1fcd2d01e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:31:25 +0300 Subject: [PATCH 08/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 8 ++++++++ src/RomanNumerals.java | 4 +++- tests/TestRomanNumerals.java | 16 +++++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index b831720..ba2e0e0 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -52,3 +52,11 @@ CompilationAction 1475671118230 TestRomanNumerals.java CompilationAction 1475671118399 TestRomanNumerals.java CompilationAction 1475671118405 TestRomanNumerals.java EditAction 1475671132497 TestRomanNumerals.java 1130 2 8 2 +CompilationAction 1475671132747 TestRomanNumerals.java +CompilationAction 1475674175275 TestRomanNumerals.java +CompilationAction 1475674175803 TestRomanNumerals.java +CompilationAction 1475674188546 TestRomanNumerals.java +CompilationAction 1475674188709 TestRomanNumerals.java +RefactoringAction 1475674274498 RomanNumerals.java ADD boolean isSubtraction FIELD +RefactoringAction 1475674280504 RomanNumerals.java RENAME isSubtraction=>boolean isSubtraction() METHOD +EditAction 1475674285604 RomanNumerals.java 321 2 2 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c4398f9..7d8a1e5 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -8,5 +8,7 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); } - + public boolean isSubtraction(String) { + + } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index c859d41..7a6407e 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -36,13 +36,19 @@ public void subtractionOccurs() { int i = 0; String[] testCases = { - "IV", "y", - "CM", "y", - "II", "n", + "IV", + "CM", + "II", + }; + + boolean[] correctResults = { + true, + true, + false }; - for (i = 0; i < testCases.length; i = i + 2) { - if (romans.isSubtraction(testCases[i])) { + for (i = 0; i < testCases.length; i++) { + if (correctResults[i] == romans.isSubtraction(testCases[i])) { caseFailed = true; break; } From 1be7b235185060772ff2a900908e36c2aa86c880 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:38:17 +0300 Subject: [PATCH 09/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 12 ++++++++++++ src/RomanNumerals.java | 8 ++++++-- tests/TestRomanNumerals.java | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index ba2e0e0..2798dec 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -60,3 +60,15 @@ CompilationAction 1475674188709 TestRomanNumerals.java RefactoringAction 1475674274498 RomanNumerals.java ADD boolean isSubtraction FIELD RefactoringAction 1475674280504 RomanNumerals.java RENAME isSubtraction=>boolean isSubtraction() METHOD EditAction 1475674285604 RomanNumerals.java 321 2 2 0 +CompilationAction 1475674285815 RomanNumerals.java +CompilationAction 1475674285816 RomanNumerals.java +CompilationAction 1475674285816 RomanNumerals.java +CompilationAction 1475674285816 TestRomanNumerals.java +RefactoringAction 1475674326020 RomanNumerals.java RENAME isSubtraction()=>boolean isSubtraction(String) METHOD +CompilationAction 1475674348253 TestRomanNumerals.java +CompilationAction 1475674348411 TestRomanNumerals.java +CompilationAction 1475674456357 RomanNumerals.java +CompilationAction 1475674456357 RomanNumerals.java +CompilationAction 1475674456357 RomanNumerals.java +CompilationAction 1475674456524 RomanNumerals.java +EditAction 1475674697270 RomanNumerals.java 476 2 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7d8a1e5..527be2d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,14 +1,18 @@ public class RomanNumerals { public int convertToInteger(String romanNum) throws RomanNumeralException { - // To be Implemented if (romanNum.equals("I")) return 1; throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); } - public boolean isSubtraction(String) { + public boolean isSubtraction(String romanNum) throws RomanNumeralException { + // Only one subtraction can be made per numeral + if (romanNum.length > 2) + return false; + if (convertToInteger(romanNum)) + return ; } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 7a6407e..7ae7c97 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -30,7 +30,7 @@ public void number_1_Generated() throws RomanNumeralException { } @Test - public void subtractionOccurs() { + public void subtractionOccurs() throws RomanNumeralException { RomanNumerals romans = new RomanNumerals(); boolean caseFailed = false; int i = 0; From 66120f2dceaaf0195a45917fc742e4c1f651f1f8 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 5 Oct 2016 16:41:45 +0300 Subject: [PATCH 10/79] besouro automatic message --- .besouro/20161005150110246/actions.txt | 6 ++++++ src/RomanNumerals.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/20161005150110246/actions.txt b/.besouro/20161005150110246/actions.txt index 2798dec..c9633c1 100644 --- a/.besouro/20161005150110246/actions.txt +++ b/.besouro/20161005150110246/actions.txt @@ -72,3 +72,9 @@ CompilationAction 1475674456357 RomanNumerals.java CompilationAction 1475674456357 RomanNumerals.java CompilationAction 1475674456524 RomanNumerals.java EditAction 1475674697270 RomanNumerals.java 476 2 4 0 +CompilationAction 1475674697491 RomanNumerals.java +CompilationAction 1475674697491 RomanNumerals.java +CompilationAction 1475674697492 RomanNumerals.java +CompilationAction 1475674904220 RomanNumerals.java +CompilationAction 1475674904221 RomanNumerals.java +CompilationAction 1475674904386 RomanNumerals.java diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 527be2d..85b8f7e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -12,7 +12,7 @@ public boolean isSubtraction(String romanNum) throws RomanNumeralException { if (romanNum.length > 2) return false; - if (convertToInteger(romanNum)) - return ; + /*if (convertToInteger(romanNum)) + return ;*/ } } From 960bffad572dd554e36d2c030ee5e4ee18a46406 Mon Sep 17 00:00:00 2001 From: abackman Date: Wed, 5 Oct 2016 16:44:42 +0300 Subject: [PATCH 11/79] Subtraction test. Unfinished subtraction recognition --- src/RomanNumerals.java | 6 ++++-- tests/TestRomanNumerals.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 85b8f7e..1774787 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,12 +7,14 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); } - public boolean isSubtraction(String romanNum) throws RomanNumeralException { + public boolean isSubtraction(String romanNum) { // Only one subtraction can be made per numeral - if (romanNum.length > 2) + if (romanNum.length() > 2) return false; /*if (convertToInteger(romanNum)) return ;*/ + + return true; // this ok or something else? } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 7ae7c97..7a6407e 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -30,7 +30,7 @@ public void number_1_Generated() throws RomanNumeralException { } @Test - public void subtractionOccurs() throws RomanNumeralException { + public void subtractionOccurs() { RomanNumerals romans = new RomanNumerals(); boolean caseFailed = false; int i = 0; From 88889368e9a9cff4c03152a33e52bf1101c94e43 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:30:40 +0300 Subject: [PATCH 12/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ .besouro/20161011222626759/besouroEpisodes.txt | 0 .besouro/20161011222626759/disagreements.txt | 0 .besouro/20161011222626759/randomHeuristicEpisodes.txt | 0 .besouro/20161011222626759/userComments.txt | 0 .besouro/20161011222626759/zorroEpisodes.txt | 0 src/RomanNumerals.java | 4 ++-- 7 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .besouro/20161011222626759/actions.txt create mode 100644 .besouro/20161011222626759/besouroEpisodes.txt create mode 100644 .besouro/20161011222626759/disagreements.txt create mode 100644 .besouro/20161011222626759/randomHeuristicEpisodes.txt create mode 100644 .besouro/20161011222626759/userComments.txt create mode 100644 .besouro/20161011222626759/zorroEpisodes.txt diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt new file mode 100644 index 0000000..d7c3119 --- /dev/null +++ b/.besouro/20161011222626759/actions.txt @@ -0,0 +1,3 @@ +FileOpenedAction 1476213987195 TestRomanNumerals.java 1199 2 9 2 +RefactoringAction 1476214090680 RomanNumerals.java RENAME isSubtraction(String)=>boolean isSubtraction(String, int) METHOD +EditAction 1476214240697 RomanNumerals.java 519 2 4 0 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161011222626759/disagreements.txt b/.besouro/20161011222626759/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161011222626759/userComments.txt b/.besouro/20161011222626759/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1774787..fffee37 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,9 +7,9 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); } - public boolean isSubtraction(String romanNum) { + public boolean isSubtraction(String romanNum, int pos) { // Only one subtraction can be made per numeral - if (romanNum.length() > 2) + if (romanNum.length() < (pos - 1)) return false; /*if (convertToInteger(romanNum)) From 28840dbb0cd811398a51302e06c0b0324985d8f8 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:35:35 +0300 Subject: [PATCH 13/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 2 ++ src/RomanNumerals.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index d7c3119..42191e8 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -1,3 +1,5 @@ FileOpenedAction 1476213987195 TestRomanNumerals.java 1199 2 9 2 RefactoringAction 1476214090680 RomanNumerals.java RENAME isSubtraction(String)=>boolean isSubtraction(String, int) METHOD EditAction 1476214240697 RomanNumerals.java 519 2 4 0 +CompilationAction 1476214241048 TestRomanNumerals.java +EditAction 1476214534972 RomanNumerals.java 766 2 2 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index fffee37..e0850df 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -8,10 +8,19 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { } public boolean isSubtraction(String romanNum, int pos) { - // Only one subtraction can be made per numeral if (romanNum.length() < (pos - 1)) + throw new RomanNumeralException( + "Position to check for subtraction is out of bounds. roman num length was: " + + romanNum.length() + " position was: " + pos); + + // Only one subtraction can be made per numeral + if ((pos) romanNum.length()) return false; + + + if (romanNum.charAt(pos) < ) + /*if (convertToInteger(romanNum)) return ;*/ From 795e4c3361d15e6a57627a451196db50494fd8f1 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:36:57 +0300 Subject: [PATCH 14/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 42191e8..d7851d2 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -3,3 +3,6 @@ RefactoringAction 1476214090680 RomanNumerals.java RENAME isSubtraction(String)= EditAction 1476214240697 RomanNumerals.java 519 2 4 0 CompilationAction 1476214241048 TestRomanNumerals.java EditAction 1476214534972 RomanNumerals.java 766 2 2 0 +CompilationAction 1476214535133 RomanNumerals.java +CompilationAction 1476214535134 RomanNumerals.java +EditAction 1476214617778 RomanNumerals.java 766 2 2 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e0850df..f9e6252 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -8,7 +8,7 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { } public boolean isSubtraction(String romanNum, int pos) { - if (romanNum.length() < (pos - 1)) + if ((romanNum.length() - 1) < pos) throw new RomanNumeralException( "Position to check for subtraction is out of bounds. roman num length was: " + romanNum.length() + " position was: " + pos); From 8167e322046a6d1adb5a7647463838a83d7cab89 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:47:04 +0300 Subject: [PATCH 15/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 18 ++++++++++++++++++ src/RomanNumerals.java | 22 +++++++++------------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index d7851d2..afb2fe1 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -6,3 +6,21 @@ EditAction 1476214534972 RomanNumerals.java 766 2 2 0 CompilationAction 1476214535133 RomanNumerals.java CompilationAction 1476214535134 RomanNumerals.java EditAction 1476214617778 RomanNumerals.java 766 2 2 0 +CompilationAction 1476214617932 RomanNumerals.java +CompilationAction 1476214617934 RomanNumerals.java +CompilationAction 1476214666993 RomanNumerals.java +CompilationAction 1476214666994 RomanNumerals.java +CompilationAction 1476214667164 RomanNumerals.java +CompilationAction 1476214704531 RomanNumerals.java +CompilationAction 1476214704748 RomanNumerals.java +CompilationAction 1476214750378 RomanNumerals.java +CompilationAction 1476214750558 RomanNumerals.java +CompilationAction 1476214890804 RomanNumerals.java +CompilationAction 1476214890994 RomanNumerals.java +CompilationAction 1476214968993 RomanNumerals.java +CompilationAction 1476214969160 RomanNumerals.java +CompilationAction 1476215095602 RomanNumerals.java +CompilationAction 1476215095763 RomanNumerals.java +CompilationAction 1476215138669 RomanNumerals.java +CompilationAction 1476215138850 TestRomanNumerals.java +EditAction 1476215224256 RomanNumerals.java 801 2 6 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index f9e6252..7cfbec0 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,23 +7,19 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); } - public boolean isSubtraction(String romanNum, int pos) { + public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralException { if ((romanNum.length() - 1) < pos) throw new RomanNumeralException( "Position to check for subtraction is out of bounds. roman num length was: " + romanNum.length() + " position was: " + pos); - - // Only one subtraction can be made per numeral - if ((pos) romanNum.length()) + + // Character at pos is the last character + if ((pos + 2) > romanNum.length()) return false; - - - - if (romanNum.charAt(pos) < ) - - /*if (convertToInteger(romanNum)) - return ;*/ - - return true; // this ok or something else? + + if (convertToInteger(romanNum.substring(pos, pos)) < convertToInteger(romanNum.substring((pos + 1), (pos + 1)))) + return true; + + return false; } } From dcc3214ab50c3ca9112704178fd56ca0e1955e46 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:47:34 +0300 Subject: [PATCH 16/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index afb2fe1..441bfeb 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -24,3 +24,4 @@ CompilationAction 1476215095763 RomanNumerals.java CompilationAction 1476215138669 RomanNumerals.java CompilationAction 1476215138850 TestRomanNumerals.java EditAction 1476215224256 RomanNumerals.java 801 2 6 0 +EditAction 1476215254000 RomanNumerals.java 801 2 6 0 From 23cdc6012760f36210506836e1190f404042e33c Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:48:44 +0300 Subject: [PATCH 17/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + tests/TestRomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 441bfeb..aae56ee 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -25,3 +25,4 @@ CompilationAction 1476215138669 RomanNumerals.java CompilationAction 1476215138850 TestRomanNumerals.java EditAction 1476215224256 RomanNumerals.java 801 2 6 0 EditAction 1476215254000 RomanNumerals.java 801 2 6 0 +EditAction 1476215324347 TestRomanNumerals.java 1199 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 7a6407e..d5afa5b 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,7 +48,7 @@ public void subtractionOccurs() { }; for (i = 0; i < testCases.length; i++) { - if (correctResults[i] == romans.isSubtraction(testCases[i])) { + if (correctResults[i] == romans.isSubtraction(testCases, i)) { caseFailed = true; break; } From 340b774bbc1f9786dcdd0a1206180416a00cac1b Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:49:04 +0300 Subject: [PATCH 18/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 2 ++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index aae56ee..c6b6aef 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -26,3 +26,5 @@ CompilationAction 1476215138850 TestRomanNumerals.java EditAction 1476215224256 RomanNumerals.java 801 2 6 0 EditAction 1476215254000 RomanNumerals.java 801 2 6 0 EditAction 1476215324347 TestRomanNumerals.java 1199 2 9 2 +CompilationAction 1476215324505 TestRomanNumerals.java +EditAction 1476215343968 TestRomanNumerals.java 1202 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index d5afa5b..7e2e679 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,7 +48,7 @@ public void subtractionOccurs() { }; for (i = 0; i < testCases.length; i++) { - if (correctResults[i] == romans.isSubtraction(testCases, i)) { + if (correctResults[i] == romans.isSubtraction(testCases[i], i)) { caseFailed = true; break; } From 94c44d6956c27e12093aed7f3319f03c1699517f Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:49:29 +0300 Subject: [PATCH 19/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 2 ++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index c6b6aef..df1bd2c 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -28,3 +28,5 @@ EditAction 1476215254000 RomanNumerals.java 801 2 6 0 EditAction 1476215324347 TestRomanNumerals.java 1199 2 9 2 CompilationAction 1476215324505 TestRomanNumerals.java EditAction 1476215343968 TestRomanNumerals.java 1202 2 9 2 +CompilationAction 1476215344115 TestRomanNumerals.java +EditAction 1476215369513 TestRomanNumerals.java 1202 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 7e2e679..d4f8e70 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,7 +48,7 @@ public void subtractionOccurs() { }; for (i = 0; i < testCases.length; i++) { - if (correctResults[i] == romans.isSubtraction(testCases[i], i)) { + if (correctResults[i] == romans.isSubtraction(testCases[i], 0)) { caseFailed = true; break; } From d2dc47a552a0749de22a2140d850a6df7c1bffb2 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 22:50:59 +0300 Subject: [PATCH 20/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 5 +++++ tests/TestRomanNumerals.java | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index df1bd2c..66aab55 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -30,3 +30,8 @@ CompilationAction 1476215324505 TestRomanNumerals.java EditAction 1476215343968 TestRomanNumerals.java 1202 2 9 2 CompilationAction 1476215344115 TestRomanNumerals.java EditAction 1476215369513 TestRomanNumerals.java 1202 2 9 2 +CompilationAction 1476215369808 TestRomanNumerals.java +CompilationAction 1476215387869 TestRomanNumerals.java +UnitTestCaseAction 1476215409408 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476215409410 TestRomanNumerals.java FAIL +EditAction 1476215459808 TestRomanNumerals.java 1233 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index d4f8e70..8ddc91d 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -4,7 +4,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@RunWith(Parameterized.class) +//@RunWith(Parameterized.class) public class TestRomanNumerals { //private RomanNumerals = new RomanNumerals(); @@ -30,7 +30,7 @@ public void number_1_Generated() throws RomanNumeralException { } @Test - public void subtractionOccurs() { + public void subtractionOccurs() throws RomanNumeralException { RomanNumerals romans = new RomanNumerals(); boolean caseFailed = false; int i = 0; From 942cc88ebd3912136b5abbfdd6781255f258cc62 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:00:43 +0300 Subject: [PATCH 21/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 8 ++++++++ src/RomanNumerals.java | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 66aab55..bc97117 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -35,3 +35,11 @@ CompilationAction 1476215387869 TestRomanNumerals.java UnitTestCaseAction 1476215409408 TestRomanNumerals.java FAIL UnitTestSessionAction 1476215409410 TestRomanNumerals.java FAIL EditAction 1476215459808 TestRomanNumerals.java 1233 2 9 2 +UnitTestCaseAction 1476215463093 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476215463095 TestRomanNumerals.java FAIL +RefactoringAction 1476215998184 RomanNumerals.java ADD RomanNumerals() METHOD +RefactoringAction 1476216022774 RomanNumerals.java ADD Hashtable<> numeralT FIELD +RefactoringAction 1476216023789 RomanNumerals.java RENAME numeralT=>Hashtable<> numeralTable FIELD +RefactoringAction 1476216029805 RomanNumerals.java RENAME numeralTable=>Hashtable<> numTable FIELD +RefactoringAction 1476216043823 RomanNumerals.java REMOVE numTable FIELD +EditAction 1476216043874 RomanNumerals.java 881 3 6 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7cfbec0..66216d9 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,5 +1,11 @@ public class RomanNumerals { + private Hashtable numTable; + + public RomanNumerals() { + + } + public int convertToInteger(String romanNum) throws RomanNumeralException { if (romanNum.equals("I")) return 1; From 0f2bfe1fa75353d9b17568c33538929efef3df56 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:04:39 +0300 Subject: [PATCH 22/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 11 +++++++++++ src/RomanNumerals.java | 25 +++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index bc97117..62e13e5 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -43,3 +43,14 @@ RefactoringAction 1476216023789 RomanNumerals.java RENAME numeralT=>Hashtable<> RefactoringAction 1476216029805 RomanNumerals.java RENAME numeralTable=>Hashtable<> numTable FIELD RefactoringAction 1476216043823 RomanNumerals.java REMOVE numTable FIELD EditAction 1476216043874 RomanNumerals.java 881 3 6 0 +CompilationAction 1476216044018 RomanNumerals.java +CompilationAction 1476216044019 RomanNumerals.java +RefactoringAction 1476216076345 RomanNumerals.java ADD Hashtable numTable FIELD +CompilationAction 1476216078640 RomanNumerals.java +CompilationAction 1476216078641 RomanNumerals.java +CompilationAction 1476216078836 RomanNumerals.java +RefactoringAction 1476216100666 RomanNumerals.java ADD import java.util.Hashtable IMPORT +CompilationAction 1476216108855 RomanNumerals.java +RefactoringAction 1476216170687 RomanNumerals.java ADD void fillHashTable() METHOD +RefactoringAction 1476216185261 RomanNumerals.java RENAME fillHashTable()=>void fillNumTable() METHOD +EditAction 1476216279554 RomanNumerals.java 1378 4 14 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 66216d9..ad0bf8e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,9 +1,30 @@ +import java.util.Hashtable; public class RomanNumerals { - private Hashtable numTable; + private Hashtable numTable; public RomanNumerals() { - + numTable = new Hashtable(); + fillNumTable(); + } + + private void fillNumTable() { + numTable.put(arg0, arg1); + numTable.put(arg0, arg1); + numTable.put(arg0, arg1); + numTable.put(arg0, arg1); + numTable.put(arg0, arg1); + numTable.put(arg0, arg1); +/* 1 I 10 X 100 C + 2 II 20 XX 200 CC + 3 III 30 XXX 300 CCC + 4 IV 40 XL 400 CD + 5 V 50 L 500 D + 6 VI 60 LX 600 DC + 7 VII 70 LXX 700 DCC + 8 VIII 80 LXXX 800 DCCC + 9 IX 90 XC 900 CM +*/ } public int convertToInteger(String romanNum) throws RomanNumeralException { From e4357b54f0d38925c0b4518094f04d4c17d9a197 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:09:21 +0300 Subject: [PATCH 23/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 5 +++++ src/RomanNumerals.java | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 62e13e5..a8d0d14 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -54,3 +54,8 @@ CompilationAction 1476216108855 RomanNumerals.java RefactoringAction 1476216170687 RomanNumerals.java ADD void fillHashTable() METHOD RefactoringAction 1476216185261 RomanNumerals.java RENAME fillHashTable()=>void fillNumTable() METHOD EditAction 1476216279554 RomanNumerals.java 1378 4 14 0 +CompilationAction 1476216279731 RomanNumerals.java +CompilationAction 1476216279731 RomanNumerals.java +CompilationAction 1476216397180 RomanNumerals.java +CompilationAction 1476216397180 RomanNumerals.java +EditAction 1476216561506 RomanNumerals.java 1444 4 13 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index ad0bf8e..91b666e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,14 +7,7 @@ public RomanNumerals() { numTable = new Hashtable(); fillNumTable(); } - - private void fillNumTable() { - numTable.put(arg0, arg1); - numTable.put(arg0, arg1); - numTable.put(arg0, arg1); - numTable.put(arg0, arg1); - numTable.put(arg0, arg1); - numTable.put(arg0, arg1); + /* 1 I 10 X 100 C 2 II 20 XX 200 CC 3 III 30 XXX 300 CCC @@ -25,9 +18,25 @@ private void fillNumTable() { 8 VIII 80 LXXX 800 DCCC 9 IX 90 XC 900 CM */ + private void fillNumTable() { + numTable.put("I", 1); + numTable.put("V", 5); + numTable.put("X", 10); + numTable.put("L", 50); + numTable.put("C", 100); + numTable.put("D", 500); + numTable.put("M", 1000); } public int convertToInteger(String romanNum) throws RomanNumeralException { + int ret = null; + + try { + + } catch() { + + } + if (romanNum.equals("I")) return 1; From 38d47f23aae1fb80e11d2f34ea573afd6253c9a2 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:12:53 +0300 Subject: [PATCH 24/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 12 ++++++++++++ src/RomanNumerals.java | 15 +++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index a8d0d14..91470c2 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -59,3 +59,15 @@ CompilationAction 1476216279731 RomanNumerals.java CompilationAction 1476216397180 RomanNumerals.java CompilationAction 1476216397180 RomanNumerals.java EditAction 1476216561506 RomanNumerals.java 1444 4 13 0 +CompilationAction 1476216561676 RomanNumerals.java +CompilationAction 1476216561677 RomanNumerals.java +RefactoringAction 1476216662309 RomanNumerals.java ADD void singleNumToInteger() METHOD +RefactoringAction 1476216710902 RomanNumerals.java RENAME singleNumToInteger()=>int singleNumToInteger(String) METHOD +CompilationAction 1476216747739 RomanNumerals.java +CompilationAction 1476216747740 RomanNumerals.java +CompilationAction 1476216747910 RomanNumerals.java +CompilationAction 1476216747910 RomanNumerals.java +CompilationAction 1476216761563 RomanNumerals.java +CompilationAction 1476216761718 RomanNumerals.java +CompilationAction 1476216761719 RomanNumerals.java +EditAction 1476216773263 RomanNumerals.java 1635 5 15 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 91b666e..cbb1342 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -29,10 +29,10 @@ private void fillNumTable() { } public int convertToInteger(String romanNum) throws RomanNumeralException { - int ret = null; - + Integer ret = null; + try { - + ret = numTable.get("romanNum"); } catch() { } @@ -42,7 +42,14 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); } - + + private int singleNumToInteger(String num) throws RomanNumeralException { + if (num.length() > 1) + throw new RomanNumeralException(""); + + return -1; + } + public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralException { if ((romanNum.length() - 1) < pos) throw new RomanNumeralException( From 7a4682c82e65c829c54e7837e2a44e0a7f2ca7cb Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:19:46 +0300 Subject: [PATCH 25/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 6 ++++++ src/RomanNumerals.java | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 91470c2..46e8cb7 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -71,3 +71,9 @@ CompilationAction 1476216761563 RomanNumerals.java CompilationAction 1476216761718 RomanNumerals.java CompilationAction 1476216761719 RomanNumerals.java EditAction 1476216773263 RomanNumerals.java 1635 5 15 0 +CompilationAction 1476216773550 RomanNumerals.java +CompilationAction 1476216964048 RomanNumerals.java +CompilationAction 1476216964233 RomanNumerals.java +CompilationAction 1476216964233 RomanNumerals.java +CompilationAction 1476217167052 RomanNumerals.java +EditAction 1476217186320 RomanNumerals.java 1865 5 18 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index cbb1342..1525f7e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -31,6 +31,8 @@ private void fillNumTable() { public int convertToInteger(String romanNum) throws RomanNumeralException { Integer ret = null; + // test subtraction for all chars + try { ret = numTable.get("romanNum"); } catch() { @@ -40,14 +42,21 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { if (romanNum.equals("I")) return 1; - throw new RomanNumeralException("No equivalent found for given roman number: " + romanNum); + throw new RomanNumeralException("No equivalent found for given Roman number: " + romanNum); } - private int singleNumToInteger(String num) throws RomanNumeralException { + public int singleNumToInteger(String num) throws RomanNumeralException, NullPointerException { + Integer ret = null; + if (num.length() > 1) throw new RomanNumeralException(""); - - return -1; + + if (null == num) + throw new RomanNumeralException("Null value can't be converted from Roman numeral to Arabic"); + + ret = numTable.get(num); + + return ret; } public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralException { From 8c21702a8e9272e1de841ce754b2aef001af8f13 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:21:20 +0300 Subject: [PATCH 26/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 46e8cb7..85bada9 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -77,3 +77,6 @@ CompilationAction 1476216964233 RomanNumerals.java CompilationAction 1476216964233 RomanNumerals.java CompilationAction 1476217167052 RomanNumerals.java EditAction 1476217186320 RomanNumerals.java 1865 5 18 0 +CompilationAction 1476217186505 RomanNumerals.java +CompilationAction 1476217239233 RomanNumerals.java +EditAction 1476217280383 RomanNumerals.java 1891 5 18 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1525f7e..bf1eefe 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -47,13 +47,13 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { public int singleNumToInteger(String num) throws RomanNumeralException, NullPointerException { Integer ret = null; - - if (num.length() > 1) - throw new RomanNumeralException(""); if (null == num) throw new RomanNumeralException("Null value can't be converted from Roman numeral to Arabic"); + if (num.length() > 1) + throw new RomanNumeralException("Only single numbers accepted"); + ret = numTable.get(num); return ret; From c1d78ad67ae21eda3a786c7e286096a1b22d42ae Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:22:19 +0300 Subject: [PATCH 27/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 2 ++ src/RomanNumerals.java | 11 ++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 85bada9..3284d8e 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -80,3 +80,5 @@ EditAction 1476217186320 RomanNumerals.java 1865 5 18 0 CompilationAction 1476217186505 RomanNumerals.java CompilationAction 1476217239233 RomanNumerals.java EditAction 1476217280383 RomanNumerals.java 1891 5 18 0 +CompilationAction 1476217280583 RomanNumerals.java +EditAction 1476217339820 RomanNumerals.java 1819 5 21 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index bf1eefe..49c3371 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -32,15 +32,8 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { Integer ret = null; // test subtraction for all chars - - try { - ret = numTable.get("romanNum"); - } catch() { - - } - - if (romanNum.equals("I")) - return 1; + + return singleNumToInteger(romanNum); throw new RomanNumeralException("No equivalent found for given Roman number: " + romanNum); } From 27bcbe26ddd1cfd5e38c42185aa6a65984eb88db Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:23:56 +0300 Subject: [PATCH 28/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 3284d8e..890b30b 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -82,3 +82,6 @@ CompilationAction 1476217239233 RomanNumerals.java EditAction 1476217280383 RomanNumerals.java 1891 5 18 0 CompilationAction 1476217280583 RomanNumerals.java EditAction 1476217339820 RomanNumerals.java 1819 5 21 0 +CompilationAction 1476217340001 RomanNumerals.java +CompilationAction 1476217354249 RomanNumerals.java +EditAction 1476217436847 RomanNumerals.java 1917 5 21 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 49c3371..6c490db 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -35,7 +35,7 @@ public int convertToInteger(String romanNum) throws RomanNumeralException { return singleNumToInteger(romanNum); - throw new RomanNumeralException("No equivalent found for given Roman number: " + romanNum); + //throw new RomanNumeralException("No equivalent found for given Roman number: " + romanNum); } public int singleNumToInteger(String num) throws RomanNumeralException, NullPointerException { @@ -48,6 +48,9 @@ public int singleNumToInteger(String num) throws RomanNumeralException, NullPoin throw new RomanNumeralException("Only single numbers accepted"); ret = numTable.get(num); + + if (null == ret) + throw new RomanNumeralException("Roman number " + num + " not found"); return ret; } From 8766efed6e6664b7bcd5249ea382653b85394137 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:24:09 +0300 Subject: [PATCH 29/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 890b30b..2bb4c9e 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -85,3 +85,4 @@ EditAction 1476217339820 RomanNumerals.java 1819 5 21 0 CompilationAction 1476217340001 RomanNumerals.java CompilationAction 1476217354249 RomanNumerals.java EditAction 1476217436847 RomanNumerals.java 1917 5 21 0 +EditAction 1476217449533 RomanNumerals.java 1918 5 21 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 6c490db..1145c3d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -50,7 +50,7 @@ public int singleNumToInteger(String num) throws RomanNumeralException, NullPoin ret = numTable.get(num); if (null == ret) - throw new RomanNumeralException("Roman number " + num + " not found"); + throw new RomanNumeralException("Roman number: " + num + " not found"); return ret; } From b682083ef2d4ff4103fc58a24ed6c5bbaed30087 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:24:24 +0300 Subject: [PATCH 30/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 2bb4c9e..57f9e96 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -86,3 +86,4 @@ CompilationAction 1476217340001 RomanNumerals.java CompilationAction 1476217354249 RomanNumerals.java EditAction 1476217436847 RomanNumerals.java 1917 5 21 0 EditAction 1476217449533 RomanNumerals.java 1918 5 21 0 +EditAction 1476217464191 RomanNumerals.java 1940 5 21 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1145c3d..76d7f0c 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -50,7 +50,7 @@ public int singleNumToInteger(String num) throws RomanNumeralException, NullPoin ret = numTable.get(num); if (null == ret) - throw new RomanNumeralException("Roman number: " + num + " not found"); + throw new RomanNumeralException("Arabic conversion for Roman number: " + num + " not found"); return ret; } From c3f4ba00ef36f7ed5f9fe8c0f17542c843a55e00 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:27:13 +0300 Subject: [PATCH 31/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 5 +++++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 57f9e96..fd21ee2 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -87,3 +87,8 @@ CompilationAction 1476217354249 RomanNumerals.java EditAction 1476217436847 RomanNumerals.java 1917 5 21 0 EditAction 1476217449533 RomanNumerals.java 1918 5 21 0 EditAction 1476217464191 RomanNumerals.java 1940 5 21 0 +UnitTestCaseAction 1476217492012 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476217492012 TestRomanNumerals.java FAIL +UnitTestCaseAction 1476217507630 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476217507630 TestRomanNumerals.java FAIL +EditAction 1476217633140 TestRomanNumerals.java 1235 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 8ddc91d..fe80822 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -30,7 +30,7 @@ public void number_1_Generated() throws RomanNumeralException { } @Test - public void subtractionOccurs() throws RomanNumeralException { + public void subtractionDetected() throws RomanNumeralException { RomanNumerals romans = new RomanNumerals(); boolean caseFailed = false; int i = 0; From 24b9e367b011225af5e5114bcd55d00ebfd9ecf7 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:28:16 +0300 Subject: [PATCH 32/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index fd21ee2..10b20b3 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -92,3 +92,4 @@ UnitTestSessionAction 1476217492012 TestRomanNumerals.java FAIL UnitTestCaseAction 1476217507630 TestRomanNumerals.java FAIL UnitTestSessionAction 1476217507630 TestRomanNumerals.java FAIL EditAction 1476217633140 TestRomanNumerals.java 1235 2 9 2 +EditAction 1476217696590 RomanNumerals.java 2039 5 22 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 76d7f0c..26a0dbc 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -65,6 +65,8 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if ((pos + 2) > romanNum.length()) return false; + System.out.println("pos == " + pos + " substr(pos, pos) == " + romanNum.substring(pos, pos)); + if (convertToInteger(romanNum.substring(pos, pos)) < convertToInteger(romanNum.substring((pos + 1), (pos + 1)))) return true; From 349db4dabe5fec0d7ef498933bed487f981d86d6 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:28:39 +0300 Subject: [PATCH 33/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 1 + 2 files changed, 2 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 10b20b3..482bd8b 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -93,3 +93,4 @@ UnitTestCaseAction 1476217507630 TestRomanNumerals.java FAIL UnitTestSessionAction 1476217507630 TestRomanNumerals.java FAIL EditAction 1476217633140 TestRomanNumerals.java 1235 2 9 2 EditAction 1476217696590 RomanNumerals.java 2039 5 22 0 +EditAction 1476217719080 RomanNumerals.java 2131 5 23 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 26a0dbc..e6c2a49 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -66,6 +66,7 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept return false; System.out.println("pos == " + pos + " substr(pos, pos) == " + romanNum.substring(pos, pos)); + System.out.println("pos == " + pos + " substr(pos, 1) == " + romanNum.substring(pos, 1)); if (convertToInteger(romanNum.substring(pos, pos)) < convertToInteger(romanNum.substring((pos + 1), (pos + 1)))) return true; From 9e22e3692605dc7b28dd30ced36c5c623df75354 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:28:58 +0300 Subject: [PATCH 34/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 482bd8b..2e16022 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -94,3 +94,6 @@ UnitTestSessionAction 1476217507630 TestRomanNumerals.java FAIL EditAction 1476217633140 TestRomanNumerals.java 1235 2 9 2 EditAction 1476217696590 RomanNumerals.java 2039 5 22 0 EditAction 1476217719080 RomanNumerals.java 2131 5 23 0 +UnitTestCaseAction 1476217721544 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476217721544 TestRomanNumerals.java FAIL +EditAction 1476217738580 RomanNumerals.java 2129 5 23 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e6c2a49..aa1acd5 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -66,7 +66,7 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept return false; System.out.println("pos == " + pos + " substr(pos, pos) == " + romanNum.substring(pos, pos)); - System.out.println("pos == " + pos + " substr(pos, 1) == " + romanNum.substring(pos, 1)); + System.out.println("pos == " + pos + " substr(pos, 1) == " + romanNum.substring(1, 2)); if (convertToInteger(romanNum.substring(pos, pos)) < convertToInteger(romanNum.substring((pos + 1), (pos + 1)))) return true; From 68bf7aa6c584910d45107ac8b974ee6e9a8f1cb2 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:29:42 +0300 Subject: [PATCH 35/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 2e16022..6f6ce96 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -97,3 +97,6 @@ EditAction 1476217719080 RomanNumerals.java 2131 5 23 0 UnitTestCaseAction 1476217721544 TestRomanNumerals.java FAIL UnitTestSessionAction 1476217721544 TestRomanNumerals.java FAIL EditAction 1476217738580 RomanNumerals.java 2129 5 23 0 +UnitTestCaseAction 1476217741066 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476217741067 TestRomanNumerals.java FAIL +EditAction 1476217782519 RomanNumerals.java 2132 5 17 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index aa1acd5..5958625 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -66,9 +66,9 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept return false; System.out.println("pos == " + pos + " substr(pos, pos) == " + romanNum.substring(pos, pos)); - System.out.println("pos == " + pos + " substr(pos, 1) == " + romanNum.substring(1, 2)); + System.out.println("pos == " + pos + " substr(pos, 1) == " + romanNum.substring(, 2)); - if (convertToInteger(romanNum.substring(pos, pos)) < convertToInteger(romanNum.substring((pos + 1), (pos + 1)))) + if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; return false; From b731d82963882bbc57d05dba2951fb507e00c7b7 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:31:37 +0300 Subject: [PATCH 36/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 4 ++++ src/RomanNumerals.java | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 6f6ce96..a771d43 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -100,3 +100,7 @@ EditAction 1476217738580 RomanNumerals.java 2129 5 23 0 UnitTestCaseAction 1476217741066 TestRomanNumerals.java FAIL UnitTestSessionAction 1476217741067 TestRomanNumerals.java FAIL EditAction 1476217782519 RomanNumerals.java 2132 5 17 0 +CompilationAction 1476217782801 RomanNumerals.java +UnitTestCaseAction 1476217799654 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476217799654 TestRomanNumerals.java FAIL +EditAction 1476217897624 RomanNumerals.java 2149 5 23 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 5958625..58b69cd 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -61,12 +61,12 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept "Position to check for subtraction is out of bounds. roman num length was: " + romanNum.length() + " position was: " + pos); + System.out.println("pos & pos + 1 == " + convertToInteger(romanNum.substring(pos, pos + 1))); + System.out.println("pos + 1 & pos + 2 == " + convertToInteger(romanNum.substring(pos + 1, pos + 2))); + // Character at pos is the last character if ((pos + 2) > romanNum.length()) return false; - - System.out.println("pos == " + pos + " substr(pos, pos) == " + romanNum.substring(pos, pos)); - System.out.println("pos == " + pos + " substr(pos, 1) == " + romanNum.substring(, 2)); if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; From 0dfa84ef199befa560b2c896b57e40741e086355 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:33:16 +0300 Subject: [PATCH 37/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index a771d43..a4bf54a 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -104,3 +104,6 @@ CompilationAction 1476217782801 RomanNumerals.java UnitTestCaseAction 1476217799654 TestRomanNumerals.java FAIL UnitTestSessionAction 1476217799654 TestRomanNumerals.java FAIL EditAction 1476217897624 RomanNumerals.java 2149 5 23 0 +UnitTestCaseAction 1476217903107 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476217903108 TestRomanNumerals.java FAIL +EditAction 1476217996680 RomanNumerals.java 2219 5 25 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 58b69cd..a126c60 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -67,10 +67,10 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept // Character at pos is the last character if ((pos + 2) > romanNum.length()) return false; - + System.out.println("testing"); if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; - + System.out.println("returning false"); return false; } } From 8c26ff52951285cbf14e1068c56f8addf96618cb Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:34:36 +0300 Subject: [PATCH 38/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index a4bf54a..4ab36cf 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -107,3 +107,6 @@ EditAction 1476217897624 RomanNumerals.java 2149 5 23 0 UnitTestCaseAction 1476217903107 TestRomanNumerals.java FAIL UnitTestSessionAction 1476217903108 TestRomanNumerals.java FAIL EditAction 1476217996680 RomanNumerals.java 2219 5 25 0 +UnitTestCaseAction 1476217998880 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476217998880 TestRomanNumerals.java FAIL +EditAction 1476218076097 TestRomanNumerals.java 1240 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index fe80822..5bcee54 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,7 +48,7 @@ public void subtractionDetected() throws RomanNumeralException { }; for (i = 0; i < testCases.length; i++) { - if (correctResults[i] == romans.isSubtraction(testCases[i], 0)) { + if (correctResults[i].equals(romans.isSubtraction(testCases[i], 0))) { caseFailed = true; break; } From 96985c3607376e7e34ca72ce4b453c0e7cae1406 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:36:14 +0300 Subject: [PATCH 39/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 5 +++++ tests/TestRomanNumerals.java | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 4ab36cf..06a29df 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -110,3 +110,8 @@ EditAction 1476217996680 RomanNumerals.java 2219 5 25 0 UnitTestCaseAction 1476217998880 TestRomanNumerals.java FAIL UnitTestSessionAction 1476217998880 TestRomanNumerals.java FAIL EditAction 1476218076097 TestRomanNumerals.java 1240 2 9 2 +CompilationAction 1476218076381 TestRomanNumerals.java +CompilationAction 1476218144056 TestRomanNumerals.java +UnitTestCaseAction 1476218146238 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476218146238 TestRomanNumerals.java FAIL +EditAction 1476218174808 TestRomanNumerals.java 1391 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5bcee54..36139c1 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,7 +48,9 @@ public void subtractionDetected() throws RomanNumeralException { }; for (i = 0; i < testCases.length; i++) { - if (correctResults[i].equals(romans.isSubtraction(testCases[i], 0))) { + System.out.println("correctResults[i] == " + correctResults[i]); + System.out.println("subtraction test == " + romans.isSubtraction(testCases[i], 0)); + if (!correctResults[i] == romans.isSubtraction(testCases[i], 0)) { caseFailed = true; break; } From 29d7b27c1d07089c99509c5f45eb6d90ff09f638 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:37:46 +0300 Subject: [PATCH 40/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ tests/TestRomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 06a29df..521a733 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -115,3 +115,6 @@ CompilationAction 1476218144056 TestRomanNumerals.java UnitTestCaseAction 1476218146238 TestRomanNumerals.java FAIL UnitTestSessionAction 1476218146238 TestRomanNumerals.java FAIL EditAction 1476218174808 TestRomanNumerals.java 1391 2 9 2 +UnitTestCaseAction 1476218176885 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476218176885 TestRomanNumerals.java FAIL +EditAction 1476218266376 TestRomanNumerals.java 1387 2 9 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 36139c1..4ec32c1 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -56,7 +56,7 @@ public void subtractionDetected() throws RomanNumeralException { } } - assertTrue("Subtraction not detected. Failed case: " + testCases[i], + assertTrue("Subtraction not detected. Failed case number: " + i, false == caseFailed); } } From 283f74452a1b63511c034e5ef9e76a6e6e75d869 Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:38:14 +0300 Subject: [PATCH 41/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ .besouro/20161011222626759/besouroEpisodes.txt | 4 ++++ .besouro/20161011222626759/randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 2 -- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 521a733..a2b147b 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -118,3 +118,6 @@ EditAction 1476218174808 TestRomanNumerals.java 1391 2 9 2 UnitTestCaseAction 1476218176885 TestRomanNumerals.java FAIL UnitTestSessionAction 1476218176885 TestRomanNumerals.java FAIL EditAction 1476218266376 TestRomanNumerals.java 1387 2 9 2 +UnitTestCaseAction 1476218268242 TestRomanNumerals.java OK +UnitTestSessionAction 1476218268243 TestRomanNumerals.java OK +EditAction 1476218294522 TestRomanNumerals.java 1232 2 9 2 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index e69de29..625cc36 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -0,0 +1,4 @@ +1476218268243 production 1 4281 false +1476218268244 refactoring 2A 4281 true +1476218268245 production 3 4281 false +1476218268246 production 2 4281 false diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index e69de29..1d0a41d 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -0,0 +1 @@ +1476218268243 production 1 4281 false diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index e69de29..1d0a41d 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -0,0 +1 @@ +1476218268243 production 1 4281 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 4ec32c1..f304a25 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,8 +48,6 @@ public void subtractionDetected() throws RomanNumeralException { }; for (i = 0; i < testCases.length; i++) { - System.out.println("correctResults[i] == " + correctResults[i]); - System.out.println("subtraction test == " + romans.isSubtraction(testCases[i], 0)); if (!correctResults[i] == romans.isSubtraction(testCases[i], 0)) { caseFailed = true; break; From 595078d30e647556c777f8a9fa49fe1c32efeb6f Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:38:21 +0300 Subject: [PATCH 42/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index a2b147b..701f3ba 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -121,3 +121,4 @@ EditAction 1476218266376 TestRomanNumerals.java 1387 2 9 2 UnitTestCaseAction 1476218268242 TestRomanNumerals.java OK UnitTestSessionAction 1476218268243 TestRomanNumerals.java OK EditAction 1476218294522 TestRomanNumerals.java 1232 2 9 2 +EditAction 1476218301042 RomanNumerals.java 2018 5 23 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index a126c60..0e51619 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -60,9 +60,6 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept throw new RomanNumeralException( "Position to check for subtraction is out of bounds. roman num length was: " + romanNum.length() + " position was: " + pos); - - System.out.println("pos & pos + 1 == " + convertToInteger(romanNum.substring(pos, pos + 1))); - System.out.println("pos + 1 & pos + 2 == " + convertToInteger(romanNum.substring(pos + 1, pos + 2))); // Character at pos is the last character if ((pos + 2) > romanNum.length()) From 35e36b93b50861232d8699a3a5e3e9d350088ddb Mon Sep 17 00:00:00 2001 From: somename Date: Tue, 11 Oct 2016 23:38:33 +0300 Subject: [PATCH 43/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ .besouro/20161011222626759/besouroEpisodes.txt | 1 + .besouro/20161011222626759/randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 701f3ba..5db54d3 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -122,3 +122,6 @@ UnitTestCaseAction 1476218268242 TestRomanNumerals.java OK UnitTestSessionAction 1476218268243 TestRomanNumerals.java OK EditAction 1476218294522 TestRomanNumerals.java 1232 2 9 2 EditAction 1476218301042 RomanNumerals.java 2018 5 23 0 +UnitTestCaseAction 1476218304474 TestRomanNumerals.java OK +UnitTestSessionAction 1476218304475 TestRomanNumerals.java OK +EditAction 1476218313088 RomanNumerals.java 1946 5 21 0 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index 625cc36..59878bb 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -2,3 +2,4 @@ 1476218268244 refactoring 2A 4281 true 1476218268245 production 3 4281 false 1476218268246 production 2 4281 false +1476218304475 refactoring 2A 9 true diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index 1d0a41d..3e77a89 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -1 +1,2 @@ 1476218268243 production 1 4281 false +1476218304475 refactoring 2A 9 true diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index 1d0a41d..784a86b 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -1 +1,2 @@ 1476218268243 production 1 4281 false +1476218304475 refactoring 2A 36 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0e51619..f82744f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -64,10 +64,10 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept // Character at pos is the last character if ((pos + 2) > romanNum.length()) return false; - System.out.println("testing"); + if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; - System.out.println("returning false"); + return false; } } From b1642615890dc946665cf13db89038553e4eb2e2 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:05:18 +0300 Subject: [PATCH 44/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 14 +++++++++ .../20161011222626759/besouroEpisodes.txt | 1 + .../randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 29 ++++++++++++++++++- 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 5db54d3..b2803b4 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -125,3 +125,17 @@ EditAction 1476218301042 RomanNumerals.java 2018 5 23 0 UnitTestCaseAction 1476218304474 TestRomanNumerals.java OK UnitTestSessionAction 1476218304475 TestRomanNumerals.java OK EditAction 1476218313088 RomanNumerals.java 1946 5 21 0 +UnitTestCaseAction 1476218315352 TestRomanNumerals.java OK +UnitTestSessionAction 1476218315352 TestRomanNumerals.java OK +RefactoringAction 1476218747070 TestRomanNumerals.java ADD void test() METHOD +RefactoringAction 1476218800082 TestRomanNumerals.java RENAME test()=>void max() METHOD +RefactoringAction 1476218803593 TestRomanNumerals.java RENAME max()=> null +RefactoringAction 1476218805601 TestRomanNumerals.java RENAME =>void repeating() METHOD +RefactoringAction 1476218911116 TestRomanNumerals.java RENAME repeating()=>void repeating_() METHOD +RefactoringAction 1476218913626 TestRomanNumerals.java RENAME repeating_()=>void repeating() METHOD +RefactoringAction 1476218921634 TestRomanNumerals.java RENAME repeating()=>void triple_repeating() METHOD +RefactoringAction 1476218927643 TestRomanNumerals.java RENAME triple_repeating()=>void max_triple_repeating() METHOD +RefactoringAction 1476218936151 TestRomanNumerals.java RENAME max_triple_repeating()=>void maxThreeepeating() METHOD +RefactoringAction 1476218937159 TestRomanNumerals.java RENAME maxThreeepeating()=>void maxThreeRepeating() METHOD +RefactoringAction 1476218939667 TestRomanNumerals.java RENAME maxThreeRepeating()=>void maxThreeRepeats() METHOD +EditAction 1476219918399 TestRomanNumerals.java 1620 3 15 2 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index 59878bb..c5a69d5 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -3,3 +3,4 @@ 1476218268245 production 3 4281 false 1476218268246 production 2 4281 false 1476218304475 refactoring 2A 9 true +1476218315352 refactoring 2A 2 true diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index 3e77a89..34c1f12 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -1,2 +1,3 @@ 1476218268243 production 1 4281 false 1476218304475 refactoring 2A 9 true +1476218315352 refactoring 2A 2 false diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index 784a86b..37f7ff6 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -1,2 +1,3 @@ 1476218268243 production 1 4281 false 1476218304475 refactoring 2A 36 false +1476218315352 refactoring 2A 10 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index f304a25..a212291 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,7 +48,7 @@ public void subtractionDetected() throws RomanNumeralException { }; for (i = 0; i < testCases.length; i++) { - if (!correctResults[i] == romans.isSubtraction(testCases[i], 0)) { + if (correctResults[i] != romans.isSubtraction(testCases[i], 0)) { caseFailed = true; break; } @@ -57,4 +57,31 @@ public void subtractionDetected() throws RomanNumeralException { assertTrue("Subtraction not detected. Failed case number: " + i, false == caseFailed); } + + @Test + public void maxThreeRepeats() { + RomanNumerals romans = new RomanNumerals(); + boolean caseFailed = false; + int i = 0; + + String[] testCases = { + "VIII", + "MCCCC", + "XXX" + }; + + boolean[] correctResults = { + true, + false, + true + }; + + for (int i = 0; i < testCases.length; i++) { + if (correctResults[i] != romans.isSubtraction()) { + + } + } + + + } } From 4b174a8a236b0edb183e74db19ff8d49efa92b75 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:09:46 +0300 Subject: [PATCH 45/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 7 +++++++ tests/TestRomanNumerals.java | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index b2803b4..c88b312 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -139,3 +139,10 @@ RefactoringAction 1476218936151 TestRomanNumerals.java RENAME max_triple_repeati RefactoringAction 1476218937159 TestRomanNumerals.java RENAME maxThreeepeating()=>void maxThreeRepeating() METHOD RefactoringAction 1476218939667 TestRomanNumerals.java RENAME maxThreeRepeating()=>void maxThreeRepeats() METHOD EditAction 1476219918399 TestRomanNumerals.java 1620 3 15 2 +CompilationAction 1476219918582 TestRomanNumerals.java +CompilationAction 1476219918583 TestRomanNumerals.java +CompilationAction 1476220129591 TestRomanNumerals.java +CompilationAction 1476220129593 TestRomanNumerals.java +CompilationAction 1476220129753 TestRomanNumerals.java +CompilationAction 1476220129753 TestRomanNumerals.java +EditAction 1476220186911 TestRomanNumerals.java 1750 3 16 3 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index a212291..f02f264 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -76,12 +76,14 @@ public void maxThreeRepeats() { true }; - for (int i = 0; i < testCases.length; i++) { - if (correctResults[i] != romans.isSubtraction()) { - + for (i = 0; i < testCases.length; i++) { + if (correctResults[i] != romans.repeatingOK(testCases[i])) { + caseFailed = true; + break; } } - + assertTrue("Repeating of '1' symbols is not ok for test case: " + i, + false == caseFailed); } } From 10b4ef748a806218cb38c567a711cc643f031afa Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:10:18 +0300 Subject: [PATCH 46/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index c88b312..1ac9370 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -146,3 +146,6 @@ CompilationAction 1476220129593 TestRomanNumerals.java CompilationAction 1476220129753 TestRomanNumerals.java CompilationAction 1476220129753 TestRomanNumerals.java EditAction 1476220186911 TestRomanNumerals.java 1750 3 16 3 +CompilationAction 1476220187056 TestRomanNumerals.java +RefactoringAction 1476220209521 RomanNumerals.java ADD boolean repeatingOK(String) METHOD +EditAction 1476220218287 RomanNumerals.java 2048 6 22 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index f82744f..a788b9e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -70,4 +70,9 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept return false; } + + public boolean repeatingOK(String string) { + // TODO Auto-generated method stub + return false; + } } From e8dd88af7670d795e651db02c39a795b8fe38cbd Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:12:00 +0300 Subject: [PATCH 47/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 6 ++++++ src/RomanNumerals.java | 5 ++++- tests/TestRomanNumerals.java | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 1ac9370..bdf572c 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -149,3 +149,9 @@ EditAction 1476220186911 TestRomanNumerals.java 1750 3 16 3 CompilationAction 1476220187056 TestRomanNumerals.java RefactoringAction 1476220209521 RomanNumerals.java ADD boolean repeatingOK(String) METHOD EditAction 1476220218287 RomanNumerals.java 2048 6 22 0 +UnitTestCaseAction 1476220224949 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476220224949 TestRomanNumerals.java FAIL +RefactoringAction 1476220316023 RomanNumerals.java RENAME repeatingOK(String)=>boolean repeatingOk(String) METHOD +RefactoringAction 1476220318531 RomanNumerals.java RENAME repeatingOk(String)=>boolean repeatingOkOneSymbols(String) METHOD +CompilationAction 1476220318827 TestRomanNumerals.java +EditAction 1476220320687 TestRomanNumerals.java 1760 3 16 3 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index a788b9e..c0c1acc 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -71,8 +71,11 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept return false; } - public boolean repeatingOK(String string) { + public boolean repeatingOkOneSymbols(String string) { // TODO Auto-generated method stub + + + return false; } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index f02f264..c2a840a 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -77,7 +77,7 @@ public void maxThreeRepeats() { }; for (i = 0; i < testCases.length; i++) { - if (correctResults[i] != romans.repeatingOK(testCases[i])) { + if (correctResults[i] != romans.repeatingOkOneSymbols(testCases[i])) { caseFailed = true; break; } From b37a6d3cd649dec1ba50a991896f369bb4a44111 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:20:13 +0300 Subject: [PATCH 48/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 24 ++++++++++++++++++++++++ src/RomanNumerals.java | 23 ++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index bdf572c..68c314a 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -155,3 +155,27 @@ RefactoringAction 1476220316023 RomanNumerals.java RENAME repeatingOK(String)=>b RefactoringAction 1476220318531 RomanNumerals.java RENAME repeatingOk(String)=>boolean repeatingOkOneSymbols(String) METHOD CompilationAction 1476220318827 TestRomanNumerals.java EditAction 1476220320687 TestRomanNumerals.java 1760 3 16 3 +UnitTestCaseAction 1476220322736 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476220322737 TestRomanNumerals.java FAIL +RefactoringAction 1476220441208 RomanNumerals.java ADD boolean isOneSymbol() METHOD +RefactoringAction 1476220488790 RomanNumerals.java RENAME isOneSymbol()=>boolean isOneSymbol(String) METHOD +CompilationAction 1476220552931 RomanNumerals.java +CompilationAction 1476220552932 RomanNumerals.java +CompilationAction 1476220552932 RomanNumerals.java +CompilationAction 1476220552932 RomanNumerals.java +CompilationAction 1476220726346 RomanNumerals.java +CompilationAction 1476220726513 RomanNumerals.java +CompilationAction 1476220726514 RomanNumerals.java +CompilationAction 1476220726514 RomanNumerals.java +CompilationAction 1476220726514 RomanNumerals.java +CompilationAction 1476220728400 RomanNumerals.java +CompilationAction 1476220728569 RomanNumerals.java +CompilationAction 1476220728570 RomanNumerals.java +CompilationAction 1476220728571 RomanNumerals.java +CompilationAction 1476220728572 RomanNumerals.java +CompilationAction 1476220751111 RomanNumerals.java +CompilationAction 1476220751274 RomanNumerals.java +CompilationAction 1476220751274 RomanNumerals.java +CompilationAction 1476220751274 RomanNumerals.java +CompilationAction 1476220751275 RomanNumerals.java +EditAction 1476220813850 RomanNumerals.java 2478 7 25 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c0c1acc..35f42b2 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -71,10 +71,31 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept return false; } - public boolean repeatingOkOneSymbols(String string) { + public boolean repeatingOkOneSymbols(String num) { // TODO Auto-generated method stub + for (int i = 0; i < num.length(); i++) { + if (isOneSymbol) + } + return false; + } + + public boolean isOneSymbol(String sym) { + String[] oneSymbols = { + "I", + "X", + "C", + "M" + }; + + if (sym.length() > 1) + throw new RomanNumeralException("Only one character must be checked with isOneSymbol"); + + for (int i = 0; i < oneSymbols.length; i++) { + if (sym.equals(oneSymbols[i])) + return true; + } return false; } From 5d568dd94a9c739650ae550b0c4d498719ea0100 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:23:20 +0300 Subject: [PATCH 49/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 13 +++++++++++++ src/RomanNumerals.java | 17 ++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 68c314a..ffebe2b 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -179,3 +179,16 @@ CompilationAction 1476220751274 RomanNumerals.java CompilationAction 1476220751274 RomanNumerals.java CompilationAction 1476220751275 RomanNumerals.java EditAction 1476220813850 RomanNumerals.java 2478 7 25 0 +CompilationAction 1476220814020 RomanNumerals.java +CompilationAction 1476220814020 RomanNumerals.java +CompilationAction 1476220814021 RomanNumerals.java +CompilationAction 1476220827975 RomanNumerals.java +CompilationAction 1476220828155 RomanNumerals.java +CompilationAction 1476220828155 RomanNumerals.java +CompilationAction 1476220866519 RomanNumerals.java +CompilationAction 1476220866710 RomanNumerals.java +CompilationAction 1476220927127 RomanNumerals.java +CompilationAction 1476220927293 RomanNumerals.java +CompilationAction 1476220946199 RomanNumerals.java +CompilationAction 1476220946377 TestRomanNumerals.java +EditAction 1476221000078 RomanNumerals.java 2671 7 28 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 35f42b2..4621876 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -71,17 +71,24 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept return false; } - public boolean repeatingOkOneSymbols(String num) { - // TODO Auto-generated method stub + public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { + int subsequentAmount = 0; for (int i = 0; i < num.length(); i++) { - if (isOneSymbol) + if (isOneSymbol(num.substring(i, i + 1))) { + subsequentAmount++; + } else { + subsequentAmount = 0; + } + + if (subsequentAmount > 3) + return false; } - return false; + return true; } - public boolean isOneSymbol(String sym) { + public boolean isOneSymbol(String sym) throws RomanNumeralException { String[] oneSymbols = { "I", "X", From 8a6853497f4e087edfde9600a02e26b6b93aeecd Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:32:36 +0300 Subject: [PATCH 50/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 7 + .../20161011222626759/besouroEpisodes.txt | 120 ++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 7 +- tests/TestRomanNumerals.java | 30 ++++- 5 files changed, 161 insertions(+), 4 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index ffebe2b..98f4311 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -192,3 +192,10 @@ CompilationAction 1476220927293 RomanNumerals.java CompilationAction 1476220946199 RomanNumerals.java CompilationAction 1476220946377 TestRomanNumerals.java EditAction 1476221000078 RomanNumerals.java 2671 7 28 0 +CompilationAction 1476221025098 TestRomanNumerals.java +UnitTestCaseAction 1476221028090 TestRomanNumerals.java OK +UnitTestSessionAction 1476221028091 TestRomanNumerals.java OK +RefactoringAction 1476221279507 TestRomanNumerals.java ADD void fiveSymbols FIELD +RefactoringAction 1476221282514 TestRomanNumerals.java RENAME fiveSymbols=>void fiveSymbolsNotRepeated FIELD +RefactoringAction 1476221286526 TestRomanNumerals.java RENAME fiveSymbolsNotRepeated=>void fiveSymbolsNotRepeated() METHOD +EditAction 1476221556366 TestRomanNumerals.java 2319 4 16 3 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index c5a69d5..5aa8a0d 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -4,3 +4,123 @@ 1476218268246 production 2 4281 false 1476218304475 refactoring 2A 9 true 1476218315352 refactoring 2A 2 true +1476221028091 test-first 1 2281 true +1476221028092 test-first 1 2281 true +1476221028093 test-first 1 2281 true +1476221028094 test-first 1 2281 true +1476221028095 test-first 1 2281 true +1476221028096 test-first 1 2281 true +1476221028097 test-first 1 2281 true +1476221028098 test-first 1 2281 true +1476221028099 test-first 1 2281 true +1476221028100 test-first 1 2281 true +1476221028101 test-first 1 2281 true +1476221028102 test-first 1 2281 true +1476221028103 test-first 1 2281 true +1476221028104 test-first 1 2281 true +1476221028105 test-first 1 2281 true +1476221028106 test-first 1 2281 true +1476221028107 test-first 1 2281 true +1476221028108 test-first 1 2281 true +1476221028109 test-first 1 2281 true +1476221028110 test-first 1 2281 true +1476221028111 test-first 1 2281 true +1476221028112 test-first 1 2281 true +1476221028113 test-first 1 2281 true +1476221028114 test-first 1 2281 true +1476221028115 test-first 1 2281 true +1476221028116 test-first 1 2281 true +1476221028117 test-first 1 2281 true +1476221028118 test-first 1 2281 true +1476221028119 test-first 1 2281 true +1476221028120 test-first 1 2281 true +1476221028121 test-first 1 2281 true +1476221028122 test-first 1 2281 true +1476221028123 test-first 1 2281 true +1476221028124 test-first 1 2281 true +1476221028125 test-first 1 2281 true +1476221028126 test-first 1 2281 true +1476221028127 test-first 1 2281 true +1476221028128 test-first 1 2281 true +1476221028129 test-first 1 2281 true +1476221028130 test-first 1 2281 true +1476221028131 test-first 1 2281 true +1476221028132 test-first 1 2281 true +1476221028133 test-first 1 2281 true +1476221028134 test-first 1 2281 true +1476221028135 test-first 1 2281 true +1476221028136 test-first 1 2281 true +1476221028137 test-first 1 2281 true +1476221028138 test-first 1 2281 true +1476221028139 test-first 1 2281 true +1476221028140 test-first 1 2281 true +1476221028141 test-first 1 2281 true +1476221028142 test-first 1 2281 true +1476221028143 test-first 1 2281 true +1476221028144 test-first 1 2281 true +1476221028145 test-first 1 2281 true +1476221028146 test-first 1 2281 true +1476221028147 test-first 1 2281 true +1476221028148 test-first 1 2281 true +1476221028149 test-first 1 2281 true +1476221028150 test-first 1 2281 true +1476221028151 test-first 1 2281 true +1476221028152 test-first 1 2281 true +1476221028153 test-first 1 2281 true +1476221028154 test-first 1 2281 true +1476221028155 test-first 1 2281 true +1476221028156 test-first 1 2281 true +1476221028157 test-first 1 2281 true +1476221028158 test-first 1 2281 true +1476221028159 test-first 1 2281 true +1476221028160 test-first 1 2281 true +1476221028161 test-first 1 2281 true +1476221028162 test-first 1 2281 true +1476221028163 test-first 1 2281 true +1476221028164 test-first 1 2281 true +1476221028165 test-first 1 2281 true +1476221028166 test-first 1 2281 true +1476221028167 test-first 1 2281 true +1476221028168 test-first 1 2281 true +1476221028169 test-first 1 2281 true +1476221028170 test-first 1 2281 true +1476221028171 test-first 1 2281 true +1476221028172 test-first 1 2281 true +1476221028173 test-first 1 2281 true +1476221028174 test-first 1 2281 true +1476221028175 test-first 1 2281 true +1476221028176 test-first 1 2281 true +1476221028177 test-first 1 2281 true +1476221028178 test-first 1 2281 true +1476221028179 test-first 1 2281 true +1476221028180 test-first 1 2281 true +1476221028181 test-first 1 2281 true +1476221028182 test-first 1 2281 true +1476221028183 test-first 1 2281 true +1476221028184 test-first 1 2281 true +1476221028185 test-first 1 2281 true +1476221028186 test-first 1 2281 true +1476221028187 test-first 1 2281 true +1476221028188 test-first 1 2281 true +1476221028189 test-first 1 2281 true +1476221028190 test-first 1 2281 true +1476221028191 test-first 1 2281 true +1476221028192 test-first 1 2281 true +1476221028193 test-first 1 2281 true +1476221028194 test-first 1 2281 true +1476221028195 test-first 1 2281 true +1476221028196 test-first 1 2281 true +1476221028197 test-first 1 2281 true +1476221028198 test-first 1 2281 true +1476221028199 test-first 1 2281 true +1476221028200 test-first 1 2281 true +1476221028201 test-first 1 2281 true +1476221028202 test-first 1 2281 true +1476221028203 test-first 1 2281 true +1476221028204 test-first 1 2281 true +1476221028205 test-first 1 2281 true +1476221028206 test-first 1 2281 true +1476221028207 test-first 1 2281 true +1476221028208 test-first 1 2281 true +1476221028209 test-first 1 2281 true +1476221028210 test-first 1 2281 true diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index 34c1f12..b760a33 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -1,3 +1,4 @@ 1476218268243 production 1 4281 false 1476218304475 refactoring 2A 9 true 1476218315352 refactoring 2A 2 false +1476221028091 test-first 1 2281 true diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index 37f7ff6..02ea743 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -1,3 +1,4 @@ -1476218268243 production 1 4281 false -1476218304475 refactoring 2A 36 false -1476218315352 refactoring 2A 10 false +1476218268243 production 1 4281 true +1476218304475 refactoring 2A 36 true +1476218315352 refactoring 2A 10 true +1476221028091 test-first 1 2712 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index c2a840a..6660005 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -59,7 +59,7 @@ public void subtractionDetected() throws RomanNumeralException { } @Test - public void maxThreeRepeats() { + public void maxThreeRepeats() throws RomanNumeralException { RomanNumerals romans = new RomanNumerals(); boolean caseFailed = false; int i = 0; @@ -86,4 +86,32 @@ public void maxThreeRepeats() { assertTrue("Repeating of '1' symbols is not ok for test case: " + i, false == caseFailed); } + + @Test + public void fiveSymbolsNotRepeated() { + RomanNumerals romans = new RomanNumerals(); + boolean caseFailed = false; + int i = 0; + + String[] testCases = { + "DCCLL", + "MDDLX", + "DCDLXIV" + }; + + boolean[] correctResults = { + false, + , + }; + + for (i = 0; i < testCases.length; i++) { + if (correctResults[i] != romans.repeatingOkFiveSymbols(testCases[i])) { + caseFailed = true; + break; + } + } + + assertTrue("Repeating of '5' symbols is not ok for test case: " + i, + false == caseFailed); + } } From 97ad7612b8022e274c8178e3b1bf54041bb89fa0 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:34:08 +0300 Subject: [PATCH 51/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 7 +++++++ src/RomanNumerals.java | 5 +++++ tests/TestRomanNumerals.java | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 98f4311..3f569a6 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -199,3 +199,10 @@ RefactoringAction 1476221279507 TestRomanNumerals.java ADD void fiveSymbols FIEL RefactoringAction 1476221282514 TestRomanNumerals.java RENAME fiveSymbols=>void fiveSymbolsNotRepeated FIELD RefactoringAction 1476221286526 TestRomanNumerals.java RENAME fiveSymbolsNotRepeated=>void fiveSymbolsNotRepeated() METHOD EditAction 1476221556366 TestRomanNumerals.java 2319 4 16 3 +CompilationAction 1476221556517 TestRomanNumerals.java +CompilationAction 1476221556517 TestRomanNumerals.java +CompilationAction 1476221622135 TestRomanNumerals.java +CompilationAction 1476221622135 TestRomanNumerals.java +CompilationAction 1476221622298 TestRomanNumerals.java +RefactoringAction 1476221640999 RomanNumerals.java ADD boolean repeatingOkFiveSymbols(String) METHOD +EditAction 1476221648158 RomanNumerals.java 2784 8 29 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 4621876..3ec3e3d 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -106,4 +106,9 @@ public boolean isOneSymbol(String sym) throws RomanNumeralException { return false; } + + public boolean repeatingOkFiveSymbols(String string) { + // TODO Auto-generated method stub + return false; + } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 6660005..ea6e9e4 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -101,7 +101,8 @@ public void fiveSymbolsNotRepeated() { boolean[] correctResults = { false, - , + false, + true }; for (i = 0; i < testCases.length; i++) { From 7fdcb651df8ac662a0df78eef34b59ed60b72822 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:41:44 +0300 Subject: [PATCH 52/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 11 +++++++++++ src/RomanNumerals.java | 26 +++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 3f569a6..d506863 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -206,3 +206,14 @@ CompilationAction 1476221622135 TestRomanNumerals.java CompilationAction 1476221622298 TestRomanNumerals.java RefactoringAction 1476221640999 RomanNumerals.java ADD boolean repeatingOkFiveSymbols(String) METHOD EditAction 1476221648158 RomanNumerals.java 2784 8 29 0 +UnitTestCaseAction 1476221652856 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476221652857 TestRomanNumerals.java FAIL +RefactoringAction 1476221873309 RomanNumerals.java ADD boolean isFiveSymbol FIELD +RefactoringAction 1476221875818 RomanNumerals.java RENAME isFiveSymbol=>boolean isFiveSymbol() METHOD +CompilationAction 1476221896859 RomanNumerals.java +CompilationAction 1476221904392 RomanNumerals.java +CompilationAction 1476221923314 RomanNumerals.java +CompilationAction 1476221979646 RomanNumerals.java +CompilationAction 1476221999310 RomanNumerals.java +CompilationAction 1476221999499 RomanNumerals.java +EditAction 1476222104167 RomanNumerals.java 3299 9 34 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3ec3e3d..e627728 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -65,6 +65,9 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if ((pos + 2) > romanNum.length()) return false; + // test if left from leftmost of subtraction is same as leftmost of subtraction + // test if in IV before I is another I -> fail + if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; @@ -106,9 +109,26 @@ public boolean isOneSymbol(String sym) throws RomanNumeralException { return false; } - - public boolean repeatingOkFiveSymbols(String string) { - // TODO Auto-generated method stub + + public boolean isFiveSymbol(String sym) throws RomanNumeralException { + String[] fiveSymbols = { "I", "X", "C", "M" }; + + if (sym.length() > 1) + throw new RomanNumeralException("Only one character must be checked with isFiveSymbol"); + + for (int i = 0; i < fiveSymbols.length; i++) { + if (sym.equals(fiveSymbols[i])) + return true; + } + return false; } + + public boolean repeatingOkFiveSymbols(String num) { + for (int i = 0; i < num.length(); i++) { + + } + + return ; + } } From b65fd41f3e729586a49b6cfe6f0504ee13e40389 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:45:37 +0300 Subject: [PATCH 53/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 11 +++++++++++ src/RomanNumerals.java | 22 +++++++++++++--------- tests/TestRomanNumerals.java | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index d506863..6b0b01d 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -217,3 +217,14 @@ CompilationAction 1476221979646 RomanNumerals.java CompilationAction 1476221999310 RomanNumerals.java CompilationAction 1476221999499 RomanNumerals.java EditAction 1476222104167 RomanNumerals.java 3299 9 34 0 +CompilationAction 1476222104316 RomanNumerals.java +CompilationAction 1476222155917 RomanNumerals.java +CompilationAction 1476222156080 RomanNumerals.java +CompilationAction 1476222221063 RomanNumerals.java +CompilationAction 1476222221259 RomanNumerals.java +CompilationAction 1476222240831 RomanNumerals.java +CompilationAction 1476222241010 TestRomanNumerals.java +CompilationAction 1476222256287 TestRomanNumerals.java +UnitTestCaseAction 1476222261722 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476222261722 TestRomanNumerals.java FAIL +EditAction 1476222337241 RomanNumerals.java 3506 9 35 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e627728..165b319 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -92,12 +92,7 @@ public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { } public boolean isOneSymbol(String sym) throws RomanNumeralException { - String[] oneSymbols = { - "I", - "X", - "C", - "M" - }; + String[] oneSymbols = { "I", "X", "C", "M" }; if (sym.length() > 1) throw new RomanNumeralException("Only one character must be checked with isOneSymbol"); @@ -111,7 +106,7 @@ public boolean isOneSymbol(String sym) throws RomanNumeralException { } public boolean isFiveSymbol(String sym) throws RomanNumeralException { - String[] fiveSymbols = { "I", "X", "C", "M" }; + String[] fiveSymbols = { "V", "L", "D" }; if (sym.length() > 1) throw new RomanNumeralException("Only one character must be checked with isFiveSymbol"); @@ -124,11 +119,20 @@ public boolean isFiveSymbol(String sym) throws RomanNumeralException { return false; } - public boolean repeatingOkFiveSymbols(String num) { + public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { + int subsequentAmount = 0; + for (int i = 0; i < num.length(); i++) { + if (isFiveSymbol(num.substring(i, i + 1))) { + subsequentAmount++; + } else { + subsequentAmount = 0; + } + if (subsequentAmount > 1) + return false; } - return ; + return true; } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index ea6e9e4..9cd7979 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -88,7 +88,7 @@ public void maxThreeRepeats() throws RomanNumeralException { } @Test - public void fiveSymbolsNotRepeated() { + public void fiveSymbolsNotRepeated() throws RomanNumeralException { RomanNumerals romans = new RomanNumerals(); boolean caseFailed = false; int i = 0; From edd788af844dd4a6b13d653658f9ef98f5f1ac12 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:50:13 +0300 Subject: [PATCH 54/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 6b0b01d..a2bfb87 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -228,3 +228,6 @@ CompilationAction 1476222256287 TestRomanNumerals.java UnitTestCaseAction 1476222261722 TestRomanNumerals.java FAIL UnitTestSessionAction 1476222261722 TestRomanNumerals.java FAIL EditAction 1476222337241 RomanNumerals.java 3506 9 35 0 +UnitTestCaseAction 1476222341075 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476222341076 TestRomanNumerals.java FAIL +EditAction 1476222613287 RomanNumerals.java 3595 9 35 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 165b319..67a9e26 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -124,6 +124,7 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { for (int i = 0; i < num.length(); i++) { if (isFiveSymbol(num.substring(i, i + 1))) { + System.out.println("incrementing subsqtAmt because of: " + num.substring(i, i + 1)); subsequentAmount++; } else { subsequentAmount = 0; From 968e070e4ce74a8330d2aad86c343e5c4ddb0f27 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:50:47 +0300 Subject: [PATCH 55/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index a2bfb87..8fd4c71 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -231,3 +231,6 @@ EditAction 1476222337241 RomanNumerals.java 3506 9 35 0 UnitTestCaseAction 1476222341075 TestRomanNumerals.java FAIL UnitTestSessionAction 1476222341076 TestRomanNumerals.java FAIL EditAction 1476222613287 RomanNumerals.java 3595 9 35 0 +UnitTestCaseAction 1476222618653 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476222618654 TestRomanNumerals.java FAIL +EditAction 1476222647424 RomanNumerals.java 3623 9 35 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 67a9e26..9aa34fa 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -124,7 +124,7 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { for (int i = 0; i < num.length(); i++) { if (isFiveSymbol(num.substring(i, i + 1))) { - System.out.println("incrementing subsqtAmt because of: " + num.substring(i, i + 1)); + System.out.println("incrementing subsqtAmt (" + subsequentAmount + ") because of: " + num.substring(i, i + 1)); subsequentAmount++; } else { subsequentAmount = 0; From 87c6f9588d0430726c3b3693299cfab1d5c1a893 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:52:27 +0300 Subject: [PATCH 56/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 8fd4c71..cc64cb8 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -234,3 +234,6 @@ EditAction 1476222613287 RomanNumerals.java 3595 9 35 0 UnitTestCaseAction 1476222618653 TestRomanNumerals.java FAIL UnitTestSessionAction 1476222618654 TestRomanNumerals.java FAIL EditAction 1476222647424 RomanNumerals.java 3623 9 35 0 +UnitTestCaseAction 1476222654166 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476222654166 TestRomanNumerals.java FAIL +EditAction 1476222746943 RomanNumerals.java 3685 9 35 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9aa34fa..8b0dc7a 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -123,6 +123,7 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { int subsequentAmount = 0; for (int i = 0; i < num.length(); i++) { + System.out.println("handling " + num.substring(i, i + 1)); if (isFiveSymbol(num.substring(i, i + 1))) { System.out.println("incrementing subsqtAmt (" + subsequentAmount + ") because of: " + num.substring(i, i + 1)); subsequentAmount++; From c75ed827889a2aa7ff7a279ad188f0c0ad1494c0 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:55:59 +0300 Subject: [PATCH 57/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index cc64cb8..c96e66d 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -237,3 +237,6 @@ EditAction 1476222647424 RomanNumerals.java 3623 9 35 0 UnitTestCaseAction 1476222654166 TestRomanNumerals.java FAIL UnitTestSessionAction 1476222654166 TestRomanNumerals.java FAIL EditAction 1476222746943 RomanNumerals.java 3685 9 35 0 +UnitTestCaseAction 1476222750701 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476222750702 TestRomanNumerals.java FAIL +EditAction 1476222959422 RomanNumerals.java 3779 9 36 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 8b0dc7a..28ca911 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -76,9 +76,10 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { int subsequentAmount = 0; + String prev = ""; for (int i = 0; i < num.length(); i++) { - if (isOneSymbol(num.substring(i, i + 1))) { + if (prev == num.substring(i, i + 1) && isOneSymbol(num.substring(i, i + 1))) { subsequentAmount++; } else { subsequentAmount = 0; @@ -86,6 +87,8 @@ public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { if (subsequentAmount > 3) return false; + + prev = num.substring(i, i + 1); } return true; From 7dd79da0b8a0d195952308fe3d06470c3eebeb69 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 00:57:03 +0300 Subject: [PATCH 58/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index c96e66d..6567753 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -240,3 +240,6 @@ EditAction 1476222746943 RomanNumerals.java 3685 9 35 0 UnitTestCaseAction 1476222750701 TestRomanNumerals.java FAIL UnitTestSessionAction 1476222750702 TestRomanNumerals.java FAIL EditAction 1476222959422 RomanNumerals.java 3779 9 36 0 +UnitTestCaseAction 1476222966660 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476222966661 TestRomanNumerals.java FAIL +EditAction 1476223023264 RomanNumerals.java 3784 9 36 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 28ca911..9af9dd7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -79,7 +79,7 @@ public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { String prev = ""; for (int i = 0; i < num.length(); i++) { - if (prev == num.substring(i, i + 1) && isOneSymbol(num.substring(i, i + 1))) { + if (prev.equals(num.substring(i, i + 1)) && isOneSymbol(num.substring(i, i + 1))) { subsequentAmount++; } else { subsequentAmount = 0; From 0d7db62cb263821df505a7970b51f0fe6561aba4 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:00:12 +0300 Subject: [PATCH 59/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 6567753..cd3e807 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -243,3 +243,6 @@ EditAction 1476222959422 RomanNumerals.java 3779 9 36 0 UnitTestCaseAction 1476222966660 TestRomanNumerals.java FAIL UnitTestSessionAction 1476222966661 TestRomanNumerals.java FAIL EditAction 1476223023264 RomanNumerals.java 3784 9 36 0 +UnitTestCaseAction 1476223026581 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476223026582 TestRomanNumerals.java FAIL +EditAction 1476223212258 RomanNumerals.java 3790 9 36 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9af9dd7..fd49053 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -79,6 +79,7 @@ public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { String prev = ""; for (int i = 0; i < num.length(); i++) { + System.out.println("handling " + num.substring(i, i + 1)); if (prev.equals(num.substring(i, i + 1)) && isOneSymbol(num.substring(i, i + 1))) { subsequentAmount++; } else { @@ -126,9 +127,9 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { int subsequentAmount = 0; for (int i = 0; i < num.length(); i++) { - System.out.println("handling " + num.substring(i, i + 1)); + if (isFiveSymbol(num.substring(i, i + 1))) { - System.out.println("incrementing subsqtAmt (" + subsequentAmount + ") because of: " + num.substring(i, i + 1)); + //System.out.println("incrementing subsqtAmt (" + subsequentAmount + ") because of: " + num.substring(i, i + 1)); subsequentAmount++; } else { subsequentAmount = 0; From d06abdcc9a626db5342870c8cbdc88d19315c5e9 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:01:27 +0300 Subject: [PATCH 60/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index cd3e807..6d7d6e3 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -246,3 +246,6 @@ EditAction 1476223023264 RomanNumerals.java 3784 9 36 0 UnitTestCaseAction 1476223026581 TestRomanNumerals.java FAIL UnitTestSessionAction 1476223026582 TestRomanNumerals.java FAIL EditAction 1476223212258 RomanNumerals.java 3790 9 36 0 +UnitTestCaseAction 1476223217524 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476223217525 TestRomanNumerals.java FAIL +EditAction 1476223287759 RomanNumerals.java 3852 9 36 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index fd49053..5dca301 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -79,7 +79,7 @@ public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { String prev = ""; for (int i = 0; i < num.length(); i++) { - System.out.println("handling " + num.substring(i, i + 1)); + System.out.println("handling " + num.substring(i, i + 1) + "prev equal test: " + prev.equals(num.substring(i, i + 1)) ); if (prev.equals(num.substring(i, i + 1)) && isOneSymbol(num.substring(i, i + 1))) { subsequentAmount++; } else { From 8ea066097c46efe0ad5e2cfcb078c76636411b13 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:02:11 +0300 Subject: [PATCH 61/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 6d7d6e3..54f052a 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -249,3 +249,6 @@ EditAction 1476223212258 RomanNumerals.java 3790 9 36 0 UnitTestCaseAction 1476223217524 TestRomanNumerals.java FAIL UnitTestSessionAction 1476223217525 TestRomanNumerals.java FAIL EditAction 1476223287759 RomanNumerals.java 3852 9 36 0 +UnitTestCaseAction 1476223291482 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476223291483 TestRomanNumerals.java FAIL +EditAction 1476223331479 RomanNumerals.java 3852 9 36 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 5dca301..62f97a5 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -86,7 +86,7 @@ public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { subsequentAmount = 0; } - if (subsequentAmount > 3) + if (subsequentAmount > 2) return false; prev = num.substring(i, i + 1); From 2c011a9a88edee1d4f34115c583281d61aa4da5a Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:03:28 +0300 Subject: [PATCH 62/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 54f052a..e6854f7 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -252,3 +252,6 @@ EditAction 1476223287759 RomanNumerals.java 3852 9 36 0 UnitTestCaseAction 1476223291482 TestRomanNumerals.java FAIL UnitTestSessionAction 1476223291483 TestRomanNumerals.java FAIL EditAction 1476223331479 RomanNumerals.java 3852 9 36 0 +UnitTestCaseAction 1476223344508 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476223344508 TestRomanNumerals.java FAIL +EditAction 1476223408543 RomanNumerals.java 3947 9 37 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 62f97a5..e3f65ce 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -125,10 +125,10 @@ public boolean isFiveSymbol(String sym) throws RomanNumeralException { public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { int subsequentAmount = 0; + String prev = ""; for (int i = 0; i < num.length(); i++) { - - if (isFiveSymbol(num.substring(i, i + 1))) { + if (prev.equals(num.substring(i, i + 1)) && isFiveSymbol(num.substring(i, i + 1))) { //System.out.println("incrementing subsqtAmt (" + subsequentAmount + ") because of: " + num.substring(i, i + 1)); subsequentAmount++; } else { @@ -137,6 +137,8 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { if (subsequentAmount > 1) return false; + + prev = num.substring(i, i + 1); } return true; From 1eebdc36a7b58b0d51d3733d1aa0b2ace5133a35 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:03:52 +0300 Subject: [PATCH 63/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index e6854f7..6de420b 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -255,3 +255,6 @@ EditAction 1476223331479 RomanNumerals.java 3852 9 36 0 UnitTestCaseAction 1476223344508 TestRomanNumerals.java FAIL UnitTestSessionAction 1476223344508 TestRomanNumerals.java FAIL EditAction 1476223408543 RomanNumerals.java 3947 9 37 0 +UnitTestCaseAction 1476223413788 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476223413789 TestRomanNumerals.java FAIL +EditAction 1476223432863 RomanNumerals.java 3947 9 37 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e3f65ce..74805ca 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -79,7 +79,6 @@ public boolean repeatingOkOneSymbols(String num) throws RomanNumeralException { String prev = ""; for (int i = 0; i < num.length(); i++) { - System.out.println("handling " + num.substring(i, i + 1) + "prev equal test: " + prev.equals(num.substring(i, i + 1)) ); if (prev.equals(num.substring(i, i + 1)) && isOneSymbol(num.substring(i, i + 1))) { subsequentAmount++; } else { @@ -128,6 +127,7 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { String prev = ""; for (int i = 0; i < num.length(); i++) { + System.out.println("handling " + num.substring(i, i + 1) + "prev equal test: " + prev.equals(num.substring(i, i + 1)) ); if (prev.equals(num.substring(i, i + 1)) && isFiveSymbol(num.substring(i, i + 1))) { //System.out.println("incrementing subsqtAmt (" + subsequentAmount + ") because of: " + num.substring(i, i + 1)); subsequentAmount++; From 4b783d232638b16b89ef325b31da06efa776d207 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:04:42 +0300 Subject: [PATCH 64/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 6de420b..0b83ae4 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -258,3 +258,6 @@ EditAction 1476223408543 RomanNumerals.java 3947 9 37 0 UnitTestCaseAction 1476223413788 TestRomanNumerals.java FAIL UnitTestSessionAction 1476223413789 TestRomanNumerals.java FAIL EditAction 1476223432863 RomanNumerals.java 3947 9 37 0 +UnitTestCaseAction 1476223436081 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476223436082 TestRomanNumerals.java FAIL +EditAction 1476223482209 RomanNumerals.java 3947 9 37 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 74805ca..0acf767 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -135,7 +135,7 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { subsequentAmount = 0; } - if (subsequentAmount > 1) + if (subsequentAmount > 0) return false; prev = num.substring(i, i + 1); From 9608e5839a9924986a743a9b15a665e56e21dc2d Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:05:26 +0300 Subject: [PATCH 65/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 + .../20161011222626759/besouroEpisodes.txt | 68 +++++++++++++++++++ .../randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 2 - 5 files changed, 73 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 0b83ae4..2a2bcbe 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -261,3 +261,6 @@ EditAction 1476223432863 RomanNumerals.java 3947 9 37 0 UnitTestCaseAction 1476223436081 TestRomanNumerals.java FAIL UnitTestSessionAction 1476223436082 TestRomanNumerals.java FAIL EditAction 1476223482209 RomanNumerals.java 3947 9 37 0 +UnitTestCaseAction 1476223499473 TestRomanNumerals.java OK +UnitTestSessionAction 1476223499473 TestRomanNumerals.java OK +EditAction 1476223526247 RomanNumerals.java 3704 9 37 0 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index 5aa8a0d..0346859 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -124,3 +124,71 @@ 1476221028208 test-first 1 2281 true 1476221028209 test-first 1 2281 true 1476221028210 test-first 1 2281 true +1476223499473 refactoring 3 2219 true +1476223499474 refactoring 3 2219 true +1476223499475 refactoring 3 2219 true +1476223499476 refactoring 3 2219 true +1476223499477 refactoring 3 2219 true +1476223499478 refactoring 3 2219 true +1476223499479 refactoring 3 2219 true +1476223499480 refactoring 3 2219 true +1476223499481 refactoring 3 2219 true +1476223499482 refactoring 3 2219 true +1476223499483 refactoring 3 2219 true +1476223499484 refactoring 3 2219 true +1476223499485 refactoring 3 2219 true +1476223499486 refactoring 3 2219 true +1476223499487 refactoring 3 2219 true +1476223499488 refactoring 3 2219 true +1476223499489 refactoring 3 2219 true +1476223499490 refactoring 3 2219 true +1476223499491 refactoring 3 2219 true +1476223499492 refactoring 3 2219 true +1476223499493 refactoring 3 2219 true +1476223499494 refactoring 3 2219 true +1476223499495 refactoring 3 2219 true +1476223499496 refactoring 3 2219 true +1476223499497 refactoring 3 2219 true +1476223499498 refactoring 3 2219 true +1476223499499 refactoring 3 2219 true +1476223499500 refactoring 3 2219 true +1476223499501 refactoring 3 2219 true +1476223499502 refactoring 3 2219 true +1476223499503 refactoring 3 2219 true +1476223499504 refactoring 3 2219 true +1476223499505 refactoring 3 2219 true +1476223499506 refactoring 3 2219 true +1476223499507 refactoring 3 2219 true +1476223499508 refactoring 3 2219 true +1476223499509 refactoring 3 2219 true +1476223499510 refactoring 3 2219 true +1476223499511 refactoring 3 2219 true +1476223499512 refactoring 3 2219 true +1476223499513 refactoring 3 2219 true +1476223499514 refactoring 3 2219 true +1476223499515 refactoring 3 2219 true +1476223499516 refactoring 3 2219 true +1476223499517 refactoring 3 2219 true +1476223499518 refactoring 3 2219 true +1476223499519 refactoring 3 2219 true +1476223499520 refactoring 3 2219 true +1476223499521 refactoring 3 2219 true +1476223499522 refactoring 3 2219 true +1476223499523 refactoring 3 2219 true +1476223499524 refactoring 3 2219 true +1476223499525 refactoring 3 2219 true +1476223499526 refactoring 3 2219 true +1476223499527 refactoring 3 2219 true +1476223499528 refactoring 3 2219 true +1476223499529 refactoring 3 2219 true +1476223499530 refactoring 3 2219 true +1476223499531 refactoring 3 2219 true +1476223499532 refactoring 3 2219 true +1476223499533 refactoring 3 2219 true +1476223499534 refactoring 3 2219 true +1476223499535 refactoring 3 2219 true +1476223499536 refactoring 3 2219 true +1476223499537 refactoring 3 2219 true +1476223499538 refactoring 3 2219 true +1476223499539 refactoring 3 2219 true +1476223499540 refactoring 3 2219 true diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index b760a33..5de4598 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -2,3 +2,4 @@ 1476218304475 refactoring 2A 9 true 1476218315352 refactoring 2A 2 false 1476221028091 test-first 1 2281 true +1476223499473 refactoring 3 2219 true diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index 02ea743..a02e83f 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -2,3 +2,4 @@ 1476218304475 refactoring 2A 36 true 1476218315352 refactoring 2A 10 true 1476221028091 test-first 1 2712 true +1476223499473 refactoring 3 2471 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0acf767..10f9cfe 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -127,9 +127,7 @@ public boolean repeatingOkFiveSymbols(String num) throws RomanNumeralException { String prev = ""; for (int i = 0; i < num.length(); i++) { - System.out.println("handling " + num.substring(i, i + 1) + "prev equal test: " + prev.equals(num.substring(i, i + 1)) ); if (prev.equals(num.substring(i, i + 1)) && isFiveSymbol(num.substring(i, i + 1))) { - //System.out.println("incrementing subsqtAmt (" + subsequentAmount + ") because of: " + num.substring(i, i + 1)); subsequentAmount++; } else { subsequentAmount = 0; From 771f04b4ea278d2e03aad92026812e90d7becd19 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:07:16 +0300 Subject: [PATCH 66/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 2a2bcbe..09ac477 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -264,3 +264,4 @@ EditAction 1476223482209 RomanNumerals.java 3947 9 37 0 UnitTestCaseAction 1476223499473 TestRomanNumerals.java OK UnitTestSessionAction 1476223499473 TestRomanNumerals.java OK EditAction 1476223526247 RomanNumerals.java 3704 9 37 0 +EditAction 1476223636311 RomanNumerals.java 3772 9 37 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 10f9cfe..1b8132f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -68,6 +68,10 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept // test if left from leftmost of subtraction is same as leftmost of subtraction // test if in IV before I is another I -> fail + // '5' symbols can never be subtracted + if (isFiveSymbol) + + if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; From 3700068a6832d6f300cd4e623270c443fc90f097 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:07:49 +0300 Subject: [PATCH 67/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 2 ++ src/RomanNumerals.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 09ac477..7e2ee3e 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -265,3 +265,5 @@ UnitTestCaseAction 1476223499473 TestRomanNumerals.java OK UnitTestSessionAction 1476223499473 TestRomanNumerals.java OK EditAction 1476223526247 RomanNumerals.java 3704 9 37 0 EditAction 1476223636311 RomanNumerals.java 3772 9 37 0 +CompilationAction 1476223636458 RomanNumerals.java +EditAction 1476223669230 RomanNumerals.java 3806 9 37 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1b8132f..8b6ffc0 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -69,7 +69,7 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept // test if in IV before I is another I -> fail // '5' symbols can never be subtracted - if (isFiveSymbol) + if (isFiveSymbol(romanNum.substring(pos, pos + 1))) if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) From 053f04e3b78776187af35920d277eed14d13d580 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:07:59 +0300 Subject: [PATCH 68/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 7e2ee3e..2127d97 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -267,3 +267,4 @@ EditAction 1476223526247 RomanNumerals.java 3704 9 37 0 EditAction 1476223636311 RomanNumerals.java 3772 9 37 0 CompilationAction 1476223636458 RomanNumerals.java EditAction 1476223669230 RomanNumerals.java 3806 9 37 0 +EditAction 1476223679582 RomanNumerals.java 3819 9 38 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 8b6ffc0..07172aa 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -70,7 +70,7 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept // '5' symbols can never be subtracted if (isFiveSymbol(romanNum.substring(pos, pos + 1))) - + return false; if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; From ee83bd3bb8bb36e296e6d404160d339b33b01508 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:10:12 +0300 Subject: [PATCH 69/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ .besouro/20161011222626759/besouroEpisodes.txt | 2 ++ .besouro/20161011222626759/randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 1 + 5 files changed, 8 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 2127d97..e68027a 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -268,3 +268,6 @@ EditAction 1476223636311 RomanNumerals.java 3772 9 37 0 CompilationAction 1476223636458 RomanNumerals.java EditAction 1476223669230 RomanNumerals.java 3806 9 37 0 EditAction 1476223679582 RomanNumerals.java 3819 9 38 0 +UnitTestCaseAction 1476223700474 TestRomanNumerals.java OK +UnitTestSessionAction 1476223700474 TestRomanNumerals.java OK +EditAction 1476223812903 RomanNumerals.java 3912 9 38 0 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index 0346859..0789e46 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -192,3 +192,5 @@ 1476223499538 refactoring 3 2219 true 1476223499539 refactoring 3 2219 true 1476223499540 refactoring 3 2219 true +1476223700474 production 1 174 false +1476223700475 refactoring 2A 174 true diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index 5de4598..955103a 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -3,3 +3,4 @@ 1476218315352 refactoring 2A 2 false 1476221028091 test-first 1 2281 true 1476223499473 refactoring 3 2219 true +1476223700474 production 1 174 false diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index a02e83f..19d68fe 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -3,3 +3,4 @@ 1476218315352 refactoring 2A 10 true 1476221028091 test-first 1 2712 true 1476223499473 refactoring 3 2471 true +1476223700474 production 1 201 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 07172aa..e8df190 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -67,6 +67,7 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept // test if left from leftmost of subtraction is same as leftmost of subtraction // test if in IV before I is another I -> fail + if (pos - 1 >= 0 && romanNum.substring(pos, pos + 1) == romanNum.substring(pos - 1, pos)) // '5' symbols can never be subtracted if (isFiveSymbol(romanNum.substring(pos, pos + 1))) From bc5555af7f4a35b732da92fc15feeb92c5bd80ff Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:10:44 +0300 Subject: [PATCH 70/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index e68027a..dd4cad7 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -271,3 +271,4 @@ EditAction 1476223679582 RomanNumerals.java 3819 9 38 0 UnitTestCaseAction 1476223700474 TestRomanNumerals.java OK UnitTestSessionAction 1476223700474 TestRomanNumerals.java OK EditAction 1476223812903 RomanNumerals.java 3912 9 38 0 +EditAction 1476223844224 RomanNumerals.java 3851 9 39 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index e8df190..fb919b7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -65,9 +65,9 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if ((pos + 2) > romanNum.length()) return false; - // test if left from leftmost of subtraction is same as leftmost of subtraction // test if in IV before I is another I -> fail - if (pos - 1 >= 0 && romanNum.substring(pos, pos + 1) == romanNum.substring(pos - 1, pos)) + if (pos - 1 >= 0 && romanNum.substring(pos, pos + 1).equals(romanNum.substring(pos - 1, pos))) + return false; // '5' symbols can never be subtracted if (isFiveSymbol(romanNum.substring(pos, pos + 1))) From 348e4997dc0c27c86401b59ced0948628f2b4de1 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:16:34 +0300 Subject: [PATCH 71/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 7 +++++++ .besouro/20161011222626759/besouroEpisodes.txt | 2 ++ .besouro/20161011222626759/randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 3 ++- 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index dd4cad7..0114899 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -272,3 +272,10 @@ UnitTestCaseAction 1476223700474 TestRomanNumerals.java OK UnitTestSessionAction 1476223700474 TestRomanNumerals.java OK EditAction 1476223812903 RomanNumerals.java 3912 9 38 0 EditAction 1476223844224 RomanNumerals.java 3851 9 39 0 +UnitTestCaseAction 1476223849422 TestRomanNumerals.java OK +UnitTestSessionAction 1476223849423 TestRomanNumerals.java OK +RefactoringAction 1476224094213 RomanNumerals.java ADD String FIELD +RefactoringAction 1476224098223 RomanNumerals.java RENAME roman=>String FIELD +RefactoringAction 1476224184916 RomanNumerals.java ADD int FIELD +RefactoringAction 1476224193927 RomanNumerals.java REMOVE roman FIELD +EditAction 1476224194262 RomanNumerals.java 3919 9 39 0 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index 0789e46..0475d5c 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -194,3 +194,5 @@ 1476223499540 refactoring 3 2219 true 1476223700474 production 1 174 false 1476223700475 refactoring 2A 174 true +1476223849423 production 1 36 false +1476223849424 refactoring 2A 36 true diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index 955103a..7d90e57 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -4,3 +4,4 @@ 1476221028091 test-first 1 2281 true 1476223499473 refactoring 3 2219 true 1476223700474 production 1 174 false +1476223849423 production 1 36 false diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index 19d68fe..79d76fb 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -4,3 +4,4 @@ 1476221028091 test-first 1 2712 true 1476223499473 refactoring 3 2471 true 1476223700474 production 1 201 true +1476223849423 production 1 148 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index fb919b7..bf4591b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,7 +1,8 @@ import java.util.Hashtable; public class RomanNumerals { - private Hashtable numTable; + private Hashtable numTable; + private String[] romanChars = { "I", "V", "X", "L", "C", "D", "M" }; public RomanNumerals() { numTable = new Hashtable(); From bda3f1010d08c0dabdf5bc9fc12c47f2162e159a Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:24:07 +0300 Subject: [PATCH 72/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 9 ++++++++ .../20161011222626759/besouroEpisodes.txt | 1 + .../randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 23 +++++++++++-------- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 0114899..855cc90 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -279,3 +279,12 @@ RefactoringAction 1476224098223 RomanNumerals.java RENAME roman=>String FIELD RefactoringAction 1476224184916 RomanNumerals.java ADD int FIELD RefactoringAction 1476224193927 RomanNumerals.java REMOVE roman FIELD EditAction 1476224194262 RomanNumerals.java 3919 9 39 0 +RefactoringAction 1476224287030 RomanNumerals.java ADD int FIELD +RefactoringAction 1476224347143 RomanNumerals.java RENAME numTable=>Hashtable indexTable FIELD +CompilationAction 1476224367948 RomanNumerals.java +CompilationAction 1476224376191 RomanNumerals.java +UnitTestCaseAction 1476224390705 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476224390706 TestRomanNumerals.java FAIL +UnitTestCaseAction 1476224498221 TestRomanNumerals.java OK +UnitTestSessionAction 1476224498222 TestRomanNumerals.java OK +EditAction 1476224647031 RomanNumerals.java 4110 9 39 0 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index 0475d5c..84344c9 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -196,3 +196,4 @@ 1476223700475 refactoring 2A 174 true 1476223849423 production 1 36 false 1476223849424 refactoring 2A 36 true +1476224498222 refactoring 2A 404 true diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index 7d90e57..ae1054c 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -5,3 +5,4 @@ 1476223499473 refactoring 3 2219 true 1476223700474 production 1 174 false 1476223849423 production 1 36 false +1476224498222 refactoring 2A 404 true diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index 79d76fb..fb65065 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -5,3 +5,4 @@ 1476223499473 refactoring 3 2471 true 1476223700474 production 1 201 true 1476223849423 production 1 148 true +1476224498222 refactoring 2A 648 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index bf4591b..3d1c08e 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,11 +1,12 @@ import java.util.Hashtable; public class RomanNumerals { - private Hashtable numTable; + private Hashtable indexTable; private String[] romanChars = { "I", "V", "X", "L", "C", "D", "M" }; + private int[] arabVals = { 1, 5, 10, 50, 100, 500, 1000 }; public RomanNumerals() { - numTable = new Hashtable(); + indexTable = new Hashtable(); fillNumTable(); } @@ -20,13 +21,13 @@ public RomanNumerals() { 9 IX 90 XC 900 CM */ private void fillNumTable() { - numTable.put("I", 1); - numTable.put("V", 5); - numTable.put("X", 10); - numTable.put("L", 50); - numTable.put("C", 100); - numTable.put("D", 500); - numTable.put("M", 1000); + indexTable.put("I", 0); + indexTable.put("V", 1); + indexTable.put("X", 2); + indexTable.put("L", 3); + indexTable.put("C", 4); + indexTable.put("D", 5); + indexTable.put("M", 6); } public int convertToInteger(String romanNum) throws RomanNumeralException { @@ -48,7 +49,7 @@ public int singleNumToInteger(String num) throws RomanNumeralException, NullPoin if (num.length() > 1) throw new RomanNumeralException("Only single numbers accepted"); - ret = numTable.get(num); + ret = arabVals[indexTable.get(num)]; if (null == ret) throw new RomanNumeralException("Arabic conversion for Roman number: " + num + " not found"); @@ -74,6 +75,8 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if (isFiveSymbol(romanNum.substring(pos, pos + 1))) return false; + if (indexTable.get(romanNum.substring(pos, pos + 2)) - indexTable.get(romanNum.substring(pos, pos + 1))) + if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; From 12cad639b9dd0dcf998e487362c6a9340498a2e7 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:28:46 +0300 Subject: [PATCH 73/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 5 +++++ src/RomanNumerals.java | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 855cc90..e48d503 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -288,3 +288,8 @@ UnitTestSessionAction 1476224390706 TestRomanNumerals.java FAIL UnitTestCaseAction 1476224498221 TestRomanNumerals.java OK UnitTestSessionAction 1476224498222 TestRomanNumerals.java OK EditAction 1476224647031 RomanNumerals.java 4110 9 39 0 +CompilationAction 1476224647179 RomanNumerals.java +CompilationAction 1476224816937 RomanNumerals.java +CompilationAction 1476224817103 RomanNumerals.java +CompilationAction 1476224889600 RomanNumerals.java +EditAction 1476224926648 RomanNumerals.java 4300 9 40 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3d1c08e..77bcc47 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -69,13 +69,13 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept // test if in IV before I is another I -> fail if (pos - 1 >= 0 && romanNum.substring(pos, pos + 1).equals(romanNum.substring(pos - 1, pos))) - return false; + throw new RomanNumeralException("Only one subtraction can be made per numeral"); - // '5' symbols can never be subtracted if (isFiveSymbol(romanNum.substring(pos, pos + 1))) - return false; + throw new RomanNumeralException("'5' symbols can never be subtracted"); - if (indexTable.get(romanNum.substring(pos, pos + 2)) - indexTable.get(romanNum.substring(pos, pos + 1))) + if (indexTable.get(romanNum.substring(pos, pos + 1)) - indexTable.get(romanNum.substring(pos, pos + 2)) < -2) + throw new RomanNumeralException("'1' symbols can only be subtracted from 2 next highest values"); if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) return true; From 0e5fb9f879c0066df4cc6d8aa176845c85d84fd3 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:31:26 +0300 Subject: [PATCH 74/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ src/RomanNumerals.java | 1 + 2 files changed, 4 insertions(+) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index e48d503..beccef5 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -293,3 +293,6 @@ CompilationAction 1476224816937 RomanNumerals.java CompilationAction 1476224817103 RomanNumerals.java CompilationAction 1476224889600 RomanNumerals.java EditAction 1476224926648 RomanNumerals.java 4300 9 40 0 +UnitTestCaseAction 1476224930258 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476224930259 TestRomanNumerals.java FAIL +EditAction 1476225086118 RomanNumerals.java 4417 9 33 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 77bcc47..0879526 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -74,6 +74,7 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if (isFiveSymbol(romanNum.substring(pos, pos + 1))) throw new RomanNumeralException("'5' symbols can never be subtracted"); + System.out.println(romanNum.substring(pos, pos + 1)) + " && " + indexTable.get(romanNum.substring(pos, pos + 2))); if (indexTable.get(romanNum.substring(pos, pos + 1)) - indexTable.get(romanNum.substring(pos, pos + 2)) < -2) throw new RomanNumeralException("'1' symbols can only be subtracted from 2 next highest values"); From 1042789983190109cd3aae28ce63d995d6cb07a0 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:33:32 +0300 Subject: [PATCH 75/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 7 +++++++ src/RomanNumerals.java | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index beccef5..8c7e10a 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -296,3 +296,10 @@ EditAction 1476224926648 RomanNumerals.java 4300 9 40 0 UnitTestCaseAction 1476224930258 TestRomanNumerals.java FAIL UnitTestSessionAction 1476224930259 TestRomanNumerals.java FAIL EditAction 1476225086118 RomanNumerals.java 4417 9 33 0 +CompilationAction 1476225086318 RomanNumerals.java +CompilationAction 1476225127678 RomanNumerals.java +UnitTestCaseAction 1476225130410 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476225130411 TestRomanNumerals.java FAIL +UnitTestCaseAction 1476225169182 TestRomanNumerals.java FAIL +UnitTestSessionAction 1476225169183 TestRomanNumerals.java FAIL +EditAction 1476225212567 RomanNumerals.java 4420 9 41 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 0879526..875e87f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -74,8 +74,8 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if (isFiveSymbol(romanNum.substring(pos, pos + 1))) throw new RomanNumeralException("'5' symbols can never be subtracted"); - System.out.println(romanNum.substring(pos, pos + 1)) + " && " + indexTable.get(romanNum.substring(pos, pos + 2))); - if (indexTable.get(romanNum.substring(pos, pos + 1)) - indexTable.get(romanNum.substring(pos, pos + 2)) < -2) + System.out.println(romanNum.substring(pos, pos + 1) + " && " + indexTable.get(romanNum.substring(pos, pos + 2))); + if (indexTable.get(romanNum.substring(pos, pos + 1)) - indexTable.get(romanNum.substring(pos + 1, pos + 2)) < -2) throw new RomanNumeralException("'1' symbols can only be subtracted from 2 next highest values"); if (convertToInteger(romanNum.substring(pos, pos + 1)) < convertToInteger(romanNum.substring((pos + 1), (pos + 2)))) From c21e5ecfb3c9192f20766f1af7d9d106a778907e Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:33:37 +0300 Subject: [PATCH 76/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 8c7e10a..46fe788 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -303,3 +303,4 @@ UnitTestSessionAction 1476225130411 TestRomanNumerals.java FAIL UnitTestCaseAction 1476225169182 TestRomanNumerals.java FAIL UnitTestSessionAction 1476225169183 TestRomanNumerals.java FAIL EditAction 1476225212567 RomanNumerals.java 4420 9 41 0 +EditAction 1476225217498 RomanNumerals.java 4424 9 41 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 875e87f..8845640 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -74,7 +74,7 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if (isFiveSymbol(romanNum.substring(pos, pos + 1))) throw new RomanNumeralException("'5' symbols can never be subtracted"); - System.out.println(romanNum.substring(pos, pos + 1) + " && " + indexTable.get(romanNum.substring(pos, pos + 2))); + System.out.println(romanNum.substring(pos, pos + 1) + " && " + indexTable.get(romanNum.substring(pos + 1, pos + 2))); if (indexTable.get(romanNum.substring(pos, pos + 1)) - indexTable.get(romanNum.substring(pos + 1, pos + 2)) < -2) throw new RomanNumeralException("'1' symbols can only be subtracted from 2 next highest values"); From 528ea92b8c5fb8f58cfa28dfb8a8a47243a29af1 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:33:52 +0300 Subject: [PATCH 77/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 3 +++ .besouro/20161011222626759/besouroEpisodes.txt | 2 ++ .besouro/20161011222626759/randomHeuristicEpisodes.txt | 1 + .besouro/20161011222626759/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 1 - 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 46fe788..2dc44fe 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -304,3 +304,6 @@ UnitTestCaseAction 1476225169182 TestRomanNumerals.java FAIL UnitTestSessionAction 1476225169183 TestRomanNumerals.java FAIL EditAction 1476225212567 RomanNumerals.java 4420 9 41 0 EditAction 1476225217498 RomanNumerals.java 4424 9 41 0 +UnitTestCaseAction 1476225220497 TestRomanNumerals.java OK +UnitTestSessionAction 1476225220498 TestRomanNumerals.java OK +EditAction 1476225232269 RomanNumerals.java 4304 9 40 0 diff --git a/.besouro/20161011222626759/besouroEpisodes.txt b/.besouro/20161011222626759/besouroEpisodes.txt index 84344c9..a58a158 100644 --- a/.besouro/20161011222626759/besouroEpisodes.txt +++ b/.besouro/20161011222626759/besouroEpisodes.txt @@ -197,3 +197,5 @@ 1476223849423 production 1 36 false 1476223849424 refactoring 2A 36 true 1476224498222 refactoring 2A 404 true +1476225220498 refactoring 2A 573 true +1476225220499 production 1 573 false diff --git a/.besouro/20161011222626759/randomHeuristicEpisodes.txt b/.besouro/20161011222626759/randomHeuristicEpisodes.txt index ae1054c..b2228d6 100644 --- a/.besouro/20161011222626759/randomHeuristicEpisodes.txt +++ b/.besouro/20161011222626759/randomHeuristicEpisodes.txt @@ -6,3 +6,4 @@ 1476223700474 production 1 174 false 1476223849423 production 1 36 false 1476224498222 refactoring 2A 404 true +1476225220498 refactoring 2A 573 false diff --git a/.besouro/20161011222626759/zorroEpisodes.txt b/.besouro/20161011222626759/zorroEpisodes.txt index fb65065..e04d895 100644 --- a/.besouro/20161011222626759/zorroEpisodes.txt +++ b/.besouro/20161011222626759/zorroEpisodes.txt @@ -6,3 +6,4 @@ 1476223700474 production 1 201 true 1476223849423 production 1 148 true 1476224498222 refactoring 2A 648 true +1476225220498 refactoring 2A 722 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 8845640..9bc1180 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -74,7 +74,6 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if (isFiveSymbol(romanNum.substring(pos, pos + 1))) throw new RomanNumeralException("'5' symbols can never be subtracted"); - System.out.println(romanNum.substring(pos, pos + 1) + " && " + indexTable.get(romanNum.substring(pos + 1, pos + 2))); if (indexTable.get(romanNum.substring(pos, pos + 1)) - indexTable.get(romanNum.substring(pos + 1, pos + 2)) < -2) throw new RomanNumeralException("'1' symbols can only be subtracted from 2 next highest values"); From 9ac5dacd4f85d68b6d4e588b546f2a8dfcef67e8 Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:33:56 +0300 Subject: [PATCH 78/79] besouro automatic message --- .besouro/20161011222626759/actions.txt | 1 + src/RomanNumerals.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.besouro/20161011222626759/actions.txt b/.besouro/20161011222626759/actions.txt index 2dc44fe..bd724f9 100644 --- a/.besouro/20161011222626759/actions.txt +++ b/.besouro/20161011222626759/actions.txt @@ -307,3 +307,4 @@ EditAction 1476225217498 RomanNumerals.java 4424 9 41 0 UnitTestCaseAction 1476225220497 TestRomanNumerals.java OK UnitTestSessionAction 1476225220498 TestRomanNumerals.java OK EditAction 1476225232269 RomanNumerals.java 4304 9 40 0 +EditAction 1476225236600 RomanNumerals.java 4255 9 40 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 9bc1180..d94da89 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -67,7 +67,6 @@ public boolean isSubtraction(String romanNum, int pos) throws RomanNumeralExcept if ((pos + 2) > romanNum.length()) return false; - // test if in IV before I is another I -> fail if (pos - 1 >= 0 && romanNum.substring(pos, pos + 1).equals(romanNum.substring(pos - 1, pos))) throw new RomanNumeralException("Only one subtraction can be made per numeral"); From db9dc66834696aa530ce6425ced0f3a49f84113d Mon Sep 17 00:00:00 2001 From: somename Date: Wed, 12 Oct 2016 01:34:49 +0300 Subject: [PATCH 79/79] besouro automatic message --- src/RomanNumerals.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index d94da89..0c3f3a9 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -2,7 +2,6 @@ public class RomanNumerals { private Hashtable indexTable; - private String[] romanChars = { "I", "V", "X", "L", "C", "D", "M" }; private int[] arabVals = { 1, 5, 10, 50, 100, 500, 1000 }; public RomanNumerals() {