1. Engineering
  2. Computer Science
  3. java code example of j unit test...

Question: java code example of j unit test...

Question details

and File I/O. Additionally, you have the opportunity to continue to build your JUnit testing skills (computer hacking skills will have to wait). Your Employee class should contain all the variables defined in the data file provided. Your Manager class should contain only a single class variable representing the number of employees that manager is responsible for. Make sure that Manager extends Employee so as to build the correct hierarchy. This aspect will not be utilized in this lab, but we may build on this lab later in the semester so this functionally could still be usefu... Design: Employee Class: .Needs to be the super class/parent of Manager .Should only contain class variable(s), constructor(s), and getters/setters Manager Class: .Should only contain class variable(s), constructor(s), and getters/setters Homework2 Class: .Should contain at least a single class variable to store all the employees Required methods are listed below. Packaging: Fully qualified class names are listed below: edu.ben.homeworks.homework2.Homework2.java edu.ben.homeworks.homework2.Homework2Test.java edu.ben.homeworks.homework2.Employee.java . edu.ben.homeworks.homework2.Manager.javaHomework2 method signatures: Imports employee data from a CSV file (A sample has been provided on D2L) This method expects the file to have a header line. *@param importData File containing data, including a header line, in CSV format * @throws FileNotFoundException Thrown if the file does not exist public static void importEmployees (File importData) throws FileNotFoundException * Returns an array containing all the employee objects * Oreturn An array of Employee objects public static Employee[] getEmployeeRecords () * Returns the first employee object that matches the given parameter. This * method is case sensitive. * return The matching employee object or null if the name is not found public static Employee getEmployeeByFirstName (String firstName) * Returns the first employee object that matches the given parameter. This *method is case sensitive. * return The matching employee object or null if the name is not found public static Employee getEmployeeByLastName (String lastName) * Deletes all employee data currently stored in this class public static void deleteAllEmployees ()

Java Code

Homework2.csv firstName,lastName,salarv.startDate Rohit,Sharma,78438.49,12/18/2019

Example of J unit test

Homeworko.java | DỊ HomeworkOTest.java33 ії in..in packagehomeworks. homeworke; 1 package e 3 public class Homeworke 5 public static void main(Stringll args) f homeworks. homeworke; 3+ import org. junit.Test: public class HomeworkeTest extends TestCase t System.out.print n(Helto wortd) @Test public void test) f String expected:,Hello, world! ; Homeworke.main nulu) String actual systemout.getHistory); assertEquals (expected, actua): 10 12 h 16

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution