Package org.fcrepo.client
Class ConnectionManagementTest
- java.lang.Object
-
- org.fcrepo.client.ConnectionManagementTest
-
public class ConnectionManagementTest extends Object
Integration test used to demonstrate connection management issues with the FcrepoClient.- Author:
- esm
-
-
Field Summary
Fields Modifier and Type Field Description org.mockserver.junit.MockServerRulemockServerRuleStarts a mock HTTP server on a free port
-
Constructor Summary
Constructors Constructor Description ConnectionManagementTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectionNotReleasedWhenEntityBodyIgnored()Demonstrates that are connections are NOT released if the user of the FcrepoClient does not handle the response body at all.voidconnectionReleasedOnEmptyBody()Demonstrates that are connections are released when the FcrepoClient receives an empty response body.voidconnectionReleasedOnEntityBodyClose()Demonstrates that HTTP connections are released when the user of the FcrepoClient closes the HTTP entity body.voidconnectionReleasedOnEntityBodyRead()Demonstrates that are connections are released when the user of the FcrepoClient reads the HTTP entity body.voidconnectionReleasedOnException()Demonstrates that HTTP connections are released when the FcrepoClient throws an exception.voidsetUp()voidtearDown()
-
-
-
Field Detail
-
mockServerRule
public org.mockserver.junit.MockServerRule mockServerRule
Starts a mock HTTP server on a free port
-
-
Constructor Detail
-
ConnectionManagementTest
public ConnectionManagementTest()
-
-
Method Detail
-
setUp
public void setUp()
-
tearDown
public void tearDown() throws IOException
- Throws:
IOException
-
connectionReleasedOnException
public void connectionReleasedOnException()
Demonstrates that HTTP connections are released when the FcrepoClient throws an exception. Each method of the FcrepoClient (get, put, post, etc.) is tested.
-
connectionReleasedOnEntityBodyClose
public void connectionReleasedOnEntityBodyClose()
Demonstrates that HTTP connections are released when the user of the FcrepoClient closes the HTTP entity body. Each method of the FcrepoClient (get, put, post, etc.) is tested.
-
connectionReleasedOnEntityBodyRead
public void connectionReleasedOnEntityBodyRead()
Demonstrates that are connections are released when the user of the FcrepoClient reads the HTTP entity body.
-
connectionNotReleasedWhenEntityBodyIgnored
public void connectionNotReleasedWhenEntityBodyIgnored()
Demonstrates that are connections are NOT released if the user of the FcrepoClient does not handle the response body at all.
-
connectionReleasedOnEmptyBody
public void connectionReleasedOnEmptyBody()
Demonstrates that are connections are released when the FcrepoClient receives an empty response body.
-
-