public class JettyFeature extends SimpleFeature implements WorkingDirectoryConfigurator
Note that at initialization the feature disables the
retryPostProp property of
HttpClient, the underlying HTTP client used by
This is to prevent the JDK's default behavior kept for backward compatibility: an unsuccessful HTTP POST request is
automatically resent to the server, unsuccessful in this case meaning the server did not send a valid HTTP response
IOException occurred. Yet in the tests using the Jersey client to make calls to Nuxeo we don't want
this as it can hide errors occurring in the HTTP communication that should prevent an appropriate response from being
sent by the server.
|Constructor and Description|
|Modifier and Type||Method and Description|
Prevents the JDK's default behavior of resending an unsuccessful HTTP POST request automatically to the server by disabling the the
Called when preparing to run the test class.
afterMethodRun, afterRun, afterTeardown, beforeMethodRun, beforeRun, beforeSetup, configure, start, stop, testCreated
public void initialize(FeaturesRunner runner) throws Exception
public void configure(RuntimeHarness harness, File workingDir) throws IOException
public static void disableSunHttpClientRetryPostProp() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
This can also be achieved by setting the
sun.net.http.retryPost system property to
Copyright © 2018 Nuxeo. All rights reserved.