KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > api > ScopeTest


1 package com.puppycrawl.tools.checkstyle.api;
2
3 import junit.framework.TestCase;
4
5 public class ScopeTest
6     extends TestCase
7 {
8     public void testMisc()
9     {
10         final Scope o = Scope.getInstance("public");
11         assertNotNull(o);
12         assertEquals("Scope[1 (public)]", o.toString());
13         assertEquals("public", o.getName());
14
15         try {
16             Scope.getInstance("unknown");
17             fail();
18         }
19         catch (IllegalArgumentException JavaDoc e) {
20             // As expected
21
}
22     }
23 }
24
Popular Tags