Package org.fcrepo.client
Class FcrepoResponseTest
- java.lang.Object
-
- org.fcrepo.client.FcrepoResponseTest
-
public class FcrepoResponseTest extends Object
- Author:
- ajs6f
-
-
Constructor Summary
Constructors Constructor Description FcrepoResponseTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestClosableReleasesResources()Demonstrates that response objects are notclose()ed by default, that the state ofFcrepoResponse.closedis set appropriately whenFcrepoResponse.close()is invoked under normal (i.e.voidtestClosableSuppressedExceptions()Demonstrates that if anIOExceptionis thrown byFcrepoResponse.close(), and an exception is thrown inside of a client'stryblock, theIOExceptionfrom theclose()method is properly appended as a suppressed exception.voidtestContentDisposition()voidtestHasType()voidtestIdiomaticInvokation()Demonstrates a successful idiomatic usage with try-with-resourcesvoidtestIdiomaticInvokationThrowsException()Demonstrates idiomatic exception handling with try-with-resourcesvoidtestLocationFromDescribedBy()voidtestLocationOverDescribedBy()voidtestResponse()
-
-
-
Constructor Detail
-
FcrepoResponseTest
public FcrepoResponseTest()
-
-
Method Detail
-
testResponse
public void testResponse() throws IOException
- Throws:
IOException
-
testClosableReleasesResources
public void testClosableReleasesResources() throws IOException
Demonstrates that response objects are notclose()ed by default, that the state ofFcrepoResponse.closedis set appropriately whenFcrepoResponse.close()is invoked under normal (i.e. no exception thrown duringclose()) conditions, and thatInputStream.close()is not invoked repeatedly after theFcrepoResponsehas beenclose()ed.- Throws:
IOException- if something exceptional happens
-
testClosableSuppressedExceptions
public void testClosableSuppressedExceptions() throws IOException
Demonstrates that if anIOExceptionis thrown byFcrepoResponse.close(), and an exception is thrown inside of a client'stryblock, theIOExceptionfrom theclose()method is properly appended as a suppressed exception.- Throws:
IOException- if something exceptional happens
-
testIdiomaticInvokation
public void testIdiomaticInvokation() throws org.fcrepo.client.FcrepoOperationFailedException
Demonstrates a successful idiomatic usage with try-with-resources- Throws:
org.fcrepo.client.FcrepoOperationFailedException- if something exceptional happens
-
testIdiomaticInvokationThrowsException
public void testIdiomaticInvokationThrowsException() throws Exception
Demonstrates idiomatic exception handling with try-with-resources- Throws:
Exception- if something exceptional happens
-
testLocationFromDescribedBy
public void testLocationFromDescribedBy() throws Exception
- Throws:
Exception
-
testLocationOverDescribedBy
public void testLocationOverDescribedBy() throws Exception
- Throws:
Exception
-
testContentDisposition
public void testContentDisposition() throws Exception
- Throws:
Exception
-
testHasType
public void testHasType() throws Exception
- Throws:
Exception
-
-