Package com.evolveum.midpoint.prism.util
Class PrismTestUtil
- java.lang.Object
- 
- com.evolveum.midpoint.prism.util.PrismTestUtil
 
- 
 @TestOnly public class PrismTestUtil extends Object Class that statically instantiates the prism contexts and provides convenient static version of the PrismContext and processor classes. This is usable for tests. DO NOT use this in the main code. Although it is placed in "main" for convenience, it should only be used in tests.- Author:
- semancik
 
- 
- 
Constructor SummaryConstructors Constructor Description PrismTestUtil()
 - 
Method Summary
 
- 
- 
- 
Method Detail- 
resetPrismContextpublic static void resetPrismContext(PrismContextFactory newPrismContextFactory) throws SchemaException, SAXException, IOException - Throws:
- SchemaException
- SAXException
- IOException
 
 - 
setFactorypublic static void setFactory(PrismContextFactory newPrismContextFactory) 
 - 
resetPrismContextpublic static void resetPrismContext() throws SchemaException, SAXException, IOException- Throws:
- SchemaException
- SAXException
- IOException
 
 - 
createPrismContextpublic static PrismContext createPrismContext() throws SchemaException, IOException - Throws:
- SchemaException
- IOException
 
 - 
createInitializedPrismContextpublic static PrismContext createInitializedPrismContext() throws SchemaException, SAXException, IOException - Throws:
- SchemaException
- SAXException
- IOException
 
 - 
getPrismContextpublic static PrismContext getPrismContext() 
 - 
setPrismContextpublic static void setPrismContext(PrismContext prismContext) 
 - 
getSchemaRegistrypublic static SchemaRegistry getSchemaRegistry() 
 - 
parseObjectpublic static <T extends Objectable> PrismObject<T> parseObject(File file) throws SchemaException, IOException - Throws:
- SchemaException
- IOException
 
 - 
parseObjectpublic static <T extends Objectable> PrismObject<T> parseObject(String xmlString) throws SchemaException - Throws:
- SchemaException
 
 - 
parseObjectablepublic static <T extends Objectable> T parseObjectable(File file) throws SchemaException, IOException - Throws:
- SchemaException
- IOException
 
 - 
parseObjectspublic static List<PrismObject<? extends Objectable>> parseObjects(File file) throws SchemaException, IOException - Throws:
- SchemaException
- IOException
 
 - 
serializeObjectToStringpublic static String serializeObjectToString(PrismObject<? extends Objectable> object, String language) throws SchemaException - Throws:
- SchemaException
 
 - 
serializeToXmlpublic static String serializeToXml(Objectable object) throws SchemaException - Throws:
- SchemaException
 
 - 
serializeObjectToStringpublic static String serializeObjectToString(PrismObject<? extends Objectable> object) throws SchemaException - Throws:
- SchemaException
 
 - 
serializeAtomicValuepublic static String serializeAtomicValue(Object object, QName elementName) throws SchemaException - Throws:
- SchemaException
 
 - 
serializeAnyDatapublic static String serializeAnyData(Object o, QName defaultRootElementName) throws SchemaException - Throws:
- SchemaException
 
 - 
serializeJaxbElementToStringpublic static String serializeJaxbElementToString(javax.xml.bind.JAXBElement<?> element) throws SchemaException - Throws:
- SchemaException
 
 - 
serializeAnyDataWrappedpublic static String serializeAnyDataWrapped(Object o) throws SchemaException - Throws:
- SchemaException
 
 - 
parseAtomicValuepublic static <T> T parseAtomicValue(File file, QName type) throws SchemaException, IOException - Throws:
- SchemaException
- IOException
 
 - 
parseAtomicValuepublic static <T> T parseAtomicValue(String data, QName type) throws SchemaException - Throws:
- SchemaException
 
 - 
parseAtomicValueCompatpublic static <T> T parseAtomicValueCompat(String data, QName type) throws SchemaException - Throws:
- SchemaException
 
 - 
parseAnyValuepublic static <T> T parseAnyValue(File file) throws SchemaException, IOException - Throws:
- SchemaException
- IOException
 
 - 
getObjectDefinitionpublic static <T extends Objectable> PrismObjectDefinition<T> getObjectDefinition(Class<T> compileTimeClass) 
 - 
createPolyString@Deprecated public static PolyString createPolyString(String orig) Deprecated.
 - 
createPolyStringpublic static PolyString createPolyString(String orig, String norm) 
 - 
createPolyStringTypepublic static PolyStringType createPolyStringType(String string) 
 - 
createPolyStringTypepublic static PolyStringType createPolyStringType(String orig, String norm) 
 - 
unmarshalFilterpublic static SearchFilterType unmarshalFilter(File file) throws Exception - Throws:
- Exception
 
 - 
getFilterConditionpublic static ObjectFilter getFilterCondition(ObjectFilter filter, int index) 
 - 
displaypublic static void display(String title, DebugDumpable dumpable) 
 - 
displayCollectionpublic static void displayCollection(String title, Collection<?> collection) 
 - 
displayQuerypublic static void displayQuery(ObjectQuery query) 
 - 
displayQueryXmlpublic static void displayQueryXml(String xml) 
 - 
displayTextpublic static void displayText(String text) 
 - 
displayQueryTypepublic static void displayQueryType(QueryType queryType) throws SchemaException - Throws:
- SchemaException
 
 - 
displaySearchFilterTypepublic static void displaySearchFilterType(SearchFilterType filterType) throws SchemaException - Throws:
- SchemaException
 
 - 
createDefaultParsingContextpublic static ParsingContext createDefaultParsingContext() 
 
- 
 
-