1 /*
2 Bloof - visualize the evolution of your software project
3 Copyright ( C ) 2003 Lukasz Pekacki <lukasz@pekacki.de>
4 http://bloof.sf.net/
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, write to the Free Software Foundation, Inc.,
16 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 $RCSfile: TimeLineResultTest.java,v $
19 Created on $Date: 2003/08/21 09:44:51 $
20 */
21 package net.sf.bloof.test.metrics;
22
23 import net.sf.bloof.metrics.ResultTimeLine;
24 import net.sf.bloof.metrics.TimeValue;
25
26 import java.util.Calendar;
27
28 import junit.framework.TestCase;
29
30 /***
31 *
32 * @author Lukasz Pekacki <pekacki@users.sourceforge.net>
33 * @version $Id: TimeLineResultTest.java,v 1.5 2003/08/21 09:44:51 pekacki Exp $
34 */
35 public class TimeLineResultTest extends TestCase {
36 /***
37 * Tests the generation of the XML Result
38 */
39 public void testGenerateXML() {
40 Calendar cal = Calendar.getInstance();
41 cal.set(2002, 1, 1, 0, 0, 0);
42 TimeValue one = new TimeValue(cal.getTime(), new Integer(10));
43 cal.set(2002, 1, 2, 0, 0, 0);
44 TimeValue two = new TimeValue(cal.getTime(), new Integer(20));
45 ResultTimeLine result = new ResultTimeLine();
46 result.addEntry(one);
47 result.addEntry(two);
48 assertEquals(XML_RESULT, result.getResultXMLString());
49 }
50
51 private static final String XML_RESULT =
52 "<data><datapoint time=\"2002-02-01 0:0:0\" "
53 + "value=\"10\"/><datapoint time=\"2002-02-02 0:0:0\" value=\"20\"/></data>";
54 }
This page was automatically generated by Maven