com.evolveum.midpoint.test
Class IntegrationTestTools

java.lang.Object
  extended by com.evolveum.midpoint.test.IntegrationTestTools

public class IntegrationTestTools
extends Object

Author:
Radovan Semancik

Field Summary
static boolean checkResults
           
static Trace LOGGER
           
 
Constructor Summary
IntegrationTestTools()
           
 
Method Summary
static void applyResourceSchema(AccountShadowType accountType, ResourceType resourceType, PrismContext prismContext)
           
static
<T> void
assertAttribute(PrismObject<? extends ResourceObjectShadowType> shadow, QName name, T... expectedValues)
           
static
<T> void
assertAttribute(ResourceObjectShadowType shadowType, QName name, T... expectedValues)
           
static
<T> void
assertAttribute(ResourceObjectShadowType shadow, ResourceType resource, String name, T... expectedValues)
           
static
<T> void
assertAttribute(String message, ResourceObjectShadowType repoShadow, QName name, T... expectedValues)
           
static void assertAttributeDefinition(ResourceAttribute<?> attr, QName expectedType, int minOccurs, int maxOccurs, boolean canRead, boolean canCreate, boolean canUpdate, Class<?> expetcedAttributeDefinitionClass)
           
static void assertAttributeNotNull(ResourceObjectShadowType repoShadow, QName name)
           
static void assertAttributeNotNull(String message, ResourceObjectShadowType repoShadow, QName name)
           
static
<T> void
assertEqualsCollection(String message, Collection<T> expectedValues, Collection<T> actualValues)
           
static
<T> void
assertEqualsCollection(String message, Collection<T> expectedValues, T[] actualValues)
           
static
<T> void
assertEqualsCollection(String message, T[] expectedValues, Collection<T> actualValues)
           
static void assertFailure(OperationResult result)
           
static void assertFailure(OperationResultType result)
           
static void assertFailure(String message, OperationResult result)
           
static void assertFailure(String message, OperationResultType result)
           
static void assertIcfsNameAttribute(PrismObject<? extends ResourceObjectShadowType> repoShadow, String value)
           
static void assertIcfsNameAttribute(ResourceObjectShadowType repoShadow, String value)
           
static void assertInMessageRecursive(Throwable e, String substring)
           
static void assertInProgress(String message, OperationResult result)
           
static
<T> void
assertNoAttribute(PrismObject<? extends ResourceObjectShadowType> shadow, QName name)
           
static void assertNoRepoCache()
           
static void assertNotEmpty(PolyString ps)
           
static void assertNotEmpty(PolyStringType ps)
           
static void assertNotEmpty(QName qname)
           
static void assertNotEmpty(String s)
           
static void assertNotEmpty(String message, PolyString ps)
           
static void assertNotEmpty(String message, PolyStringType ps)
           
static void assertNotEmpty(String message, QName qname)
           
static void assertNotEmpty(String message, String s)
           
static void assertNotInMessageRecursive(Throwable e, String substring)
           
static void assertProvisioningAccountShadow(PrismObject<AccountShadowType> account, ResourceType resourceType, Class<?> expetcedAttributeDefinitionClass)
           
static void assertScripts(List<ScriptHistoryEntry> scriptsHistory, ProvisioningScriptSpec... expectedScripts)
           
static void assertSuccess(OperationResult result)
           
static void assertSuccess(String message, OperationResult result)
           
static void assertSuccess(String message, OperationResult result, int level)
          level=-1 - check all levels level=0 - check only the top-level level=1 - check one level below top-level ...
static void assertSuccess(String message, OperationResultType result)
           
static void assertSuccessOrWarning(String message, OperationResult result)
           
static void assertSuccessOrWarning(String message, OperationResult result, int level)
           
static void assertTestResourceFailure(OperationResult testResult, ConnectorTestOperation operation)
           
static void assertTestResourceNotApplicable(OperationResult testResult, ConnectorTestOperation operation)
           
static void assertTestResourceSuccess(OperationResult testResult, ConnectorTestOperation operation)
           
