@Test
public void testStoreAndLoadParameter() throws IOException, ValidationException, ConversionException {
final OperatorParameterSupport support = new OperatorParameterSupport(new TestOpSpi().getOperatorDescriptor());
PropertySet container = support.getPropertySet();
container.setValue("paramDouble", 0.42);
container.setValue("paramString", "A String!");
container.setValue("paramComplex", new Complex(25));
final DomElement domElement = support.toDomElement();
assertEquals("parameters", domElement.getName());
assertEquals(3, domElement.getChildCount());
assertNotNull(domElement.getChild("paramDouble"));
assertEquals("0.42", domElement.getChild("paramDouble").getValue());
assertNotNull(domElement.getChild("paramString"));
assertEquals("A String!", domElement.getChild("paramString").getValue());
assertNotNull(domElement.getChild("paramComplex"));
assertNotNull(domElement.getChild("paramComplex").getChild("complexInt"));
assertEquals("25", domElement.getChild("paramComplex").getChild("complexInt").getValue());
container.setValue("paramDouble", 23.67);
container.setValue("paramString", "Another String");
container.setValue("paramComplex", new Complex(17));
support.fromDomElement(domElement);
assertEquals(0.42, (double)support.getPropertySet().getValue("paramDouble"), 1.0e-6);
assertEquals("A String!", support.getPropertySet().getValue("paramString"));
assertEquals(new Complex(25), support.getPropertySet().getValue("paramComplex"));
}