1
2
3
4
5
6
7 package nl.tudelft.simulation.xml;
8
9 import java.net.URL;
10
11 import junit.framework.Assert;
12 import junit.framework.TestCase;
13 import nl.tudelft.simulation.dsol.experiment.ExperimentalFrame;
14 import nl.tudelft.simulation.language.io.URLResource;
15 import nl.tudelft.simulation.logger.Logger;
16 import nl.tudelft.simulation.xml.dsol.ExperimentParser;
17
18 /***
19 * <p>
20 * (c) copyright 2002-2005 <a href="http://www.simulation.tudelft.nl">Delft
21 * University of Technology </a>, the Netherlands. <br>
22 * See for project information <a
23 * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
24 * License of use: <a href="http://www.gnu.org/copyleft/lesser.html">Lesser
25 * General Public License (LGPL) </a>, no warranty.
26 *
27 * @author <a href="http://www.peter-jacobs.com/index.htm">Peter Jacobs </a>
28 * @version 1.2 Sep 28, 2004
29 * @since 1.5
30 */
31 public class ExperimentParserT extends TestCase
32 {
33
34 /***
35 * constructs a new ExperimentParserT
36 */
37 public ExperimentParserT()
38 {
39 this("test");
40 }
41
42 /***
43 * constructs a new ExperimentParserT
44 *
45 * @param arg0
46 */
47 public ExperimentParserT(String arg0)
48 {
49 super(arg0);
50 }
51
52 /***
53 * tests the experiment test
54 */
55 public void test()
56 {
57 URL url = URLResource.getResource("/resources/DummyExperiment.xml");
58 Assert.assertFalse(url == null);
59 try
60 {
61 ExperimentalFrame experimentalFrame = ExperimentParser
62 .parseExperimentalFrame(url);
63 System.out.println(experimentalFrame);
64 } catch (Exception exception)
65 {
66 Logger.warning(this, "test", exception);
67 Assert.fail(exception.getMessage());
68 }
69 }
70 }