Export to GitHub

specs - issue #165

Exception during reflective instantiation of test class not reported with TestInterfaceRunner


Posted on Nov 26, 2010 by Massive Camel

What steps will reproduce the problem? 1. Clone this sample project: https://github.com/retronym/specs-bug 2. sbt test 3. observe error "Could not create an instance of BrokenTest" without cause.

What is the expected output? What do you see instead?

Expect stack trace and message related to: https://github.com/retronym/specs-bug/blob/master/src/test/scala/BrokenTest.scala#L4

What version of the product are you using? On what operating system?

Specs 1.6.7-SNAPSHOT, SBT 0.7.5.RC0, Scala 2.8.1

Please provide any additional information below.

Comment #1

Posted on Nov 26, 2010 by Massive Camel

You'll need to specifically catch InvocationTarketException after calling newInstance, and throw the targetException.

Comment #2

Posted on Nov 27, 2010 by Massive Giraffe

Done. Thanks for the analysis Jason.

Comment #3

Posted on Nov 27, 2010 by Massive Camel

Still needs a small change: https://github.com/retronym/specs/commit/ec2464c61b439ee80c857553eefbc1f4de259fbb

Comment #4

Posted on Nov 27, 2010 by Massive Camel

Previous change was incomplete. Here is the completed topic branch: https://github.com/retronym/specs/commits/issue-165

Comment #5

Posted on Nov 28, 2010 by Massive Giraffe

The changes you made look fine to me, but I don't have time to do a full inspection on the code right now, so I just merged in the changes (with an additional getFullStackAsString as an implicit on Throwables)

Comment #6

Posted on Dec 8, 2010 by Massive Giraffe

Issue 166 has been merged into this issue.

Status: Fixed

Labels:
Type-Defect Priority-Medium