-
Notifications
You must be signed in to change notification settings - Fork 0
FlightTest Documentation
The FlightTest class is a test class for the Flight class, using the JUnit frameworks for testing.
- The FlightTest class is called via the Test Suite Class Test Suite and therefore requires no individual instance for the required functionality. The below code showcases how the FlightTest class is referenced and utilized:
@RunWith(Suite.class)
@Suite.SuiteClasses({
LuggageManagementSystemTest.class,
PassengerTest.class,
LuggageSlipTest.class,
LuggageManifestTest.class,
FlightTest.class
})
-
This class is used with the Template design pattern as a subclass of the TestTemplate class.
-
The main methods implemented are as follows:
-
testFlightNo() -
testDestination() -
testOrigin() -
testFlightDate() -
testManifest() -
testConstructor() -
testCheckInLuggage() -
testPrintLuggageManifest() -
testGetAllowedLuggage() -
testToString()
-
These methods are used to test method & attribute naming conventions and types, behaviour and functionality of methods, expected abstractions and inheritance hierarchies of the student's submitted Passenger.java file.
Methods
-
@Before public void init():
-
@Test public void testFlightNo(): This method is used to test the use of proper naming convention and type (String) of theflightNofield in the student Flight class.
No change is made to the Automated Judge System or the student submission file. There is no returned object nor any accepted parameters, however, the use of inherited attributes from the parent class, TestTemplate is used to track its grading, i.e.-
boolean passedis used to indicate whether a particular test condition is true and therefore the designated mark should be awarded. -
Class<?> testClassis used to set the class type to Flight to indicate the Flight class is being tested.
A
Feedbackobject is created reflecting the appropriate feedback response and mark to be displayed from the test result. -
-
@Test public void testDestination(): This method is used to test the use of proper naming convention and type (String) of thedestinationfield in the student Flight class.
No change is made to the Automated Judge System or the student submission file. There is no returned object nor any accepted parameters, however, the use of inherited attributes from the parent class, TestTemplate is used to track its grading, i.e.-
boolean passedis used to indicate whether a particular test condition is true and therefore the designated mark should be awarded. -
Class<?> testClassis used to set the class type to Flight to indicate the Flight class is being tested.
A
Feedbackobject is created reflecting the appropriate feedback response and mark to be displayed from the test result. -
-
@Test public void testOrigin(): This method is used to test the use of proper naming convention and type (String) of theoriginfield in the student Flightclass.
No change is made to the Automated Judge System or the student submission file. There is no returned object nor any accepted parameters, however, the use of inherited attributes from the parent class, TestTemplate is used to track its grading, i.e.-
boolean passedis used to indicate whether a particular test condition is true and therefore the designated mark should be awarded. -
Class<?> testClassis used to set the class type to FLight to indicate the Flight class is being tested.
A
Feedbackobject is created reflecting the appropriate feedback response and mark to be displayed from the test result. -
-
@Test public void testFlightDate(): This method is used to test the use of proper naming convention and type (LocalDateTime) of theflightDatefield in the student Flightclass.
No change is made to the Automated Judge System or the student submission file. There is no returned object nor any accepted parameters, however, the use of inherited attributes from the parent class, TestTemplate is used to track its grading, i.e.-
boolean passedis used to indicate whether a particular test condition is true and therefore the designated mark should be awarded. -
Class<?> testClassis used to set the class type to Flight to indicate the Flight class is being tested.
A
Feedbackobject is created reflecting the appropriate feedback response and mark to be displayed from the test result. -
-
@Test public void testManifest(): This method is used to test the use of proper naming convention and type (LuggageManifest) of themanifestfield in the student Flight class.
No change is made to the Automated Judge System or the student submission file. There is no returned object nor any accepted parameters, however, the use of inherited attributes from the parent class, TestTemplate is used to track its grading, i.e.-
boolean passedis used to indicate whether a particular test condition is true and therefore the designated mark should be awarded. -
Class<?> testClassis used to set the class type to Flight to indicate the Flight class is being tested.
A
Feedbackobject is created reflecting the appropriate feedback response and mark to be displayed from the test result. -
-
@Test public void testConstructor(): -
@Test public void testCheckInLuggage(): -
@Test public void testPrintLuggageManifest(): -
@Test public void testGetAllowedLuggage(): -
@Test public void testToString():
Fields
-
private Flight flight1: