Menu

#8 NoUnit fails on method throws Exception

open
nobody
5
2002-01-02
2002-01-02
Alex
No

NoUnit fails to generate a report on a method that
throws an exception.

Here is a java file that will break nounit:

<-- Start NoUnitFailure.java -->
public class NoUnitFailure {
public void hereNoUnitFails()
throws Exception
{
}
}
<-- End NoUnitFailure.java -->

Here is the exception that is generated from NoUnit:

<-- Start Exception -->

Exception in thread "main"
java.lang.ClassCastException:
org.gjt.jclasslib.structures.attributes.ExceptionsAttri
bute
at
net.firstpartners.nounit.reader.bytecode.ByteCodeCallsS
nippetFactory.<init>
(ByteCodeCallsSnippetFactory.java:108)
at
net.firstpartners.nounit.reader.bytecode.ByteCodeMethod
SnippetFactory.addMethods
(ByteCodeMethodSnippetFactory.java:111)
at
net.firstpartners.nounit.reader.bytecode.ByteCodeMethod
SnippetFactory.getSnippets
(ByteCodeMethodSnippetFactory.java:57)
at
net.firstpartners.nounit.reader.bytecode.ByteCodeClassS
nippetFactory.getSnippets
(ByteCodeClassSnippetFactory.java:77)
at
net.firstpartners.nounit.reader.bytecode.ByteCodePackag
eSnippetFactory.getSnippets
(ByteCodePackageSnippetFactory.java:76)
at
net.firstpartners.nounit.reader.bytecode.ByteCodeProjec
tSnippetFactory.getSnippets
(ByteCodeProjectSnippetFactory.java:80)
at
net.firstpartners.nounit.ui.common.Processor.transform
(Processor.java:48)
at
net.firstpartners.nounit.ui.command.CommandLineProcesso
r.main(CommandLineProcessor.java:54)

<-- End Exception -->

No report is generated by NoUnit under these
conditions.

Discussion

  • Stefan G. Renz

    Stefan G. Renz - 2002-02-12

    Logged In: YES
    user_id=57189

    line 108 accesses genAttributes[0], but should be genAttributes[counter]

     
  • Dave Astels

    Dave Astels - 2002-10-26

    Logged In: YES
    user_id=315608

    in
    net.firstpartners.nounit.reader.bytecode.ByteCodeCallsSnippetFactory
    constructor: ByteCodeCallsSnippetFactory(MethodInfo thisMethod,
    ClassFile classFile)

    //Do conversion and doc preparation
    attribute = (CodeAttribute)genAttributes[0];

    should be:

    //Do conversion and doc preparation
    attribute = (CodeAttribute)genAttributes[counter];

     

Log in to post a comment.