コード例 #1
0
ファイル: LogItemTest.java プロジェクト: pkdevboxy/osee
 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
ファイル: LogItemTest.java プロジェクト: pkdevboxy/osee
  @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());
  }