static void assertWarning(String message, OperationResult result)
           
static void assertWarning(String message, OperationResultType result)
           
static void checkAllShadows(ResourceType resourceType, RepositoryService repositoryService, ObjectChecker<AccountShadowType> checker, PrismContext prismContext)
           
static void checkShadow(AccountShadowType shadowType, ResourceType resourceType, RepositoryService repositoryService, ObjectChecker<AccountShadowType> checker, PrismContext prismContext, OperationResult parentResult)
           
static ObjectQuery createAllShadowsQuery(ResourceType resourceType, PrismContext prismContext)
           
static ObjectQuery createAllShadowsQuery(ResourceType resourceType, QName objectClass, PrismContext prismContext)
           
static ObjectQuery createAllShadowsQuery(ResourceType resourceType, String objectClassLocalName, PrismContext prismContext)
           
static void display(OperationResult result)
           
static void display(org.opends.server.types.SearchResultEntry response)
           
static void display(String message)
           
static void display(String message, Collection collection)
           
static void display(String title, Dumpable dumpable)
           
static void display(String title, org.opends.server.types.Entry entry)
           
static void display(String title, List<Element> elements)
           
static void display(String title, Object value)
           
static void display(String message, ObjectType o)
           
static void display(String title, OperationResult result)
           
static void display(String title, OperationResultType result)
           
static void display(String message, PrismContainer<?> propertyContainer)
           
static void display(String message, org.opends.server.types.SearchResultEntry response)
           
static void display(String title, String value)
           
static void display(String message, Task task)
           
static void display(String title, Throwable e)
           
static void displayJaxb(String title, Object o, QName qname)
           
static void displayObjectTypeCollection(String message, Collection<? extends ObjectType> collection)
           
static void displayScripts(List<ScriptHistoryEntry> scriptsHistory)
           
static void displayTestTile(Object testCase, String testName)
           
static void displayTestTile(String testName)
           
static void displayThen(String testName)
           
static void displayWhen(String testName)
           
static String getAttributeValue(ResourceObjectShadowType repoShadow, QName name)
           
static
<T> Collection<T>
getAttributeValues(PrismObject<? extends ResourceObjectShadowType> shadow, QName name)
           
static
<T> Collection<T>
getAttributeValues(ResourceObjectShadowType shadowType, QName name)
           
static String getErrorMessage(OperationResult result)
           
static boolean hasInMessageRecursive(Throwable e, String substring)
           
static boolean hasWarningAssertSuccess(String message, OperationResultType result)
           
static void waitFor(String message, Checker checker, int timeoutInterval)
           
static void waitFor(String message, Checker checker, int timeoutInterval, long sleepInterval)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkResults

public static boolean checkResults

LOGGER

public static Trace LOGGER
Constructor Detail

IntegrationTestTools

public IntegrationTestTools()
Method Detail

assertSuccess

public static void assertSuccess(OperationResult result)

assertSuccess

public static void assertSuccess(String message,
                                 OperationResultType result)

assertWarning

public static void assertWarning(String message,
                                 OperationResultType result)

hasWarningAssertSuccess

public static boolean hasWarningAssertSuccess(String message,
                                              OperationResultType result)

assertSuccess

public static void assertSuccess(String message,
                                 OperationResult result)

assertFailure

public static void assertFailure(String message,
                                 OperationResult result)

assertFailure

public static void assertFailure(OperationResult result)

assertFailure

public static void assertFailure(OperationResultType result)

assertFailure

public static void assertFailure(String message,
                                 OperationResultType result)

assertSuccess

public static void assertSuccess(String message,
                                 OperationResult result,
                                 int level)
level=-1 - check all levels level=0 - check only the top-level level=1 - check one level below top-level ...

Parameters:
message -
result -
level -

assertSuccessOrWarning

public static void assertSuccessOrWarning(String message,
                                          OperationResult result,
                                          int level)

assertSuccessOrWarning

public static void assertSuccessOrWarning(String message,
                                          OperationResult result)

