From 602f4a956aca597e7c38428dad927b9c2df47f10 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:37:02 +0300 Subject: [PATCH 01/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 2 ++ .besouro/20160929153653315/besouroEpisodes.txt | 0 .besouro/20160929153653315/disagreements.txt | 0 .../20160929153653315/randomHeuristicEpisodes.txt | 0 .besouro/20160929153653315/userComments.txt | 0 .besouro/20160929153653315/zorroEpisodes.txt | 0 tests/TestRomanNumerals.java | 14 ++++++++++++++ 7 files changed, 16 insertions(+) create mode 100644 .besouro/20160929153653315/actions.txt create mode 100644 .besouro/20160929153653315/besouroEpisodes.txt create mode 100644 .besouro/20160929153653315/disagreements.txt create mode 100644 .besouro/20160929153653315/randomHeuristicEpisodes.txt create mode 100644 .besouro/20160929153653315/userComments.txt create mode 100644 .besouro/20160929153653315/zorroEpisodes.txt diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt new file mode 100644 index 0000000..c1eb016 --- /dev/null +++ b/.besouro/20160929153653315/actions.txt @@ -0,0 +1,2 @@ +FileOpenedAction 1475152613817 TestRomanNumerals.java 329 2 2 0 +EditAction 1475152622422 TestRomanNumerals.java 335 2 2 0 diff --git a/.besouro/20160929153653315/besouroEpisodes.txt b/.besouro/20160929153653315/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929153653315/disagreements.txt b/.besouro/20160929153653315/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929153653315/randomHeuristicEpisodes.txt b/.besouro/20160929153653315/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929153653315/userComments.txt b/.besouro/20160929153653315/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20160929153653315/zorroEpisodes.txt b/.besouro/20160929153653315/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5d1de75..69e86e9 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -6,6 +6,20 @@ public class TestRomanNumerals { @Test public void test() { + fail("Not yet implemented"); + + + + } + + @Test + public void test_FirstRule() { + //The symbols 'I', 'X', 'C', and 'M' can be repeated + // at most 3 times in a row. + + + + fail("Not yet implemented"); } From 797b20d56b9f0ecf73c09367e116c015128b6337 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:37:03 +0300 Subject: [PATCH 02/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + src/RomanNumerals.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index c1eb016..fec0f42 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -1,2 +1,3 @@ FileOpenedAction 1475152613817 TestRomanNumerals.java 329 2 2 0 EditAction 1475152622422 TestRomanNumerals.java 335 2 2 0 +EditAction 1475152622955 RomanNumerals.java 126 1 1 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 20904f0..da0ccca 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -3,6 +3,8 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { // To be Implemented return 0; + + } } From b477c561e7d416b1a36e9a624e38c09bd3398576 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:39:30 +0300 Subject: [PATCH 03/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 7 +++++++ tests/TestRomanNumerals.java | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index fec0f42..9db1261 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -1,3 +1,10 @@ FileOpenedAction 1475152613817 TestRomanNumerals.java 329 2 2 0 EditAction 1475152622422 TestRomanNumerals.java 335 2 2 0 EditAction 1475152622955 RomanNumerals.java 126 1 1 0 +RefactoringAction 1475152646342 TestRomanNumerals.java RENAME test_FirstRule()=>void test_Cher() METHOD +RefactoringAction 1475152647853 TestRomanNumerals.java RENAME test_Cher()=>void test_CherFor() METHOD +RefactoringAction 1475152659379 TestRomanNumerals.java RENAME test_CherFor()=>void test_CherFore() METHOD +RefactoringAction 1475152660407 TestRomanNumerals.java RENAME test_CherFore()=>void test_CherFor3() METHOD +RefactoringAction 1475152661434 TestRomanNumerals.java RENAME test_CherFor3()=>void test_CherFor3I() METHOD +RefactoringAction 1475152764363 TestRomanNumerals.java ADD RomanNumerals romanNumerals FIELD +EditAction 1475152770354 TestRomanNumerals.java 409 2 3 1 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 69e86e9..4c706ff 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -4,6 +4,8 @@ public class TestRomanNumerals { + RomanNumerals romanNumerals= new RomanNumerals(); + @Test public void test() { fail("Not yet implemented"); @@ -13,14 +15,13 @@ public void test() { } @Test - public void test_FirstRule() { + public void test_CherFor3I() { //The symbols 'I', 'X', 'C', and 'M' can be repeated // at most 3 times in a row. - - - - fail("Not yet implemented"); + String num="MCMLXXXIV"; + + assertTrue(cherFor3I(num)); } } From 5090ae5532360d5eb0c097571451d3e0cb9bac1d Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:41:50 +0300 Subject: [PATCH 04/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 4 ++++ src/RomanNumerals.java | 19 +++++++++++++++++++ tests/TestRomanNumerals.java | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 9db1261..298fc8c 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -8,3 +8,7 @@ RefactoringAction 1475152660407 TestRomanNumerals.java RENAME test_CherFore()=>v RefactoringAction 1475152661434 TestRomanNumerals.java RENAME test_CherFor3()=>void test_CherFor3I() METHOD RefactoringAction 1475152764363 TestRomanNumerals.java ADD RomanNumerals romanNumerals FIELD EditAction 1475152770354 TestRomanNumerals.java 409 2 3 1 +CompilationAction 1475152770533 TestRomanNumerals.java +RefactoringAction 1475152785945 RomanNumerals.java ADD boolean cherFor3I(String) METHOD +CompilationAction 1475152910860 TestRomanNumerals.java +EditAction 1475152910876 RomanNumerals.java 389 2 4 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index da0ccca..c848edc 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -2,9 +2,28 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { // To be Implemented + + + return 0; } + + public boolean cherFor3I(String num) { + // TODO Auto-generated method stub + int numI=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='I') { + numI++; + } + + } + + + if (numI<=3) { + return true; + }else return false; + } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 4c706ff..411446d 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -21,7 +21,7 @@ public void test_CherFor3I() { String num="MCMLXXXIV"; - assertTrue(cherFor3I(num)); + assertTrue(romanNumerals.cherFor3I(num)); } } From 1211f2acf885fe6c76bbf13d2a5d48d88e3590ef Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:42:34 +0300 Subject: [PATCH 05/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 5 +++++ .besouro/20160929153653315/besouroEpisodes.txt | 2 ++ .besouro/20160929153653315/randomHeuristicEpisodes.txt | 1 + .besouro/20160929153653315/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 2 +- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 298fc8c..cc68427 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -12,3 +12,8 @@ CompilationAction 1475152770533 TestRomanNumerals.java RefactoringAction 1475152785945 RomanNumerals.java ADD boolean cherFor3I(String) METHOD CompilationAction 1475152910860 TestRomanNumerals.java EditAction 1475152910876 RomanNumerals.java 389 2 4 0 +UnitTestCaseAction 1475152918095 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475152918096 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475152939535 TestRomanNumerals.java OK +UnitTestSessionAction 1475152939536 Rerun TestRomanNumerals.test_CherFor3I OK +EditAction 1475152954181 TestRomanNumerals.java 423 2 3 1 diff --git a/.besouro/20160929153653315/besouroEpisodes.txt b/.besouro/20160929153653315/besouroEpisodes.txt index e69de29..4876851 100644 --- a/.besouro/20160929153653315/besouroEpisodes.txt +++ b/.besouro/20160929153653315/besouroEpisodes.txt @@ -0,0 +1,2 @@ +1475152939536 test-first 2 325 true +1475152939537 test-first 2 325 true diff --git a/.besouro/20160929153653315/randomHeuristicEpisodes.txt b/.besouro/20160929153653315/randomHeuristicEpisodes.txt index e69de29..77b4ebb 100644 --- a/.besouro/20160929153653315/randomHeuristicEpisodes.txt +++ b/.besouro/20160929153653315/randomHeuristicEpisodes.txt @@ -0,0 +1 @@ +1475152939536 test-first 2 325 true diff --git a/.besouro/20160929153653315/zorroEpisodes.txt b/.besouro/20160929153653315/zorroEpisodes.txt index e69de29..77b4ebb 100644 --- a/.besouro/20160929153653315/zorroEpisodes.txt +++ b/.besouro/20160929153653315/zorroEpisodes.txt @@ -0,0 +1 @@ +1475152939536 test-first 2 325 true diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 411446d..661cd14 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -19,7 +19,7 @@ public void test_CherFor3I() { //The symbols 'I', 'X', 'C', and 'M' can be repeated // at most 3 times in a row. - String num="MCMLXXXIV"; + String num="MCMLIIIIV"; assertTrue(romanNumerals.cherFor3I(num)); } From faf76703ebe9a3c718c51afa9361854792919ce6 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:42:47 +0300 Subject: [PATCH 06/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 3 +++ tests/TestRomanNumerals.java | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index cc68427..77bc43e 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -17,3 +17,6 @@ UnitTestSessionAction 1475152918096 TestRomanNumerals.java FAIL UnitTestCaseAction 1475152939535 TestRomanNumerals.java OK UnitTestSessionAction 1475152939536 Rerun TestRomanNumerals.test_CherFor3I OK EditAction 1475152954181 TestRomanNumerals.java 423 2 3 1 +UnitTestCaseAction 1475152954939 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475152954939 TestRomanNumerals.java FAIL +EditAction 1475152967856 TestRomanNumerals.java 416 2 3 1 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 661cd14..f0346d0 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -5,7 +5,7 @@ public class TestRomanNumerals { RomanNumerals romanNumerals= new RomanNumerals(); - + @Test public void test() { fail("Not yet implemented"); @@ -18,9 +18,7 @@ public void test() { public void test_CherFor3I() { //The symbols 'I', 'X', 'C', and 'M' can be repeated // at most 3 times in a row. - - String num="MCMLIIIIV"; - + String num="MCMLXXXIV"; assertTrue(romanNumerals.cherFor3I(num)); } From c608d086ac8554704f6b55265dc4287d7cc71fe9 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:43:28 +0300 Subject: [PATCH 07/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 6 ++++++ src/RomanNumerals.java | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 77bc43e..19e57b5 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -20,3 +20,9 @@ EditAction 1475152954181 TestRomanNumerals.java 423 2 3 1 UnitTestCaseAction 1475152954939 TestRomanNumerals.java FAIL UnitTestSessionAction 1475152954939 TestRomanNumerals.java FAIL EditAction 1475152967856 TestRomanNumerals.java 416 2 3 1 +RefactoringAction 1475152971810 TestRomanNumerals.java ADD void test_CherFor3I()/2 METHOD +RefactoringAction 1475152976846 TestRomanNumerals.java RENAME test_CherFor3I()/2=>void test_CherFor3() METHOD +RefactoringAction 1475152977894 TestRomanNumerals.java RENAME test_CherFor3()=>void test_CherFor3C() METHOD +RefactoringAction 1475152979943 TestRomanNumerals.java RENAME test_CherFor3C()=>void test_CherFor3X() METHOD +RefactoringAction 1475152992744 RomanNumerals.java ADD boolean cherFor3X(String) METHOD +EditAction 1475153008204 RomanNumerals.java 642 3 7 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c848edc..c257f80 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -26,4 +26,19 @@ public boolean cherFor3I(String num) { return true; }else return false; } + + public boolean cherFor3X(String num) { + // TODO Auto-generated method stub + int numI=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='X') { + numI++; + } + + } + + + if (numI<=3) { + return true; + }else return false; } } From d3cba11988f02195ab5ca14e61fc3210eeeea45e Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:43:28 +0300 Subject: [PATCH 08/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + tests/TestRomanNumerals.java | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 19e57b5..dadf10e 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -26,3 +26,4 @@ RefactoringAction 1475152977894 TestRomanNumerals.java RENAME test_CherFor3()=>v RefactoringAction 1475152979943 TestRomanNumerals.java RENAME test_CherFor3C()=>void test_CherFor3X() METHOD RefactoringAction 1475152992744 RomanNumerals.java ADD boolean cherFor3X(String) METHOD EditAction 1475153008204 RomanNumerals.java 642 3 7 0 +EditAction 1475153008392 TestRomanNumerals.java 616 3 5 2 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index f0346d0..aa86c46 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -21,5 +21,11 @@ public void test_CherFor3I() { String num="MCMLXXXIV"; assertTrue(romanNumerals.cherFor3I(num)); } - + @Test + public void test_CherFor3X() { + //The symbols 'I', 'X', 'C', and 'M' can be repeated + // at most 3 times in a row. + String num="MCMLXXXIV"; + assertTrue(romanNumerals.cherFor3X(num)); + } } From e331946a3382260614f3fb5f8a0a0532ed5baf2b Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:44:01 +0300 Subject: [PATCH 09/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 6 ++++++ src/RomanNumerals.java | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index dadf10e..7dfd5ea 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -27,3 +27,9 @@ RefactoringAction 1475152979943 TestRomanNumerals.java RENAME test_CherFor3C()=> RefactoringAction 1475152992744 RomanNumerals.java ADD boolean cherFor3X(String) METHOD EditAction 1475153008204 RomanNumerals.java 642 3 7 0 EditAction 1475153008392 TestRomanNumerals.java 616 3 5 2 +UnitTestCaseAction 1475153009292 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475153009292 TestRomanNumerals.java FAIL +RefactoringAction 1475153015583 TestRomanNumerals.java ADD void test_CherFor3X()/2 METHOD +RefactoringAction 1475153020107 TestRomanNumerals.java RENAME test_CherFor3X()/2=>void test_CherFor3C() METHOD +RefactoringAction 1475153026646 RomanNumerals.java ADD boolean cherFor3C(String) METHOD +EditAction 1475153041684 RomanNumerals.java 921 4 10 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c257f80..3c0b1e3 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -41,4 +41,20 @@ public boolean cherFor3X(String num) { if (numI<=3) { return true; }else return false; } + + public boolean cherFor3C(String num) { + // TODO Auto-generated method stub + int numI=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='C') { + numI++; + } + + } + + + if (numI<=3) { + return true; + }else return false; + } } From f031347c4b86c11e95811c02923a4372c518fdda Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:44:01 +0300 Subject: [PATCH 10/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + tests/TestRomanNumerals.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 7dfd5ea..72fbda1 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -33,3 +33,4 @@ RefactoringAction 1475153015583 TestRomanNumerals.java ADD void test_CherFor3X() RefactoringAction 1475153020107 TestRomanNumerals.java RENAME test_CherFor3X()/2=>void test_CherFor3C() METHOD RefactoringAction 1475153026646 RomanNumerals.java ADD boolean cherFor3C(String) METHOD EditAction 1475153041684 RomanNumerals.java 921 4 10 0 +EditAction 1475153041819 TestRomanNumerals.java 819 4 7 3 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index aa86c46..2397a48 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -28,4 +28,12 @@ public void test_CherFor3X() { String num="MCMLXXXIV"; assertTrue(romanNumerals.cherFor3X(num)); } + + @Test + public void test_CherFor3C() { + //The symbols 'I', 'X', 'C', and 'M' can be repeated + // at most 3 times in a row. + String num="MCMLXXXIV"; + assertTrue(romanNumerals.cherFor3C(num)); + } } From dfbb440bb622eb052a85d692610f55f49de929c6 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:44:34 +0300 Subject: [PATCH 11/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 6 ++++++ src/RomanNumerals.java | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 72fbda1..06aff53 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -34,3 +34,9 @@ RefactoringAction 1475153020107 TestRomanNumerals.java RENAME test_CherFor3X()/2 RefactoringAction 1475153026646 RomanNumerals.java ADD boolean cherFor3C(String) METHOD EditAction 1475153041684 RomanNumerals.java 921 4 10 0 EditAction 1475153041819 TestRomanNumerals.java 819 4 7 3 +UnitTestCaseAction 1475153042641 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475153042642 TestRomanNumerals.java FAIL +RefactoringAction 1475153052280 TestRomanNumerals.java ADD void test_CherFor3C()/2 METHOD +RefactoringAction 1475153055319 TestRomanNumerals.java RENAME test_CherFor3C()/2=>void test_CherFor3M() METHOD +RefactoringAction 1475153062594 RomanNumerals.java ADD boolean cherFor3M(String) METHOD +EditAction 1475153074670 RomanNumerals.java 1175 5 13 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3c0b1e3..be7a4ba 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -57,4 +57,20 @@ public boolean cherFor3C(String num) { return true; }else return false; } + + public boolean cherFor3M(String num) { + // TODO Auto-generated method stub + int numI=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='M') { + numI++; + } + + } + + + if (numI<=3) { + return true; + }else return false; + } } From 8d2ce0f072dbee83d79c6abb1701b5cd0172060a Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:44:34 +0300 Subject: [PATCH 12/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + tests/TestRomanNumerals.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 06aff53..263b095 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -40,3 +40,4 @@ RefactoringAction 1475153052280 TestRomanNumerals.java ADD void test_CherFor3C() RefactoringAction 1475153055319 TestRomanNumerals.java RENAME test_CherFor3C()/2=>void test_CherFor3M() METHOD RefactoringAction 1475153062594 RomanNumerals.java ADD boolean cherFor3M(String) METHOD EditAction 1475153074670 RomanNumerals.java 1175 5 13 0 +EditAction 1475153074829 TestRomanNumerals.java 1020 5 9 4 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 2397a48..06f3794 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -36,4 +36,11 @@ public void test_CherFor3C() { String num="MCMLXXXIV"; assertTrue(romanNumerals.cherFor3C(num)); } + @Test + public void test_CherFor3M() { + //The symbols 'I', 'X', 'C', and 'M' can be repeated + // at most 3 times in a row. + String num="MCMLXXXIV"; + assertTrue(romanNumerals.cherFor3M(num)); + } } From a37fd7cfbd047ddacd4044cabdd28a4120c2aea4 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:46:50 +0300 Subject: [PATCH 13/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 6 ++++++ src/RomanNumerals.java | 11 ++++++++++- tests/TestRomanNumerals.java | 12 +++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 263b095..1e3a226 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -41,3 +41,9 @@ RefactoringAction 1475153055319 TestRomanNumerals.java RENAME test_CherFor3C()/2 RefactoringAction 1475153062594 RomanNumerals.java ADD boolean cherFor3M(String) METHOD EditAction 1475153074670 RomanNumerals.java 1175 5 13 0 EditAction 1475153074829 TestRomanNumerals.java 1020 5 9 4 +UnitTestCaseAction 1475153075541 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475153075542 TestRomanNumerals.java FAIL +RefactoringAction 1475153175046 TestRomanNumerals.java ADD void test_CherFor3M()/2 METHOD +RefactoringAction 1475153203606 TestRomanNumerals.java RENAME test_CherFor3M()/2=>void test_CherForNo() METHOD +RefactoringAction 1475153205127 TestRomanNumerals.java RENAME test_CherForNo()=>void test_CherForNoV() METHOD +EditAction 1475153210562 TestRomanNumerals.java 1127 6 9 4 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index be7a4ba..6df21b8 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -2,7 +2,16 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { // To be Implemented - + int num=0; + if (cherFor3C(romanNum)&&cherFor3I(romanNum)&&cherFor3M(romanNum)&&cherFor3X(romanNum)) { + + + + + + + + } return 0; diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 06f3794..3ada46b 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -28,7 +28,7 @@ public void test_CherFor3X() { String num="MCMLXXXIV"; assertTrue(romanNumerals.cherFor3X(num)); } - + @Test public void test_CherFor3C() { //The symbols 'I', 'X', 'C', and 'M' can be repeated @@ -42,5 +42,15 @@ public void test_CherFor3M() { // at most 3 times in a row. String num="MCMLXXXIV"; assertTrue(romanNumerals.cherFor3M(num)); + } + + @Test + public void test_CherForNoV() { + + // The symbols 'V', 'L', and 'D' can never be repeated. + + + + } } From 66aa3d99419d3df274404c1cfc87c09c7b44a752 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:48:00 +0300 Subject: [PATCH 14/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 10 ++++++++++ tests/TestRomanNumerals.java | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 1e3a226..a62f5d6 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -47,3 +47,13 @@ RefactoringAction 1475153175046 TestRomanNumerals.java ADD void test_CherFor3M() RefactoringAction 1475153203606 TestRomanNumerals.java RENAME test_CherFor3M()/2=>void test_CherForNo() METHOD RefactoringAction 1475153205127 TestRomanNumerals.java RENAME test_CherForNo()=>void test_CherForNoV() METHOD EditAction 1475153210562 TestRomanNumerals.java 1127 6 9 4 +RefactoringAction 1475153266779 TestRomanNumerals.java ADD void test_checkFor3I() METHOD +RefactoringAction 1475153266780 TestRomanNumerals.java ADD void test_checkFor3X() METHOD +RefactoringAction 1475153266782 TestRomanNumerals.java ADD void test_checkFor3C() METHOD +RefactoringAction 1475153266785 TestRomanNumerals.java ADD void test_checkFor3M() METHOD +RefactoringAction 1475153266795 TestRomanNumerals.java ADD void test_checkForNoV() METHOD +RefactoringAction 1475153278295 RomanNumerals.java ADD boolean checkFor3I(String) METHOD +RefactoringAction 1475153278296 RomanNumerals.java ADD boolean checkFor3X(String) METHOD +RefactoringAction 1475153278297 RomanNumerals.java ADD boolean checkFor3C(String) METHOD +RefactoringAction 1475153278297 RomanNumerals.java ADD boolean checkFor3M(String) METHOD +EditAction 1475153280571 TestRomanNumerals.java 1206 6 11 5 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 3ada46b..42d06e7 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -15,40 +15,40 @@ public void test() { } @Test - public void test_CherFor3I() { + public void test_checkFor3I() { //The symbols 'I', 'X', 'C', and 'M' can be repeated // at most 3 times in a row. String num="MCMLXXXIV"; - assertTrue(romanNumerals.cherFor3I(num)); + assertTrue(romanNumerals.checkFor3I(num)); } @Test - public void test_CherFor3X() { + public void test_checkFor3X() { //The symbols 'I', 'X', 'C', and 'M' can be repeated // at most 3 times in a row. String num="MCMLXXXIV"; - assertTrue(romanNumerals.cherFor3X(num)); + assertTrue(romanNumerals.checkFor3X(num)); } @Test - public void test_CherFor3C() { + public void test_checkFor3C() { //The symbols 'I', 'X', 'C', and 'M' can be repeated // at most 3 times in a row. String num="MCMLXXXIV"; - assertTrue(romanNumerals.cherFor3C(num)); + assertTrue(romanNumerals.checkFor3C(num)); } @Test - public void test_CherFor3M() { + public void test_checkFor3M() { //The symbols 'I', 'X', 'C', and 'M' can be repeated // at most 3 times in a row. String num="MCMLXXXIV"; - assertTrue(romanNumerals.cherFor3M(num)); + assertTrue(romanNumerals.checkFor3M(num)); } @Test - public void test_CherForNoV() { - + public void test_checkForNoV() { // The symbols 'V', 'L', and 'D' can never be repeated. - + String num="MCMLXXXIV"; + assertTrue(romanNumerals.checkForNoV(num)); From fc8ab2a0680a39858b5e94e7b0ce72ffd641fbe8 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:50:59 +0300 Subject: [PATCH 15/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 14 +++ src/RomanNumerals.java | 123 +++++++++++++++---------- tests/TestRomanNumerals.java | 2 +- 3 files changed, 90 insertions(+), 49 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index a62f5d6..4dfc1b6 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -57,3 +57,17 @@ RefactoringAction 1475153278296 RomanNumerals.java ADD boolean checkFor3X(String RefactoringAction 1475153278297 RomanNumerals.java ADD boolean checkFor3C(String) METHOD RefactoringAction 1475153278297 RomanNumerals.java ADD boolean checkFor3M(String) METHOD EditAction 1475153280571 TestRomanNumerals.java 1206 6 11 5 +CompilationAction 1475153280845 TestRomanNumerals.java +CompilationAction 1475153280845 TestRomanNumerals.java +CompilationAction 1475153280845 TestRomanNumerals.java +CompilationAction 1475153280845 TestRomanNumerals.java +CompilationAction 1475153280845 TestRomanNumerals.java +CompilationAction 1475153281030 TestRomanNumerals.java +RefactoringAction 1475153296142 RomanNumerals.java ADD boolean checkForNorepeatV(String) METHOD +CompilationAction 1475153411415 TestRomanNumerals.java +UnitTestCaseAction 1475153412029 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475153412029 TestRomanNumerals.java FAIL +RefactoringAction 1475153424069 TestRomanNumerals.java ADD void test_checkForNoV()/2 METHOD +RefactoringAction 1475153427599 TestRomanNumerals.java RENAME test_checkForNoV()/2=>void test_checkForNoL() METHOD +RefactoringAction 1475153436569 RomanNumerals.java ADD boolean checkForNorepeatL(String) METHOD +EditAction 1475153459314 RomanNumerals.java 1881 7 21 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 6df21b8..d6725b2 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -3,83 +3,110 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { // To be Implemented int num=0; - if (cherFor3C(romanNum)&&cherFor3I(romanNum)&&cherFor3M(romanNum)&&cherFor3X(romanNum)) { - - - - - - - + if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { + + + + + + + } - - + + return 0; - - - - } - public boolean cherFor3I(String num) { + + + } + //1 rule + public boolean checkFor3I(String num) { // TODO Auto-generated method stub - int numI=0; + int numOfThatChar=0; for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='I') { - numI++; + numOfThatChar++; } - + } - - - if (numI<=3) { + + + if (numOfThatChar<=3) { return true; }else return false; } - public boolean cherFor3X(String num) { + public boolean checkFor3X(String num) { // TODO Auto-generated method stub - int numI=0; + int numOfThatChar=0; for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='X') { - numI++; + numOfThatChar++; } - + } - - - if (numI<=3) { + + + if (numOfThatChar<=3) { return true; }else return false; } - public boolean cherFor3C(String num) { + public boolean checkFor3C(String num) { // TODO Auto-generated method stub - int numI=0; - for (int i = 0; i < num.length(); i++) { - if (num.charAt(i)=='C') { - numI++; - } - - } - - - if (numI<=3) { - return true; - }else return false; + int numOfThatChar=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='C') { + numOfThatChar++; + } + + } + + + if (numOfThatChar<=3) { + return true; + }else return false; } - public boolean cherFor3M(String num) { + public boolean checkFor3M(String num) { // TODO Auto-generated method stub - int numI=0; + int numOfThatChar=0; for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='M') { - numI++; + numOfThatChar++; } - + } - - - if (numI<=3) { + + + if (numOfThatChar<=3) { return true; }else return false; } + + + //2rule + + public boolean checkForNorepeatV(String num) { + int numOfThatChar=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='V') { + numOfThatChar++; + } + } + if (numOfThatChar>1) { + return false; + }else return true; + } + public boolean checkForNorepeatL(String num) { + // TODO Auto-generated method stub + int numOfThatChar=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='L') { + numOfThatChar++; + } + } + if (numOfThatChar>1) { + return false; + }else return true; + } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 42d06e7..8f5f13c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -48,7 +48,7 @@ public void test_checkFor3M() { public void test_checkForNoV() { // The symbols 'V', 'L', and 'D' can never be repeated. String num="MCMLXXXIV"; - assertTrue(romanNumerals.checkForNoV(num)); + assertTrue(romanNumerals.checkForNorepeatV(num)); From bb3c326f452680d27fc37455059ff4a6de2473d7 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:50:59 +0300 Subject: [PATCH 16/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + tests/TestRomanNumerals.java | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 4dfc1b6..3893ec0 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -71,3 +71,4 @@ RefactoringAction 1475153424069 TestRomanNumerals.java ADD void test_checkForNoV RefactoringAction 1475153427599 TestRomanNumerals.java RENAME test_checkForNoV()/2=>void test_checkForNoL() METHOD RefactoringAction 1475153436569 RomanNumerals.java ADD boolean checkForNorepeatL(String) METHOD EditAction 1475153459314 RomanNumerals.java 1881 7 21 0 +EditAction 1475153459462 TestRomanNumerals.java 1392 7 13 6 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 8f5f13c..ec46da7 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -49,8 +49,12 @@ public void test_checkForNoV() { // The symbols 'V', 'L', and 'D' can never be repeated. String num="MCMLXXXIV"; assertTrue(romanNumerals.checkForNorepeatV(num)); - - - + } + + @Test + public void test_checkForNoL() { + // The symbols 'V', 'L', and 'D' can never be repeated. + String num="MCMLXXXIV"; + assertTrue(romanNumerals.checkForNorepeatL(num)); } } From 0351cb5bdfed34b3baf997637334127a8200654c Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:51:30 +0300 Subject: [PATCH 17/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 7 +++++++ src/RomanNumerals.java | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 3893ec0..8628e7e 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -72,3 +72,10 @@ RefactoringAction 1475153427599 TestRomanNumerals.java RENAME test_checkForNoV() RefactoringAction 1475153436569 RomanNumerals.java ADD boolean checkForNorepeatL(String) METHOD EditAction 1475153459314 RomanNumerals.java 1881 7 21 0 EditAction 1475153459462 TestRomanNumerals.java 1392 7 13 6 +UnitTestCaseAction 1475153460322 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475153460323 TestRomanNumerals.java FAIL +RefactoringAction 1475153468674 TestRomanNumerals.java ADD void test_checkForNoL()/2 METHOD +RefactoringAction 1475153470692 TestRomanNumerals.java RENAME test_checkForNoL()/2=>void test_checkForNo() METHOD +RefactoringAction 1475153471716 TestRomanNumerals.java RENAME test_checkForNo()=>void test_checkForNoD() METHOD +RefactoringAction 1475153478480 RomanNumerals.java ADD boolean checkForNorepeatD(String) METHOD +EditAction 1475153490459 RomanNumerals.java 2176 8 24 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index d6725b2..8c138d1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -109,4 +109,16 @@ public boolean checkForNorepeatL(String num) { return false; }else return true; } + public boolean checkForNorepeatD(String num) { + // TODO Auto-generated method stub + int numOfThatChar=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='D') { + numOfThatChar++; + } + } + if (numOfThatChar>1) { + return false; + }else return true; + } } From f4a8152a257407baed41f06199766df8a2de86e0 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 15:51:30 +0300 Subject: [PATCH 18/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + tests/TestRomanNumerals.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 8628e7e..963fc91 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -79,3 +79,4 @@ RefactoringAction 1475153470692 TestRomanNumerals.java RENAME test_checkForNoL() RefactoringAction 1475153471716 TestRomanNumerals.java RENAME test_checkForNo()=>void test_checkForNoD() METHOD RefactoringAction 1475153478480 RomanNumerals.java ADD boolean checkForNorepeatD(String) METHOD EditAction 1475153490459 RomanNumerals.java 2176 8 24 0 +EditAction 1475153490618 TestRomanNumerals.java 1573 8 15 7 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index ec46da7..064b9c3 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -57,4 +57,10 @@ public void test_checkForNoL() { String num="MCMLXXXIV"; assertTrue(romanNumerals.checkForNorepeatL(num)); } + @Test + public void test_checkForNoD() { + // The symbols 'V', 'L', and 'D' can never be repeated. + String num="MCMLXXXIV"; + assertTrue(romanNumerals.checkForNorepeatD(num)); + } } From 0f0f5634e7e29705d8d956b1add366218942a04c Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:18:20 +0300 Subject: [PATCH 19/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 21 ++++++++++++++++ src/RomanNumerals.java | 34 +++++++++++++++++++------- tests/TestRomanNumerals.java | 12 +++++++++ 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 963fc91..29d52d8 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -80,3 +80,24 @@ RefactoringAction 1475153471716 TestRomanNumerals.java RENAME test_checkForNo()= RefactoringAction 1475153478480 RomanNumerals.java ADD boolean checkForNorepeatD(String) METHOD EditAction 1475153490459 RomanNumerals.java 2176 8 24 0 EditAction 1475153490618 TestRomanNumerals.java 1573 8 15 7 +UnitTestCaseAction 1475153491557 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475153491558 TestRomanNumerals.java FAIL +RefactoringAction 1475153530962 TestRomanNumerals.java ADD void test FIELD +RefactoringAction 1475153532482 TestRomanNumerals.java RENAME test=>void test_ FIELD +RefactoringAction 1475153536504 TestRomanNumerals.java RENAME test_=>void test_() METHOD +RefactoringAction 1475153615121 TestRomanNumerals.java RENAME test_()=>void test_First() METHOD +RefactoringAction 1475153616148 TestRomanNumerals.java RENAME test_First()=>void test_FirstI() METHOD +RefactoringAction 1475153638818 RomanNumerals.java ADD boolean checkFirstI(String) METHOD +RefactoringAction 1475154830909 TestRomanNumerals.java RENAME test_FirstI()=>void test_che() METHOD +RefactoringAction 1475154831978 TestRomanNumerals.java RENAME test_che()=>void test_check() METHOD +RefactoringAction 1475154835504 TestRomanNumerals.java RENAME test_check()=>void test_che() METHOD +RefactoringAction 1475154840030 TestRomanNumerals.java RENAME test_che()=>void test_check() METHOD +RefactoringAction 1475154843054 TestRomanNumerals.java RENAME test_check()=>void test_checkIf() METHOD +RefactoringAction 1475154846583 TestRomanNumerals.java RENAME test_checkIf()=>void test_checkIfIVis() METHOD +RefactoringAction 1475154848107 TestRomanNumerals.java RENAME test_checkIfIVis()=>void test_checkIfIVis$() METHOD +RefactoringAction 1475154849624 TestRomanNumerals.java RENAME test_checkIfIVis$()=>void test_checkIfIVis4() METHOD +RefactoringAction 1475154898952 RomanNumerals.java RENAME checkFirstI(String)=>boolean checkIfIVis4(String) METHOD +RefactoringAction 1475155051379 RomanNumerals.java RENAME checkIfIVis4(String)=>int wahtIVis4(String) METHOD +RefactoringAction 1475155052406 RomanNumerals.java RENAME wahtIVis4(String)=>int wahtIIVis4(String) METHOD +RefactoringAction 1475155053932 RomanNumerals.java RENAME wahtIIVis4(String)=>int wahtIsIVis4(String) METHOD +EditAction 1475155100008 TestRomanNumerals.java 1853 9 15 7 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 8c138d1..1056746 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -4,10 +4,15 @@ public int convertToInteger(String romanNum) { // To be Implemented int num=0; if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { + if (checkForNorepeatD(romanNum)&&checkForNorepeatL(romanNum)&&checkForNorepeatV(romanNum)) { + } + + + @@ -111,14 +116,25 @@ public boolean checkForNorepeatL(String num) { } public boolean checkForNorepeatD(String num) { // TODO Auto-generated method stub - int numOfThatChar=0; - for (int i = 0; i < num.length(); i++) { - if (num.charAt(i)=='D') { - numOfThatChar++; - } - } - if (numOfThatChar>1) { - return false; - }else return true; + int numOfThatChar=0; + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='D') { + numOfThatChar++; + } + } + if (numOfThatChar>1) { + return false; + }else return true; + } + public int wahtIsIVis4(String num) { + + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='I' &&(num.charAt(i+1)=='V')) { + return 4; + }else return -1; + + + } + return -1; } } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 064b9c3..0b7109c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -63,4 +63,16 @@ public void test_checkForNoD() { String num="MCMLXXXIV"; assertTrue(romanNumerals.checkForNorepeatD(num)); } + + +//rule 3 + + @Test + public void test_checkIfIVis4(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="IV"; + assertEquals(4, (romanNumerals.checkIfIVis4(num)); + } } From 3fd71d7c1731d2a4ee77bb3a02ef2d85597ef851 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:24:37 +0300 Subject: [PATCH 20/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 33 +++++++++++++++++++++ src/RomanNumerals.java | 40 ++++++++++++++++++++++++++ tests/TestRomanNumerals.java | 2 +- 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 29d52d8..dde9383 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -101,3 +101,36 @@ RefactoringAction 1475155051379 RomanNumerals.java RENAME checkIfIVis4(String)=> RefactoringAction 1475155052406 RomanNumerals.java RENAME wahtIVis4(String)=>int wahtIIVis4(String) METHOD RefactoringAction 1475155053932 RomanNumerals.java RENAME wahtIIVis4(String)=>int wahtIsIVis4(String) METHOD EditAction 1475155100008 TestRomanNumerals.java 1853 9 15 7 +CompilationAction 1475155100365 TestRomanNumerals.java +CompilationAction 1475155100366 TestRomanNumerals.java +UnitTestCaseAction 1475155102330 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155102331 TestRomanNumerals.java FAIL +RefactoringAction 1475155121960 RomanNumerals.java ADD Object checkIfIVis4(String) METHOD +RefactoringAction 1475155134198 RomanNumerals.java REMOVE checkIfIVis4(String) METHOD +CompilationAction 1475155138095 TestRomanNumerals.java +CompilationAction 1475155138096 TestRomanNumerals.java +UnitTestCaseAction 1475155138741 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155138742 TestRomanNumerals.java FAIL +RefactoringAction 1475155146594 TestRomanNumerals.java ADD void test_checkIfIVis4()/2 METHOD +RefactoringAction 1475155152619 TestRomanNumerals.java RENAME test_checkIfIVis4()/2=>void test_checkIfIVis9() METHOD +RefactoringAction 1475155185151 TestRomanNumerals.java REMOVE test_checkIfIVis9() METHOD +RefactoringAction 1475155211683 TestRomanNumerals.java ADD void test_checkIfIVis4()/2 METHOD +RefactoringAction 1475155222236 TestRomanNumerals.java RENAME test_checkIfIVis4()/2=>void test_() METHOD +RefactoringAction 1475155286106 TestRomanNumerals.java REMOVE test_() METHOD +RefactoringAction 1475155290188 TestRomanNumerals.java ADD void test_checkIfIVis4()/2 METHOD +RefactoringAction 1475155293215 TestRomanNumerals.java RENAME test_checkIfIVis4()/2=>void test_checkIfIVis9() METHOD +RefactoringAction 1475155304302 TestRomanNumerals.java ADD void test_checkIfIVis9()/2 METHOD +RefactoringAction 1475155307882 TestRomanNumerals.java RENAME test_checkIfIVis9()/2=>void test_checkIfIVis() METHOD +RefactoringAction 1475155312926 TestRomanNumerals.java RENAME test_checkIfIVis()=>void test_checkIfIVis49() METHOD +RefactoringAction 1475155321997 TestRomanNumerals.java ADD void test_checkIfIVis9()/2 METHOD +RefactoringAction 1475155336091 TestRomanNumerals.java RENAME test_checkIfIVis9()/2=>void test_checkIfIVis99() METHOD +RefactoringAction 1475155344137 TestRomanNumerals.java ADD void test_checkIfIVis99()/2 METHOD +RefactoringAction 1475155347156 TestRomanNumerals.java RENAME test_checkIfIVis99()/2=>void test_checkIfIVis49()/2 METHOD +RefactoringAction 1475155357608 RomanNumerals.java ADD Object wahtIsIVis9(String) METHOD +RefactoringAction 1475155363134 RomanNumerals.java ADD Object wahtIsIVis49(String) METHOD +RefactoringAction 1475155367896 RomanNumerals.java ADD Object wahtIsIVis99(String) METHOD +RefactoringAction 1475155373907 RomanNumerals.java ADD Object wahtIsIVis499(String) METHOD +RefactoringAction 1475155471553 TestRomanNumerals.java RENAME test_checkIfIVis49()/2=>void test_checkIfIVis490() METHOD +RefactoringAction 1475155472573 TestRomanNumerals.java RENAME test_checkIfIVis490()=>void test_checkIfIVis4909() METHOD +RefactoringAction 1475155473598 TestRomanNumerals.java RENAME test_checkIfIVis4909()=>void test_checkIfIVis499() METHOD +EditAction 1475155477149 RomanNumerals.java 3240 13 34 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 1056746..bbece77 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -134,6 +134,46 @@ public int wahtIsIVis4(String num) { }else return -1; + } + return -1; + } + public Object wahtIsIVis9(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='I' &&(num.charAt(i+1)=='X')) { + return 9; + }else return -1; + + + } + return -1; + } + public Object wahtIsIVis49(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='I' &&(num.charAt(i+1)=='L')) { + return 49; + }else return -1; + + + } + return -1; + } + public Object wahtIsIVis99(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='I' &&(num.charAt(i+1)=='C')) { + return 99; + }else return -1; + + + } + return -1; + } + public Object wahtIsIVis499(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='I' &&(num.charAt(i+1)=='D')) { + return 499; + }else return -1; + + } return -1; } diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 0b7109c..c7b3836 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -73,6 +73,6 @@ public void test_checkIfIVis4(){ // 'IX', 'XL' and 'XC', 'CD' and 'CM'). String num="IV"; - assertEquals(4, (romanNumerals.checkIfIVis4(num)); + assertEquals(4, (romanNumerals.wahtIsIVis4(num))); } } From 58bd7950d3548e4648cb1b21f6fb9b9236ccbaa1 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:24:37 +0300 Subject: [PATCH 21/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + tests/TestRomanNumerals.java | 32 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index dde9383..05060fc 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -134,3 +134,4 @@ RefactoringAction 1475155471553 TestRomanNumerals.java RENAME test_checkIfIVis49 RefactoringAction 1475155472573 TestRomanNumerals.java RENAME test_checkIfIVis490()=>void test_checkIfIVis4909() METHOD RefactoringAction 1475155473598 TestRomanNumerals.java RENAME test_checkIfIVis4909()=>void test_checkIfIVis499() METHOD EditAction 1475155477149 RomanNumerals.java 3240 13 34 0 +EditAction 1475155477794 TestRomanNumerals.java 2925 13 25 12 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index c7b3836..2d19597 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -75,4 +75,36 @@ public void test_checkIfIVis4(){ String num="IV"; assertEquals(4, (romanNumerals.wahtIsIVis4(num))); } + @Test + public void test_checkIfIVis9(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="IX"; + assertEquals(9, (romanNumerals.wahtIsIVis9(num))); + } + @Test + public void test_checkIfIVis49(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="IL"; + assertEquals(49, (romanNumerals.wahtIsIVis49(num))); + } + @Test + public void test_checkIfIVis99(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="IC"; + assertEquals(99, (romanNumerals.wahtIsIVis99(num))); + } + @Test + public void test_checkIfIVis499(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="ID"; + assertEquals(499, (romanNumerals.wahtIsIVis499(num))); + } } From 57eee365b922a28489b99e908393d47ad43c2496 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:29:50 +0300 Subject: [PATCH 22/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 22 +++++++++++++++ src/RomanNumerals.java | 38 +++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 05060fc..41d38a9 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -135,3 +135,25 @@ RefactoringAction 1475155472573 TestRomanNumerals.java RENAME test_checkIfIVis49 RefactoringAction 1475155473598 TestRomanNumerals.java RENAME test_checkIfIVis4909()=>void test_checkIfIVis499() METHOD EditAction 1475155477149 RomanNumerals.java 3240 13 34 0 EditAction 1475155477794 TestRomanNumerals.java 2925 13 25 12 +UnitTestCaseAction 1475155478566 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155478566 TestRomanNumerals.java FAIL +RefactoringAction 1475155599251 TestRomanNumerals.java ADD void test_checkIfIVis9()/2 METHOD +RefactoringAction 1475155599254 TestRomanNumerals.java ADD void test_checkIfIVis49()/2 METHOD +RefactoringAction 1475155599255 TestRomanNumerals.java ADD void test_checkIfIVis99()/2 METHOD +RefactoringAction 1475155599259 TestRomanNumerals.java ADD void test_checkIfIVis499()/2 METHOD +RefactoringAction 1475155613814 TestRomanNumerals.java RENAME test_checkIfIVis9()/2=>void test_checkIfIVis40() METHOD +RefactoringAction 1475155627910 TestRomanNumerals.java RENAME test_checkIfIVis49()/2=>void test_checkIfIVis90() METHOD +RefactoringAction 1475155662144 TestRomanNumerals.java RENAME test_checkIfIVis99()/2=>void test_checkIfIVis490() METHOD +RefactoringAction 1475155671204 TestRomanNumerals.java REMOVE test_checkIfIVis499()/2 METHOD +RefactoringAction 1475155709830 RomanNumerals.java ADD Object wahtIsXLis40(String) METHOD +RefactoringAction 1475155715450 RomanNumerals.java ADD Object wahtIsXCis90(String) METHOD +RefactoringAction 1475155719726 RomanNumerals.java ADD Object wahtIsXDis490(String) METHOD +RefactoringAction 1475155731080 RomanNumerals.java RENAME wahtIsIVis9(String)=>Object wahtIsIis9(String) METHOD +RefactoringAction 1475155732103 RomanNumerals.java RENAME wahtIsIis9(String)=>Object wahtIsIXis9(String) METHOD +RefactoringAction 1475155735651 RomanNumerals.java RENAME wahtIsIVis49(String)=>Object wahtIsIis49(String) METHOD +RefactoringAction 1475155736683 RomanNumerals.java RENAME wahtIsIis49(String)=>Object wahtIsILis49(String) METHOD +RefactoringAction 1475155740713 RomanNumerals.java RENAME wahtIsIVis99(String)=>Object wahtIsIis99(String) METHOD +RefactoringAction 1475155743743 RomanNumerals.java RENAME wahtIsIis99(String)=>Object wahtIsICis99(String) METHOD +RefactoringAction 1475155746765 RomanNumerals.java RENAME wahtIsIVis499(String)=>Object wahtIsIis499(String) METHOD +RefactoringAction 1475155747793 RomanNumerals.java RENAME wahtIsIis499(String)=>Object wahtIsIDis499(String) METHOD +EditAction 1475155790661 RomanNumerals.java 3830 16 40 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index bbece77..d22c73c 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -137,7 +137,7 @@ public int wahtIsIVis4(String num) { } return -1; } - public Object wahtIsIVis9(String num) { + public Object wahtIsIXis9(String num) { for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='I' &&(num.charAt(i+1)=='X')) { return 9; @@ -147,7 +147,7 @@ public Object wahtIsIVis9(String num) { } return -1; } - public Object wahtIsIVis49(String num) { + public Object wahtIsILis49(String num) { for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='I' &&(num.charAt(i+1)=='L')) { return 49; @@ -157,7 +157,7 @@ public Object wahtIsIVis49(String num) { } return -1; } - public Object wahtIsIVis99(String num) { + public Object wahtIsICis99(String num) { for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='I' &&(num.charAt(i+1)=='C')) { return 99; @@ -167,13 +167,43 @@ public Object wahtIsIVis99(String num) { } return -1; } - public Object wahtIsIVis499(String num) { + public Object wahtIsIDis499(String num) { for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='I' &&(num.charAt(i+1)=='D')) { return 499; }else return -1; + } + return -1; + } + public Object wahtIsXLis40(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='X' &&(num.charAt(i+1)=='L')) { + return 40; + }else return -1; + + + } + return -1; + } + public Object wahtIsXCis90(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='X' &&(num.charAt(i+1)=='C')) { + return 90; + }else return -1; + + + } + return -1; + } + public Object wahtIsXDis490(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='X' &&(num.charAt(i+1)=='D')) { + return 490; + }else return -1; + + } return -1; } From 52ad5417758dfb9aff5f89831573ec9a12211267 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:29:50 +0300 Subject: [PATCH 23/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 5 ++++ tests/TestRomanNumerals.java | 33 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 41d38a9..fe6ed27 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -157,3 +157,8 @@ RefactoringAction 1475155743743 RomanNumerals.java RENAME wahtIsIis99(String)=>O RefactoringAction 1475155746765 RomanNumerals.java RENAME wahtIsIVis499(String)=>Object wahtIsIis499(String) METHOD RefactoringAction 1475155747793 RomanNumerals.java RENAME wahtIsIis499(String)=>Object wahtIsIDis499(String) METHOD EditAction 1475155790661 RomanNumerals.java 3830 16 40 0 +CompilationAction 1475155790853 TestRomanNumerals.java +CompilationAction 1475155790854 TestRomanNumerals.java +CompilationAction 1475155790854 TestRomanNumerals.java +CompilationAction 1475155790854 TestRomanNumerals.java +EditAction 1475155790871 TestRomanNumerals.java 3750 16 31 15 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 2d19597..62815c6 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -107,4 +107,37 @@ public void test_checkIfIVis499(){ String num="ID"; assertEquals(499, (romanNumerals.wahtIsIVis499(num))); } + + + + + + + @Test + public void test_checkIfIVis40(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="XL"; + assertEquals(40, (romanNumerals.wahtIsXLis40(num))); + } + @Test + public void test_checkIfIVis90(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="XC"; + assertEquals(90, (romanNumerals.wahtIsXCis90(num))); + } + @Test + public void test_checkIfIVis490(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="XD"; + assertEquals(490, (romanNumerals.wahtIsXDis490(num))); + } + + + } From 792918d606db7745d17d72131bd4820c49845520 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:30:23 +0300 Subject: [PATCH 24/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 5 +++++ tests/TestRomanNumerals.java | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index fe6ed27..50a1fcf 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -162,3 +162,8 @@ CompilationAction 1475155790854 TestRomanNumerals.java CompilationAction 1475155790854 TestRomanNumerals.java CompilationAction 1475155790854 TestRomanNumerals.java EditAction 1475155790871 TestRomanNumerals.java 3750 16 31 15 +CompilationAction 1475155791042 TestRomanNumerals.java +CompilationAction 1475155791042 TestRomanNumerals.java +CompilationAction 1475155791042 TestRomanNumerals.java +CompilationAction 1475155791043 TestRomanNumerals.java +EditAction 1475155823048 TestRomanNumerals.java 3750 16 31 15 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 62815c6..4659d38 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -81,7 +81,7 @@ public void test_checkIfIVis9(){ // 'IX', 'XL' and 'XC', 'CD' and 'CM'). String num="IX"; - assertEquals(9, (romanNumerals.wahtIsIVis9(num))); + assertEquals(9, (romanNumerals.wahtIsIXis9(num))); } @Test public void test_checkIfIVis49(){ @@ -89,7 +89,7 @@ public void test_checkIfIVis49(){ // 'IX', 'XL' and 'XC', 'CD' and 'CM'). String num="IL"; - assertEquals(49, (romanNumerals.wahtIsIVis49(num))); + assertEquals(49, (romanNumerals.wahtIsILis49(num))); } @Test public void test_checkIfIVis99(){ @@ -97,7 +97,7 @@ public void test_checkIfIVis99(){ // 'IX', 'XL' and 'XC', 'CD' and 'CM'). String num="IC"; - assertEquals(99, (romanNumerals.wahtIsIVis99(num))); + assertEquals(99, (romanNumerals.wahtIsICis99(num))); } @Test public void test_checkIfIVis499(){ @@ -105,7 +105,7 @@ public void test_checkIfIVis499(){ // 'IX', 'XL' and 'XC', 'CD' and 'CM'). String num="ID"; - assertEquals(499, (romanNumerals.wahtIsIVis499(num))); + assertEquals(499, (romanNumerals.wahtIsIDis499(num))); } From 937e8e810f8c21bf16accc8c13360ce1843d638d Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:33:25 +0300 Subject: [PATCH 25/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 19 +++++++++++++++++++ src/RomanNumerals.java | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 50a1fcf..1500097 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -167,3 +167,22 @@ CompilationAction 1475155791042 TestRomanNumerals.java CompilationAction 1475155791042 TestRomanNumerals.java CompilationAction 1475155791043 TestRomanNumerals.java EditAction 1475155823048 TestRomanNumerals.java 3750 16 31 15 +UnitTestCaseAction 1475155823717 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475155823718 TestRomanNumerals.java FAIL +RefactoringAction 1475155837169 TestRomanNumerals.java ADD void test_checkIfIVis90()/2 METHOD +RefactoringAction 1475155837171 TestRomanNumerals.java ADD void test_checkIfIVis490()/2 METHOD +RefactoringAction 1475155841249 TestRomanNumerals.java RENAME test_checkIfIVis90()/2=>void test_checkIfLis90() METHOD +RefactoringAction 1475155844279 TestRomanNumerals.java RENAME test_checkIfLis90()=>void test_checkIfLCis90() METHOD +RefactoringAction 1475155869828 TestRomanNumerals.java REMOVE test_checkIfIVis490()/2 METHOD +RefactoringAction 1475155888376 TestRomanNumerals.java ADD void test_checkIfIVis490()/2 METHOD +RefactoringAction 1475155892424 TestRomanNumerals.java REMOVE test_checkIfIVis490()/2 METHOD +RefactoringAction 1475155905506 TestRomanNumerals.java REMOVE test_checkIfIVis99() METHOD +RefactoringAction 1475155905508 TestRomanNumerals.java REMOVE test_checkIfIVis499() METHOD +RefactoringAction 1475155905509 TestRomanNumerals.java REMOVE test_checkIfIVis49() METHOD +RefactoringAction 1475155928119 TestRomanNumerals.java RENAME test_checkIfLCis90()=>void test_checkIfis90() METHOD +RefactoringAction 1475155930164 TestRomanNumerals.java RENAME test_checkIfis90()=>void test_checkIfCDis90() METHOD +RefactoringAction 1475155936704 TestRomanNumerals.java RENAME test_checkIfCDis90()=>void test_checkIfCDis400() METHOD +RefactoringAction 1475155944229 TestRomanNumerals.java RENAME test_checkIfIVis490()=>void test_checkIfIVis900() METHOD +RefactoringAction 1475155971401 RomanNumerals.java ADD Object wahtIsCDis400(String) METHOD +RefactoringAction 1475155990571 RomanNumerals.java ADD Object wahtIsCMis900(String) METHOD +EditAction 1475156005715 RomanNumerals.java 4226 18 44 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index d22c73c..dd38a70 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -204,6 +204,26 @@ public Object wahtIsXDis490(String num) { }else return -1; + } + return -1; + } + public Object wahtIsCDis400(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='C' &&(num.charAt(i+1)=='D')) { + return 400; + }else return -1; + + + } + return -1; + } + public Object wahtIsCMis900(String num) { + for (int i = 0; i < num.length(); i++) { + if (num.charAt(i)=='C' &&(num.charAt(i+1)=='M')) { + return 900; + }else return -1; + + } return -1; } From f4bec706c72ce6440f4deb7c6675957436056bfb Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:33:26 +0300 Subject: [PATCH 26/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 1 + tests/TestRomanNumerals.java | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 1500097..90673c0 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -186,3 +186,4 @@ RefactoringAction 1475155944229 TestRomanNumerals.java RENAME test_checkIfIVis49 RefactoringAction 1475155971401 RomanNumerals.java ADD Object wahtIsCDis400(String) METHOD RefactoringAction 1475155990571 RomanNumerals.java ADD Object wahtIsCMis900(String) METHOD EditAction 1475156005715 RomanNumerals.java 4226 18 44 0 +EditAction 1475156006062 TestRomanNumerals.java 4284 14 27 13 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 4659d38..244081d 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -83,7 +83,7 @@ public void test_checkIfIVis9(){ String num="IX"; assertEquals(9, (romanNumerals.wahtIsIXis9(num))); } - @Test + /*@Test public void test_checkIfIVis49(){ // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and // 'IX', 'XL' and 'XC', 'CD' and 'CM'). @@ -107,7 +107,7 @@ public void test_checkIfIVis499(){ String num="ID"; assertEquals(499, (romanNumerals.wahtIsIDis499(num))); } - + */ @@ -129,15 +129,31 @@ public void test_checkIfIVis90(){ String num="XC"; assertEquals(90, (romanNumerals.wahtIsXCis90(num))); } - @Test +/* @Test public void test_checkIfIVis490(){ // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and // 'IX', 'XL' and 'XC', 'CD' and 'CM'). String num="XD"; assertEquals(490, (romanNumerals.wahtIsXDis490(num))); - } - + }*/ +} +@Test +public void test_checkIfCDis400(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="CD"; + assertEquals(400, (romanNumerals.wahtIsCDis400(num))); +} +@Test +public void test_checkIfIVis900(){ +// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and +// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="CM"; + assertEquals(900, (romanNumerals.wahtIsCMis900(num))); +} } From 8c11205395231d55fea17d4e58e8292325d47b5a Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:33:39 +0300 Subject: [PATCH 27/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 5 ++ tests/TestRomanNumerals.java | 90 +++++++++++++------------- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index 90673c0..de8e3f3 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -187,3 +187,8 @@ RefactoringAction 1475155971401 RomanNumerals.java ADD Object wahtIsCDis400(Stri RefactoringAction 1475155990571 RomanNumerals.java ADD Object wahtIsCMis900(String) METHOD EditAction 1475156005715 RomanNumerals.java 4226 18 44 0 EditAction 1475156006062 TestRomanNumerals.java 4284 14 27 13 +CompilationAction 1475156006248 TestRomanNumerals.java +CompilationAction 1475156016664 TestRomanNumerals.java +UnitTestCaseAction 1475156017235 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475156017236 TestRomanNumerals.java FAIL +EditAction 1475156019752 TestRomanNumerals.java 4301 14 27 13 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 244081d..217b773 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -50,7 +50,7 @@ public void test_checkForNoV() { String num="MCMLXXXIV"; assertTrue(romanNumerals.checkForNorepeatV(num)); } - + @Test public void test_checkForNoL() { // The symbols 'V', 'L', and 'D' can never be repeated. @@ -63,23 +63,23 @@ public void test_checkForNoD() { String num="MCMLXXXIV"; assertTrue(romanNumerals.checkForNorepeatD(num)); } - - -//rule 3 - + + + //rule 3 + @Test public void test_checkIfIVis4(){ -// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and -// 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and + // 'IX', 'XL' and 'XC', 'CD' and 'CM'). + String num="IV"; assertEquals(4, (romanNumerals.wahtIsIVis4(num))); } @Test public void test_checkIfIVis9(){ -// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and -// 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and + // 'IX', 'XL' and 'XC', 'CD' and 'CM'). + String num="IX"; assertEquals(9, (romanNumerals.wahtIsIXis9(num))); } @@ -87,7 +87,7 @@ public void test_checkIfIVis9(){ public void test_checkIfIVis49(){ // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and // 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + String num="IL"; assertEquals(49, (romanNumerals.wahtIsILis49(num))); } @@ -95,7 +95,7 @@ public void test_checkIfIVis49(){ public void test_checkIfIVis99(){ // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and // 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + String num="IC"; assertEquals(99, (romanNumerals.wahtIsICis99(num))); } @@ -103,57 +103,57 @@ public void test_checkIfIVis99(){ public void test_checkIfIVis499(){ // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and // 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + String num="ID"; assertEquals(499, (romanNumerals.wahtIsIDis499(num))); } - */ - - - - - + */ + + + + + @Test public void test_checkIfIVis40(){ -// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and -// 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and + // 'IX', 'XL' and 'XC', 'CD' and 'CM'). + String num="XL"; assertEquals(40, (romanNumerals.wahtIsXLis40(num))); } @Test public void test_checkIfIVis90(){ -// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and -// 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and + // 'IX', 'XL' and 'XC', 'CD' and 'CM'). + String num="XC"; assertEquals(90, (romanNumerals.wahtIsXCis90(num))); } -/* @Test + /* @Test public void test_checkIfIVis490(){ // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and // 'IX', 'XL' and 'XC', 'CD' and 'CM'). - + String num="XD"; assertEquals(490, (romanNumerals.wahtIsXDis490(num))); }*/ -} -@Test -public void test_checkIfCDis400(){ -// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and -// 'IX', 'XL' and 'XC', 'CD' and 'CM'). - String num="CD"; - assertEquals(400, (romanNumerals.wahtIsCDis400(num))); -} -@Test -public void test_checkIfIVis900(){ -// The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and -// 'IX', 'XL' and 'XC', 'CD' and 'CM'). + @Test + public void test_checkIfCDis400(){ + // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and + // 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="CD"; + assertEquals(400, (romanNumerals.wahtIsCDis400(num))); + } + @Test + public void test_checkIfIVis900(){ + // The '1' symbols ('I', 'X', and 'C') can only be subtracted from the 2 next highest values ('IV' and + // 'IX', 'XL' and 'XC', 'CD' and 'CM'). + + String num="CM"; + assertEquals(900, (romanNumerals.wahtIsCMis900(num))); + } + - String num="CM"; - assertEquals(900, (romanNumerals.wahtIsCMis900(num))); -} - - } From e973b971bd032fcc0e7253eb0b0a2a03c798e03d Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 29 Sep 2016 16:51:27 +0300 Subject: [PATCH 28/40] besouro automatic message --- .besouro/20160929153653315/actions.txt | 4 ++++ src/RomanNumerals.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.besouro/20160929153653315/actions.txt b/.besouro/20160929153653315/actions.txt index de8e3f3..dc612a9 100644 --- a/.besouro/20160929153653315/actions.txt +++ b/.besouro/20160929153653315/actions.txt @@ -192,3 +192,7 @@ CompilationAction 1475156016664 TestRomanNumerals.java UnitTestCaseAction 1475156017235 TestRomanNumerals.java FAIL UnitTestSessionAction 1475156017236 TestRomanNumerals.java FAIL EditAction 1475156019752 TestRomanNumerals.java 4301 14 27 13 +RefactoringAction 1475156043750 TestRomanNumerals.java ADD be made FIELD +RefactoringAction 1475156043750 TestRomanNumerals.java ADD per numeral() METHOD +RefactoringAction 1475156046271 TestRomanNumerals.java REMOVE made FIELD +RefactoringAction 1475156046272 TestRomanNumerals.java REMOVE numeral() METHOD diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index dd38a70..c68e724 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -127,7 +127,7 @@ public boolean checkForNorepeatD(String num) { }else return true; } public int wahtIsIVis4(String num) { - + for (int i = 0; i < num.length(); i++) { if (num.charAt(i)=='I' &&(num.charAt(i+1)=='V')) { return 4; From 9248d5f7565e66aef32746635ba967a5be70e19f Mon Sep 17 00:00:00 2001 From: jon bilbao Date: Thu, 29 Sep 2016 16:52:08 +0300 Subject: [PATCH 29/40] version X --- tests/TestRomanNumerals.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 217b773..563fd0c 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -154,6 +154,10 @@ public void test_checkIfIVis900(){ String num="CM"; assertEquals(900, (romanNumerals.wahtIsCMis900(num))); } + //4 rule + +// Only one subtraction can +// be made per numeral ('XC' is allowed, 'XXC' is not). } From b821913c615cddf3d568863099abb2b40b36f0b6 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:10:10 +0300 Subject: [PATCH 30/40] besouro automatic message --- .besouro/20161006150244533/actions.txt | 2 ++ .besouro/20161006150244533/besouroEpisodes.txt | 0 .besouro/20161006150244533/disagreements.txt | 0 .../20161006150244533/randomHeuristicEpisodes.txt | 0 .besouro/20161006150244533/userComments.txt | 0 .besouro/20161006150244533/zorroEpisodes.txt | 0 tests/TestRomanNumerals.java | 11 +++++------ 7 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .besouro/20161006150244533/actions.txt create mode 100644 .besouro/20161006150244533/besouroEpisodes.txt create mode 100644 .besouro/20161006150244533/disagreements.txt create mode 100644 .besouro/20161006150244533/randomHeuristicEpisodes.txt create mode 100644 .besouro/20161006150244533/userComments.txt create mode 100644 .besouro/20161006150244533/zorroEpisodes.txt diff --git a/.besouro/20161006150244533/actions.txt b/.besouro/20161006150244533/actions.txt new file mode 100644 index 0000000..7139341 --- /dev/null +++ b/.besouro/20161006150244533/actions.txt @@ -0,0 +1,2 @@ +FileOpenedAction 1475755364932 RomanNumerals.java 4224 19 47 0 +EditAction 1475755810552 TestRomanNumerals.java 4449 14 28 14 diff --git a/.besouro/20161006150244533/besouroEpisodes.txt b/.besouro/20161006150244533/besouroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006150244533/disagreements.txt b/.besouro/20161006150244533/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006150244533/randomHeuristicEpisodes.txt b/.besouro/20161006150244533/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006150244533/userComments.txt b/.besouro/20161006150244533/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006150244533/zorroEpisodes.txt b/.besouro/20161006150244533/zorroEpisodes.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 563fd0c..f3baf24 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -8,9 +8,8 @@ public class TestRomanNumerals { @Test public void test() { - fail("Not yet implemented"); - - + int num= romanNumerals.convertToInteger("MCMLXXXIV"); + assertEquals(1984, num); } @@ -155,9 +154,9 @@ public void test_checkIfIVis900(){ assertEquals(900, (romanNumerals.wahtIsCMis900(num))); } //4 rule - -// Only one subtraction can -// be made per numeral ('XC' is allowed, 'XXC' is not). + + // Only one subtraction can + // be made per numeral ('XC' is allowed, 'XXC' is not). } From b315a19fdb2c966a10f9946da14cc44e7206674e Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:10:37 +0300 Subject: [PATCH 31/40] besouro automatic message --- .besouro/20161006150244533/actions.txt | 3 ++ src/RomanNumerals.java | 41 +++++++++++++++++++++----- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/.besouro/20161006150244533/actions.txt b/.besouro/20161006150244533/actions.txt index 7139341..245df8f 100644 --- a/.besouro/20161006150244533/actions.txt +++ b/.besouro/20161006150244533/actions.txt @@ -1,2 +1,5 @@ FileOpenedAction 1475755364932 RomanNumerals.java 4224 19 47 0 EditAction 1475755810552 TestRomanNumerals.java 4449 14 28 14 +UnitTestCaseAction 1475755814154 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755814155 TestRomanNumerals.java FAIL +EditAction 1475755837577 RomanNumerals.java 4985 19 48 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index c68e724..f52571b 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -2,26 +2,51 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { // To be Implemented - int num=0; + //1984 = MCMLXXXIV + int num=0, tempNum=0, tempNum2=0, tempNum3=0; + char tempChar; if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { if (checkForNorepeatD(romanNum)&&checkForNorepeatL(romanNum)&&checkForNorepeatV(romanNum)) { - - - + for (int i = romanNum.length(); i < 0; i--) { + tempChar= romanNum.charAt(i); + tempNum= convertCharToNum(tempChar); + tempNum2=convertCharToNum(romanNum.charAt(i-1)); + tempNum3=convertCharToNum(romanNum.charAt(i-2)); + if (tempNum>tempNum2&&tempNumtempNum&&tempNum>tempNum3) { + num= num+(tempNum-tempNum2-tempNum3); + } + } } + } + return 0; + } + public int convertCharToNum(Character a){ + int num=0; + if (a=='I') { + num=1; + }else if(a=='V') { + num=5; + }else if(a=='X') { + num=10; + }else if(a=='L') { + num=50; - } - - - return 0; + }else if (a=='C') { + num=100; + }else if(a=='M') { + num=1000; + } + return num; } //1 rule From f2a438af47ea4dfb510ea6b716057a483b165d3f Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:11:51 +0300 Subject: [PATCH 32/40] besouro automatic message --- .besouro/20161006150244533/actions.txt | 7 +++++++ src/RomanNumerals.java | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.besouro/20161006150244533/actions.txt b/.besouro/20161006150244533/actions.txt index 245df8f..95560ac 100644 --- a/.besouro/20161006150244533/actions.txt +++ b/.besouro/20161006150244533/actions.txt @@ -3,3 +3,10 @@ EditAction 1475755810552 TestRomanNumerals.java 4449 14 28 14 UnitTestCaseAction 1475755814154 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755814155 TestRomanNumerals.java FAIL EditAction 1475755837577 RomanNumerals.java 4985 19 48 0 +UnitTestCaseAction 1475755838548 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755838549 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475755871700 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755871700 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475755884541 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755884542 TestRomanNumerals.java FAIL +EditAction 1475755911201 RomanNumerals.java 5017 19 48 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index f52571b..f25a0c3 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,8 +7,9 @@ public int convertToInteger(String romanNum) { char tempChar; if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { if (checkForNorepeatD(romanNum)&&checkForNorepeatL(romanNum)&&checkForNorepeatV(romanNum)) { + for (int i = romanNum.length(); i < 1; i--) { + System.out.println("iep"); - for (int i = romanNum.length(); i < 0; i--) { tempChar= romanNum.charAt(i); tempNum= convertCharToNum(tempChar); tempNum2=convertCharToNum(romanNum.charAt(i-1)); From a7e8c668c815502ab906050e897f6c77f13c5799 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:13:04 +0300 Subject: [PATCH 33/40] besouro automatic message --- .besouro/20161006150244533/actions.txt | 10 ++++++++++ src/RomanNumerals.java | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006150244533/actions.txt b/.besouro/20161006150244533/actions.txt index 95560ac..dc1179a 100644 --- a/.besouro/20161006150244533/actions.txt +++ b/.besouro/20161006150244533/actions.txt @@ -10,3 +10,13 @@ UnitTestSessionAction 1475755871700 TestRomanNumerals.java FAIL UnitTestCaseAction 1475755884541 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755884542 TestRomanNumerals.java FAIL EditAction 1475755911201 RomanNumerals.java 5017 19 48 0 +UnitTestCaseAction 1475755912205 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755912206 TestRomanNumerals.java FAIL +CompilationAction 1475755945334 RomanNumerals.java +CompilationAction 1475755945335 RomanNumerals.java +CompilationAction 1475755952198 RomanNumerals.java +CompilationAction 1475755952313 RomanNumerals.java +CompilationAction 1475755964261 RomanNumerals.java +UnitTestCaseAction 1475755966108 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755966109 TestRomanNumerals.java FAIL +EditAction 1475755984363 RomanNumerals.java 5025 19 48 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index f25a0c3..6ee3e6f 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,7 +7,7 @@ public int convertToInteger(String romanNum) { char tempChar; if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { if (checkForNorepeatD(romanNum)&&checkForNorepeatL(romanNum)&&checkForNorepeatV(romanNum)) { - for (int i = romanNum.length(); i < 1; i--) { + for (int i = romanNum.length(); i<0 ; i--) { System.out.println("iep"); tempChar= romanNum.charAt(i); @@ -22,7 +22,9 @@ public int convertToInteger(String romanNum) { } } } - return 0; + return num; + + } public int convertCharToNum(Character a){ From 8b0d12807a8371984c39210c4e984fba95b3dcb6 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:13:18 +0300 Subject: [PATCH 34/40] besouro automatic message --- .besouro/20161006150244533/actions.txt | 3 +++ src/RomanNumerals.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.besouro/20161006150244533/actions.txt b/.besouro/20161006150244533/actions.txt index dc1179a..3cdf9c8 100644 --- a/.besouro/20161006150244533/actions.txt +++ b/.besouro/20161006150244533/actions.txt @@ -20,3 +20,6 @@ CompilationAction 1475755964261 RomanNumerals.java UnitTestCaseAction 1475755966108 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755966109 TestRomanNumerals.java FAIL EditAction 1475755984363 RomanNumerals.java 5025 19 48 0 +UnitTestCaseAction 1475755985232 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755985232 TestRomanNumerals.java FAIL +EditAction 1475755998614 RomanNumerals.java 5025 19 48 0 diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 6ee3e6f..5cec076 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -7,7 +7,7 @@ public int convertToInteger(String romanNum) { char tempChar; if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { if (checkForNorepeatD(romanNum)&&checkForNorepeatL(romanNum)&&checkForNorepeatV(romanNum)) { - for (int i = romanNum.length(); i<0 ; i--) { + for (int i = romanNum.length(); i>0 ; i--) { System.out.println("iep"); tempChar= romanNum.charAt(i); From 870b0c6029170260e50bdb19bac1ebfa2f787368 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 15:49:24 +0300 Subject: [PATCH 35/40] besouro automatic message --- .besouro/20161006150244533/actions.txt | 28 +++++++++++ src/RomanNumerals.java | 69 ++++++++++++++++++++------ 2 files changed, 83 insertions(+), 14 deletions(-) diff --git a/.besouro/20161006150244533/actions.txt b/.besouro/20161006150244533/actions.txt index 3cdf9c8..70021f3 100644 --- a/.besouro/20161006150244533/actions.txt +++ b/.besouro/20161006150244533/actions.txt @@ -23,3 +23,31 @@ EditAction 1475755984363 RomanNumerals.java 5025 19 48 0 UnitTestCaseAction 1475755985232 TestRomanNumerals.java FAIL UnitTestSessionAction 1475755985232 TestRomanNumerals.java FAIL EditAction 1475755998614 RomanNumerals.java 5025 19 48 0 +UnitTestCaseAction 1475755999543 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475755999543 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756079607 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756079607 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756106045 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756106046 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756111503 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756111503 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756370589 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756370589 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756466555 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756466556 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756505917 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756505918 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756945365 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756945366 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475756993610 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475756993610 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475757046048 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475757046049 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475757122310 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475757122311 TestRomanNumerals.java FAIL +CompilationAction 1475757204489 RomanNumerals.java +CompilationAction 1475757214645 RomanNumerals.java +CompilationAction 1475757214730 RomanNumerals.java +CompilationAction 1475757222140 RomanNumerals.java +UnitTestCaseAction 1475757222780 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475757222780 TestRomanNumerals.java FAIL diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 5cec076..7563ea1 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -3,28 +3,69 @@ public class RomanNumerals { public int convertToInteger(String romanNum) { // To be Implemented //1984 = MCMLXXXIV - int num=0, tempNum=0, tempNum2=0, tempNum3=0; + int num=0, tempNum=0, tempNum2=0, tempNum3=0, sigNum=0; char tempChar; if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { if (checkForNorepeatD(romanNum)&&checkForNorepeatL(romanNum)&&checkForNorepeatV(romanNum)) { - for (int i = romanNum.length(); i>0 ; i--) { - System.out.println("iep"); - - tempChar= romanNum.charAt(i); - tempNum= convertCharToNum(tempChar); - tempNum2=convertCharToNum(romanNum.charAt(i-1)); - tempNum3=convertCharToNum(romanNum.charAt(i-2)); - if (tempNum>tempNum2&&tempNumtempNum&&tempNum>tempNum3) { - num= num+(tempNum-tempNum2-tempNum3); + for (int i = romanNum.length()-1; i>=0 ; i--) { + if(sigNum==0){ + System.out.println("iep sumo"); + + tempChar= romanNum.charAt(i); + tempNum= convertCharToNum(tempChar); + if(i==1) { + + tempNum2=convertCharToNum(romanNum.charAt(i-1)); + if (tempNum>tempNum2) { + System.out.println(tempNum + "el sig es menor"+tempNum2); + + num= num+(tempNum-tempNum2); + sigNum=-1; + } else{ + num= num+tempNum; + } + + }else if(i==0){ + + num= num+tempNum; + + + }else if(i!=0 && i !=1){ + tempNum2=convertCharToNum(romanNum.charAt(i-1)); + tempNum3=convertCharToNum(romanNum.charAt(i-2)); + if (tempNum>tempNum2&&tempNumtempNum&&tempNum>tempNum3) { + System.out.println(tempNum + "el sig y el sig es menor"+tempNum2+','+tempNum3); + + num= num+(tempNum-tempNum2-tempNum3); + sigNum=-2; + }else { + num= num+tempNum; + } + + + } + }else if (sigNum==-1) { + sigNum=0; + System.out.println("iep No sumo 1"); + + + }else if (sigNum==-2) { + sigNum=-1; + System.out.println("iep No sumo2"); + } + System.out.println(num +" y "+sigNum); } } } return num; - - + + } public int convertCharToNum(Character a){ From 7dbbea6f31bd2b7b39ea2a1df8229c669163b4ea Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 16:05:52 +0300 Subject: [PATCH 36/40] besouro automatic message --- src/RomanNumerals.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 7563ea1..3002c05 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -8,6 +8,9 @@ public int convertToInteger(String romanNum) { if (checkFor3C(romanNum)&&checkFor3I(romanNum)&&checkFor3M(romanNum)&&checkFor3X(romanNum)) { if (checkForNorepeatD(romanNum)&&checkForNorepeatL(romanNum)&&checkForNorepeatV(romanNum)) { for (int i = romanNum.length()-1; i>=0 ; i--) { + tempNum=0; + tempNum2=0; + tempNum3=0; if(sigNum==0){ System.out.println("iep sumo"); @@ -33,12 +36,14 @@ public int convertToInteger(String romanNum) { }else if(i!=0 && i !=1){ tempNum2=convertCharToNum(romanNum.charAt(i-1)); tempNum3=convertCharToNum(romanNum.charAt(i-2)); + System.out.println("elnorma"+ tempNum+','+tempNum2+','+tempNum3); + if (tempNum>tempNum2&&tempNumtempNum&&tempNum>tempNum3) { + System.out.println("sig"+sigNum); + } else if (tempNum>tempNum2&&tempNum>tempNum3) { System.out.println(tempNum + "el sig y el sig es menor"+tempNum2+','+tempNum3); num= num+(tempNum-tempNum2-tempNum3); From c69ba15b8e48a857a4f319272166ca3a993ec4a9 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 16:34:17 +0300 Subject: [PATCH 37/40] besouro automatic message --- .besouro/20161006160552135/actions.txt | 6 ++++++ .besouro/20161006160552135/besouroEpisodes.txt | 1 + .besouro/20161006160552135/disagreements.txt | 0 .besouro/20161006160552135/randomHeuristicEpisodes.txt | 1 + .besouro/20161006160552135/userComments.txt | 0 .besouro/20161006160552135/zorroEpisodes.txt | 1 + src/RomanNumerals.java | 2 +- tests/TestRomanNumerals.java | 5 +++-- 8 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .besouro/20161006160552135/actions.txt create mode 100644 .besouro/20161006160552135/besouroEpisodes.txt create mode 100644 .besouro/20161006160552135/disagreements.txt create mode 100644 .besouro/20161006160552135/randomHeuristicEpisodes.txt create mode 100644 .besouro/20161006160552135/userComments.txt create mode 100644 .besouro/20161006160552135/zorroEpisodes.txt diff --git a/.besouro/20161006160552135/actions.txt b/.besouro/20161006160552135/actions.txt new file mode 100644 index 0000000..a88930c --- /dev/null +++ b/.besouro/20161006160552135/actions.txt @@ -0,0 +1,6 @@ +FileOpenedAction 1475759152309 RomanNumerals.java 6083 19 48 0 +UnitTestCaseAction 1475760721216 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475760721217 RomanNumerals.java FAIL +UnitTestCaseAction 1475760812760 TestRomanNumerals.java OK +UnitTestSessionAction 1475760812760 RomanNumerals.java OK +EditAction 1475760857210 TestRomanNumerals.java 4446 14 26 13 diff --git a/.besouro/20161006160552135/besouroEpisodes.txt b/.besouro/20161006160552135/besouroEpisodes.txt new file mode 100644 index 0000000..bb7b1da --- /dev/null +++ b/.besouro/20161006160552135/besouroEpisodes.txt @@ -0,0 +1 @@ +1475760812760 regression 2 1660 true diff --git a/.besouro/20161006160552135/disagreements.txt b/.besouro/20161006160552135/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006160552135/randomHeuristicEpisodes.txt b/.besouro/20161006160552135/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..bb7b1da --- /dev/null +++ b/.besouro/20161006160552135/randomHeuristicEpisodes.txt @@ -0,0 +1 @@ +1475760812760 regression 2 1660 true diff --git a/.besouro/20161006160552135/userComments.txt b/.besouro/20161006160552135/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161006160552135/zorroEpisodes.txt b/.besouro/20161006160552135/zorroEpisodes.txt new file mode 100644 index 0000000..8c3d6a6 --- /dev/null +++ b/.besouro/20161006160552135/zorroEpisodes.txt @@ -0,0 +1 @@ +1475760812760 regression 2 1660 false diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 3002c05..ea29e50 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -38,7 +38,7 @@ public int convertToInteger(String romanNum) { tempNum3=convertCharToNum(romanNum.charAt(i-2)); System.out.println("elnorma"+ tempNum+','+tempNum2+','+tempNum3); - if (tempNum>tempNum2&&tempNumtempNum2&&tempNum<=tempNum3) { System.out.println(tempNum + "el sig es menor"+tempNum2); num= num+(tempNum-tempNum2); sigNum=-1; diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index f3baf24..863be64 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -8,8 +8,9 @@ public class TestRomanNumerals { @Test public void test() { - int num= romanNumerals.convertToInteger("MCMLXXXIV"); - assertEquals(1984, num); + int num= romanNumerals.convertToInteger("MMXIV +"); + assertEquals(2014, num); } From e765dfdd0a4da3249128b5cb334836e09753da2a Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 16:34:23 +0300 Subject: [PATCH 38/40] besouro automatic message --- .besouro/20161006160552135/actions.txt | 2 ++ tests/TestRomanNumerals.java | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006160552135/actions.txt b/.besouro/20161006160552135/actions.txt index a88930c..b0aca6a 100644 --- a/.besouro/20161006160552135/actions.txt +++ b/.besouro/20161006160552135/actions.txt @@ -4,3 +4,5 @@ UnitTestSessionAction 1475760721217 RomanNumerals.java FAIL UnitTestCaseAction 1475760812760 TestRomanNumerals.java OK UnitTestSessionAction 1475760812760 RomanNumerals.java OK EditAction 1475760857210 TestRomanNumerals.java 4446 14 26 13 +CompilationAction 1475760857541 TestRomanNumerals.java +EditAction 1475760863070 TestRomanNumerals.java 4445 14 28 14 diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 863be64..818f22a 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -8,8 +8,7 @@ public class TestRomanNumerals { @Test public void test() { - int num= romanNumerals.convertToInteger("MMXIV -"); + int num= romanNumerals.convertToInteger("MMXIV"); assertEquals(2014, num); } From 6a48ec75c022abf8d459d398d8b63e5e6de1ad11 Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 16:34:36 +0300 Subject: [PATCH 39/40] besouro automatic message --- .besouro/20161006160552135/actions.txt | 3 +++ .besouro/20161006160552135/besouroEpisodes.txt | 1 + .besouro/20161006160552135/randomHeuristicEpisodes.txt | 1 + .besouro/20161006160552135/zorroEpisodes.txt | 1 + tests/TestRomanNumerals.java | 4 ++-- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.besouro/20161006160552135/actions.txt b/.besouro/20161006160552135/actions.txt index b0aca6a..1051f3a 100644 --- a/.besouro/20161006160552135/actions.txt +++ b/.besouro/20161006160552135/actions.txt @@ -6,3 +6,6 @@ UnitTestSessionAction 1475760812760 RomanNumerals.java OK EditAction 1475760857210 TestRomanNumerals.java 4446 14 26 13 CompilationAction 1475760857541 TestRomanNumerals.java EditAction 1475760863070 TestRomanNumerals.java 4445 14 28 14 +UnitTestCaseAction 1475760863897 TestRomanNumerals.java OK +UnitTestSessionAction 1475760863897 TestRomanNumerals.java OK +EditAction 1475760876284 TestRomanNumerals.java 4449 14 28 14 diff --git a/.besouro/20161006160552135/besouroEpisodes.txt b/.besouro/20161006160552135/besouroEpisodes.txt index bb7b1da..1808a5b 100644 --- a/.besouro/20161006160552135/besouroEpisodes.txt +++ b/.besouro/20161006160552135/besouroEpisodes.txt @@ -1 +1,2 @@ 1475760812760 regression 2 1660 true +1475760863897 test-addition 1 6 true diff --git a/.besouro/20161006160552135/randomHeuristicEpisodes.txt b/.besouro/20161006160552135/randomHeuristicEpisodes.txt index bb7b1da..1808a5b 100644 --- a/.besouro/20161006160552135/randomHeuristicEpisodes.txt +++ b/.besouro/20161006160552135/randomHeuristicEpisodes.txt @@ -1 +1,2 @@ 1475760812760 regression 2 1660 true +1475760863897 test-addition 1 6 true diff --git a/.besouro/20161006160552135/zorroEpisodes.txt b/.besouro/20161006160552135/zorroEpisodes.txt index 8c3d6a6..d10fa76 100644 --- a/.besouro/20161006160552135/zorroEpisodes.txt +++ b/.besouro/20161006160552135/zorroEpisodes.txt @@ -1 +1,2 @@ 1475760812760 regression 2 1660 false +1475760863897 test-addition 1 51 false diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 818f22a..f3baf24 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -8,8 +8,8 @@ public class TestRomanNumerals { @Test public void test() { - int num= romanNumerals.convertToInteger("MMXIV"); - assertEquals(2014, num); + int num= romanNumerals.convertToInteger("MCMLXXXIV"); + assertEquals(1984, num); } From a7e2ca441662fef4ed0f934dc0b671f4ebb8712d Mon Sep 17 00:00:00 2001 From: somename Date: Thu, 6 Oct 2016 16:34:40 +0300 Subject: [PATCH 40/40] besouro automatic message --- .besouro/20161006160552135/actions.txt | 2 ++ .besouro/20161006160552135/besouroEpisodes.txt | 1 + .besouro/20161006160552135/randomHeuristicEpisodes.txt | 1 + .besouro/20161006160552135/zorroEpisodes.txt | 1 + 4 files changed, 5 insertions(+) diff --git a/.besouro/20161006160552135/actions.txt b/.besouro/20161006160552135/actions.txt index 1051f3a..4d5d45f 100644 --- a/.besouro/20161006160552135/actions.txt +++ b/.besouro/20161006160552135/actions.txt @@ -9,3 +9,5 @@ EditAction 1475760863070 TestRomanNumerals.java 4445 14 28 14 UnitTestCaseAction 1475760863897 TestRomanNumerals.java OK UnitTestSessionAction 1475760863897 TestRomanNumerals.java OK EditAction 1475760876284 TestRomanNumerals.java 4449 14 28 14 +UnitTestCaseAction 1475760877100 TestRomanNumerals.java OK +UnitTestSessionAction 1475760877100 TestRomanNumerals.java OK diff --git a/.besouro/20161006160552135/besouroEpisodes.txt b/.besouro/20161006160552135/besouroEpisodes.txt index 1808a5b..3c56488 100644 --- a/.besouro/20161006160552135/besouroEpisodes.txt +++ b/.besouro/20161006160552135/besouroEpisodes.txt @@ -1,2 +1,3 @@ 1475760812760 regression 2 1660 true 1475760863897 test-addition 1 6 true +1475760877100 regression 1 0 true diff --git a/.besouro/20161006160552135/randomHeuristicEpisodes.txt b/.besouro/20161006160552135/randomHeuristicEpisodes.txt index 1808a5b..9404b75 100644 --- a/.besouro/20161006160552135/randomHeuristicEpisodes.txt +++ b/.besouro/20161006160552135/randomHeuristicEpisodes.txt @@ -1,2 +1,3 @@ 1475760812760 regression 2 1660 true 1475760863897 test-addition 1 6 true +1475760877100 regression 1 0 false diff --git a/.besouro/20161006160552135/zorroEpisodes.txt b/.besouro/20161006160552135/zorroEpisodes.txt index d10fa76..e3940f9 100644 --- a/.besouro/20161006160552135/zorroEpisodes.txt +++ b/.besouro/20161006160552135/zorroEpisodes.txt @@ -1,2 +1,3 @@ 1475760812760 regression 2 1660 false 1475760863897 test-addition 1 51 false +1475760877100 regression 1 13 false