Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

Commit 6c522fc

Browse files
committed
messages: Add JavaMethod and JavaStackTraceElement as SourceReference
Cucumber JVM can not reference files by URI. So it should use either java methods or stack trace elements as a source reference instead. For example: ```json { "hook": { "id": "a1839ec6-f75d-4029-9b75-4b8203d8b2e8", "sourceReference": { "javaMethod": { "className": "io.cucumber.compatibility.attachments.Attachments", "methodName": "before", "methodParameterTypes": [ "io.cucumber.java.Scenario" ] } } } } ``` See: cucumber/cucumber-jvm#2058 Fixes: cucumber/common#1119
1 parent abed633 commit 6c522fc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

messages.proto

+17-1
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,26 @@ message Location {
137137
* [Location](#io.cucumber.messages.Location) within that file.
138138
*/
139139
message SourceReference {
140-
string uri = 1;
140+
oneof reference {
141+
string uri = 1;
142+
JavaMethod java_method = 3;
143+
JavaStackTraceElement java_stack_trace_element = 4;
144+
}
141145
Location location = 2;
142146
}
143147

148+
message JavaMethod {
149+
string class_name = 1;
150+
string method_name = 2;
151+
repeated string method_parameter_types = 3;
152+
}
153+
154+
message JavaStackTraceElement {
155+
string class_name = 1;
156+
string method_name = 2;
157+
string file_name = 3;
158+
}
159+
144160
////// Source
145161

146162
/**

0 commit comments

Comments
 (0)