boolean mandantoryFalse = false;
boolean finalizedTrue = false;
boolean finalizedFalse = false;
XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface
(XNameAccess.class, oObj);
String[] filterNames = xNA.getElementNames();
// XNameContainer; XNameReplace
String filterName = filterNames[0];
Object[] instance = null;;
for (int i = 0; i < filterNames.length; i++) {
log.println("------------------------------------------------");
try{
PropertyValue instanceProp = new PropertyValue();
filterName = filterNames[i];
log.println(filterName);
// testobject must new created for every test.
// We change in a loop the container and try to flush this changes.
// If we get an expected exception this container is corrupt. It's
// similar to a document which could not be saved beacuse of invalid
// contend. While you don't remove the invalid conted you will never
// be able to save the document. Same here.
try{
oObj = getTestObject(serviceName);
} catch (java.lang.Exception e){
failed("could not get test object", CONTINUE);
}
xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oObj);
XNameContainer xNC = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, oObj);
XNameReplace xNR = (XNameReplace) UnoRuntime.queryInterface(XNameReplace.class, oObj);
XFlushable xFlush = (XFlushable) UnoRuntime.queryInterface(XFlushable.class, oObj);
instance = (Object[]) xNA.getByName(filterName);
PropertyValue[] props = (PropertyValue[]) instance;
printPropertyValues(props);
boolean isMandatory = ((Boolean) getPropertyValueValue(props, "Mandatory")).booleanValue();