org.sakaiproject.entitybroker.mocks
Class ResolvableEntityProviderMock

java.lang.Object
  extended by org.sakaiproject.entitybroker.mocks.EntityProviderMock
      extended by org.sakaiproject.entitybroker.mocks.CoreEntityProviderMock
          extended by org.sakaiproject.entitybroker.mocks.ResolvableEntityProviderMock
All Implemented Interfaces:
CollectionResolvable, Outputable, Resolvable, CoreEntityProvider, EntityProvider, Formats

public class ResolvableEntityProviderMock
extends CoreEntityProviderMock
implements CoreEntityProvider, Resolvable, CollectionResolvable, Outputable

Stub class to make it possible to test the Resolvable capability, will perform like the actual class so it can be reliably used for testing
Returns MyEntity objects
Allows for testing CollectionResolvable as well, returns 3 MyEntity objects if no search restrictions, 1 if "stuff" property is set, none if other properties are set
Finally, this allows us to test the outputting of data because it implements outputable

Author:
Aaron Zeckoski (aaronz@vt.edu)

Field Summary
 
Fields inherited from class org.sakaiproject.entitybroker.mocks.CoreEntityProviderMock
ids
 
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
 
Constructor Summary
ResolvableEntityProviderMock(String prefix, String[] ids)
          TEST Constructor: allows for easy setup of this stub for testing
 
Method Summary
 List<?> getEntities(EntityReference ref, Search search)
           
 Object getEntity(EntityReference reference)
           
 String[] getHandledOutputFormats()
           
 
Methods inherited from class org.sakaiproject.entitybroker.mocks.CoreEntityProviderMock
entityExists
 
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.EntityProvider
getEntityPrefix
 

Constructor Detail

ResolvableEntityProviderMock

public ResolvableEntityProviderMock(String prefix,
                                    String[] ids)
TEST Constructor: allows for easy setup of this stub for testing

Parameters:
prefix -
ids -
Method Detail

getHandledOutputFormats

public String[] getHandledOutputFormats()
Specified by:
getHandledOutputFormats in interface Outputable

getEntity

public Object getEntity(EntityReference reference)
Specified by:
getEntity in interface Resolvable

getEntities

public List<?> getEntities(EntityReference ref,
                           Search search)
Specified by:
getEntities in interface CollectionResolvable


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