13141516171819
new Duration(null, new Date()); } @Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConstructorEnd() throws Exception { new Duration(new Date(), null); }
18192021222324
new Duration(new Date(), null); } @Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConstructorEndBeforeStart() throws Exception { new Duration(new Date(), new Date(System.currentTimeMillis()-4000)); }
24252627282930313233
} @Test public void shouldNotLeakOnConststructStart() throws Exception { Date start = new Date(); Duration dur = new Duration(start, new Date()); start.setTime(100); Assert.assertNotEquals(start, dur.getStart()); }
33343536373839404142
} @Test public void shouldNotLeakOnConststructEnd() throws Exception { Date end = new Date(); Duration dur = new Duration(new Date(), end); end.setTime(100); Assert.assertNotEquals(end, dur.getEnd()); }
4142434445464748495051
Assert.assertNotEquals(end, dur.getEnd()); } @Test public void shouldNotLeakOnGetStart() throws Exception { Duration dur = new Duration(new Date(), new Date()); Date start = dur.getStart(); start.setTime(100); Assert.assertNotEquals(start, dur.getStart()); }
5051525354555657585960
Assert.assertNotEquals(start, dur.getStart()); } @Test public void shouldNotLeakOnGetEnd() throws Exception { Duration dur = new Duration(new Date(), new Date()); Date end = dur.getEnd(); end.setTime(100); Assert.assertNotEquals(end, dur.getEnd()); }
52535455565758
return "conference"; } @Override protected Conference createDomainObject() { return new Conference("Name", "TagLine", new Duration(new Date(), new Date())); }
11121314151617
public class SessionValidationTestCase extends TimestampableSpecification<Session> { @Override protected Session createInstance() throws Exception { return new Session("", "", new Duration(new Date(), new Date())); }
28293031323334
m.invoke(entity); } @Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConstructorTitle() throws Exception { new Session(null, "", new Duration(new Date(), new Date())); }
33343536373839
new Session(null, "", new Duration(new Date(), new Date())); } @Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConstructorOutline() throws Exception { new Session("", null, new Duration(new Date(), new Date())); }