@Test public void testTime() { assertTrue(validEntry.getTime() != null); assertTrue(validEntry.getTime().compareTo(new GregorianCalendar()) <= 0); GregorianCalendar date = new GregorianCalendar(2009, 8, 10); validEntry.setTime(date); assertEquals(date, validEntry.getTime()); }
@Test public void testToString() { validEntry.setValue("Value"); validEntry.setUsername("username"); validEntry.setClazz(TrialSite.class); validEntry.setAction(ActionType.LOGIN); validEntry.setIdentifier(1000); assertNotNull(validEntry.toString()); assertTrue(validEntry.toString().length() > 0); validEntry = new LogEntry(); validEntry.setUsername("username"); validEntry.setAction(ActionType.LOGIN); assertNotNull(validEntry.toString()); assertTrue(validEntry.toString().length() > 0); }
@Test public void testValue() { assertTrue(validEntry.getValue() == null); validEntry.setValue("Value"); assertEquals("Value", validEntry.getValue()); }
@Test public void testUsername() { assertTrue(validEntry.getUsername() == null); validEntry.setUsername("username"); assertEquals("username", validEntry.getUsername()); }
@Test public void testClass() { assertTrue(validEntry.getClazz() == null); validEntry.setClazz(TrialSite.class); assertEquals(TrialSite.class, validEntry.getClazz()); }
@Test public void testAction() { assertTrue(validEntry.getAction() == null); validEntry.setAction(ActionType.LOGIN); assertEquals(ActionType.LOGIN, validEntry.getAction()); }
@Test public void testIdentifier() { assertTrue(validEntry.getIdentifier() <= 0); validEntry.setIdentifier(1000); assertTrue(validEntry.getIdentifier() == 1000); }