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
-
Method Summary
Modifier and TypeMethodDescriptionstatic ParsingContext
static PrismContext
static PolyString
createPolyString
(String orig) Deprecated.static PolyString
createPolyString
(String orig, String norm) static PolyStringType
createPolyStringType
(String string) static PolyStringType
createPolyStringType
(String orig, String norm) static PrismContext
static void
display
(String title, DebugDumpable dumpable) static void
static void
displayCollection
(String title, Collection<?> collection) static void
displayQuery
(ObjectQuery query) static void
displayQueryType
(QueryType queryType) static void
displayQueryXml
(String xml) static void
displaySearchFilterType
(SearchFilterType filterType) static void
displayText
(String text) static ObjectFilter
getFilterCondition
(ObjectFilter filter, int index) static <T extends Objectable>
PrismObjectDefinition<T>getObjectDefinition
(Class<T> compileTimeClass) static @NotNull PrismContext
static SchemaRegistry
static <T> T
parseAnyValue
(File file) static <T> T
parseAtomicValue
(File file, QName type) static <T> T
parseAtomicValue
(String data, QName type) static <T> T
parseAtomicValueCompat
(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 void
static void
resetPrismContext
(PrismContextFactory newPrismContextFactory) static String
serializeAnyData
(Object o, QName defaultRootElementName) static String
static String
serializeAtomicValue
(Object object, QName elementName) static String
serializeFilter
(@NotNull ObjectFilter filter) static String
serializeJaxbElementToString
(jakarta.xml.bind.JAXBElement<?> element) static String
serializeObjectToString
(PrismObject<? extends Objectable> object) static String
serializeObjectToString
(PrismObject<? extends Objectable> object, String language) static String
serializeToXml
(Objectable object) static void
setFactory
(PrismContextFactory newPrismContextFactory) static void
setPrismContext
(PrismContext prismContext) static SearchFilterType
unmarshalFilter
(File file)
-
Constructor Details
-
PrismTestUtil
public PrismTestUtil()
-
-
Method Details
-
resetPrismContext
public static void resetPrismContext(PrismContextFactory newPrismContextFactory) throws SchemaException, SAXException, IOException - Throws:
SchemaException
SAXException
IOException
-
setFactory
-
resetPrismContext
- Throws:
SchemaException
SAXException
IOException
-
createPrismContext
- Throws:
SchemaException
IOException
-
createInitializedPrismContext
public static PrismContext createInitializedPrismContext() throws SchemaException, SAXException, IOException- Throws:
SchemaException
SAXException
IOException
-
getPrismContext
-
setPrismContext
-
getSchemaRegistry
-
parseObject
public static <T extends Objectable> PrismObject<T> parseObject(File file) throws SchemaException, IOException - Throws:
SchemaException
IOException
-
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:
SchemaException
IOException
-
parseObjects
public static List<PrismObject<? extends Objectable>> parseObjects(File file) throws SchemaException, IOException - Throws:
SchemaException
IOException
-
parseObjectsCompat
public static List<PrismObject<? extends Objectable>> parseObjectsCompat(File file) throws SchemaException, IOException - Throws:
SchemaException
IOException
-
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:
SchemaException
IOException
-
parseAtomicValue
- Throws:
SchemaException
-
parseAtomicValueCompat
- Throws:
SchemaException
-
parseAnyValue
- Throws:
SchemaException
IOException
-
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
-