KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > chaperon > test > SimpleParserTestCase


1 /*
2  * Copyright (C) Chaperon. All rights reserved.
3  * -------------------------------------------------------------------------
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE file.
7  */

8
9 package net.sourceforge.chaperon.test;
10
11 import junit.framework.Test;
12 import junit.framework.TestCase;
13 import junit.framework.TestSuite;
14
15 import net.sourceforge.chaperon.common.SimpleParser;
16
17 import java.io.File JavaDoc;
18
19 public class SimpleParserTestCase extends TestCase
20 {
21   public SimpleParserTestCase(String JavaDoc name)
22   {
23     super(name);
24   }
25
26   public void testSimpleParser() throws Exception JavaDoc
27   {
28     File JavaDoc lexicon = new File JavaDoc("src/resources/grammars/grm.xlex");
29     File JavaDoc grammar = new File JavaDoc("src/resources/grammars/grm.xgrm");
30     File JavaDoc in = new File JavaDoc("src/resources/grammars/java.grm");
31     File JavaDoc out = new File JavaDoc("build/chaperon/simpleparser.test");
32
33     //out.deleteOnExit();
34
SimpleParser.process(lexicon, grammar, in, out);
35   }
36
37   public static Test suite()
38   {
39     return new TestSuite(SimpleParserTestCase.class);
40   }
41 }
42
Popular Tags