public interface ListDriverInterface
| Modifier and Type | Interface and Description |
|---|---|
static class |
ListDriverInterface.ListType
This
enum is used to specify which list implementation to use. |
static class |
ListDriverInterface.TestType
This
enum is used to specify which test scenario will be executed. |
| Modifier and Type | Method and Description |
|---|---|
ListInterface<java.lang.Integer> |
createList(ListDriverInterface.ListType listType,
ListDriverInterface.TestType forTestType)
This method is used to create a new list of the specified listType.
|
ListInterface<java.lang.Integer> |
initializeList(ListInterface<java.lang.Integer> list,
int firstNumber,
int lastNumber,
int increment)
This method is called by the createList() method to initialize the list with the required elements.
|
double |
memoryUsage()
This method is used to calculate the amount of memory being used in the JVM currently.
|
java.lang.Object[] |
runTestCase(ListDriverInterface.ListType listType,
ListDriverInterface.TestType testType,
int numberOfTimes)
This method will run the testType on a list of type listType for numberOfTimes.
|
ListInterface<java.lang.Integer> createList(ListDriverInterface.ListType listType, ListDriverInterface.TestType forTestType)
initializeList to populate the list with the required elements.
initializeList(ListInterface, int, int, int)listType - This parameter specifies the type of list to create. See the enum ListDriverInterface.ListType.forTestType - This parameter specifies the type of test that the list is being created for. See the enum
ListDriverInterface.TestType.ListInterface<java.lang.Integer> initializeList(ListInterface<java.lang.Integer> list,
int firstNumber,
int lastNumber,
int increment)
Integer objects
starting with firstNumber and ending with lastNumber incrementing each time by
increment. Please note that when the increment == 0, this method does not add anything to the
list.list - The list to be initialized.firstNumber - The first number to be added to the list.lastNumber - The last number to be added to the listincrement - The increment to be used by the for loop for each iteration. If the increment is zero, this
method will not add anything to the list.double memoryUsage()
double representing the amount of memory in megabytes currently allocated in
the JVM. Please note that you must convert from kilobytes to megabytes.java.lang.Object[] runTestCase(ListDriverInterface.ListType listType, ListDriverInterface.TestType testType, int numberOfTimes)
This method will run the testType on a list of type listType for numberOfTimes.
Create the Object array
Create instance of TestTimes class
This method repeats the following numberOfTimes:
Object array
Object array
Add TestTimes instance to the Object array
Return the Object array
listType - The type of list needed. See the enum ListDriverInterface.ListType.testType - The type of test case being run. See the enum ListDriverInterface.TestType.numberOfTimes - This parameter specifies the number of times to run the specified test.