Package org.apache.sling.commons.testing.sling

# Class MockResourceResolver

java.lang.Object
org.apache.sling.commons.testing.sling.MockResourceResolver

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `org.apache.sling.api.adapter.Adaptable`, `org.apache.sling.api.resource.ResourceResolver`

@Deprecated public class MockResourceResolver extends Object implements org.apache.sling.api.resource.ResourceResolver
Deprecated.
Please use the Mock Resource Resolver Implementation from testing/resourceresolver-mock instead.

## Field Summary

### Fields inherited from interface org.apache.sling.api.resource.ResourceResolver

`PROPERTY_RESOURCE_TYPE, REQUEST_ATTR_WORKSPACE_INFO, USER_IMPERSONATOR`

## Constructor Summary

Constructors
Constructor
Description
`MockResourceResolver()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`<AdapterType>
AdapterType`
`adaptTo(Class<AdapterType> type)`
Deprecated.
`void`
`addChildren(org.apache.sling.api.resource.Resource parent, Collection<org.apache.sling.api.resource.Resource> children)`
Deprecated.
`void`
`addResource(org.apache.sling.api.resource.Resource resource)`
Deprecated.
`org.apache.sling.api.resource.ResourceResolver`
`clone(Map<String,Object> authenticationInfo)`
Deprecated.
`void`
`close()`
Deprecated.
`void`
`commit()`
Deprecated.
`org.apache.sling.api.resource.Resource`
`copy(String srcAbsPath, String destAbsPath)`
Deprecated.
`org.apache.sling.api.resource.Resource`
`create(org.apache.sling.api.resource.Resource arg0, String arg1, Map<String,Object> arg2)`
Deprecated.
`void`
`delete(org.apache.sling.api.resource.Resource arg0)`
Deprecated.
`Iterator<org.apache.sling.api.resource.Resource>`
`findResources(String query, String language)`
Deprecated.
`Object`
`getAttribute(String name)`
Deprecated.
`Iterator<String>`
`getAttributeNames()`
Deprecated.
`Iterable<org.apache.sling.api.resource.Resource>`
`getChildren(org.apache.sling.api.resource.Resource arg0)`
Deprecated.
`@Nullable org.apache.sling.api.resource.Resource`
`getParent(@NotNull org.apache.sling.api.resource.Resource child)`
Deprecated.
`String`
`getParentResourceType(String arg0)`
Deprecated.
`String`
`getParentResourceType(org.apache.sling.api.resource.Resource arg0)`
Deprecated.
`@NotNull Map<String,Object>`
`getPropertyMap()`
Deprecated.
`org.apache.sling.api.resource.Resource`
`getResource(String path)`
Deprecated.
`org.apache.sling.api.resource.Resource`
`getResource(org.apache.sling.api.resource.Resource base, String path)`
Deprecated.
`String[]`
`getSearchPath()`
Deprecated.
`String`
`getUserID()`
Deprecated.
`boolean`
`hasChanges()`
Deprecated.
`boolean`
`hasChildren(@NotNull org.apache.sling.api.resource.Resource resource)`
Deprecated.
`boolean`
`isLive()`
Deprecated.
`boolean`
`isResourceType(org.apache.sling.api.resource.Resource arg0, String arg1)`
Deprecated.
`Iterator<org.apache.sling.api.resource.Resource>`
`listChildren(org.apache.sling.api.resource.Resource parent)`
Deprecated.
`String`
`map(String resourcePath)`
Deprecated.
`String`
`map(javax.servlet.http.HttpServletRequest request, String resourcePath)`
Deprecated.
`org.apache.sling.api.resource.Resource`
`move(String srcAbsPath, String destAbsPath)`
Deprecated.
`boolean`
`orderBefore(@NotNull org.apache.sling.api.resource.Resource parent, @NotNull String name, @Nullable String followingSiblingName)`
Deprecated.
`Iterator<Map<String,Object>>`
`queryResources(String query, String language)`
Deprecated.
`void`
`refresh()`
Deprecated.
`org.apache.sling.api.resource.Resource`
`resolve(String absPath)`
Deprecated.
`org.apache.sling.api.resource.Resource`
`resolve(javax.servlet.http.HttpServletRequest request)`
Deprecated.
`org.apache.sling.api.resource.Resource`
`resolve(javax.servlet.http.HttpServletRequest request, String absPath)`
Deprecated.
`void`
`revert()`
Deprecated.
`void`
`setSearchPath(String... searchPath)`
Deprecated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MockResourceResolver

public MockResourceResolver()
Deprecated.

## Method Details

### addResource

@Deprecated public void addResource(org.apache.sling.api.resource.Resource resource)
Deprecated.

### addChildren

@Deprecated public void addChildren(org.apache.sling.api.resource.Resource parent, Collection<org.apache.sling.api.resource.Resource> children)
Deprecated.

### resolve

@Deprecated public org.apache.sling.api.resource.Resource resolve(javax.servlet.http.HttpServletRequest request)
Deprecated.

Specified by:
  `resolve` in interface `org.apache.sling.api.resource.ResourceResolver`

### resolve

@Deprecated public org.apache.sling.api.resource.Resource resolve(String absPath)
Deprecated.

Specified by:
  `resolve` in interface `org.apache.sling.api.resource.ResourceResolver`

### map

@Deprecated public String map(String resourcePath)
Deprecated.

Specified by:
  `map` in interface `org.apache.sling.api.resource.ResourceResolver`

### getResource

@Deprecated public org.apache.sling.api.resource.Resource getResource(String path)
Deprecated.

Specified by:
  `getResource` in interface `org.apache.sling.api.resource.ResourceResolver`

### getResource

@Deprecated public org.apache.sling.api.resource.Resource getResource(org.apache.sling.api.resource.Resource base, String path)
Deprecated.

Specified by:
  `getResource` in interface `org.apache.sling.api.resource.ResourceResolver`

### getSearchPath

@Deprecated public String[] getSearchPath()
Deprecated.

Specified by:
  `getSearchPath` in interface `org.apache.sling.api.resource.ResourceResolver`

### listChildren

@Deprecated public Iterator<org.apache.sling.api.resource.Resource> listChildren(org.apache.sling.api.resource.Resource parent)
Deprecated.

Specified by:
  `listChildren` in interface `org.apache.sling.api.resource.ResourceResolver`

### findResources

@Deprecated public Iterator<org.apache.sling.api.resource.Resource> findResources(String query, String language)
Deprecated.

Specified by:
  `findResources` in interface `org.apache.sling.api.resource.ResourceResolver`

### queryResources

@Deprecated public Iterator<Map<String,Object>> queryResources(String query, String language)
Deprecated.

Specified by:
  `queryResources` in interface `org.apache.sling.api.resource.ResourceResolver`

### adaptTo

@Deprecated public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
Deprecated.

Specified by:
  `adaptTo` in interface `org.apache.sling.api.adapter.Adaptable`

### setSearchPath

@Deprecated public void setSearchPath(String... searchPath)
Deprecated.

### map

@Deprecated public String map(javax.servlet.http.HttpServletRequest request, String resourcePath)
Deprecated.

Specified by:
  `map` in interface `org.apache.sling.api.resource.ResourceResolver`

### resolve

@Deprecated public org.apache.sling.api.resource.Resource resolve(javax.servlet.http.HttpServletRequest request, String absPath)
Deprecated.

Specified by:
  `resolve` in interface `org.apache.sling.api.resource.ResourceResolver`

### close

@Deprecated public void close()
Deprecated.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `org.apache.sling.api.resource.ResourceResolver`

### getUserID

@Deprecated public String getUserID()
Deprecated.

Specified by:
  `getUserID` in interface `org.apache.sling.api.resource.ResourceResolver`

### isLive

@Deprecated public boolean isLive()
Deprecated.

Specified by:
  `isLive` in interface `org.apache.sling.api.resource.ResourceResolver`

### clone

@Deprecated public org.apache.sling.api.resource.ResourceResolver clone(Map<String,Object> authenticationInfo) throws org.apache.sling.api.resource.LoginException
Deprecated.

Specified by:
  `clone` in interface `org.apache.sling.api.resource.ResourceResolver`
Throws:
  `org.apache.sling.api.resource.LoginException`

### getAttribute

@Deprecated public Object getAttribute(String name)
Deprecated.

Specified by:
  `getAttribute` in interface `org.apache.sling.api.resource.ResourceResolver`

### getAttributeNames

@Deprecated public Iterator<String> getAttributeNames()
Deprecated.

Specified by:
  `getAttributeNames` in interface `org.apache.sling.api.resource.ResourceResolver`

### commit

@Deprecated public void commit() throws org.apache.sling.api.resource.PersistenceException
Deprecated.

Specified by:
  `commit` in interface `org.apache.sling.api.resource.ResourceResolver`
Throws:
  `org.apache.sling.api.resource.PersistenceException`

### create

@Deprecated public org.apache.sling.api.resource.Resource create(org.apache.sling.api.resource.Resource arg0, String arg1, Map<String,Object> arg2) throws org.apache.sling.api.resource.PersistenceException
Deprecated.

Specified by:
  `create` in interface `org.apache.sling.api.resource.ResourceResolver`
Throws:
  `org.apache.sling.api.resource.PersistenceException`

### delete

@Deprecated public void delete(org.apache.sling.api.resource.Resource arg0) throws org.apache.sling.api.resource.PersistenceException
Deprecated.

Specified by:
  `delete` in interface `org.apache.sling.api.resource.ResourceResolver`
Throws:
  `org.apache.sling.api.resource.PersistenceException`

### getChildren

@Deprecated public Iterable<org.apache.sling.api.resource.Resource> getChildren(org.apache.sling.api.resource.Resource arg0)
Deprecated.

Specified by:
  `getChildren` in interface `org.apache.sling.api.resource.ResourceResolver`

### getParentResourceType

@Deprecated public String getParentResourceType(org.apache.sling.api.resource.Resource arg0)
Deprecated.

Specified by:
  `getParentResourceType` in interface `org.apache.sling.api.resource.ResourceResolver`

### getParentResourceType

@Deprecated public String getParentResourceType(String arg0)
Deprecated.

Specified by:
  `getParentResourceType` in interface `org.apache.sling.api.resource.ResourceResolver`

### hasChanges

@Deprecated public boolean hasChanges()
Deprecated.

Specified by:
  `hasChanges` in interface `org.apache.sling.api.resource.ResourceResolver`

### isResourceType

@Deprecated public boolean isResourceType(org.apache.sling.api.resource.Resource arg0, String arg1)
Deprecated.

Specified by:
  `isResourceType` in interface `org.apache.sling.api.resource.ResourceResolver`

### refresh

@Deprecated public void refresh()
Deprecated.

Specified by:
  `refresh` in interface `org.apache.sling.api.resource.ResourceResolver`

### revert

@Deprecated public void revert()
Deprecated.

Specified by:
  `revert` in interface `org.apache.sling.api.resource.ResourceResolver`

### getParent

@Deprecated @Nullable public @Nullable org.apache.sling.api.resource.Resource getParent(@NotNull @NotNull org.apache.sling.api.resource.Resource child)
Deprecated.

Specified by:
  `getParent` in interface `org.apache.sling.api.resource.ResourceResolver`

### hasChildren

@Deprecated public boolean hasChildren(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
Deprecated.

Specified by:
  `hasChildren` in interface `org.apache.sling.api.resource.ResourceResolver`

### orderBefore

@Deprecated public boolean orderBefore(@NotNull @NotNull org.apache.sling.api.resource.Resource parent, @NotNull @NotNull String name, @Nullable @Nullable String followingSiblingName) throws UnsupportedOperationException, org.apache.sling.api.resource.PersistenceException, IllegalArgumentException
Deprecated.

Specified by:
  `orderBefore` in interface `org.apache.sling.api.resource.ResourceResolver`
Throws:
  `UnsupportedOperationException`
  `org.apache.sling.api.resource.PersistenceException`
  `IllegalArgumentException`

### copy

@Deprecated public org.apache.sling.api.resource.Resource copy(String srcAbsPath, String destAbsPath) throws org.apache.sling.api.resource.PersistenceException
Deprecated.

Specified by:
  `copy` in interface `org.apache.sling.api.resource.ResourceResolver`
Throws:
  `org.apache.sling.api.resource.PersistenceException`

### move

@Deprecated public org.apache.sling.api.resource.Resource move(String srcAbsPath, String destAbsPath) throws org.apache.sling.api.resource.PersistenceException
Deprecated.

Specified by:
  `move` in interface `org.apache.sling.api.resource.ResourceResolver`
Throws:
  `org.apache.sling.api.resource.PersistenceException`

### getPropertyMap

@Deprecated @NotNull public @NotNull Map<String,Object> getPropertyMap()
Deprecated.

Specified by:
  `getPropertyMap` in interface `org.apache.sling.api.resource.ResourceResolver`