org.sakaiproject.entitybroker.mocks
Class RedirectControllableEntityProviderMock

java.lang.Object
  extended by org.sakaiproject.entitybroker.mocks.EntityProviderMock
      extended by org.sakaiproject.entitybroker.mocks.CRUDableEntityProviderMock
          extended by org.sakaiproject.entitybroker.mocks.RESTfulEntityProviderMock
              extended by org.sakaiproject.entitybroker.mocks.RedirectControllableEntityProviderMock
All Implemented Interfaces:
ActionsExecutable, CollectionResolvable, Createable, CRUDable, Deleteable, Describeable, Inputable, Outputable, Redirectable, RedirectControllable, Resolvable, RESTful, Sampleable, Saveable, Updateable, CoreEntityProvider, EntityProvider, Formats

public class RedirectControllableEntityProviderMock
extends RESTfulEntityProviderMock
implements CoreEntityProvider, RESTful, RedirectControllable

Stub class to make it possible to test the RedirectControllable capabilities, will perform like the actual class so it can be reliably used for testing
Will perform all CRUDable operations as well as allowing for internal data output processing
Returns MyEntity objects
Allows for testing Resolvable and CollectionResolvable as well, returns 2 MyEntity objects if no search restrictions, 1 if "stuff" property is set, none if other properties are set

Author:
Aaron Zeckoski (aaron@caret.cam.ac.uk)

Field Summary
 String[] templates
           
 
Fields inherited from class org.sakaiproject.entitybroker.mocks.CRUDableEntityProviderMock
myEntities
 
Fields inherited from class org.sakaiproject.entitybroker.mocks.EntityProviderMock
prefix
 
Fields inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.CollectionResolvable
SEARCH_LOCATION_REFERENCE, SEARCH_TAGS, SEARCH_USER_REFERENCE
 
Fields inherited from interface org.sakaiproject.entitybroker.entityprovider.extension.Formats
ALL_KNOWN_FORMATS, ATOM, ATOM_EXTENSIONS, ATOM_MIME_TYPE, FORM, FORM_EXTENSIONS, FORM_MIME_TYPE, HTML, HTML_EXTENSIONS, HTML_MIME_TYPE, JSON, JSON_EXTENSIONS, JSON_MIME_TYPE, JSONP, JSONP_EXTENSIONS, JSONP_MIME_TYPE, RSS, RSS_EXTENSIONS, RSS_MIME_TYPE, TXT, TXT_EXTENSIONS, TXT_MIME_TYPE, UTF_8, XML, XML_EXTENSIONS, XML_MIME_TYPE
 
Fields inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.ActionsExecutable
ACTION_METHOD_SUFFIX
 
Constructor Summary
RedirectControllableEntityProviderMock(String prefix, String[] ids)
           
 
Method Summary
 String[] defineHandledTemplatePatterns()
           
 String handleRedirects(String matchedTemplate, String incomingURL, String[] incomingSegments, Map<String,String> values)
           
 String neverRedirector(String incomingURL, Map<String,String> values)
           
 String returningRedirector(String incomingURL, Map<String,String> values)
           
 
Methods inherited from class org.sakaiproject.entitybroker.mocks.RESTfulEntityProviderMock
getHandledInputFormats, getHandledOutputFormats
 
Methods inherited from class org.sakaiproject.entitybroker.mocks.CRUDableEntityProviderMock
createEntity, deleteEntity, entityExists, getEntities, getEntity, getSampleEntity, updateEntity
 
Methods inherited from class org.sakaiproject.entitybroker.mocks.EntityProviderMock
getEntityPrefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.CoreEntityProvider
entityExists
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Createable
createEntity
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Sampleable
getSampleEntity
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Updateable
updateEntity
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Resolvable
getEntity
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.EntityProvider
getEntityPrefix
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Deleteable
deleteEntity
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.CollectionResolvable
getEntities
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Outputable
getHandledOutputFormats
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Inputable
getHandledInputFormats
 

Field Detail

templates

public String[] templates
Constructor Detail

RedirectControllableEntityProviderMock

public RedirectControllableEntityProviderMock(String prefix,
                                              String[] ids)
Method Detail

defineHandledTemplatePatterns

public String[] defineHandledTemplatePatterns()
Specified by:
defineHandledTemplatePatterns in interface RedirectControllable

handleRedirects

public String handleRedirects(String matchedTemplate,
                              String incomingURL,
                              String[] incomingSegments,
                              Map<String,String> values)
Specified by:
handleRedirects in interface RedirectControllable

returningRedirector

public String returningRedirector(String incomingURL,
                                  Map<String,String> values)

neverRedirector

public String neverRedirector(String incomingURL,
                              Map<String,String> values)


Copyright © 2007-2013 Sakai Project. All Rights Reserved.