Bug 639 - Java Null Exception when view the Application that is empty
Summary: Java Null Exception when view the Application that is empty
Status: RESOLVED INVALID
Alias: None
Product: 2021 CS3343 Hall Admission System
Classification: Unclassified
Component: System Section (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Assignee: newbie
URL:
Depends on:
Blocks:
 
Reported: 2021-12-04 15:59 HKT by amble3232
Modified: 2021-12-04 16:00 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description amble3232 2021-12-04 15:59:54 HKT
Background:
I am doing the unit test in ECLIPSE 2021-06 (4.20.0) on method viewApplication() in HallSystem class.
When I am doing testViewApplication2() in testHallSystem class, I am trying to test finding an std2’s application but there is no std2’ application.

Steps to Reproduce:
1. Run the package with testHall_Admission
2. Run the method “void testViewApplication2” in testHallSystem class

Actual result:
The system output the error message of “java.lang.NullPointerException: Cannot invoke “HallAdmissionSystem.Application.toString()” because the return value of “HallAdmissionSystem.HallSystem.findApplication(HallAdmissionSystem.Student)” is null” in the console after the test run.