We were given a jar file to do blackbox testing on the methods. I know one test is supposed to give us a runtime exception but I'm getting a null pointer exception. My question is do I have this setup correctly and do you guys know where I'm going wrong?
Imported JAR file into build path correctly?
I've never used Eclipse, but from your output it looks like everything is setup fine.
I'm not surprised by the NullPointerException
either; you called addCourse()
and passed null
instead of a Course
.
This is clearly homework. I don't know what your directions are, but if you don't expect that method to throw NPE, you probably shouldn't be putting nulls in there.
Since the exception you're looking for is CourseOverlapException
, you probably ought to try adding two SingleLectureCourse
s that have overlapping time ranges.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.