Example #1
0
 public void workerSetTest() {
   Set<Worker> workerSet = new HashSet<Worker>();
   Worker worker1 = new Worker("张三", 18);
   worker1.setWorkerId(1);
   workerSet.add(worker1);
   Worker worker2 = new Worker("李四", 8);
   worker2.setWorkerId(2);
   System.out.println(workerSet.contains(worker2));
 }
Example #2
0
  public void departTest() {
    Department department1 = depDAO.getDepartment(1);
    Department department2 = depDAO.getDepartment(2);
    Department department3 = depDAO.getDepartment(3);
    Worker worker1 = new Worker("jaku", 18);
    worker1.setWorkerPassword("111111");
    worker1.setDepartment(department1);
    worker1.setWorkerLevel(1);

    Worker worker2 = new Worker("balen", 28);
    worker2.setWorkerPassword("111111");
    worker2.setDepartment(department2);
    worker2.setWorkerLevel(2);

    Worker worker3 = new Worker("admin", 38);
    worker3.setWorkerPassword("111111");
    worker3.setDepartment(department3);
    worker3.setWorkerLevel(3);

    department1.addWorker(worker1);
    department2.addWorker(worker2);
    department3.addWorker(worker3);
    depDAO.saveDepart(department1);
    depDAO.saveDepart(department2);
    depDAO.saveDepart(department3);
  }