public class TestRESTAPI extends FedoraServerTestCase
Constants.FedoraHome| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Boolean |
authorizeAccess |
sslACCESS, ACTION, API, ATOM_APIM1_0, ATOM_ZIP1_1, ATOM1_1, AUDIT, AUDIT1_0, BATCH_MODIFY, BATCH_MODIFY1_1, BE_SECURITY, BE_SECURITY1_0, BINDING_SPEC, DATASTREAM, DC, DISSEMINATOR, DS_COMPOSITE_MODEL, DS_COMPOSITE_MODEL1_0, DS_INPUT_SPEC1_0, DS_INPUT_SPEC1_1, EMPTY_STRING_ARRAY, ENVIRONMENT, FCFG, FEDORA, FEDORA_APP_CONTEXT_NAME, FEDORA_DEFAULT_APP_CONTEXT, FEDORA_HOME, FEDORA_REPOSITORY_PID, FOXML, FOXML1_0, FOXML1_0_LEGACY, FOXML1_1, HTTP_REQUEST, MANAGEMENT, METHOD_MAP, METS, METS_EXT, METS_EXT1_0, METS_EXT1_0_LEGACY, METS_EXT1_1, MODEL, MULGARA, OAI_DC, OAI_DC2_0, OAI_FRIENDS, OAI_FRIENDS2_0, OAI_IDENTIFIER, OAI_IDENTIFIER2_0, OAI_PMH, OAI_PMH2_0, OAI_PROV, OAI_PROV2_0, OBJ_DATASTREAMS1_0, OBJ_HISTORY1_0, OBJ_ITEMS1_0, OBJ_METHODS1_0, OBJ_PROFILE1_0, OBJ_VALIDATION1_0, OBJECT, OLD_XLINK, PID_LIST1_0, RDF, RDF_XSD, RECOVERY, RELS_EXT, RELS_EXT1_0, RELS_INT1_0, REPO_DESC1_0, RESOURCE, SDEF, SDEF_METHOD_MAP1_0, SDEP, SDEP_METHOD_MAP1_0, SDEP_METHOD_MAP1_1, SERVICE_PROFILE, SOAP, SOAP_ENC, SUBJECT, TYPES, VIEW, WSDL, WSDL_HTTP, WSDL_MIME, XACML_POLICY, XACML_POLICY1_0, XACML1, XACML1_ACTION, XACML1_POLICY, XACML1_RESOURCE, XACML1_SUBJECT, XACML2_POLICY_SCHEMA, XLINK, XML_XSD, XMLNS, XSIBESECURITY, DEMO_DIR_PREFIX, FCFG, FEDORA_HOME_CLIENT, FEDORA_HOME_CLIENT_BIN, FEDORA_HOME_SERVER, FEDORA_HOME_SERVER_CONFIG, FEDORA_PASSWORD, FEDORA_USERNAME, NS_FCFG, NS_FEDORA_TYPES, NS_FEDORA_TYPES_PREFIX| Constructor and Description |
|---|
TestRESTAPI() |
| Modifier and Type | Method and Description |
|---|---|
static void |
bootStrap() |
static void |
cleanUp() |
protected static org.apache.http.entity.StringEntity |
getStringEntity(java.lang.String content,
java.lang.String contentType) |
protected static java.net.URI |
getURI(java.lang.String url) |
protected static FedoraClient |
initClient() |
static void |
main(java.lang.String[] args) |
protected org.apache.http.HttpResponse |
post(java.net.URI url,
java.io.File requestContent,
boolean authenticate)
Deprecated.
|
protected org.apache.http.HttpResponse |
put(java.net.URI url,
java.io.File requestContent,
boolean authenticate)
Deprecated.
|
protected static byte[] |
readBytes(org.apache.http.HttpResponse response) |
protected static java.lang.String |
readString(org.apache.http.HttpResponse response) |
protected static java.lang.String |
readString(org.apache.http.HttpResponse response,
java.nio.charset.Charset charset) |
void |
setUp() |
protected static void |
stopClient() |
static junit.framework.Test |
suite() |
void |
tearDown() |
void |
testAddDatastream() |
void |
testAddRelationship() |
void |
testChunked() |
void |
testDatastreamDisseminationConditionalGet() |
void |
testDatastreamDisseminationContentDispositionFromId() |
void |
testDatastreamDisseminationContentDispositionFromLabel() |
void |
testDatastreamDisseminationContentDispositionFromRels() |
void |
testDatastreamDisseminationGetContentRange() |
void |
testDatastreamDisseminationHEAD() |
void |
testDeletedObject() |
void |
testDisseminationContentLengthWhenKnown() |
void |
testExportObject() |
void |
testFindObjects() |
void |
testFindObjectsBadSyntax() |
void |
testFindObjectWithSingleQuote()
test case for FCREPO-867.
|
void |
testGetDatastreamDissemination() |
void |
testGetDatastreamHistory() |
void |
testGetDatastreamProfile() |
void |
testGETMethodBuiltInBadMethod() |
void |
testGETMethodBuiltInBadUserArg() |
void |
testGETMethodBuiltInNoArg() |
void |
testGETMethodCustomBadDate() |
void |
testGETMethodCustomBadMethod() |
void |
testGETMethodCustomBadUserArg() |
void |
testGETMethodCustomEarlyDate() |
void |
testGETMethodCustomGoodDate() |
void |
testGETMethodCustomGoodUserArg() |
void |
testGETMethodCustomGoodUserArgGoodDate() |
void |
testGETMethodCustomNoArg() |
void |
testGETMethodCustomUserArgBadDate() |
void |
testGETMethodCustomUserArgEarlyDate() |
void |
testGetNextPID() |
void |
testGetObjectHistory() |
void |
testGetObjectProfile() |
void |
testGetObjectXML() |
void |
testGetRelationships() |
void |
testGetWADL() |
void |
testIngest() |
void |
testIngestWithParameterPid() |
void |
testLifecycle() |
void |
testListDatastreams() |
void |
testListMethods() |
void |
testListMethodsForSDep() |
void |
testModifyDatastreamByReference() |
void |
testModifyDatastreamByValue() |
void |
testModifyDatastreamNoContent() |
void |
testModifyObject() |
void |
testPurgeDatastream() |
void |
testPurgeObject() |
void |
testPurgeRelationship() |
void |
testResponseOverride() |
void |
testResumeFindObjects()
Disabled until FCREPO-798 is public public void testFindObjectsQuery()
throws Exception { String templateUrl = "/search?$value$";
TemplatedResourceIterator tri = new
TemplatedResourceIterator(templateUrl,
"src/test/resources/APIM2/restsearchvalues"); while (tri.hasNext()) { url
= tri.next(); HttpResponse resp = get(getAuthAccess());
//assertEquals(SC_OK, resp.getStatusCode()); url =
String.format("/objects/new"); HttpResponse response = post("", true);
assertEquals(SC_CREATED, response.getStatusCode()); } }
|
void |
testSetDatastreamState() |
void |
testSetDatastreamVersionable() |
void |
testUpload() |
void |
testValidate() |
protected void |
validateResponse(java.net.URI url,
org.apache.http.HttpResponse res) |
protected void |
verifyDELETEStatusOnly(java.net.URI url,
int expected,
boolean authenticate) |
protected byte[] |
verifyGETStatusBytes(java.net.URI url,
int expected,
boolean authenticate,
boolean validate) |
protected void |
verifyGETStatusOnly(java.net.URI url,
int expected) |
protected void |
verifyGETStatusOnly(java.net.URI url,
int expected,
boolean validate) |
protected void |
verifyGETStatusOnly(java.net.URI url,
int expected,
boolean authenticate,
boolean validate) |
protected java.lang.String |
verifyGETStatusString(java.net.URI url,
int expected,
boolean authenticate,
boolean validate) |
protected void |
verifyNoAuthFailOnAPIAAuth(java.net.URI url) |
protected void |
verifyPOSTStatusOnly(java.net.URI url,
int expected,
org.apache.http.entity.StringEntity content,
boolean authenticate) |
protected void |
verifyPOSTStatusOnly(java.net.URI url,
int expected,
org.apache.http.entity.StringEntity content,
boolean authenticate,
boolean validate) |
protected void |
verifyPUTStatusOnly(java.net.URI url,
int expected,
org.apache.http.entity.StringEntity content,
boolean authenticate) |
getDemoObjects, getDemoObjects, getXMLQueryResult, getXMLQueryResult, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDocumentTransformDemoObjects, ingestFormattingObjectsDemoObjects, ingestImageCollectionDemoObjects, ingestImageManipulationDemoObjects, ingestSimpleDocumentDemoObjects, ingestSimpleImageDemoObjects, purgeDemoObjects, purgeDemoObjects, purgeDemoObjects, testingAtom, testingAtomZip, testingMETSgetBaseURL, getDemoAppServerContext, getDemoBaseURL, getFedoraAppServerContext, getFedoraClient, getFedoraClient, getHost, getPassword, getPort, getProtocol, getRIImplementation, getServerConfiguration, getUsernameprotected static FedoraClient initClient() throws java.lang.Exception
java.lang.Exceptionprotected static void stopClient()
public static void bootStrap()
throws java.lang.Exception
java.lang.Exceptionpublic static void cleanUp()
throws java.lang.Exception
java.lang.Exceptionpublic void setUp()
throws java.lang.Exception
java.lang.Exceptionpublic void tearDown()
throws java.lang.Exception
java.lang.Exceptionprotected static byte[] readBytes(org.apache.http.HttpResponse response)
protected static java.lang.String readString(org.apache.http.HttpResponse response)
protected static java.lang.String readString(org.apache.http.HttpResponse response,
java.nio.charset.Charset charset)
protected void verifyDELETEStatusOnly(java.net.URI url,
int expected,
boolean authenticate)
throws java.lang.Exception
java.lang.Exceptionprotected void verifyGETStatusOnly(java.net.URI url,
int expected,
boolean authenticate,
boolean validate)
throws java.lang.Exception
java.lang.Exceptionprotected void verifyGETStatusOnly(java.net.URI url,
int expected,
boolean validate)
throws java.lang.Exception
java.lang.Exceptionprotected void verifyGETStatusOnly(java.net.URI url,
int expected)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String verifyGETStatusString(java.net.URI url,
int expected,
boolean authenticate,
boolean validate)
throws java.lang.Exception
java.lang.Exceptionprotected byte[] verifyGETStatusBytes(java.net.URI url,
int expected,
boolean authenticate,
boolean validate)
throws java.lang.Exception
java.lang.Exceptionprotected static org.apache.http.entity.StringEntity getStringEntity(java.lang.String content,
java.lang.String contentType)
protected void verifyPOSTStatusOnly(java.net.URI url,
int expected,
org.apache.http.entity.StringEntity content,
boolean authenticate)
throws java.lang.Exception
java.lang.Exceptionprotected void verifyPOSTStatusOnly(java.net.URI url,
int expected,
org.apache.http.entity.StringEntity content,
boolean authenticate,
boolean validate)
throws java.lang.Exception
java.lang.Exceptionprotected void verifyPUTStatusOnly(java.net.URI url,
int expected,
org.apache.http.entity.StringEntity content,
boolean authenticate)
throws java.lang.Exception
java.lang.Exceptionprotected void verifyNoAuthFailOnAPIAAuth(java.net.URI url)
throws java.lang.Exception
java.lang.Exceptionpublic void testGetWADL()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetObjectProfile()
throws java.lang.Exception
java.lang.Exceptionpublic void testListMethods()
throws java.lang.Exception
java.lang.Exceptionpublic void testListMethodsForSDep()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodBuiltInBadMethod()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodBuiltInBadUserArg()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodBuiltInNoArg()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomBadMethod()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomBadUserArg()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomNoArg()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomGoodUserArg()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomGoodUserArgGoodDate()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomUserArgBadDate()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomUserArgEarlyDate()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomGoodDate()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomBadDate()
throws java.lang.Exception
java.lang.Exceptionpublic void testGETMethodCustomEarlyDate()
throws java.lang.Exception
java.lang.Exceptionpublic void testListDatastreams()
throws java.lang.Exception
java.lang.Exceptionpublic void testDeletedObject()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetDatastreamProfile()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetDatastreamHistory()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetDatastreamDissemination()
throws java.lang.Exception
java.lang.Exceptionpublic void testFindObjects()
throws java.lang.Exception
java.lang.Exceptionpublic void testFindObjectWithSingleQuote()
throws java.lang.Exception
java.lang.Exceptionpublic void testResumeFindObjects()
throws java.lang.Exception
java.lang.Exceptionpublic void testFindObjectsBadSyntax()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetObjectHistory()
throws java.lang.Exception
java.lang.Exceptionpublic void testIngest()
throws java.lang.Exception
java.lang.Exceptionpublic void testIngestWithParameterPid()
throws java.lang.Exception
java.lang.Exceptionpublic void testModifyObject()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetObjectXML()
throws java.lang.Exception
java.lang.Exceptionpublic void testValidate()
throws java.lang.Exception
java.lang.Exceptionpublic void testExportObject()
throws java.lang.Exception
java.lang.Exceptionpublic void testPurgeObject()
throws java.lang.Exception
java.lang.Exceptionpublic void testAddDatastream()
throws java.lang.Exception
java.lang.Exceptionpublic void testModifyDatastreamByReference()
throws java.lang.Exception
java.lang.Exceptionpublic void testModifyDatastreamByValue()
throws java.lang.Exception
java.lang.Exceptionpublic void testModifyDatastreamNoContent()
throws java.lang.Exception
java.lang.Exceptionpublic void testSetDatastreamState()
throws java.lang.Exception
java.lang.Exceptionpublic void testSetDatastreamVersionable()
throws java.lang.Exception
java.lang.Exceptionpublic void testPurgeDatastream()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetNextPID()
throws java.lang.Exception
java.lang.Exceptionpublic void testLifecycle()
throws java.lang.Exception
java.lang.Exceptionpublic void testChunked()
throws java.lang.Exception
java.lang.Exceptionpublic void testResponseOverride()
throws java.lang.Exception
java.lang.Exceptionpublic void testDatastreamDisseminationContentDispositionFromRels()
throws java.lang.Exception
java.lang.Exceptionpublic void testDatastreamDisseminationContentDispositionFromLabel()
throws java.lang.Exception
java.lang.Exceptionpublic void testDatastreamDisseminationContentDispositionFromId()
throws java.lang.Exception
java.lang.Exceptionpublic void testDatastreamDisseminationConditionalGet()
throws java.lang.Exception
java.lang.Exceptionpublic void testDatastreamDisseminationGetContentRange()
throws java.lang.Exception
java.lang.Exceptionpublic void testDatastreamDisseminationHEAD()
throws java.lang.Exception
java.lang.Exceptionpublic void testUpload()
throws java.lang.Exception
java.lang.Exceptionpublic void testGetRelationships()
throws java.lang.Exception
java.lang.Exceptionpublic void testAddRelationship()
throws java.lang.Exception
java.lang.Exceptionpublic void testPurgeRelationship()
throws java.lang.Exception
java.lang.Exceptionpublic void testDisseminationContentLengthWhenKnown()
throws java.lang.Exception
java.lang.Exceptionprotected static java.net.URI getURI(java.lang.String url)
protected void validateResponse(java.net.URI url,
org.apache.http.HttpResponse res)
throws java.lang.Exception
java.lang.Exception@Deprecated
protected org.apache.http.HttpResponse put(java.net.URI url,
java.io.File requestContent,
boolean authenticate)
throws java.lang.Exception
java.lang.Exception@Deprecated
protected org.apache.http.HttpResponse post(java.net.URI url,
java.io.File requestContent,
boolean authenticate)
throws java.lang.Exception
java.lang.Exceptionpublic static junit.framework.Test suite()
public static void main(java.lang.String[] args)
Copyright © 2014 DuraSpace. All Rights Reserved.