public class ServletContainerFeature extends Object implements RunnerFeature
 Note that at initialization the feature disables the retryPostProp property of
 HttpClient, the underlying HTTP client used by Client.
 
 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
 or an 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.
| Modifier and Type | Field and Description | 
|---|---|
| protected int | port | 
| protected static int | RETRIES | 
| Constructor and Description | 
|---|
| ServletContainerFeature() | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | disableSunHttpClientRetryPostProp()Prevents the JDK's default behavior of resending an unsuccessful HTTP POST request automatically to the server by
 disabling the the  retryPostPropproperty ofHttpClient. | 
| protected int | findFreePort() | 
| int | getPort()Returns the port allocated for this servlet container. | 
| void | initialize(FeaturesRunner runner)Called when preparing to run the test class. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterMethodRun, afterRun, afterTeardown, beforeMethodRun, beforeRun, beforeSetup, configure, start, stop, testCreatedprotected static final int RETRIES
protected int port
public ServletContainerFeature()
public void initialize(FeaturesRunner runner) throws Exception
RunnerFeatureinitialize in interface RunnerFeatureExceptionprotected int findFreePort()
public int getPort()
public static void disableSunHttpClientRetryPostProp() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
retryPostProp property of HttpClient.
 
 This can also be achieved by setting the sun.net.http.retryPost system property to false.
NoSuchFieldExceptionSecurityExceptionIllegalArgumentExceptionIllegalAccessExceptionCopyright © 2019 Nuxeo. All rights reserved.