1 38 39 package org.jfree.data.junit; 40 41 import java.util.Date ; 42 43 import junit.framework.Test; 44 import junit.framework.TestCase; 45 import junit.framework.TestSuite; 46 47 import org.jfree.data.gantt.Task; 48 import org.jfree.data.gantt.TaskSeries; 49 import org.jfree.data.gantt.TaskSeriesCollection; 50 import org.jfree.data.time.SimpleTimePeriod; 51 52 57 public class TaskSeriesCollectionTests extends TestCase { 58 59 64 public static Test suite() { 65 return new TestSuite(TaskSeriesCollectionTests.class); 66 } 67 68 73 public TaskSeriesCollectionTests(String name) { 74 super(name); 75 } 76 77 80 public void test697153() { 81 82 TaskSeries s1 = new TaskSeries("S1"); 83 s1.add(new Task("Task 1", new SimpleTimePeriod(new Date (), new Date ()))); 84 s1.add(new Task("Task 2", new SimpleTimePeriod(new Date (), new Date ()))); 85 s1.add(new Task("Task 3", new SimpleTimePeriod(new Date (), new Date ()))); 86 87 TaskSeries s2 = new TaskSeries("S2"); 88 s2.add(new Task("Task 2", new SimpleTimePeriod(new Date (), new Date ()))); 89 s2.add(new Task("Task 3", new SimpleTimePeriod(new Date (), new Date ()))); 90 s2.add(new Task("Task 4", new SimpleTimePeriod(new Date (), new Date ()))); 91 92 TaskSeriesCollection tsc = new TaskSeriesCollection(); 93 tsc.add(s1); 94 tsc.add(s2); 95 96 s1.removeAll(); 97 98 int taskCount = tsc.getColumnCount(); 99 100 assertEquals(3, taskCount); 101 102 } 103 104 107 public void test800324() { 108 TaskSeries s1 = new TaskSeries("S1"); 109 s1.add(new Task("Task 1", new SimpleTimePeriod(new Date (), new Date ()))); 110 s1.add(new Task("Task 2", new SimpleTimePeriod(new Date (), new Date ()))); 111 s1.add(new Task("Task 3", new SimpleTimePeriod(new Date (), new Date ()))); 112 113 TaskSeriesCollection tsc = new TaskSeriesCollection(); 114 tsc.add(s1); 115 116 Number start = tsc.getStartValue(0, 3); 118 assertEquals(start, null); 119 Number end = tsc.getEndValue(0, 3); 120 assertEquals(end, null); 121 122 int count = tsc.getSubIntervalCount(0, 3); 123 assertEquals(0, count); 124 125 } 126 } 127 | Popular Tags |