Interface SLMSTestInterface

All Known Implementing Classes:
SLMSTI

public interface SLMSTestInterface

This is a test-interface that we are going to use to test your SLMS prototype. To actually make the testing possible, you need to provide an implementation of this "interface".

We provide a bunch of test classes (Test0, Test1, etc) which you can use to test your prototype. These are the same test classes we will use.

Additionally, you will need modify the class "YourTestInterfaceFactory".

To make sure that this test-interface is neutral towards your particular implementation, most methods here just take strings as parameters.

The test interface will need to get access to your application logic. Sometimes this means that you need to give it an administrator credential.

DO NOT modify any class we provide for you, except that class YourTestInterfaceFactory.


Method Summary
 void addChild(java.lang.String emailParent, java.lang.String childName)
          This add a child to a parent's list of children.
 void addClass(java.lang.String name)
          This method should add a new school-class with the given name to your SLMS.
 void addLunchDate(java.lang.String emailParent, java.lang.String childName, SimpleDate date)
          Add a lunch date for a child that belongs to a parent.
 void addNoLunchDate(java.lang.String emailTeacher, SimpleDate date)
          This is to add a date that a teacher indicates that on that date there is no lunch for her class.
 void addParent(java.lang.String name, java.lang.String email, java.lang.String pwd)
          This method should add a new parent to your SLMS.
 void addParentRoleToTeacher(java.lang.String teacherEmail)
          This is to add a parent-role to a teacher.
 void addPreferDate(java.lang.String emailParent, SimpleDate date)
          This is to add a preferred supervision date of a parent.
 void addPupil(java.lang.String childName, java.lang.String className)
          This should add a child to the system, and adding her to a school class as well.
 void addTeacher(java.lang.String name, java.lang.String email, java.lang.String pwd)
          This method should add a new teacher to your SLMS.
 void addUnavailableDate(java.lang.String emailParent, SimpleDate date)
          This is to add a date where a parent would be unavailable for supervision.
 void assignTeacher(java.lang.String emailTeacher, java.lang.String className)
          Assign a teacher to a class.
 int calculateCost(java.lang.String childName, int year)
          This is to calculate the cost of lunch of a given child, for a given year.
 void demoteFromCoordinator(java.lang.String emailCoordinator)
          This is to remove the coordinator-role from a parent.
 boolean hasLunch(java.lang.String childName, SimpleDate date)
          Check whether a child has a lunch scheduled on the given date.
 boolean hasNoLunch(java.lang.String className, SimpleDate date)
          This is to check if a class has no lunch on a given date.
 boolean isAvailable(java.lang.String emailParent, SimpleDate date)
          This is to check if the parent is available for supervision on a given dat.
 boolean isChildOf(java.lang.String childName, java.lang.String emailParent)
          Check if a child belongs to the children of a parent.
 boolean isCoordinator(java.lang.String emailUser)
          This is to check if a parent is a coordinator.
 boolean isPreferred(java.lang.String emailParent, SimpleDate date)
          This is to check if the parent prefers a given date to do supervision.
 boolean isPupilOf(java.lang.String childName, java.lang.String className)
          Check if the given pupil is a pupil of the given class.
 boolean isTeacherOf(java.lang.String emailTeacher, java.lang.String className)
          Check is the given teacher is the teacher of the given class.
 boolean isUnavailable(java.lang.String emailParent, SimpleDate date)
          This is to check if the parent is unavailable for supervision on a given dat.
 void promoteToCoordinator(java.lang.String emailParent)
          This is to add a coordinator-role to a parent.
 void removeParentRoleFromTeacher(java.lang.String teacherEmail)
          This is to remove the parent-role from a teacher.
 void resetSLMS()
          This method should reset the state of the SLMS.
 void setToPayAfrontCostScheme(java.lang.String emailParent, java.lang.String childName)
          This is to set a child of a given parent to use the pay-afront cost shceme.
 void setToStandardCostScheme(java.lang.String emailParent, java.lang.String childName)
          This is to set a child of a given parent to use the standard cost scheme.
 boolean userExists(java.lang.String email)
          Check if a user with the given email exists in your SLMS.
 

Method Detail

resetSLMS

void resetSLMS()
This method should reset the state of the SLMS. At the beginning of every test-case that we provide for you, we call this method to make sure that the SLMS is always started with the same state. Of course after that, each test-case may decide to put a different population into your SLMS.


addClass

void addClass(java.lang.String name)
This method should add a new school-class with the given name to your SLMS.


addParent

void addParent(java.lang.String name,
               java.lang.String email,
               java.lang.String pwd)
This method should add a new parent to your SLMS. You need to allow the test interface to do this without having to go through the normal registration process. Pre-condition: nu user with the same email already exists.


