Question: This test is a junit test. My thought is position A, since we're not supposed to fail the test right? If put in position A,

This test is a junit test. My thought is position A, since we're not supposed to fail the test right? If put in position A, fail() would not be reached because an exception is thrown before reaching it, and the junit test passes. This is what we want, right?

Otherwise, if the answer is position B (or something else), please specify and explain why. Thank you so much!!!

 This test is a junit test. My thought is position A,

Another method,?jumpToLightSpeed. takes in a coordinate as parameter for the destination, and throws a HyperDriveOfflineException' if hyperdrive appears to be offline. public void testJumpToLightSpeed (Coordinate destination) // construct a new Death Star DeathStar ds - new DeathStar) // turn off hyperdrive ds.hyperDrive.off); // destination: Planet Alderaan Coordinate alderaanLocationUtil.getCoordinate("Alderaan") // trying to jump to light speed should throw an exception try ds.jumpToLightSpeed(alderaan); /I Position A fail); catch (HyperDri veOfflineException e) System.err.println(e) /1 Position B fail) ) finally -t I Position C fail) Choose the best place(s) to add the 'fail)' statement: (1 point)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!