Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code that i need to test Download Lab03MovieCollectionsskeletonizip and import it into Eclipse. As needed you can reference instructions for importing to Eclipse: Eclipse import

image text in transcribed
image text in transcribed
image text in transcribed
code that i need to test
image text in transcribed
image text in transcribed
Download Lab03MovieCollectionsskeletonizip and import it into Eclipse. As needed you can reference instructions for importing to Eclipse: Eclipse import (1).pdf;olas. Note: The skeleton does contain errors, these will be resolved as you implement the various portions of the lab solution. - Create a new class named Movie in the collections package. - Have Movie class extend the MovieADT abstract class. The MovieADT class provides all of the methods you will need for the Movie class. What does this mean? That when you extend MovieADT the "Movie" class will get all those methods automatically. - So all you need to do in the Movie class is inplement the constuctor, which takes a parameter and makes a call to _See the UML at the topk MovieADT. gginnings of the test class are provided here: pockoge collections; public closs MovieTest extends student.TestCase private Movie movie; F* "Sets up \% public void setUp0? movie = new Movie('Spiderman"); movie.setGenre(Action'); moviesetvear(2002); movie.sethatins(4): J II start your test cases below. Looking at the MovieADT class, you will see getter and setter methods which have been implemented for you. You will need to write the test cases for these getter and setter methods. You can test getritie by comparing it to the title sent to the constructor. For the other instance variables test the getter and setter by using them together, for example: public void testGetGenre0 I. /I Check the Jurrent value of the field assertEquals("Action*; movie. getGenre0): II Set a new value and confirm that it updated properly moviesetGenre('Romance); assertEquals("Romance; moviesetGenre0): Conditions te check while testing the (already implementedl eguals method: 1. Comparing a movie object to itself (i.e the same variable). 2. Comparing a movie object to nult (or a null object) 3. Comparing a movie object to another movie object. Comparing two movie objects wath the same title (but difterent variable names) Comparing two movie objects with a different title (obviously ditferent variables). 4. Comparing a movie object to an object that is not a movie object there are a lot of objects that are not of class movie) Now check to make sure all of your tests pass for the Movie class then move on to implement the Moviocollection interrace iGo back to see which class should implement this interface) package collections: Movienat abstraction to represent a movie to be stored in a noyie collectiog. Each novie object has a title (string). qence (string), rating (det), and year (int). - Couthor Mecag Rifases * Cinersion 2815.02. 18 wf public abstract class MovieAot ) private string tit le: private String genre; private int rating: private int year; II f+4 Create a new Movie object. Anarof.ritle The nase of the navie. publie MovieADT(string title) i f this,title = title; 8) - The nase/title of the novic. - areturn Petura the movie'si title. public string gettitle() i. 3 retarn titte: l of Gence of a novie. Qreturn Returns the movie's qenre. public 5tring getGenre() return genres 3 fir Set the genre of a movie. fipramigenre The novie's new genre. public void setGence(string genre) ) this.genre = genres (f) 7. The rating of a noyde out of 5 stars. E efecura peturns the naviels rating. peblic int gethating () f publict int gethat inath (1) return rating (d) las - The cating af a nuvie oet of 5 stars. - parencratino * The movie's new rating public void setfuting (iat rating) this. rating a rating

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

More Books

Students also viewed these Databases questions

Question

What are the advantages and disadvantages of owning a franchise?

Answered: 1 week ago

Question

Know the diff erence between forensic and correctional psychology

Answered: 1 week ago