addTeacher

void addTeacher(java.lang.String name,
                java.lang.String email,
                java.lang.String pwd)
This method should add a new teacher to your SLMS. You need to allow the test interface to do this without having to go through the normal registration process. Pre-condition: nu user with the same email already exists.


userExists

boolean userExists(java.lang.String email)
Check if a user with the given email exists in your SLMS.


assignTeacher

void assignTeacher(java.lang.String emailTeacher,
                   java.lang.String className)
Assign a teacher to a class. Pre-condition: the teacher and the class already exist in your SLMS,


isTeacherOf

boolean isTeacherOf(java.lang.String emailTeacher,
                    java.lang.String className)
Check is the given teacher is the teacher of the given class.


addPupil

void addPupil(java.lang.String childName,
              java.lang.String className)
This should add a child to the system, and adding her to a school class as well. Pre-condition: the class already exists.


isPupilOf

boolean isPupilOf(java.lang.String childName,
                  java.lang.String className)
Check if the given pupil is a pupil of the given class.


addChild

void addChild(java.lang.String emailParent,
              java.lang.String childName)
This add a child to a parent's list of children. Pre-condition: the parent already exists, and the child must already be a pupil in some class.


isChildOf

boolean isChildOf(java.lang.String childName,
                  java.lang.String emailParent)
Check if a child belongs to the children of a parent.


addLunchDate

void addLunchDate(java.lang.String emailParent,
                  java.lang.String childName,
                  SimpleDate date)
Add a lunch date for a child that belongs to a parent. Pre-condition: both the child and parent should already exists. The child should be a child of the parent.


hasLunch

boolean hasLunch(java.lang.String childName,
                 SimpleDate date)
Check whether a child has a lunch scheduled on the given date. Pre-condition: the child already exists.


addPreferDate

void addPreferDate(java.lang.String emailParent,
                   SimpleDate date)
This is to add a preferred supervision date of a parent. Pre-condition: the parent should exist.


addUnavailableDate

void addUnavailableDate(java.lang.String emailParent,
                        SimpleDate date)
This is to add a date where a parent would be unavailable for supervision. Pre-cond: the parent should exist.


isAvailable

boolean isAvailable(java.lang.String emailParent,
                    SimpleDate date)
This is to check if the parent is available for supervision on a given dat. Pre-cond: the parent should exist.


isUnavailable

boolean isUnavailable(java.lang.String emailParent,
                      SimpleDate date)
This is to check if the parent is unavailable for supervision on a given dat. Pre-cond: the parent should exist.


isPreferred

boolean isPreferred(java.lang.String emailParent,
                    SimpleDate date)
This is to check if the parent prefers a given date to do supervision. Pre-cond: the parent should exist.


addNoLunchDate

void addNoLunchDate(java.lang.String emailTeacher,
                    SimpleDate date)
This is to add a date that a teacher indicates that on that date there is no lunch for her class. Pre-cond: the teacher and her class should exist.


hasNoLunch

boolean hasNoLunch(java.lang.String className,
                   SimpleDate date)
This is to check if a class has no lunch on a given date. Pre-cond: the class should exist.


addParentRoleToTeacher

void addParentRoleToTeacher(java.lang.String teacherEmail)
This is to add a parent-role to a teacher. Pre-cond: the teacher should exist.


removeParentRoleFromTeacher

void removeParentRoleFromTeacher(java.lang.String teacherEmail)
This is to remove the parent-role from a teacher. Pre-cond: the teacher/parent should exist.


setToStandardCostScheme

void setToStandardCostScheme(java.lang.String emailParent,
                             java.lang.String childName)
This is to set a child of a given parent to use the standard cost scheme. Pre-cond: the parent and child should exist. The child should belong to the parent.


setToPayAfrontCostScheme

void setToPayAfrontCostScheme(java.lang.String emailParent,
                              java.lang.String childName)
This is to set a child of a given parent to use the pay-afront cost shceme. Pre-cond: the parent and child should exist. The child should belong to the parent.


calculateCost

int calculateCost(java.lang.String childName,
                  int year)
This is to calculate the cost of lunch of a given child, for a given year. The cost is expressed in euro-cent. Pre-cond: the child should exist.


promoteToCoordinator

void promoteToCoordinator(java.lang.String emailParent)
This is to add a coordinator-role to a parent. Pre-cond: the parent should exist.


demoteFromCoordinator

void demoteFromCoordinator(java.lang.String emailCoordinator)
This is to remove the coordinator-role from a parent. Pre-cond: the parent should exist.


isCoordinator

boolean isCoordinator(java.lang.String emailUser)
This is to check if a parent is a coordinator. Pre-cond: the parent should exist.