简体   繁体   中英

Eclipse, Java, Junit4, I want to blackbox test a jar file. Need a little help in setting up

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?

Package explorer is like this

Single test case

Imported JAR file into build path correctly?

Test case that is giving the wrong error

UML Diagram

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM