KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > regression > Issue84411Test


1 /*
2  * Issue84411Test.java
3  * JUnit based test
4  *
5  * Created on September 9, 2006, 9:01 AM
6  */

7
8 package regression;
9
10 import java.io.InputStream JavaDoc;
11 import junit.framework.TestCase;
12 import junit.framework.*;
13 import org.netbeans.modules.classfile.*;
14
15 /**
16  *
17  * @author tball
18  */

19 public class Issue84411Test extends TestCase {
20     
21     public Issue84411Test(String JavaDoc testName) {
22         super(testName);
23     }
24     
25     /**
26      * Test whether the SwitchData.class from Java 6 build 71 can be read
27      * successfully. Issue 84411 reported that an IndexOutOfBoundsException
28      * was thrown due to an invalid name_attribute_index in one of that
29      * class's Code attributes.
30      */

31     public void test84411() throws Exception JavaDoc {
32         InputStream JavaDoc classData =
33             getClass().getResourceAsStream("datafiles/SwitchData.class");
34         ClassFile classFile = new ClassFile(classData);
35         classFile.toString();
36     }
37 }
38
Popular Tags