01: /*
02: * Issue84411Test.java
03: * JUnit based test
04: *
05: * Created on September 9, 2006, 9:01 AM
06: */
07:
08: package regression;
09:
10: import java.io.InputStream;
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 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 {
32: InputStream classData = getClass().getResourceAsStream(
33: "datafiles/SwitchData.class");
34: ClassFile classFile = new ClassFile(classData);
35: classFile.toString();
36: }
37: }
|