assertWarning

public static void assertWarning(String message,
                                 OperationResult result)

assertInProgress

public static void assertInProgress(String message,
                                    OperationResult result)

getErrorMessage

public static String getErrorMessage(OperationResult result)

assertTestResourceSuccess

public static void assertTestResourceSuccess(OperationResult testResult,
                                             ConnectorTestOperation operation)

assertTestResourceFailure

public static void assertTestResourceFailure(OperationResult testResult,
                                             ConnectorTestOperation operation)

assertTestResourceNotApplicable

public static void assertTestResourceNotApplicable(OperationResult testResult,
                                                   ConnectorTestOperation operation)

assertNotEmpty

public static void assertNotEmpty(String message,
                                  String s)

assertNotEmpty

public static void assertNotEmpty(PolyString ps)

assertNotEmpty

public static void assertNotEmpty(PolyStringType ps)

assertNotEmpty

public static void assertNotEmpty(String message,
                                  PolyString ps)

assertNotEmpty

public static void assertNotEmpty(String message,
                                  PolyStringType ps)

assertNotEmpty

public static void assertNotEmpty(String s)

assertNotEmpty

public static void assertNotEmpty(String message,
                                  QName qname)

assertNotEmpty

public static void assertNotEmpty(QName qname)

assertAttribute

public static <T> void assertAttribute(ResourceObjectShadowType shadow,
                                       ResourceType resource,
                                       String name,
                                       T... expectedValues)

assertAttribute

public static <T> void assertAttribute(ResourceObjectShadowType shadowType,
                                       QName name,
                                       T... expectedValues)

assertAttribute

public static <T> void assertAttribute(PrismObject<? extends ResourceObjectShadowType> shadow,
                                       QName name,
                                       T... expectedValues)

assertAttribute

public static <T> void assertAttribute(String message,
                                       ResourceObjectShadowType repoShadow,
                                       QName name,
                                       T... expectedValues)

assertNoAttribute

public static <T> void assertNoAttribute(PrismObject<? extends ResourceObjectShadowType> shadow,
                                         QName name)

assertEqualsCollection

public static <T> void assertEqualsCollection(String message,
                                              Collection<T> expectedValues,
                                              Collection<T> actualValues)

assertEqualsCollection

public static <T> void assertEqualsCollection(String message,
                                              Collection<T> expectedValues,
                                              T[] actualValues)

assertEqualsCollection

public static <T> void assertEqualsCollection(String message,
                                              T[] expectedValues,
                                              Collection<T> actualValues)

assertIcfsNameAttribute

public static void assertIcfsNameAttribute(ResourceObjectShadowType repoShadow,
                                           String value)

assertIcfsNameAttribute

public static void assertIcfsNameAttribute(PrismObject<? extends ResourceObjectShadowType> repoShadow,
                                           String value)

assertAttributeNotNull

public static void assertAttributeNotNull(ResourceObjectShadowType repoShadow,
                                          QName name)

assertAttributeNotNull

public static void assertAttributeNotNull(String message,
                                          ResourceObjectShadowType repoShadow,
                                          QName name)

assertAttributeDefinition

public static void assertAttributeDefinition(ResourceAttribute<?> attr,
                                             QName expectedType,
                                             int minOccurs,
                                             int maxOccurs,
                                             boolean canRead,
                                             boolean canCreate,
                                             boolean canUpdate,
                                             Class<?> expetcedAttributeDefinitionClass)

assertProvisioningAccountShadow

public static void assertProvisioningAccountShadow(PrismObject<AccountShadowType> account,
                                                   ResourceType resourceType,
                                                   Class<?> expetcedAttributeDefinitionClass)

getAttributeValues

public static <T> Collection<T> getAttributeValues(ResourceObjectShadowType shadowType,
                                                   QName name)

getAttributeValues

public static <T> Collection<T> getAttributeValues(PrismObject<? extends ResourceObjectShadowType> shadow,
                                                   QName name)

getAttributeValue

public static String getAttributeValue(ResourceObjectShadowType repoShadow,
                                       QName name)

