com.silverpeas.web
Class ResourceDeletionTest<T extends TestResources>

java.lang.Object
  extended by com.sun.jersey.test.framework.JerseyTest
      extended by com.silverpeas.web.RESTWebServiceTest<T>
          extended by com.silverpeas.web.ResourceDeletionTest<T>
All Implemented Interfaces:
WebResourceTesting

public abstract class ResourceDeletionTest<T extends TestResources>
extends RESTWebServiceTest<T>
implements WebResourceTesting

Unit tests on the deletion of a resource in Silverpeas through a REST web service. This class is an abstract one and it implements some tests that are redondant over all web resources in Silverpeas (about authorization failure, authentication failure, ...)


Field Summary
 
Fields inherited from class com.silverpeas.web.RESTWebServiceTest
CONTEXT_NAME
 
Fields inherited from interface com.silverpeas.web.WebResourceTesting
HTTP_SESSIONKEY
 
Constructor Summary
ResourceDeletionTest(String webServicePackage, String springContext)
           
 
Method Summary
 void deleteAt(String uri)
          Requests a delete of the web resource identified at the specified URI.
<C> C
deleteAt(String uri, Class<C> c)
          Requests a delete of the web resource identified at the specified URI.
 void deletionOfAnUnexistingResource()
           
 void deletionOfAResourceByANonAuthenticatedUser()
           
 void deletionOfAResourceByANonAuthorizedUser()
           
 void deletionOfAResourceWithADeprecatedSession()
           
 
Methods inherited from class com.silverpeas.web.RESTWebServiceTest
addComponentInstance, addTool, aUser, authenticate, buildQueryParametersFrom, denieAuthorizationToUsers, denieSpaceAuthorizationToUsers, getAccessControllerMock, getExistingComponentInstances, getExistingTools, getMockedSpaceAccessController, getOrganizationControllerMock, getPersonalizationServiceMock, getTestResources, prepareMockedResources, resource, setComponentAccessibilityToUser
 
Methods inherited from class com.sun.jersey.test.framework.JerseyTest
client, configure, getBaseURI, getClient, getClientFactory, getPort, getTestContainerFactory, setClientFactory, setTestContainerFactory, setUp, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.silverpeas.web.WebResourceTesting
anUnexistingResourceURI, aResource, aResourceURI, getSessionKey, getWebEntityClass
 

Constructor Detail

ResourceDeletionTest

public ResourceDeletionTest(String webServicePackage,
                            String springContext)
See Also:
RESTWebServiceTest.RESTWebServiceTest(java.lang.String, java.lang.String)
Method Detail

deleteAt

public void deleteAt(String uri)
Requests a delete of the web resource identified at the specified URI. If an error occurs, then an UniformInterfaceException exception is thrown.

Parameters:
uri - the uri of the resource to delete.

deleteAt

public <C> C deleteAt(String uri,
                      Class<C> c)
Requests a delete of the web resource identified at the specified URI. If an error occurs, then an UniformInterfaceException exception is thrown.

Parameters:
c - the class of which the returned resource should be an instance.
uri - the uri of the resource to delete.
Returns:
the web entity.

deletionOfAResourceByANonAuthenticatedUser

public void deletionOfAResourceByANonAuthenticatedUser()
                                                throws Exception
Throws:
Exception

deletionOfAResourceWithADeprecatedSession

public void deletionOfAResourceWithADeprecatedSession()
                                               throws Exception
Throws:
Exception

deletionOfAResourceByANonAuthorizedUser

public void deletionOfAResourceByANonAuthorizedUser()
                                             throws Exception
Throws:
Exception

deletionOfAnUnexistingResource

public void deletionOfAnUnexistingResource()
                                    throws Exception
Throws:
Exception


Copyright © 2016 Silverpeas. All Rights Reserved.