-
Notifications
You must be signed in to change notification settings - Fork 0
LuggageManagementSystemTest Documentation
The LuggageManagementSystemTest class is a test class for the LuggageManagement class, using the JUnit frameworks for testing.
- The LuggageManagementSystemTest 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 LuggageManagementSystemTest 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:
testSystemRun()
This 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 LuggageManagementSystem.java file.
Methods
-
@Before public void init():
-
@Test public void testSystemRun(): This method is used to test whether the LuggageManagementSystem class can correctly run without error. 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 LuggageManagementSystem to indicate the LuggageManagementSystem 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 testToString():