displayTestTile

public static void displayTestTile(String testName)

displayTestTile

public static void displayTestTile(Object testCase,
                                   String testName)

displayWhen

public static void displayWhen(String testName)

displayThen

public static void displayThen(String testName)

waitFor

public static void waitFor(String message,
                           Checker checker,
                           int timeoutInterval)
                    throws Exception
Throws:
Exception

waitFor

public static void waitFor(String message,
                           Checker checker,
                           int timeoutInterval,
                           long sleepInterval)
                    throws Exception
Throws:
Exception

displayJaxb

public static void displayJaxb(String title,
                               Object o,
                               QName qname)
                        throws JAXBException
Throws:
JAXBException

display

public static void display(String message)

display

public static void display(String message,
                           org.opends.server.types.SearchResultEntry response)

display

public static void display(org.opends.server.types.SearchResultEntry response)

display

public static void display(String message,
                           Task task)

display

public static void display(String message,
                           ObjectType o)

display

public static void display(String message,
                           Collection collection)

displayObjectTypeCollection

public static void displayObjectTypeCollection(String message,
                                               Collection<? extends ObjectType> collection)

display

public static void display(String title,
                           org.opends.server.types.Entry entry)

display

public static void display(String message,
                           PrismContainer<?> propertyContainer)

display

public static void display(OperationResult result)

display

public static void display(String title,
                           OperationResult result)

display

public static void display(String title,
                           OperationResultType result)
                    throws JAXBException
Throws:
JAXBException

display

public static void display(String title,
                           List<Element> elements)

display

public static void display(String title,
                           Dumpable dumpable)

display

public static void display(String title,
                           String value)

display

public static void display(String title,
                           Object value)

display

public static void display(String title,
                           Throwable e)

checkAllShadows

public static void checkAllShadows(ResourceType resourceType,
                                   RepositoryService repositoryService,
                                   ObjectChecker<AccountShadowType> checker,
                                   PrismContext prismContext)
                            throws SchemaException,
                                   ObjectNotFoundException,
                                   CommunicationException,
                                   ConfigurationException
Throws:
SchemaException
ObjectNotFoundException
CommunicationException
ConfigurationException

createAllShadowsQuery

public static ObjectQuery createAllShadowsQuery(ResourceType resourceType,
                                                PrismContext prismContext)
                                         throws SchemaException
Throws:
SchemaException

createAllShadowsQuery

public static ObjectQuery createAllShadowsQuery(ResourceType resourceType,
                                                QName objectClass,
                                                PrismContext prismContext)
                                         throws SchemaException
Throws:
SchemaException

createAllShadowsQuery

public static ObjectQuery createAllShadowsQuery(ResourceType resourceType,
                                                String objectClassLocalName,
                                                PrismContext prismContext)
                                         throws SchemaException
Throws:
SchemaException

checkShadow

public static void checkShadow(AccountShadowType shadowType,
                               ResourceType resourceType,
                               RepositoryService repositoryService,
                               ObjectChecker<AccountShadowType> checker,
                               PrismContext prismContext,
                               OperationResult parentResult)

applyResourceSchema

public static void applyResourceSchema(AccountShadowType accountType,
                                       ResourceType resourceType,
                                       PrismContext prismContext)
                                throws SchemaException
Throws:
SchemaException

assertInMessageRecursive

public static void assertInMessageRecursive(Throwable e,
                                            String substring)

hasInMessageRecursive

public static boolean hasInMessageRecursive(Throwable e,
                                            String substring)

assertNotInMessageRecursive

public static void assertNotInMessageRecursive(Throwable e,
                                               String substring)

assertNoRepoCache

public static void assertNoRepoCache()

assertScripts

public static void assertScripts(List<ScriptHistoryEntry> scriptsHistory,
                                 ProvisioningScriptSpec... expectedScripts)

displayScripts

public static void displayScripts(List<ScriptHistoryEntry> scriptsHistory)


Copyright © 2013 evolveum. All Rights Reserved.