roman_numerals_buggy
roman_numerals_buggy/package.bluej
#BlueJ package file dependency1.from=RomanNumeralsTest dependency1.to=RomanNumerals dependency1.type=UsesDependency package.editor.height=400 package.editor.width=560 package.editor.x=733 package.editor.y=118 package.numDependencies=1 package.numTargets=2 package.showExtends=true package.showUses=true target1.editor.height=700 target1.editor.width=900 target1.editor.x=623 target1.editor.y=216 target1.height=50 target1.name=RomanNumeralsTest target1.naviview.expanded=false target1.showInterface=false target1.type=UnitTestTarget target1.width=140 target1.x=70 target1.y=70 target2.editor.height=700 target2.editor.width=900 target2.editor.x=578 target2.editor.y=92 target2.height=50 target2.name=RomanNumerals target2.naviview.expanded=false target2.showInterface=false target2.type=ClassTarget target2.width=120 target2.x=70 target2.y=10
roman_numerals_buggy/README.TXT
------------------------------------------------------------------------ This is the project README file. Here, you should describe your project. Tell the reader (someone who does not know anything about this project) all he/she needs to know. The comments should usually include at least: ------------------------------------------------------------------------ PROJECT TITLE: PURPOSE OF PROJECT: VERSION or DATE: HOW TO START THIS PROJECT: AUTHORS: USER INSTRUCTIONS:
roman_numerals_buggy/RomanNumerals.class
public synchronized class RomanNumerals { public void RomanNumerals(); public String toRoman(int); }
roman_numerals_buggy/RomanNumerals.ctxt
#BlueJ class context comment0.params=n comment0.target=java.lang.String\ toRoman(int) numComments=1
roman_numerals_buggy/RomanNumerals.java
roman_numerals_buggy/RomanNumerals.java
public
class
RomanNumerals
{
public
String
toRoman
(
int
n
)
{
String
r
=
""
;
while
(
n
>
0
)
{
if
(
n
>=
1000
)
{
r
+=
"M"
;
n
-=
1000
;
}
else
if
(
n
>
500
)
{
r
+=
"D"
;
n
-=
500
;
}
else
if
(
n
>=
100
)
{
r
+=
"C"
;
n
-=
100
;
}
else
if
(
n
>=
50
)
{
r
+=
"L"
;
n
-=
50
;
}
else
if
(
n
>=
10
)
{
r
+=
"X"
;
n
-=
10
;
}
else
if
(
n
>=
5
)
{
r
+=
"V"
;
n
-=
5
;
}
else
{
r
+=
"I"
;
n
-=
1
;
}
}
return
r
;
}
}
roman_numerals_buggy/RomanNumeralsTest.class
public synchronized class RomanNumeralsTest extends junit.framework.TestCase { public void RomanNumeralsTest(); protected void setUp(); protected void tearDown(); public void test_1(); public void test_3(); public void test_8(); public void test_27(); public void test_2011(); public void test_44(); public void test555(); public void test500(); }
roman_numerals_buggy/RomanNumeralsTest.ctxt
#BlueJ class context comment0.params= comment0.target=RomanNumeralsTest() comment0.text=\r\n\ Default\ constructor\ for\ test\ class\ RomanNumeralsTest\r\n comment1.params= comment1.target=void\ setUp() comment1.text=\r\n\ Sets\ up\ the\ test\ fixture.\r\n\r\n\ Called\ before\ every\ test\ case\ method.\r\n comment10.params= comment10.target=void\ test500() comment2.params= comment2.target=void\ tearDown() comment2.text=\r\n\ Tears\ down\ the\ test\ fixture.\r\n\r\n\ Called\ after\ every\ test\ case\ method.\r\n comment3.params= comment3.target=void\ test_1() comment4.params= comment4.target=void\ test_3() comment5.params= comment5.target=void\ test_8() comment6.params= comment6.target=void\ test_27() comment7.params= comment7.target=void\ test_2011() comment8.params= comment8.target=void\ test_44() comment9.params= comment9.target=void\ test555() numComments=11
roman_numerals_buggy/RomanNumeralsTest.java
roman_numerals_buggy/RomanNumeralsTest.java
/**
* The test class RomanNumeralsTest.
*
*
@author
(your name)
*
@version
(a version number or a date)
*/
public
class
RomanNumeralsTest
extends
junit
.
framework
.
TestCase
{
/**
* Default constructor for test class RomanNumeralsTest
*/
public
RomanNumeralsTest
()
{
}
/**
* Sets up the test fixture.
*
* Called before every test case method.
*/
protected
void
setUp
()
{
}
/**
* Tears down the test fixture.
*
* Called after every test case method.
*/
protected
void
tearDown
()
{
}
public
void
test_1
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"I"
,
romanNum1
.
toRoman
(
1
));
}
public
void
test_3
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"III"
,
romanNum1
.
toRoman
(
3
));
}
public
void
test_8
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"VIII"
,
romanNum1
.
toRoman
(
8
));
}
public
void
test_27
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"XXVII"
,
romanNum1
.
toRoman
(
27
));
}
public
void
test_2011
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"MMXI"
,
romanNum1
.
toRoman
(
2011
));
}
public
void
test_44
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"XVIV"
,
romanNum1
.
toRoman
(
44
));
}
public
void
test555
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"DLV"
,
romanNum1
.
toRoman
(
555
));
}
public
void
test500
()
{
RomanNumerals
romanNum1
=
new
RomanNumerals
();
assertEquals
(
"D"
,
romanNum1
.
toRoman
(
500
));
}
}