File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
scala/sources/src/main/scala/io/cucumber/scala Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11package io .cucumber .scala
22
33import java .lang .reflect .InvocationTargetException
4+ import java .util .Optional
45
5- import io .cucumber .core .backend .{CucumberInvocationTargetException , Located }
6+ import io .cucumber .core .backend .{CucumberInvocationTargetException , Located , SourceReference }
67
78import scala .util .{Failure , Try }
89
910trait AbstractGlueDefinition extends Located {
1011
1112 val location : StackTraceElement
1213
14+ lazy val sourceReference : SourceReference = SourceReference .fromStackTraceElement(location)
15+
1316 override def getLocation (): String = {
1417 location.toString
1518 }
@@ -18,6 +21,10 @@ trait AbstractGlueDefinition extends Located {
1821 location.getFileName != null && location.getFileName == stackTraceElement.getFileName
1922 }
2023
24+ override def getSourceReference (): Optional [SourceReference ] = {
25+ Optional .of(sourceReference)
26+ }
27+
2128 /**
2229 * Executes the block of code and handle failures in the way asked by Cucumber specification: that is throwing a CucumberInvocationTargetException.
2330 */
You can’t perform that action at this time.
0 commit comments