Package com.evolveum.midpoint.prism.util
Class PrismTestUtil
java.lang.Object
com.evolveum.midpoint.prism.util.PrismTestUtil
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ParsingContextstatic PrismContextstatic PolyStringcreatePolyString(String orig) Deprecated.static PolyStringcreatePolyString(String orig, String norm) static PolyStringTypecreatePolyStringType(String string) static PolyStringTypecreatePolyStringType(String orig, String norm) static PrismContextstatic voiddisplay(String title, DebugDumpable dumpable) static voidstatic voiddisplayCollection(String title, Collection<?> collection) static voiddisplayQuery(ObjectQuery query) static voiddisplayQueryType(QueryType queryType) static voiddisplayQueryXml(String xml) static voiddisplaySearchFilterType(SearchFilterType filterType) static voiddisplayText(String text) static ObjectFiltergetFilterCondition(ObjectFilter filter, int index) static <T extends Objectable>
PrismObjectDefinition<T>getObjectDefinition(Class<T> compileTimeClass) static @NotNull PrismContextstatic SchemaRegistrystatic <T> TparseAnyValue(File file) static <T> TparseAtomicValue(File file, QName type) static <T> TparseAtomicValue(String data, QName type) static <T> TparseAtomicValueCompat(String data, QName type) static <T extends Objectable>
PrismObject<T>parseObject(File file) static <T extends Objectable>
PrismObject<T>parseObject(String xmlString) static <T extends Objectable>
TparseObjectable(File file) static List<PrismObject<? extends Objectable>>parseObjects(File file) static List<PrismObject<? extends Objectable>>parseObjectsCompat(File file) static voidstatic voidresetPrismContext(PrismContextFactory newPrismContextFactory) static StringserializeAnyData(Object o, QName defaultRootElementName) static Stringstatic StringserializeAtomicValue(Object object, QName elementName) static StringserializeFilter(@NotNull ObjectFilter filter) static StringserializeJaxbElementToString(jakarta.xml.bind.JAXBElement<?> element) static StringserializeObjectToString(PrismObject<? extends Objectable> object) static StringserializeObjectToString(PrismObject<? extends Objectable> object, String language) static StringserializeToXml(Objectable object) static voidsetFactory(PrismContextFactory newPrismContextFactory) static voidsetPrismContext(PrismContext prismContext) static SearchFilterTypeunmarshalFilter(File file)
-
Constructor Details
-
PrismTestUtil
public PrismTestUtil()
-
-
Method Details
-
resetPrismContext
public static void resetPrismContext(PrismContextFactory newPrismContextFactory) throws SchemaException, SAXException, IOException - Throws:
SchemaExceptionSAXExceptionIOException
-
setFactory
-
resetPrismContext
- Throws:
SchemaExceptionSAXExceptionIOException
-
createPrismContext
- Throws:
SchemaExceptionIOException
-
createInitializedPrismContext
public static PrismContext createInitializedPrismContext() throws SchemaException, SAXException, IOException- Throws:
SchemaExceptionSAXExceptionIOException
-
getPrismContext
-
setPrismContext
-
getSchemaRegistry
-
parseObject
public static <T extends Objectable> PrismObject<T> parseObject(File file) throws SchemaException, IOException - Throws:
SchemaExceptionIOException
-
parseObject
public static <T extends Objectable> PrismObject<T> parseObject(String xmlString) throws SchemaException - Throws:
SchemaException
-
parseObjectable
public static <T extends Objectable> T parseObjectable(File file) throws SchemaException, IOException - Throws:
SchemaExceptionIOException
-
parseObjects
public static List<PrismObject<? extends Objectable>> parseObjects(File file) throws SchemaException, IOException - Throws:
SchemaExceptionIOException
-
parseObjectsCompat
public static List<PrismObject<? extends Objectable>> parseObjectsCompat(File file) throws SchemaException, IOException - Throws:
SchemaExceptionIOException
-
serializeObjectToString
public static String serializeObjectToString(PrismObject<? extends Objectable> object, String language) throws SchemaException - Throws:
SchemaException
-
serializeToXml
- Throws:
SchemaException
-
serializeObjectToString
public static String serializeObjectToString(PrismObject<? extends Objectable> object) throws SchemaException - Throws:
SchemaException
-
serializeAtomicValue
- Throws:
SchemaException
-
serializeAnyData
public static String serializeAnyData(Object o, QName defaultRootElementName) throws SchemaException - Throws:
SchemaException
-
serializeJaxbElementToString
public static String serializeJaxbElementToString(jakarta.xml.bind.JAXBElement<?> element) throws SchemaException - Throws:
SchemaException
-
serializeAnyDataWrapped
- Throws:
SchemaException
-
parseAtomicValue
- Throws:
SchemaExceptionIOException
-
parseAtomicValue
- Throws:
SchemaException
-
parseAtomicValueCompat
- Throws:
SchemaException
-
parseAnyValue
- Throws:
SchemaExceptionIOException
-
getObjectDefinition
public static <T extends Objectable> PrismObjectDefinition<T> getObjectDefinition(Class<T> compileTimeClass) -
createPolyString
Deprecated. -
createPolyString
-
createPolyStringType
-
createPolyStringType
-
unmarshalFilter
- Throws:
Exception
-
getFilterCondition
-
display
-
display
-
displayCollection
-
displayQuery
-
displayQueryXml
-
displayText
-
displayQueryType
- Throws:
SchemaException
-
displaySearchFilterType
- Throws:
SchemaException
-
createDefaultParsingContext
-
serializeFilter
-