public class BaseResourceTestCase extends BaseExoTestCase
| Modifier and Type | Field and Description |
|---|---|
protected org.exoplatform.container.configuration.ConfigurationManager |
configurationManager |
protected org.exoplatform.container.PortalContainer |
container |
protected static org.exoplatform.services.log.Log |
log |
protected org.exoplatform.services.rest.impl.ProviderBinder |
providerBinder |
protected String |
REPO_NAME |
protected org.exoplatform.services.jcr.RepositoryService |
repositoryService |
protected org.exoplatform.services.rest.impl.RequestHandlerImpl |
requestHandler |
protected org.exoplatform.services.rest.impl.ResourceBinder |
resourceBinder |
protected javax.jcr.Node |
root |
protected javax.jcr.Session |
session |
protected org.exoplatform.services.jcr.ext.common.SessionProvider |
sessionProvider |
protected String |
WORKSPACE_NAME |
ownBootstrap| Constructor and Description |
|---|
BaseResourceTestCase() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResource(Class<?> resourceClass,
javax.ws.rs.core.MultivaluedMap<String,String> properties)
Register supplied class as per-request root resource if it has valid
JAX-RS annotations and no one resource with the same UriPattern already
registered.
|
void |
addResource(Object resource,
javax.ws.rs.core.MultivaluedMap<String,String> properties)
Register supplied Object as singleton root resource if it has valid JAX-RS
annotations and no one resource with the same UriPattern already
registered.
|
protected <T> T |
getService(Class<T> clazz) |
void |
removeResource(Class clazz)
Remove the resource instance of provided class from root resource
container.
|
org.exoplatform.services.rest.impl.ContainerResponse |
service(String method,
String requestURI,
String baseURI,
Map<String,List<String>> headers,
byte[] data,
org.exoplatform.services.rest.ContainerResponseWriter writer)
Get response with provided writer
|
org.exoplatform.services.rest.impl.ContainerResponse |
service(String method,
String requestURI,
String baseURI,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
byte[] data)
Get response without provided writer
|
void |
setUp() |
void |
tearDown() |
afterRunBare, beforeRunBare, getContainerafterClass, beforeClass, begin, end, isForceContainerReload, setForceContainerReloadassertInstanceOf, fail, fail, failure, failureassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toStringprotected static org.exoplatform.services.log.Log log
protected org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider
protected org.exoplatform.services.rest.impl.ProviderBinder providerBinder
protected org.exoplatform.services.rest.impl.ResourceBinder resourceBinder
protected org.exoplatform.services.rest.impl.RequestHandlerImpl requestHandler
protected final String REPO_NAME
protected final String WORKSPACE_NAME
protected org.exoplatform.container.PortalContainer container
protected org.exoplatform.services.jcr.RepositoryService repositoryService
protected org.exoplatform.container.configuration.ConfigurationManager configurationManager
protected javax.jcr.Session session
protected javax.jcr.Node root
public void setUp()
throws Exception
setUp in class junit.framework.TestCaseExceptionpublic void tearDown()
throws Exception
tearDown in class junit.framework.TestCaseExceptionpublic org.exoplatform.services.rest.impl.ContainerResponse service(String method, String requestURI, String baseURI, Map<String,List<String>> headers, byte[] data, org.exoplatform.services.rest.ContainerResponseWriter writer) throws Exception
method - requestURI - baseURI - headers - data - writer - Exceptionpublic org.exoplatform.services.rest.impl.ContainerResponse service(String method, String requestURI, String baseURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, byte[] data) throws Exception
method - requestURI - baseURI - headers - data - Exceptionpublic void addResource(Class<?> resourceClass, javax.ws.rs.core.MultivaluedMap<String,String> properties)
resourceClass - class of candidate to be root resourceproperties - optional resource properties. It may contains additional
info about resource, e.g. description of resource, its
responsibility, etc. This info can be retrieved
ObjectModel.getProperties().
This parameter may be nullpublic void addResource(Object resource, javax.ws.rs.core.MultivaluedMap<String,String> properties)
resource - candidate to be root resourceproperties - optional resource properties. It may contains additional
info about resource, e.g. description of resource, its
responsibility, etc. This info can be retrieved
ObjectModel.getProperties().
This parameter may be nullpublic void removeResource(Class clazz)
clazz - the class of resourceprotected <T> T getService(Class<T> clazz)
Copyright © 2003–2019 eXo Platform SAS. All rights reserved.