betfair / cougar

Cougar is a framework for making building network exposed service interfaces easy.
http://betfair.github.io/cougar
Apache License 2.0
27 stars 18 forks source link

Fix failing test because of the test order #1

Closed paulo-santos closed 10 years ago

paulo-santos commented 10 years ago

The build was failing on my system: Apache Maven 3.1.0 Java version: 1.7.0_45, vendor: Oracle Corporation Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.9", arch: "x86_64", family: "mac"

After debugging I found out that the RescriptOperationBindingTest fails if JsonRpcTransportCommandProcessorTest runs before. As we are running all the tests in the same thread, we need to be careful when playing with ThreadLocal. JsonRpcTransportCommandProcessorTest, sets the EnumUtils.setHardFailureForThisThread(false), which is changing the default value that is "true".

It happens because it uses the primitive type boolean "hardFailEnumDeserialisation" value from AbstractHttpCommandProcessor, which has not been set before starting the test, and therefore is value is false.