Question: Create a JUnit test suite and test runner for the DVD Collection Project. The rest of the prompt is screenshotted below. Both DVD . java
Create a JUnit test suite and test runner for the DVD Collection Project. The rest of the prompt is screenshotted below. Both DVDjava and DVDCollection.java classes are also screenshotted below. The DVDConsoleUI.java class is written out here below.
Please fully complete this Java JUnit test project and create source files for all classes, tests, test suite, and the test runner. Also provide screenshots of the test runs and results.
DVDConsoleUI.java:
import java.util.;
This class is an implementation of DVDUserInterface
that uses the console to display the menu of command choices
public class DVDConsoleUI implements DVDUserInterface
private DVDCollection dvdlist;
private Scanner scan;
public DVDConsoleUIDVDCollection dl
dvdlist dl;
scan new ScannerSystemin;
public void processCommands
String commands AddModify DVD
"Remove DVD
"Get DVDs By Rating",
"Get Total Running Time",
"Save and Exit";
int choice;
do
for int i ; i commands.length; i
System.out.printlnSelect i : commandsi;
try
choice scan.nextInt;
scan.nextLine;
switch choice
case : doAddOrModifyDVD; break;
case : doRemoveDVD; break;
case : doGetDVDsByRating; break;
case : doGetTotalRunningTime; break;
case : doSave; break;
default: System.out.printlnINVALID CHOICE TRY AGAIN";
catch InputMismatchException e
System.out.printlnINVALID CHOICE TRY AGAIN";
scan.nextLine;
choice ;
while choice commands.length;
private void doAddOrModifyDVD
Request the title
System.out.printlnEnter title";
String title scan.nextLine;
if titleequals
return; input was cancelled
title title.toUpperCase;
Request the rating
System.out.printlnEnter rating";
String rating scan.nextLine;
if ratingequals
return; input was cancelled
rating rating.toUpperCase;
Request the running time
System.out.printlnEnter running time";
String time scan.nextLine; NOTE: time read in as a String!
if timeequals
return; input was cancelled
Add or modify the DVD assuming the rating and time are valid
dvdlist.addOrModifyDVDtitle rating, time;
Display current collection to the console for debugging
System.out.printlnAddingModifying: title rating time;
System.out.printlndvdlist;
private void doRemoveDVD
Request the title
System.out.printlnEnter title";
String title scan.nextLine;
if titleequals
return; dialog was cancelled
title title.toUpperCase;
Remove the matching DVD if found
dvdlist.removeDVDtitle;
Display current collection to the console for debugging
System.out.printlnRemoving: title;
System.out.printlndvdlist;
private void doGetDVDsByRating
Request the rating
System.out.printlnEnter rating";
String rating scan.nextLine;
if ratingequals
return; dialog was cancelled
rating rating.toUpperCase;
String results dvdlist.getDVDsByRatingrating;
System.out.printlnDVDs with rating rating;
System.out.printlnresults;
private void doGetTotalRunningTime
int total dvdlist.getTotalRunningTime;
System.out.printlnTotal Running Time of DVDs: ;
System.out.printlntotal;
private void doSave
dvdlist.save;
DVDManager.java:
public class DVDManager
public static void mainString args
DVDCollection dl new DVDCollection;
Always use the GUI interface
Removes all command console output
DVDUserInterface dlInterface new DVDGUIdl;
dlInterface.processCommands;
DVDUserInterface.java:
public interface DVDUserInterface
void processCommands;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
