Advertisement
mmayoub

ServiveOffice, Tester class

Aug 20th, 2017
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. package Tester;
  2.  
  3. import ServicePkg.Office;
  4.  
  5. public class Tester {
  6.  
  7.     public static void main(String[] args) {
  8.         try {
  9.             // create office with maximum 10 waiting customers
  10.             Office myOffice = new Office(10);
  11.  
  12.             // open the office for customers to arrive
  13.             myOffice.open();
  14.  
  15.             // wait 500 to get customers, no employees yet
  16.             Thread.sleep(500);
  17.  
  18.             // add two employees
  19.             myOffice.addEmployee();
  20.             myOffice.addEmployee();
  21.  
  22.             // wait 500 and then add new employee
  23.             Thread.sleep(500);
  24.             myOffice.addEmployee();
  25.  
  26.             // get employee out after 500
  27.             Thread.sleep(500);
  28.             myOffice.removeEmployee("Employee #1");
  29.  
  30.             // wait 500 before closing the office
  31.             Thread.sleep(500);
  32.             myOffice.close();
  33.  
  34.         } catch (InterruptedException e) {
  35.             // TODO Auto-generated catch block
  36.             e.printStackTrace();
  37.         }
  38.     }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement