KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > languages > javascript > 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.javascript;
11
12
13 import java.io.IOException JavaDoc;
14 import java.io.InputStream JavaDoc;
15 import java.io.PrintWriter JavaDoc;
16 import java.util.List JavaDoc;
17 import java.util.Map JavaDoc;
18 import junit.framework.TestCase;
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.ParseException;
23 import org.netbeans.modules.languages.parser.Petra;
24
25
26 /**
27  *
28  * @author Jan Jancura
29  */

30 public class NBSTest extends TestCase {
31     
32     public NBSTest (String JavaDoc testName) {
33         super (testName);
34     }
35     
36     public void testFirst () {
37         InputStream JavaDoc is = getClass ().getClassLoader ().getResourceAsStream ("org/netbeans/modules/languages/ruby/Ruby.nbs");
38         try {
39             Language l = NBSLanguageReader.readLanguage ("test", is, "test/mimeType");
40             List JavaDoc r = l.getAnalyser ().getRules ();
41             Map JavaDoc f = Petra.first (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