示例#1
0
  /** Tests get Search */
  public static void testSearch() {
    try {
      TimeTableModel model = new TimeTableModel();
      List list = new ArrayList();
      model.setSubject("O");
      list = model.search(0, 0);
      if (list.size() < 0) {
        System.out.println("Test Serach fail");
      }
      Iterator it = list.iterator();
      while (it.hasNext()) {
        model = (TimeTableModel) it.next();
        System.out.println(model.getId());
        System.out.println(model.getBranch());
        System.out.println(model.getSemester());
        System.out.println(model.getYear());
        System.out.println(model.getSubject());
        System.out.println(model.getDate());
        System.out.println(model.getTime());
        System.out.println(model.getFaculty());
      }

    } catch (ApplicationException e) {
      e.printStackTrace();
    }
  }
示例#2
0
 /** Tests find a User by PK. */
 public static void testFindByPK() {
   try {
     TimeTableModel model = new TimeTableModel();
     model = model.findByPK(1L);
     if (model == null) {
       System.out.println("Test Find By PK fail");
     } else {
       System.out.println(model.getId());
       System.out.println(model.getBranch());
       System.out.println(model.getSemester());
       System.out.println(model.getYear());
       System.out.println(model.getSubject());
       System.out.println(model.getDate());
       System.out.println(model.getTime());
       System.out.println(model.getFaculty());
     }
   } catch (ApplicationException e) {
     e.printStackTrace();
   }
 }