Aryeh M. Friedman said:
Assert.java:81: warning: [unchecked] unchecked cast
found : java.lang.Object
required: java.lang.Comparable<java.lang.Object>
if(((Comparable<Object>) val).compareTo(min)<=0)
You can turn off the cast check warning using a variant on the -lint
command line option to javac.
TestFailException.java:11: warning: [serial] serializable class
unittest.TestFailException has no definition of serialVersionUID
public class TestFailException extends RuntimeException
^
The same with that warning.
TestResult.java:49: unittest.TestErrorException is abstract; cannot be
instantiated
throw new TestErrorException();
^
You need to make a non-abstract subclass.
TestResultTest.java:57: incompatible types
found : unittest.TestErrorException
required: java.lang.Throwable
} catch(TestErrorException e) {
^
Your TestErrorException needs to extend Throwable or one of its
subclasses. Unlike C++, you cannot throw any object you want.
Assert.assertRange(5,0,9);
^
When autoboxing the 5, the compiler uses Integer: That class does not
AssertTest.java:89:
assertRange(java.lang.Comparable<java.lang.Object>,java.lang.Object,java.lang.Object)
in unittest.Assert cannot be applied to (int,int,int)
Assert.assertRange(-1,0,9);
^
Same thing.
AssertTest.java:90:
assertRange(java.lang.Comparable<java.lang.Object>,java.lang.Object,java.lang.Object)
in unittest.Assert cannot be applied to (int,int,int)
Assert.assertRange(10,0,9);
^
And again.
The rest are the same you got before.