KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > languages > velocity > NBSTest


1 /*
2  * NBSTest.java
3  *
4  * Created on September 1, 2006, 2:46 PM
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package org.netbeans.modules.languages.velocity;
11
12 import java.io.IOException JavaDoc;
13 import java.io.InputStream JavaDoc;
14 import java.util.List JavaDoc;
15 import java.util.Map JavaDoc;
16 import junit.framework.TestCase;
17
18 import org.netbeans.api.languages.ParseException;
19 import org.netbeans.modules.languages.Language;
20 import org.netbeans.modules.languages.NBSLanguageReader;
21 import org.netbeans.modules.languages.parser.AnalyserAnalyser;
22 import org.netbeans.modules.languages.parser.Petra;
23
24
25 /**
26  *
27  * @author Jan Jancura
28  */

29 public class NBSTest extends TestCase {
30     
31     public NBSTest (String JavaDoc testName) {
32         super (testName);
33     }
34     
35     public void testFirst () {
36         InputStream JavaDoc is = getClass ().getClassLoader ().getResourceAsStream ("org/netbeans/modules/languages/velocity/Velocity.nbs");
37         try {
38             Language l = NBSLanguageReader.readLanguage ("test", is, "test/x-velocity");
39             List JavaDoc r = l.getAnalyser ().getRules ();
40             AnalyserAnalyser.printRules (r, null);
41             Map JavaDoc f = Petra.first2 (r);
42             //AnalyserAnalyser.printDepth (f, null);
43
//AnalyserAnalyser.printConflicts (f, null);
44
AnalyserAnalyser.printF (f, null);
45         } catch (ParseException ex) {
46             ex.printStackTrace();
47         } catch (IOException JavaDoc ex) {
48             ex.printStackTrace();
49         }
50     }
51 }
52
Popular Tags