|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.evolveum.icf.dummy.resource.DummyResource
public class DummyResource
Resource for use with dummy ICF connector. This is a simple Java object that pretends to be a resource. It has accounts and account schema. It has operations to manipulate accounts, execute scripts and so on almost like a real resource. The purpose is to simulate a real resource with avery little overhead. The resource is a singleton, therefore the resource instance can be shared by the connector and the test code. The usual story is like this: 1) test class fetches first instance of the resource (getInstance). This will cause loading of the resource class in the test (parent) classloader. 2) test class configures the connector (e.g. schema) usually by calling the populateWithDefaultSchema() method. 3) test class initializes IDM. This will cause connector initialization. The connector will fetch the instance of dummy resource. As it was loaded by the parent classloader, it will get the same instance as the test class. 4) test class invokes IDM operation. That will invoke connector and change the resource. 5) test class will access resource directly to see if the operation went OK. The dummy resource is a separate package (JAR) from the dummy connector. Connector has its own classloader. If the resource would be the same package as connector, it will get loaded by the connector classloader regardless whether it is already loaded by the parent classloader.
Method Summary | |
---|---|
java.lang.String |
addAccount(DummyAccount newAccount)
|
void |
deleteAccount(java.lang.String id)
|
DummyAccount |
getAccountByUsername(java.lang.String username)
|
DummyObjectClass |
getAccountObjectClass()
|
static DummyResource |
getInstance()
|
java.util.List<java.lang.String> |
getScriptHistory()
Returns script history ordered chronologically (oldest first). |
java.util.Collection<DummyAccount> |
listAccounts()
|
void |
populateWithDefaultSchema()
Populates the resource with some kind of "default" schema. |
void |
purgeScriptHistory()
Clears the script history. |
void |
runScript(java.lang.String scriptCode)
Pretend to run script on the resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DummyResource getInstance()
public DummyObjectClass getAccountObjectClass()
public java.util.Collection<DummyAccount> listAccounts()
public DummyAccount getAccountByUsername(java.lang.String username)
public java.lang.String addAccount(DummyAccount newAccount) throws ObjectAlreadyExistsException
ObjectAlreadyExistsException
public void deleteAccount(java.lang.String id) throws ObjectDoesNotExistException
ObjectDoesNotExistException
public java.util.List<java.lang.String> getScriptHistory()
public void purgeScriptHistory()
public void runScript(java.lang.String scriptCode)
scriptCode
- code of the scriptpublic void populateWithDefaultSchema()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |