Updating to NBMs from NetBeans 8.0.1 as some of them are required to run on JDK8
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
6 package org.apidesign.cloneproblem;
9 import junit.framework.TestCase;
11 /** The test as would be written by the (not paranoiac) API author.
13 * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
15 public class IntervalTest extends TestCase {
17 public IntervalTest(String testName) {
21 // BEGIN: interval.test
22 public void testOneSecondInterval() {
23 Date now = new Date();
24 Date later = new Date(now.getTime() + 1000);
26 Interval interval = new Interval(now, later);
27 assertEquals("1s", 1000, interval.getLength());
31 public void testLaterCantBeSooner() {
32 Date now = new Date();
33 Date later = new Date(now.getTime() - 1000);
36 Interval interval = new Interval(now, later);
37 fail("Shall throw IllegalArgumentException");
38 } catch (IllegalArgumentException ex) {
43 public void testDoesNotThrowNPEOnSecondArg() {
44 Date now = new Date();
46 Interval interval = new Interval(now, null);
47 fail("Shall throw IllegalArgumentException");
48 } catch (IllegalArgumentException ex) {
53 public void testDoesNotThrowNPEOnFirstArg() {
54 Date now = new Date();
56 Interval interval = new Interval(null, now);
57 fail("Shall throw IllegalArgumentException");
58 } catch (IllegalArgumentException ex) {