Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The JUnit tests for two classes contain a check exception named DealWithMeException and an unchecked exception named UnfixableException. Write these two exceptions. import static org.junit.Assert.assertEquals;

The JUnit tests for two classes contain a check exception named DealWithMeException and an unchecked exception named UnfixableException. Write these two exceptions.

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class ExceptionsTest {

@Test public final void testCheckedException() { Class cut = DealWithMeException.class; assertEquals("To make a class a checked exception it needs be a subclass of the appropriate Java class", Exception.class, cut.getSuperclass()); }

@Test public final void testUncheckedException() { Class cut = UnfixableException.class; assertEquals("To make a class an unchecked exception it needs be a subclass of the appropriate Java class", RuntimeException.class, cut.getSuperclass()); }

}

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_2

Step: 3

blur-text-image_3

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

List the benefits of strategic planning.

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago