Question: Create and run JunitTest cases for the following Java classes class Person { protected String name; protected String address; protected String phoneNumber; protected String email;
Create and run JunitTest cases for the following Java classes
class Person {
protected String name;
protected String address;
protected String phoneNumber;
protected String email;
Person(String name) {
this.name = name;
}
public String getName() {
return name;
}
@Override
public String toString() {
return "Person: " + name;
}
}
class Student extends Person {
public static int FRESHMAN = 1;
public static int SOPHOMORE = 2;
public static int JUNIOR = 3;
public static int SENIOR = 4;
protected int status;
Student(String name) {
super(name);
}
@Override
public String toString() {
return "Student: " + getName();
}
}
class Employee extends Person {
protected String office;
protected int salary;
protected java.util.Calendar dateHired;
Employee(String name) {
super(name);
}
@Override
public String toString() {
return "Employee: " + getName();
}
}
class Faculty extends Employee {
public static int LECTURER = 1;
public static int ASSISTANT_PROFESSOR = 2;
public static int ASSOCIATE_PROFESSOR = 3;
public static int PROFESSOR = 4;
protected String officeHours;
protected int rank;
Faculty(String name) {
super(name);
}
@Override
public String toString() {
return "Faculty: " + name;
}
}
class Staff extends Employee {
protected String title;
Staff(String name) {
super(name);
}
@Override
public String toString() {
return "Staff: " + getName();
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
