diff --git a/.besouro/20161005142310907/actions.txt b/.besouro/20161005142310907/actions.txt new file mode 100644 index 0000000..2c12945 --- /dev/null +++ b/.besouro/20161005142310907/actions.txt @@ -0,0 +1,159 @@ +FileOpenedAction 1475666591208 TestRomanNumerals.java 1504 15 15 15 +RefactoringAction 1475666606591 TestRomanNumerals.java ADD void testRomanNumerals FIELD +RefactoringAction 1475666607619 TestRomanNumerals.java RENAME testRomanNumerals=>void testRomanNumerals_ FIELD +RefactoringAction 1475666624139 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumeralsI_ FIELD +RefactoringAction 1475666625158 TestRomanNumerals.java RENAME testRomanNumeralsI_=>void testRomanNumerals_ FIELD +RefactoringAction 1475666627180 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumerals_I FIELD +RefactoringAction 1475666628688 TestRomanNumerals.java RENAME testRomanNumerals_I=>void testRomanNumerals_I_RE FIELD +RefactoringAction 1475666629705 TestRomanNumerals.java RENAME testRomanNumerals_I_RE=>void testRomanNumerals_I_Re FIELD +RefactoringAction 1475666633231 TestRomanNumerals.java RENAME testRomanNumerals_I_Re=>void testRomanNumerals_I_repeated FIELD +RefactoringAction 1475666637251 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated=>void testRomanNumerals_I_repeated_three_times FIELD +RefactoringAction 1475666638270 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_three_times=>void testRomanNumerals_I_repeated_three_times_ FIELD +RefactoringAction 1475666640288 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_three_times_=>void testRomanNumerals_I_repeated_three_times_III_ FIELD +RefactoringAction 1475666647806 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_three_times_III_=>void testRomanNumerals_I_repeated_four_times_III_ FIELD +RefactoringAction 1475666652824 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_III_=>void testRomanNumerals_I_repeated_four_times_IIII_ FIELD +RefactoringAction 1475666655842 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_IIII_=>void testRomanNumerals_I_repeated_four_times_IIII_() METHOD +EditAction 1475666811921 TestRomanNumerals.java 1654 16 16 16 +UnitTestCaseAction 1475666813747 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475666813747 TestRomanNumerals.java FAIL +RefactoringAction 1475666876453 RomanNumerals.java ADD void check FIELD +RefactoringAction 1475666877968 RomanNumerals.java RENAME check=>void checkThe FIELD +RefactoringAction 1475666879985 RomanNumerals.java RENAME checkThe=>void checkTheRows FIELD +RefactoringAction 1475666882001 RomanNumerals.java RENAME checkTheRows=>void checkThe FIELD +RefactoringAction 1475666885010 RomanNumerals.java RENAME checkThe=>void checkTheRepetition() METHOD +RefactoringAction 1475666894040 RomanNumerals.java RENAME checkTheRepetition()=>void checkHowMany() METHOD +RefactoringAction 1475666902563 RomanNumerals.java RENAME checkHowMany()=>void checkHowManyRomanNums() METHOD +RefactoringAction 1475666909578 RomanNumerals.java RENAME checkHowManyRomanNums()=>void checkHowManySimilarRomanNums() METHOD +RefactoringAction 1475667044810 RomanNumerals.java RENAME checkHowManySimilarRomanNums()=>void checkHowManySimilarRomanNums(String) METHOD +RefactoringAction 1475667182226 RomanNumerals.java ADD int i FIELD +RefactoringAction 1475667184741 RomanNumerals.java REMOVE i FIELD +EditAction 1475668199858 RomanNumerals.java 2220 5 15 0 +CompilationAction 1475668200122 RomanNumerals.java +CompilationAction 1475668215878 RomanNumerals.java +CompilationAction 1475668216054 TestRomanNumerals.java +CompilationAction 1475668274556 TestRomanNumerals.java +UnitTestCaseAction 1475668277992 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668277993 TestRomanNumerals.java FAIL +EditAction 1475668303719 RomanNumerals.java 2250 5 15 0 +UnitTestCaseAction 1475668307757 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668307758 TestRomanNumerals.java FAIL +EditAction 1475668974914 RomanNumerals.java 2187 5 13 0 +CompilationAction 1475668975086 RomanNumerals.java +EditAction 1475668980021 RomanNumerals.java 2188 5 16 0 +UnitTestCaseAction 1475668982597 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475668982597 TestRomanNumerals.java FAIL +UnitTestCaseAction 1475669011195 TestRomanNumerals.java OK +UnitTestSessionAction 1475669011196 TestRomanNumerals.java OK +RefactoringAction 1475669051771 TestRomanNumerals.java ADD void testRomanNumerals_ FIELD +RefactoringAction 1475669053783 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumerals_X FIELD +RefactoringAction 1475669056796 TestRomanNumerals.java RENAME testRomanNumerals_X=>void testRomanNumerals_X_repeated FIELD +RefactoringAction 1475669058310 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated=>void testRomanNumerals_X_repeated_ FIELD +RefactoringAction 1475669062824 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_=>void testRomanNumerals_X_repeated_five_times_ FIELD +RefactoringAction 1475669064336 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_=>void testRomanNumerals_X_repeated_five_times_XXXXX FIELD +RefactoringAction 1475669068869 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_XXXXX=>void testRomanNumerals_X_repeated_five_times_XXXXX_ FIELD +RefactoringAction 1475669071383 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_XXXXX_=>void testRomanNumerals_X_repeated_five_times_XXXXX_exception FIELD +RefactoringAction 1475669078396 TestRomanNumerals.java RENAME testRomanNumerals_I_repeated_four_times_IIII_()=>void testRomanNumerals_I_repeated_four_times_IIII_exception() METHOD +RefactoringAction 1475669082910 TestRomanNumerals.java RENAME testRomanNumerals_X_repeated_five_times_XXXXX_exception=>void testRomanNumerals_X_repeated_five_times_XXXXX_exception() METHOD +UnitTestCaseAction 1475669109355 TestRomanNumerals.java OK +UnitTestSessionAction 1475669109355 TestRomanNumerals.java OK +RefactoringAction 1475669168576 TestRomanNumerals.java ADD void testRomanNumerals_ FIELD +RefactoringAction 1475669181591 TestRomanNumerals.java RENAME testRomanNumerals_=>void testRomanNumerals_V_repeated FIELD +RefactoringAction 1475669186104 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated=>void testRomanNumerals_V_repeated_three_times_ FIELD +RefactoringAction 1475669188128 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_=>void testRomanNumerals_V_repeated_three_times_VVVVV_ FIELD +RefactoringAction 1475669191141 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_=>void testRomanNumerals_V_repeated_three_times_VVVVV_25 FIELD +RefactoringAction 1475669192152 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_25=>void testRomanNumerals_V_repeated_three_times_VVVVV_ FIELD +RefactoringAction 1475669193666 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_=>void testRomanNumerals_V_repeated_three_times_VVVVV_25 FIELD +RefactoringAction 1475669198189 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_25=>void testRomanNumerals_V_repeated_three_times_VVVVV_exception FIELD +RefactoringAction 1475669208204 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_exception=>void testRomanNumerals_V_repeated_three_times_VVVVV_exception() METHOD +UnitTestCaseAction 1475669226906 TestRomanNumerals.java OK +UnitTestSessionAction 1475669226906 TestRomanNumerals.java OK +RefactoringAction 1475669256818 TestRomanNumerals.java ADD void testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2 METHOD +RefactoringAction 1475669261832 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2=>void testRomanNumerals_D_repeated_three_times_VVVVV_exception() METHOD +RefactoringAction 1475669268348 TestRomanNumerals.java RENAME testRomanNumerals_D_repeated_three_times_VVVVV_exception()=>void testRomanNumerals_D_repeated_two_times_VVVVV_exception() METHOD +RefactoringAction 1475669273860 TestRomanNumerals.java RENAME testRomanNumerals_D_repeated_two_times_VVVVV_exception()=>void testRomanNumerals_D_repeated_two_times_DD_exception() METHOD +UnitTestCaseAction 1475669290363 TestRomanNumerals.java OK +UnitTestSessionAction 1475669290363 TestRomanNumerals.java OK +RefactoringAction 1475669323916 TestRomanNumerals.java ADD void testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2 METHOD +RefactoringAction 1475669327930 TestRomanNumerals.java RENAME testRomanNumerals_V_repeated_three_times_VVVVV_exception()/2=>void testRomanNumerals__VVVVV_exception() METHOD +RefactoringAction 1475669333442 TestRomanNumerals.java RENAME testRomanNumerals__VVVVV_exception()=>void testRomanNumerals__I__exception() METHOD +RefactoringAction 1475669339960 TestRomanNumerals.java RENAME testRomanNumerals__I__exception()=>void testRomanNumerals__I_subtracted_exception() METHOD +RefactoringAction 1475669342973 TestRomanNumerals.java RENAME testRomanNumerals__I_subtracted_exception()=>void testRomanNumerals__I_subtractedF_exception() METHOD +RefactoringAction 1475669344986 TestRomanNumerals.java RENAME testRomanNumerals__I_subtractedF_exception()=>void testRomanNumerals__I_subtracted_exception() METHOD +RefactoringAction 1475669346997 TestRomanNumerals.java RENAME testRomanNumerals__I_subtracted_exception()=>void testRomanNumerals__I_subtractedFrom_exception() METHOD +RefactoringAction 1475669382513 TestRomanNumerals.java RENAME testRomanNumerals__I_subtractedFrom_exception()=>void testRomanNumerals__I_subtractedFromL_exception() METHOD +UnitTestCaseAction 1475669402534 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475669402535 TestRomanNumerals.java FAIL +RefactoringAction 1475669503326 RomanNumerals.java ADD void checkIf FIELD +RefactoringAction 1475669505339 RomanNumerals.java RENAME checkIf=>void checkIfValid FIELD +RefactoringAction 1475669508351 RomanNumerals.java RENAME checkIfValid=>void checkIfValidSubtraction() METHOD +RefactoringAction 1475669541375 RomanNumerals.java RENAME checkIfValidSubtraction()=>void checkIfValidSubtraction(String) METHOD +RefactoringAction 1475669979311 RomanNumerals.java ADD void processTheChar(char) METHOD +RefactoringAction 1475670080684 RomanNumerals.java RENAME processTheChar(char)=>void processTheChar(char, char) METHOD +EditAction 1475670370080 RomanNumerals.java 2740 7 20 0 +UnitTestCaseAction 1475670374460 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670374460 TestRomanNumerals.java FAIL +EditAction 1475670396268 RomanNumerals.java 2711 7 20 0 +EditAction 1475670404417 RomanNumerals.java 2711 7 20 0 +UnitTestCaseAction 1475670407566 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670407567 TestRomanNumerals.java FAIL +EditAction 1475670459665 RomanNumerals.java 2709 7 20 0 +UnitTestCaseAction 1475670462617 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670462617 TestRomanNumerals.java FAIL +EditAction 1475670545915 RomanNumerals.java 2801 7 20 0 +UnitTestCaseAction 1475670548437 TestRomanNumerals.java OK +UnitTestSessionAction 1475670548438 TestRomanNumerals.testRomanNumerals__I_subtractedFromL_exception OK +RefactoringAction 1475670560705 TestRomanNumerals.java ADD void testRomanNumerals__I_subtractedFromL_exception()/2 METHOD +RefactoringAction 1475670573732 TestRomanNumerals.java RENAME testRomanNumerals__I_subtractedFromL_exception()/2=>void testRomanNumerals__X_subtractedFromL_exception() METHOD +RefactoringAction 1475670577243 TestRomanNumerals.java RENAME testRomanNumerals__X_subtractedFromL_exception()=>void testRomanNumerals__X_subtractedFrom_exception() METHOD +RefactoringAction 1475670596755 TestRomanNumerals.java RENAME testRomanNumerals__X_subtractedFrom_exception()=>void testRomanNumerals__X_subtractedFromD_exception() METHOD +UnitTestCaseAction 1475670616568 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670616569 TestRomanNumerals.java FAIL +EditAction 1475670683607 RomanNumerals.java 2975 7 21 0 +UnitTestCaseAction 1475670687247 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670687248 TestRomanNumerals.java FAIL +EditAction 1475670722735 RomanNumerals.java 3066 7 21 0 +UnitTestCaseAction 1475670729189 TestRomanNumerals.java OK +UnitTestSessionAction 1475670729189 TestRomanNumerals.java OK +RefactoringAction 1475670741855 TestRomanNumerals.java ADD void testRomanNumerals__X_subtractedFromD_exception()/2 METHOD +RefactoringAction 1475670752868 TestRomanNumerals.java RENAME testRomanNumerals__X_subtractedFromD_exception()/2=>void testRomanNumerals__C_subtractedFromD_exception() METHOD +RefactoringAction 1475670755380 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromD_exception()=>void testRomanNumerals__C_subtractedFrom_exception() METHOD +RefactoringAction 1475670769393 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFrom_exception()=>void testRomanNumerals__C_subtractedFromM_exception() METHOD +RefactoringAction 1475670772907 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromM_exception()=>void testRomanNumerals__C_subtractedFromM_() METHOD +RefactoringAction 1475670777418 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromM_()=>void testRomanNumerals__C_subtractedFromM_900() METHOD +RefactoringAction 1475670800443 TestRomanNumerals.java RENAME testRomanNumerals__C_subtractedFromM_900()=>void testRomanNumerals__CM_900() METHOD +UnitTestCaseAction 1475670810502 TestRomanNumerals.java OK +UnitTestSessionAction 1475670810503 TestRomanNumerals.java OK +RefactoringAction 1475670831478 TestRomanNumerals.java ADD void testRomanNumerals__CM_900()/2 METHOD +RefactoringAction 1475670836490 TestRomanNumerals.java RENAME testRomanNumerals__CM_900()/2=>void testRomanNumerals__XCC_900() METHOD +RefactoringAction 1475670842509 TestRomanNumerals.java RENAME testRomanNumerals__XCC_900()=>void testRomanNumerals__XXC_900() METHOD +RefactoringAction 1475670846520 TestRomanNumerals.java RENAME testRomanNumerals__XXC_900()=>void testRomanNumerals__XXC_exception() METHOD +RefactoringAction 1475670852533 TestRomanNumerals.java RENAME testRomanNumerals__XXC_exception()=>void testRomanNumerals_multip_XXC_exception() METHOD +RefactoringAction 1475670854545 TestRomanNumerals.java RENAME testRomanNumerals_multip_XXC_exception()=>void testRomanNumerals_multiple_XXC_exception() METHOD +RefactoringAction 1475670856557 TestRomanNumerals.java RENAME testRomanNumerals_multiple_XXC_exception()=>void testRomanNumerals_multipleTimes_XXC_exception() METHOD +RefactoringAction 1475670862071 TestRomanNumerals.java RENAME testRomanNumerals_multipleTimes_XXC_exception()=>void testRomanNumerals_subtractionultipleTimes_XXC_exception() METHOD +RefactoringAction 1475670863082 TestRomanNumerals.java RENAME testRomanNumerals_subtractionultipleTimes_XXC_exception()=>void testRomanNumerals_subtractionMultipleTimes_XXC_exception() METHOD +RefactoringAction 1475670867095 TestRomanNumerals.java RENAME testRomanNumerals__CM_900()=>void testRomanNumerals_CM_900() METHOD +UnitTestCaseAction 1475670899819 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475670899819 TestRomanNumerals.java FAIL +EditAction 1475671065081 RomanNumerals.java 3084 7 21 0 +EditAction 1475673162130 RomanNumerals.java 3254 7 24 0 +UnitTestCaseAction 1475673165664 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673165665 TestRomanNumerals.java FAIL +EditAction 1475673198743 RomanNumerals.java 3349 7 24 0 +UnitTestCaseAction 1475673201082 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673201082 TestRomanNumerals.java FAIL +RefactoringAction 1475673252145 RomanNumerals.java ADD boolean x FIELD +EditAction 1475673265552 RomanNumerals.java 3359 7 23 0 +UnitTestCaseAction 1475673268506 TestRomanNumerals.java OK +UnitTestSessionAction 1475673268507 TestRomanNumerals.java OK +EditAction 1475673345697 RomanNumerals.java 3437 7 24 0 +RefactoringAction 1475673352857 TestRomanNumerals.java ADD void testRomanNumerals_subtractionMultipleTimes_XXC_exception()/2 METHOD +RefactoringAction 1475673367380 TestRomanNumerals.java RENAME testRomanNumerals_subtractionMultipleTimes_XXC_exception()/2=>void testRomanNumerals_subtractionMultipleTimes_XXL_exception() METHOD +UnitTestCaseAction 1475673378233 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673378233 TestRomanNumerals.java FAIL +EditAction 1475673450520 RomanNumerals.java 3467 7 26 0 +UnitTestCaseAction 1475673452356 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673452357 TestRomanNumerals.java FAIL +EditAction 1475673850729 RomanNumerals.java 3485 7 26 0 +UnitTestCaseAction 1475673852931 TestRomanNumerals.java FAIL +UnitTestSessionAction 1475673852931 TestRomanNumerals.java FAIL diff --git a/.besouro/20161005142310907/besouroEpisodes.txt b/.besouro/20161005142310907/besouroEpisodes.txt new file mode 100644 index 0000000..54b652f --- /dev/null +++ b/.besouro/20161005142310907/besouroEpisodes.txt @@ -0,0 +1,293 @@ +1475669011196 test-first 1 2419 true +1475669011197 test-first 1 2419 true +1475669011198 test-first 1 2419 true +1475669011199 test-first 1 2419 true +1475669011200 test-first 1 2419 true +1475669011201 test-first 1 2419 true +1475669011202 test-first 1 2419 true +1475669011203 test-first 1 2419 true +1475669011204 test-first 1 2419 true +1475669011205 test-first 1 2419 true +1475669011206 test-first 1 2419 true +1475669011207 test-first 1 2419 true +1475669011208 test-first 1 2419 true +1475669011209 test-first 1 2419 true +1475669011210 test-first 1 2419 true +1475669011211 test-first 1 2419 true +1475669011212 test-first 1 2419 true +1475669011213 test-first 1 2419 true +1475669011214 test-first 1 2419 true +1475669011215 test-first 1 2419 true +1475669011216 test-first 1 2419 true +1475669011217 test-first 1 2419 true +1475669011218 test-first 1 2419 true +1475669011219 test-first 1 2419 true +1475669011220 test-first 1 2419 true +1475669011221 test-first 1 2419 true +1475669011222 test-first 1 2419 true +1475669011223 test-first 1 2419 true +1475669011224 test-first 1 2419 true +1475669011225 test-first 1 2419 true +1475669011226 test-first 1 2419 true +1475669011227 test-first 1 2419 true +1475669011228 test-first 1 2419 true +1475669011229 test-first 1 2419 true +1475669011230 test-first 1 2419 true +1475669011231 test-first 1 2419 true +1475669011232 test-first 1 2419 true +1475669011233 test-first 1 2419 true +1475669011234 test-first 1 2419 true +1475669011235 test-first 1 2419 true +1475669011236 test-first 1 2419 true +1475669011237 test-first 1 2419 true +1475669011238 test-first 1 2419 true +1475669011239 test-first 1 2419 true +1475669011240 test-first 1 2419 true +1475669011241 test-first 1 2419 true +1475669011242 test-first 1 2419 true +1475669011243 test-first 1 2419 true +1475669109355 refactoring 2B 57 true +1475669109356 refactoring 3 57 true +1475669109357 refactoring 3 57 true +1475669109358 refactoring 3 57 true +1475669109359 refactoring 3 57 true +1475669109360 refactoring 1B 57 true +1475669109361 refactoring 3 57 true +1475669109362 refactoring 3 57 true +1475669109363 refactoring 3 57 true +1475669109364 refactoring 3 57 true +1475669109365 refactoring 3 57 true +1475669109366 refactoring 3 57 true +1475669109367 refactoring 3 57 true +1475669109368 refactoring 3 57 true +1475669109369 refactoring 3 57 true +1475669109370 refactoring 3 57 true +1475669109371 refactoring 2B 57 true +1475669109372 refactoring 3 57 true +1475669109373 refactoring 1B 57 true +1475669109374 refactoring 3 57 true +1475669109375 refactoring 3 57 true +1475669109376 refactoring 3 57 true +1475669109377 refactoring 3 57 true +1475669109378 refactoring 3 57 true +1475669109379 refactoring 3 57 true +1475669109380 refactoring 3 57 true +1475669109381 refactoring 3 57 true +1475669109382 refactoring 3 57 true +1475669109383 refactoring 3 57 true +1475669109384 refactoring 3 57 true +1475669109385 refactoring 3 57 true +1475669109386 refactoring 3 57 true +1475669109387 refactoring 2B 57 true +1475669109388 refactoring 3 57 true +1475669109389 refactoring 3 57 true +1475669109390 refactoring 1B 57 true +1475669109391 refactoring 3 57 true +1475669109392 refactoring 3 57 true +1475669109393 refactoring 3 57 true +1475669109394 refactoring 3 57 true +1475669109395 refactoring 3 57 true +1475669109396 refactoring 3 57 true +1475669109397 refactoring 3 57 true +1475669109398 refactoring 3 57 true +1475669109399 refactoring 3 57 true +1475669109400 refactoring 3 57 true +1475669109401 refactoring 3 57 true +1475669109402 refactoring 3 57 true +1475669109403 refactoring 3 57 true +1475669109404 refactoring 3 57 true +1475669109405 refactoring 3 57 true +1475669109406 refactoring 2B 57 true +1475669109407 refactoring 3 57 true +1475669109408 refactoring 3 57 true +1475669109409 refactoring 3 57 true +1475669109410 refactoring 3 57 true +1475669109411 refactoring 3 57 true +1475669109412 refactoring 1B 57 true +1475669109413 refactoring 3 57 true +1475669109414 refactoring 3 57 true +1475669109415 refactoring 3 57 true +1475669109416 refactoring 3 57 true +1475669109417 refactoring 3 57 true +1475669109418 refactoring 3 57 true +1475669109419 refactoring 3 57 true +1475669109420 refactoring 3 57 true +1475669109421 refactoring 3 57 true +1475669109422 refactoring 1B 57 true +1475669109423 refactoring 3 57 true +1475669109424 refactoring 3 57 true +1475669109425 refactoring 3 57 true +1475669109426 refactoring 3 57 true +1475669109427 refactoring 3 57 true +1475669109428 refactoring 3 57 true +1475669109429 refactoring 3 57 true +1475669109430 refactoring 2B 57 true +1475669109431 refactoring 3 57 true +1475669109432 refactoring 3 57 true +1475669109433 refactoring 3 57 true +1475669109434 refactoring 1B 57 true +1475669109435 refactoring 3 57 true +1475669109436 refactoring 3 57 true +1475669109437 refactoring 3 57 true +1475669109438 refactoring 3 57 true +1475669109439 refactoring 3 57 true +1475669109440 refactoring 3 57 true +1475669109441 refactoring 3 57 true +1475669109442 refactoring 2B 57 true +1475669109443 refactoring 3 57 true +1475669109444 refactoring 3 57 true +1475669109445 refactoring 3 57 true +1475669109446 refactoring 3 57 true +1475669109447 refactoring 3 57 true +1475669109448 refactoring 2B 57 true +1475669109449 refactoring 3 57 true +1475669109450 refactoring 3 57 true +1475669109451 refactoring 3 57 true +1475669109452 refactoring 1B 57 true +1475669109453 refactoring 3 57 true +1475669109454 refactoring 3 57 true +1475669109455 refactoring 3 57 true +1475669109456 refactoring 1B 57 true +1475669109457 refactoring 2B 57 true +1475669109458 refactoring 2B 57 true +1475669109459 refactoring 3 57 true +1475669109460 refactoring 3 57 true +1475669109461 refactoring 3 57 true +1475669109462 refactoring 3 57 true +1475669109463 refactoring 3 57 true +1475669109464 refactoring 3 57 true +1475669109465 refactoring 1B 57 true +1475669109466 refactoring 1B 57 true +1475669109467 refactoring 3 57 true +1475669109468 refactoring 2B 57 true +1475669109469 refactoring 3 57 true +1475669109470 regression 1 57 true +1475669109471 refactoring 3 57 true +1475669109472 refactoring 3 57 true +1475669109473 refactoring 3 57 true +1475669109474 refactoring 3 57 true +1475669109475 refactoring 3 57 true +1475669226906 refactoring 3 58 true +1475669226907 refactoring 1B 58 true +1475669226908 refactoring 2B 58 true +1475669226909 refactoring 3 58 true +1475669226910 refactoring 3 58 true +1475669226911 refactoring 3 58 true +1475669226912 refactoring 3 58 true +1475669226913 refactoring 3 58 true +1475669226914 refactoring 3 58 true +1475669226915 refactoring 3 58 true +1475669226916 refactoring 3 58 true +1475669226917 refactoring 3 58 true +1475669226918 refactoring 3 58 true +1475669226919 refactoring 3 58 true +1475669226920 refactoring 2B 58 true +1475669226921 refactoring 3 58 true +1475669226922 refactoring 3 58 true +1475669226923 refactoring 3 58 true +1475669226924 refactoring 3 58 true +1475669226925 refactoring 3 58 true +1475669226926 refactoring 1B 58 true +1475669226927 refactoring 3 58 true +1475669226928 refactoring 3 58 true +1475669226929 refactoring 3 58 true +1475669226930 refactoring 3 58 true +1475669226931 refactoring 3 58 true +1475669226932 refactoring 1B 58 true +1475669226933 refactoring 3 58 true +1475669226934 refactoring 3 58 true +1475669226935 refactoring 3 58 true +1475669226936 refactoring 3 58 true +1475669226937 refactoring 3 58 true +1475669226938 refactoring 3 58 true +1475669226939 refactoring 3 58 true +1475669226940 refactoring 2B 58 true +1475669226941 refactoring 3 58 true +1475669226942 refactoring 1B 58 true +1475669226943 refactoring 3 58 true +1475669226944 refactoring 3 58 true +1475669226945 refactoring 3 58 true +1475669226946 refactoring 3 58 true +1475669226947 refactoring 3 58 true +1475669226948 refactoring 2B 58 true +1475669226949 refactoring 3 58 true +1475669226950 refactoring 3 58 true +1475669226951 refactoring 3 58 true +1475669226952 refactoring 3 58 true +1475669226953 refactoring 3 58 true +1475669226954 refactoring 3 58 true +1475669226955 refactoring 3 58 true +1475669226956 refactoring 3 58 true +1475669226957 refactoring 3 58 true +1475669226958 refactoring 3 58 true +1475669226959 refactoring 3 58 true +1475669226960 refactoring 1B 58 true +1475669226961 refactoring 3 58 true +1475669226962 refactoring 2B 58 true +1475669226963 refactoring 3 58 true +1475669226964 refactoring 3 58 true +1475669226965 refactoring 3 58 true +1475669226966 refactoring 1B 58 true +1475669226967 refactoring 3 58 true +1475669226968 refactoring 3 58 true +1475669226969 refactoring 3 58 true +1475669226970 refactoring 2B 58 true +1475669226971 refactoring 3 58 true +1475669226972 refactoring 3 58 true +1475669226973 refactoring 3 58 true +1475669226974 refactoring 1B 58 true +1475669226975 refactoring 3 58 true +1475669226976 refactoring 2B 58 true +1475669226977 refactoring 3 58 true +1475669226978 regression 1 58 true +1475669226979 refactoring 3 58 true +1475669226980 refactoring 3 58 true +1475669226981 refactoring 3 58 true +1475669226982 refactoring 3 58 true +1475669226983 refactoring 3 58 true +1475669226984 refactoring 1B 58 true +1475669226985 refactoring 3 58 true +1475669226986 refactoring 3 58 true +1475669226987 refactoring 3 58 true +1475669226988 refactoring 3 58 true +1475669226989 refactoring 3 58 true +1475669226990 refactoring 3 58 true +1475669226991 refactoring 2B 58 true +1475669226992 refactoring 3 58 true +1475669226993 refactoring 3 58 true +1475669226994 refactoring 3 58 true +1475669226995 refactoring 3 58 true +1475669226996 refactoring 3 58 true +1475669226997 refactoring 3 58 true +1475669226998 refactoring 2B 58 true +1475669226999 refactoring 3 58 true +1475669227000 refactoring 1B 58 true +1475669227001 refactoring 3 58 true +1475669227002 refactoring 3 58 true +1475669227003 refactoring 3 58 true +1475669227004 refactoring 3 58 true +1475669227005 refactoring 3 58 true +1475669290363 test-addition 1 33 true +1475670548438 test-first 3 1224 true +1475670548439 test-first 3 1224 true +1475670548440 test-first 3 1224 true +1475670548441 test-first 3 1224 true +1475670548442 test-first 3 1224 true +1475670548443 test-first 3 1224 true +1475670548444 test-first 3 1224 true +1475670548445 test-first 3 1224 true +1475670548446 test-first 3 1224 true +1475670548447 test-first 3 1224 true +1475670729189 test-first 3 168 true +1475670729190 test-first 3 168 true +1475670729191 test-first 3 168 true +1475670729192 production 1 168 false +1475670810503 test-addition 1 68 true +1475673268507 test-first 3 2437 true +1475673268508 test-first 3 2437 true +1475673268509 test-first 3 2437 true +1475673268510 test-first 3 2437 true +1475673268511 test-first 3 2437 true +1475673268512 test-first 3 2437 true +1475673268513 test-first 3 2437 true +1475673268514 production 1 2437 false diff --git a/.besouro/20161005142310907/disagreements.txt b/.besouro/20161005142310907/disagreements.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142310907/randomHeuristicEpisodes.txt b/.besouro/20161005142310907/randomHeuristicEpisodes.txt new file mode 100644 index 0000000..25008e1 --- /dev/null +++ b/.besouro/20161005142310907/randomHeuristicEpisodes.txt @@ -0,0 +1,8 @@ +1475669011196 test-first 1 2419 true +1475669109355 refactoring 2B 57 false +1475669226906 refactoring 3 58 false +1475669290363 test-addition 1 33 true +1475670548438 test-first 3 1224 true +1475670729189 test-first 3 168 true +1475670810503 test-addition 1 68 true +1475673268507 test-first 3 2437 true diff --git a/.besouro/20161005142310907/userComments.txt b/.besouro/20161005142310907/userComments.txt new file mode 100644 index 0000000..e69de29 diff --git a/.besouro/20161005142310907/zorroEpisodes.txt b/.besouro/20161005142310907/zorroEpisodes.txt new file mode 100644 index 0000000..aec6425 --- /dev/null +++ b/.besouro/20161005142310907/zorroEpisodes.txt @@ -0,0 +1,8 @@ +1475669011196 test-first 1 2419 true +1475669109355 refactoring 2B 98 true +1475669226906 refactoring 3 117 true +1475669290363 test-addition 1 63 true +1475670548438 test-first 3 1258 true +1475670729189 test-first 3 180 true +1475670810503 test-addition 1 81 true +1475673268507 test-first 3 2458 true diff --git a/src/RomanNumerals.java b/src/RomanNumerals.java index 20904f0..917a7e7 100644 --- a/src/RomanNumerals.java +++ b/src/RomanNumerals.java @@ -1,8 +1,146 @@ public class RomanNumerals { - public int convertToInteger(String romanNum) { - // To be Implemented - return 0; + + private int totalArabic; + private int lastNumber; + private boolean x = false; + + public RomanNumerals() { + this.totalArabic = 0; + this.lastNumber = 0; + } + + public int convertToInteger(String romanNum) throws RomanNumeralsException { + checkHowManySimilarRomanNums(romanNum); + checkIfValidSubtraction(romanNum); + for (int i = romanNum.length() - 1; i >= 0 ; i--) { + handleRomanNumbers(romanNum, i); + } + return totalArabic; + + } + + private void handleRomanNumbers(String romanNum, int i) { + switch (romanNum.charAt(i)) { + case 'M': + processtotalArabic(1000); + lastNumber = 1000; + break; + + case 'D': + processtotalArabic(500); + lastNumber = 500; + break; + + case 'C': + processtotalArabic(100); + lastNumber = 100; + break; + + case 'L': + processtotalArabic(50); + lastNumber = 50; + break; + + case 'X': + processtotalArabic(10); + lastNumber = 10; + break; + + case 'V': + processtotalArabic(5); + lastNumber = 5; + break; + + case 'I': + processtotalArabic(1); + lastNumber = 1; + break; + } + } + + + private void processtotalArabic(int arabic) { + if (lastNumber > arabic) { + totalArabic -= arabic; + } else { + totalArabic += arabic; + } + } + + private void checkHowManySimilarRomanNums(String romanNum) throws RomanNumeralsException { + int romanD = 0; + int romanC = 0; + int romanL = 0; + int romanX = 0; + int romanV = 0; + int romanI = 0; + int romanM = 0; + for(int i = romanNum.length() - 1; i >= 0 ; i--) { + if(romanNum.charAt(i) == 'I') + romanI++; + if(romanNum.charAt(i) == 'V') + romanV++; + if(romanNum.charAt(i) == 'X') + romanX++; + if(romanNum.charAt(i) == 'L') + romanL++; + if(romanNum.charAt(i) == 'C') + romanC++; + if(romanNum.charAt(i) == 'D') + romanD++; + if(romanNum.charAt(i) == 'M') + romanM++; + } + if(romanI > 3 || romanX > 3 || romanC > 3 || romanM > 3 || romanV > 1 || romanL > 1 || romanD > 1) + throw new RomanNumeralsException(); + } + + public void checkIfValidSubtraction(String romanNum) throws RomanNumeralsException { + char lastChar = 0; + for(int i = romanNum.length() - 1; i >= 0 ; i--) { + switch (romanNum.charAt(i)) { + case 'L': + processTheChar('L', lastChar); + lastChar = 'L'; + break; + case 'I': + processTheChar('I', lastChar); + lastChar = 'I'; + break; + case 'X': + processTheChar('X', lastChar); + lastChar = 'X'; + break; + case 'D': + processTheChar('D', lastChar); + lastChar = 'D'; + break; + case 'C': + processTheChar('C', lastChar); + lastChar = 'C'; + break; + } + } + } + + private void processTheChar(char c, char lastChar) throws RomanNumeralsException { + if( c == 'I' ) + if( lastChar == 'L' ) + throw new RomanNumeralsException(); + if ( c == 'X' ) + if(lastChar == 'X' && x == true) + throw new RomanNumeralsException(); + x = false; + if ( c == 'C' ) + if( lastChar == 'X' && x == true) + throw new RomanNumeralsException(); + x = false; + if( c == 'X' ) + if( lastChar == 'D' ) + throw new RomanNumeralsException(); + if( lastChar == 'X') + x = true; } } diff --git a/src/RomanNumeralsException.java b/src/RomanNumeralsException.java new file mode 100644 index 0000000..2692417 --- /dev/null +++ b/src/RomanNumeralsException.java @@ -0,0 +1,4 @@ + +public class RomanNumeralsException extends Exception { + +} diff --git a/tests/TestRomanNumerals.java b/tests/TestRomanNumerals.java index 5d1de75..b0271aa 100644 --- a/tests/TestRomanNumerals.java +++ b/tests/TestRomanNumerals.java @@ -4,9 +4,101 @@ public class TestRomanNumerals { - @Test - public void test() { - fail("Not yet implemented"); + RomanNumerals romanNumerals = new RomanNumerals(); + private void assertRomanNumerals(String roman, int expected) throws RomanNumeralsException { + + assertEquals(expected, romanNumerals.convertToInteger(roman)); + } + @Test public void testRomanNumerals_I_1() throws RomanNumeralsException { + assertRomanNumerals ("I", 1); } + @Test public void testRomanNumerals_V_5() throws RomanNumeralsException { + assertRomanNumerals ("V", 5); + } + + @Test public void testRomanNumerals_X_10() throws RomanNumeralsException { + assertRomanNumerals ("X", 10); + } + + @Test public void testRomanNumerals_L_50() throws RomanNumeralsException { + assertRomanNumerals ("L", 50); + } + + @Test public void testRomanNumerals_C_100() throws RomanNumeralsException { + assertRomanNumerals ("C", 100); + } + + @Test public void testRomanNumerals_D_500() throws RomanNumeralsException { + assertRomanNumerals ("D", 500); + } + + @Test public void testRomanNumerals_M_1000() throws RomanNumeralsException { + assertRomanNumerals ("M", 1000); + } + + @Test public void testRomanNumerals_II_2() throws RomanNumeralsException { + assertRomanNumerals ("II", 2); + } + + @Test public void testRomanNumerals_IV_4() throws RomanNumeralsException { + assertRomanNumerals("IV", 4); + } + + @Test public void testRomanNumerals_IX_9() throws RomanNumeralsException { + assertRomanNumerals("IX", 9); + } + + @Test public void testRomanNumerals_LXXX_80() throws RomanNumeralsException { + assertRomanNumerals("LXXX", 80); + } + + @Test public void testRomanNumerals_MCMLXXXIV_1984() throws RomanNumeralsException { + assertRomanNumerals("MCMLXXXIV", 1984); + } + + @Test public void testRomanNumerals_MMXIV_2014() throws RomanNumeralsException { + assertRomanNumerals("MMXIV", 2014); + } + + @Test public void testRomanNumerals_DCCC_800() throws RomanNumeralsException { + assertRomanNumerals("DCCC", 800); + } + + @Test (expected = RomanNumeralsException.class) public void testRomanNumerals_I_repeated_four_times_IIII_exception() throws RomanNumeralsException { + assertRomanNumerals("IIII", 4); + } + + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals_X_repeated_five_times_XXXXX_exception() throws RomanNumeralsException { + assertRomanNumerals("XXXXX", 50); + } + + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals_V_repeated_three_times_VVVVV_exception() throws RomanNumeralsException { + assertRomanNumerals("VVVVV", 25); + } + + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals_D_repeated_two_times_DD_exception() throws RomanNumeralsException { + assertRomanNumerals("DD", 1000); + } + + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals__I_subtractedFromL_exception() throws RomanNumeralsException { + assertRomanNumerals("IL", 49); + } + + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals__X_subtractedFromD_exception() throws RomanNumeralsException { + assertRomanNumerals("XD", 490); + } + + @Test public void testRomanNumerals_CM_900() throws RomanNumeralsException { + assertRomanNumerals("CM", 900); + } + + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals_subtractionMultipleTimes_XXC_exception() throws RomanNumeralsException { + assertRomanNumerals("XXC", 80); + } + + @Test ( expected = RomanNumeralsException.class ) public void testRomanNumerals_subtractionMultipleTimes_XXL_exception() throws RomanNumeralsException { + assertRomanNumerals("XXL", 30); + } + }