Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

StepsScanner.Step fails with an StringIndexOutOfBoundsException #191

Open
Vad1mo opened this issue Nov 2, 2018 · 0 comments
Open

StepsScanner.Step fails with an StringIndexOutOfBoundsException #191

Vad1mo opened this issue Nov 2, 2018 · 0 comments

Comments

@Vad1mo
Copy link

Vad1mo commented Nov 2, 2018

I have Groovy Function name with spaces.

    @Step("The customer <name> is listed")
    def "The Customer Name Is Listed"(String name) {
        System.println("The customer $name is listed")
        assert false
    }

And the Scan Function fails with an StringIndexOutOfBoundsException:

16:12:56.447 [QUIET] [system.out] [runner: 1] Exception in thread "main" [runner: 1] java.lang.StringIndexOutOfBoundsException: begin 15, end 10, length 35[runner: 1] 
16:12:56.447 [QUIET] [system.out] [runner: 1]   at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3107)[runner: 1] 
16:12:56.447 [QUIET] [system.out] [runner: 1]   at java.base/java.lang.String.substring(String.java:1873)[runner: 1] 
16:12:56.447 [QUIET] [system.out] [runner: 1]   at org.reflections.util.Utils.getMemberFromDescriptor(Utils.java:67)[runner: 1] 
16:12:56.448 [QUIET] [system.out] [runner: 1]   at org.reflections.util.Utils.getMethodsFromDescriptors(Utils.java:101)[runner: 1] 
16:12:56.448 [QUIET] [system.out] [runner: 1]   at org.reflections.Reflections.getMethodsAnnotatedWith(Reflections.java:482)[runner: 1] 
16:12:56.448 [QUIET] [system.out] [runner: 1]   at com.thoughtworks.gauge.scan.StepsScanner.scan(StepsScanner.java:40)[runner: 1] 
16:12:56.448 [QUIET] [system.out] [runner: 1]   at com.thoughtworks.gauge.scan.ClasspathScanner.scan(ClasspathScanner.java:43)
16:12:56.448 [QUIET] [system.out] [runner: 1]   at com.thoughtworks.gauge.GaugeRuntime.connectSynchronously(GaugeRuntime.java:80)[runner: 1] 
16:12:56.448 [QUIET] [system.out] [runner: 1]   at com.thoughtworks.gauge.GaugeRuntime.main(GaugeRuntime.java:57)[runner: 1] 

I guess there is no easy solution, just want to keep that for the record and myself in the future.

@gaugebot gaugebot bot added the community label Nov 2, 2018
@sriv sriv removed the community label Nov 12, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants