Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!!!

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

1. Discuss the four components of language.

Answered: 1 week ago