poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amol Deshmukh <adeshm...@hobsons-us.com>
Subject JUnit test fails and other problem
Date Wed, 26 Jan 2005 15:16:35 GMT
Hi,


(I.)
I'm having some problems running the JUnit tests 
for the POI source code. StackTrace is at the end 
of this message. Apparently this is something that 
I have noticed over the last week or so. I was able
to get all the tests running prior to that. 

The exception is thrown from a call at:
org.apache.poi.hssf.usermodel.TestBugs.test15556(TestBugs.java:259)

I'm running Windows XP.


(II.)
Also, I wanted to know how to send a PATCH for
the JUnit tests. Atleast one class does not seem to
close FileIn/OutputStreams at all places 
(org.apache.poi.hssf.usermodel.TestBugs). I have 
fixed the 'problem' locally, but I dont know whether
this should be submitted as a PATCH since it is change
to 'testing' code.


Regards,
~ amol


---- Addendum: ----

Stack trace for (I.) from JUnit via ant task "test":
    [junit] java.lang.reflect.InvocationTargetException
    [junit] at
sun.reflect.GeneratedConstructorAccessor41.newInstance(Unknown Source)
    [junit] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    [junit] at java.lang.reflect.Constructor.newInstance(Unknown Source)
    [junit] at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224
)
    [junit] at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:16
0)
    [junit] at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:164)
    [junit] at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:211)
    [junit] at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:192)
    [junit] at
org.apache.poi.hssf.usermodel.TestBugs.test15556(TestBugs.java:259)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
    [junit] at java.lang.reflect.Method.invoke(Unknown Source)
    [junit] at junit.framework.TestCase.runTest(TestCase.java:154)
    [junit] at junit.framework.TestCase.runBare(TestCase.java:127)
    [junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit] at junit.framework.TestResult.run(TestResult.java:109)
    [junit] at junit.framework.TestCase.run(TestCase.java:118)
    [junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [junit] at junit.framework.TestSuite.run(TestSuite.java:203)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRu
nner.java:289)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask
.java:1061)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav
a:676)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitT
ask.java:1413)
    [junit] at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.jav
a:633)
    [junit] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    [junit] at org.apache.tools.ant.Task.perform(Task.java:364)
    [junit] at org.apache.tools.ant.Target.execute(Target.java:341)
    [junit] at org.apache.tools.ant.Target.performTasks(Target.java:369)
    [junit] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
    [junit] at
org.apache.tools.ant.Project.executeTargets(Project.java:1062)
    [junit] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunn
er.java:377)
    [junit] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRun
ner.java:135)
    [junit] Caused by: java.lang.ArrayIndexOutOfBoundsException: 33
    [junit] at
org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:491)
    [junit] at
org.apache.poi.util.LittleEndian.getShort(LittleEndian.java:52)
    [junit] at
org.apache.poi.hssf.record.ObjRecord.fillFields(ObjRecord.java:98)
    [junit] at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
    [junit] at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
    [junit] at
org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:61)
    [junit] ... 34 more
    [junit] Test

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message