small medium large xlarge

Generic-user-small
11 Dec 2017, 17:00
Axel Vuylsteke (5 posts)

Hello,

Upon adding the lines int bananaPrice = price; and executing the ./cucumber.sh file I receive the following command line errors:

Feature: Checkout
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by cucumber.deps.com.thoughtworks.xstream.core.util.Fields (file:/home/axelixx/Documents/Personal/Cucumber/checkout/jars/cucumber-jvm-deps-1.0.5.jar) to field java.util.TreeMap.comparator WARNING: Please consider reporting this to the maintainers of cucumber.deps.com.thoughtworks.xstream.core.util.Fields WARNING: Use –illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

Scenario: Checkout a banana # checkout.feature:2 Given the price of a “banana” is 40c # CheckoutSteps.thePriceOfAIsC(String,int) When I checkout 1 “banana” # CheckoutSteps.iCheckout(int,String) cucumber.api.PendingException: TODO: implement me
at step_definitions.CheckoutSteps.iCheckout(CheckoutSteps.java:14) at ✽.When I checkout 1 “banana”(checkout.feature:4)

Then the total price should be 40c   # CheckoutSteps.theTotalPriceShouldBeC(int)

1 Scenarios (1 pending)
3 Steps (1 skipped, 1 pending, 1 passed)
0m0.144s

cucumber.api.PendingException: TODO: implement me
at step_definitions.CheckoutSteps.iCheckout(CheckoutSteps.java:14) at ✽.When I checkout 1 “banana”(checkout.feature:4)

Anyone can assist?

Generic-user-small
12 Dec 2017, 21:28
Seb Rose (19 posts)

Could you try downloading the source code for the book from https://pragprog.com/titles/srjcuc/source_code and cd to code/first_taste/05

From there if you run ./cucumber do you get the same error? It works as expected on my machine (no surprise there ;).

If it does work on the download, please compare your solution to the download. If it still throws the same error, please let me know more about the versions you have in your jars folder.

Generic-user-small
13 Dec 2017, 16:22
Axel Vuylsteke (5 posts)

Hi, Thx for your response. I have received the same error.

cucumber-core-1.2.5.jar cucumber-java-1.2.5.jar cucumber-jvm-deps-1.0.5.jar gherkin-2.12.2.jar junit-4.12.jar are my versions

Generic-user-small
15 Dec 2017, 09:18
Seb Rose (19 posts)

Hi,

I’ve done a little research and it looks like you are using Java 9.

It seems that Java 9 has introduced some restrictions on reflection. Refelction is used heavily by the ThoughtWorks xstream library that Cucumber depends on. We’ll take a look and see if ThoughtWorks has an updated library that is Java 9 compatible.

In the meantime, you could apply the work-around described in [this thread](https://github.com/gradle/gradle/issues/2995). See the entry from @blindpirate dated September 29.

Seb

Generic-user-small
15 Dec 2017, 12:01
Axel Vuylsteke (5 posts)

Thank you Seb!!! Will try that workaround :D

Generic-user-small
15 Dec 2017, 15:39
Axel Vuylsteke (5 posts)

I have installed java 8 atm. So this is ok :D

You must be logged in to comment