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 1
1
package io .cucumber .scala
2
2
3
3
import java .lang .reflect .InvocationTargetException
4
+ import java .util .Optional
4
5
5
- import io .cucumber .core .backend .{CucumberInvocationTargetException , Located }
6
+ import io .cucumber .core .backend .{CucumberInvocationTargetException , Located , SourceReference }
6
7
7
8
import scala .util .{Failure , Try }
8
9
9
10
trait AbstractGlueDefinition extends Located {
10
11
11
12
val location : StackTraceElement
12
13
14
+ lazy val sourceReference : SourceReference = SourceReference .fromStackTraceElement(location)
15
+
13
16
override def getLocation (): String = {
14
17
location.toString
15
18
}
@@ -18,6 +21,10 @@ trait AbstractGlueDefinition extends Located {
18
21
location.getFileName != null && location.getFileName == stackTraceElement.getFileName
19
22
}
20
23
24
+ override def getSourceReference (): Optional [SourceReference ] = {
25
+ Optional .of(sourceReference)
26
+ }
27
+
21
28
/**
22
29
* Executes the block of code and handle failures in the way asked by Cucumber specification: that is throwing a CucumberInvocationTargetException.
23
30
*/
You can’t perform that action at this time.
0 commit comments