public class TestRESTAPI extends FedoraServerTestCase
Constants.FedoraHome| Modifier and Type | Field and Description |
|---|---|
protected 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.ByteArrayEntity |
getBytesEntity(byte[] content,
String contentType) |
protected static org.apache.http.entity.StringEntity |
getStringEntity(String content,
String contentType) |
protected static URI |
getURI(String url) |
protected static FedoraClient |
initClient() |
static void |
main(String[] args) |
protected org.apache.http.HttpResponse |
post(URI url,
File requestContent,
boolean authenticate)
Deprecated.
|
protected org.apache.http.HttpResponse |
put(URI url,
File requestContent,
boolean authenticate)
Deprecated.
|
protected static byte[] |
readBytes(org.apache.http.HttpResponse response) |
protected static String |
readString(org.apache.http.HttpResponse response) |
protected static String |
readString(org.apache.http.HttpResponse response,
Charset charset) |
void |
setUp() |
protected static void |
stopClient() |
static junit.framework.Test |
suite() |
void |
tearDown() |
void |
testAddDatastream() |
void |
testAddRelationship() |
void |
testAtomZipRoundTrip() |
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(URI url,
org.apache.http.HttpResponse res) |
protected void |
verifyDELETEStatusOnly(URI url,
int expected,
boolean authenticate) |
protected byte[] |
verifyGETStatusBytes(URI url,
int expected,
boolean authenticate,
boolean validate) |
protected void |
verifyGETStatusOnly(URI url,
int expected) |
protected void |
verifyGETStatusOnly(URI url,
int expected,
boolean validate) |
protected void |
verifyGETStatusOnly(URI url,
int expected,
boolean authenticate,
boolean validate) |
protected String |
verifyGETStatusString(URI url,
int expected,
boolean authenticate,
boolean validate) |
protected void |
verifyNoAuthFailOnAPIAAuth(URI url) |
protected void |
verifyPOSTStatusOnly(URI url,
int expected,
org.apache.http.entity.AbstractHttpEntity entity,
boolean authenticate) |
protected void |
verifyPOSTStatusOnly(URI url,
int expected,
org.apache.http.entity.AbstractHttpEntity content,
boolean authenticate,
boolean validate) |
protected void |
verifyPUTStatusOnly(URI url,
int expected,
org.apache.http.entity.AbstractHttpEntity content,
boolean authenticate) |
getDemoObjects, getDemoObjects, getXMLQueryResult, getXMLQueryResult, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDemoObjects, ingestDocumentTransformDemoObjects, ingestFormattingObjectsDemoObjects, ingestImageCollectionDemoObjects, ingestImageManipulationDemoObjects, ingestSimpleDocumentDemoObjects, ingestSimpleImageDemoObjects, purgeDemoObjects, purgeDemoObjects, purgeDemoObjects, runConcurrent, testingAtom, testingAtomZip, testingMETSgetBaseURL, getDemoAppServerContext, getDemoBaseURL, getFedoraAppServerContext, getFedoraClient, getFedoraClient, getHost, getPassword, getPort, getProtocol, getRIImplementation, getServerConfiguration, getUsernameprotected Boolean authorizeAccess
protected static FedoraClient initClient() throws Exception
Exceptionprotected static void stopClient()
protected static byte[] readBytes(org.apache.http.HttpResponse response)
protected static String readString(org.apache.http.HttpResponse response)
protected static String readString(org.apache.http.HttpResponse response, Charset charset)
protected void verifyDELETEStatusOnly(URI url, int expected, boolean authenticate) throws Exception
Exceptionprotected void verifyGETStatusOnly(URI url, int expected, boolean authenticate, boolean validate) throws Exception
Exceptionprotected void verifyGETStatusOnly(URI url, int expected, boolean validate) throws Exception
Exceptionprotected void verifyGETStatusOnly(URI url, int expected) throws Exception
Exceptionprotected String verifyGETStatusString(URI url, int expected, boolean authenticate, boolean validate) throws Exception
Exceptionprotected byte[] verifyGETStatusBytes(URI url, int expected, boolean authenticate, boolean validate) throws Exception
Exceptionprotected static org.apache.http.entity.StringEntity getStringEntity(String content, String contentType)
protected static org.apache.http.entity.ByteArrayEntity getBytesEntity(byte[] content,
String contentType)
protected void verifyPOSTStatusOnly(URI url, int expected, org.apache.http.entity.AbstractHttpEntity entity, boolean authenticate) throws Exception
Exceptionprotected void verifyPOSTStatusOnly(URI url, int expected, org.apache.http.entity.AbstractHttpEntity content, boolean authenticate, boolean validate) throws Exception
Exceptionprotected void verifyPUTStatusOnly(URI url, int expected, org.apache.http.entity.AbstractHttpEntity content, boolean authenticate) throws Exception
Exceptionprotected void verifyNoAuthFailOnAPIAAuth(URI url) throws Exception
Exceptionpublic void testGETMethodBuiltInBadMethod()
throws Exception
Exceptionpublic void testGETMethodBuiltInBadUserArg()
throws Exception
Exceptionpublic void testGETMethodBuiltInNoArg()
throws Exception
Exceptionpublic void testGETMethodCustomBadMethod()
throws Exception
Exceptionpublic void testGETMethodCustomBadUserArg()
throws Exception
Exceptionpublic void testGETMethodCustomGoodUserArg()
throws Exception
Exceptionpublic void testGETMethodCustomGoodUserArgGoodDate()
throws Exception
Exceptionpublic void testGETMethodCustomUserArgBadDate()
throws Exception
Exceptionpublic void testGETMethodCustomUserArgEarlyDate()
throws Exception
Exceptionpublic void testGETMethodCustomGoodDate()
throws Exception
Exceptionpublic void testGETMethodCustomBadDate()
throws Exception
Exceptionpublic void testGETMethodCustomEarlyDate()
throws Exception
Exceptionpublic void testGetDatastreamDissemination()
throws Exception
Exceptionpublic void testFindObjectWithSingleQuote()
throws Exception
Exceptionpublic void testResumeFindObjects()
throws Exception
Exceptionpublic void testIngestWithParameterPid()
throws Exception
Exceptionpublic void testModifyDatastreamByReference()
throws Exception
Exceptionpublic void testModifyDatastreamByValue()
throws Exception
Exceptionpublic void testModifyDatastreamNoContent()
throws Exception
Exceptionpublic void testSetDatastreamVersionable()
throws Exception
Exceptionpublic void testDatastreamDisseminationContentDispositionFromRels()
throws Exception
Exceptionpublic void testDatastreamDisseminationContentDispositionFromLabel()
throws Exception
Exceptionpublic void testDatastreamDisseminationContentDispositionFromId()
throws Exception
Exceptionpublic void testDatastreamDisseminationConditionalGet()
throws Exception
Exceptionpublic void testDatastreamDisseminationGetContentRange()
throws Exception
Exceptionpublic void testDatastreamDisseminationHEAD()
throws Exception
Exceptionpublic void testDisseminationContentLengthWhenKnown()
throws Exception
Exceptionprotected void validateResponse(URI url, org.apache.http.HttpResponse res) throws Exception
Exception@Deprecated protected org.apache.http.HttpResponse put(URI url, File requestContent, boolean authenticate) throws Exception
Exception@Deprecated protected org.apache.http.HttpResponse post(URI url, File requestContent, boolean authenticate) throws Exception
Exceptionpublic static junit.framework.Test suite()
public static void main(String[] args)
Copyright © 2015 DuraSpace. All Rights Reserved.