Chee Seng Chua
unread,Aug 2, 2012, 9:35:08 AM8/2/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mirco Dotta, scala-...@googlegroups.com, Luc Bourlier, Iulian Dragos
Hi all,
I can't go through IType/IJavaElement, as it is what I can get from property tester (when user right click in the code, the element which is clicked on). However, the compilation unit workaround does work, the only different is instead of:-
I'll need to use:-
t.symbol.fullName == "..."
I have checked in the changes:-
The goal of the ScalaTestLaunchShortcut.isScalaTestSuite is to determine whether a particular IType is a runnable suite, which could be a sub-class of org.scalatest.Suite or class annotated with @WrapWith (which is used to run non-ScalaTest suite, such as specs, cucumber, scalachecks etc.). While in ScalaTestFinder, it needs to find out the finder class, which is from @Style annotation. For ScalaTest style traits (Suite, FunSpec, FeatureSpec etc.) it is annotated at the style traits level, so it only needs to find it from the super classes/traits @Style. For the @WrapWith case, the @Style is available at the runner class, for example:-
import org.specs.Specification
import org.scalatest.WrapWith
import org.scalatest.specs.Spec1Runner
@WrapWith(classOf[Spec1Runner])
class ExampleSpec1 extends Specification {
...
}
The @Style will be available at Spec1Runner class. Previously the lookup was done with reflection, but it has a problem where the information will not be available until the class is compiled, which these changes should fix.
Do feel free to review and comment on the code.
Thanks a lot for the guidance!
P/S Iulian: Sorry to disturb your vacation, I wasn't aware of that. Have a good one!
Best Regards,
Chee Seng