Пример #1
0
 public static void validateItem(IAtsUser user, IAtsLogItem item, Date date)
     throws OseeCoreException {
   Assert.assertEquals(LogType.Error, item.getType());
   Assert.assertEquals(date, item.getDate());
   Assert.assertEquals(user.getUserId(), item.getUserId());
   Assert.assertEquals("Analyze", item.getState());
   Assert.assertEquals("my msg", item.getMsg());
 }
Пример #2
0
  @Test
  public void testSetsAndGets() throws OseeCoreException {
    Date date = new Date();
    IAtsLogItem item = getTestLogItem(date, user);
    item.setMsg("new msg");
    Assert.assertEquals("new msg", item.getMsg());

    item.setState("Implement");
    Assert.assertEquals("Implement", item.getState());

    item.setUserId("asdf");
    Assert.assertEquals("asdf", item.getUserId());

    item.setType(LogType.Note);
    Assert.assertEquals(LogType.Note, item.getType());

    Calendar cal = Calendar.getInstance();
    cal.set(2011, 10, 1);
    Date newDate = cal.getTime();
    item.setDate(newDate);
    Assert.assertNotEquals(date, item.getDate());
    Assert.assertEquals(newDate, item.getDate());
  }