|
||||||||||
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)
|
java.lang.String |
dump()
|
DummyAccount |
getAccountByUsername(java.lang.String username)
|
DummyObjectClass |
getAccountObjectClass()
|
java.util.List<DummyDelta> |
getDeltasSince(int syncToken)
|
static DummyResource |
getInstance()
|
static DummyResource |
getInstance(java.lang.String instanceName)
|
int |
getLatestSyncToken()
|
BreakMode |
getSchemaBreakMode()
|
java.util.List<java.lang.String> |
getScriptHistory()
Returns script history ordered chronologically (oldest first). |
DummySyncStyle |
getSyncStyle()
|
java.lang.String |
getUselessGuardedString()
|
java.lang.String |
getUselessString()
|
boolean |
isEnforceSchema()
|
boolean |
isTolerateDuplicateValues()
|
java.util.Collection<DummyAccount> |
listAccounts()
|
void |
populateWithDefaultSchema()
Populates the resource with some kind of "default" schema. |
void |
purgeScriptHistory()
Clears the script history. |
void |
reset()
Clears everything, just like the resouce was just created. |
void |
runScript(java.lang.String scriptCode)
Pretend to run script on the resource. |
void |
setEnforceSchema(boolean enforceSchema)
|
void |
setSchemaBreakMode(BreakMode schemaBreakMode)
|
void |
setSyncStyle(DummySyncStyle syncStyle)
|
void |
setTolerateDuplicateValues(boolean tolerateDuplicateValues)
|
void |
setUselessGuardedString(java.lang.String uselessGuardedString)
|
void |
setUselessString(java.lang.String uselessString)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void reset()
public static DummyResource getInstance()
public static DummyResource getInstance(java.lang.String instanceName)
public boolean isTolerateDuplicateValues()
public void setTolerateDuplicateValues(boolean tolerateDuplicateValues)
public boolean isEnforceSchema()
public void setEnforceSchema(boolean enforceSchema)
public BreakMode getSchemaBreakMode()
public void setSchemaBreakMode(BreakMode schemaBreakMode)
public java.lang.String getUselessString()
public void setUselessString(java.lang.String uselessString)
public java.lang.String getUselessGuardedString()
public void setUselessGuardedString(java.lang.String uselessGuardedString)
public DummyObjectClass getAccountObjectClass() throws java.net.ConnectException, java.io.FileNotFoundException
java.net.ConnectException
java.io.FileNotFoundException
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()
public DummySyncStyle getSyncStyle()
public void setSyncStyle(DummySyncStyle syncStyle)
public int getLatestSyncToken()
public java.util.List<DummyDelta> getDeltasSince(int syncToken)
public java.lang.String dump()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |