ProductionRequest implements XmlConvertible { @Override public String toXml() { try { return new ParameterBlockConverter().convertObjectToXml(this); } catch (ConversionException e) { throw new RuntimeException(e); } } private  ProductionRequest();  ProductionRequest(String productionType,
                             String userName,
                             String... productionParametersKeyValuePairs);  ProductionRequest(String productionType,
                             String userName,
                             Map<String, String> productionParameters); String getProductionType(); String getUserName(); Map<String, String> getParameters(); String getParameter(String name, boolean mandatory); void setParameter(String key, String value); void ensureParameterSet(String name); static DateFormat getDateFormat(); String getString(String name); String getString(String name, String def); boolean getBoolean(String name); Boolean getBoolean(String name, Boolean def); int getInteger(String name); Integer getInteger(String name, Integer def); float getFloat(String name); Float getFloat(String name, Float def); double getDouble(String name); Double getDouble(String name, Double def); Date getDate(String name); Date getDate(String name, Date def); Date[] getDates(String name, Date[] def); Geometry getGeometry(String name); Geometry getGeometry(String name, Geometry def); String getProductionName(String defaultProductionName); boolean isAutoStaging(); String getStagingDirectory(String productionId); String getRegionName(); Geometry getRegionGeometry(); Geometry getRegionGeometry(Geometry defaultGeometry); List<DateRange> getDateRanges(); DateRange createFromMinMax(); String getXmlDecodedString(String name, String def); @Override String toXml(); static ProductionRequest fromXml(String xml); static final String DATE_PATTERN; static final DateFormat DATE_FORMAT; }
@Test public void testToXml() throws Exception { ProductionRequest productionRequest = new ProductionRequest("test", "dummy", "minDate", "2001-02-03", "maxDate", "2002-04-06"); String xmlString = productionRequest.toXml(); assertEquals("<parameters>\n" + " <productionType>test</productionType>\n" + " <userName>dummy</userName>\n" + " <productionParameters class=\"java.util.HashMap\">\n" + " <minDate>2001-02-03</minDate>\n" + " <maxDate>2002-04-06</maxDate>\n" + " </productionParameters>\n" + "</parameters>", xmlString); }