use of com.agiletec.aps.system.services.category.Category in project entando-core by entando.
the class TestDataObjectManager method testGetXML.
public void testGetXML() throws Throwable {
DataObject dataObject = this._dataObjectManager.createDataObject("ART");
dataObject.setId("ART1");
dataObject.setTypeCode("Articolo");
dataObject.setTypeDescription("Articolo");
dataObject.setDescription("descrizione");
dataObject.setStatus(DataObject.STATUS_DRAFT);
dataObject.setMainGroup("free");
Category cat13 = new Category();
cat13.setCode("13");
dataObject.addCategory(cat13);
Category cat19 = new Category();
cat19.setCode("19");
dataObject.addCategory(cat19);
String xml = dataObject.getXML();
assertNotNull(xml);
assertTrue(xml.indexOf("<dataObject id=\"ART1\" typecode=\"Articolo\" typedescr=\"Articolo\">") != -1);
assertTrue(xml.indexOf("<descr>descrizione</descr>") != -1);
assertTrue(xml.indexOf("<status>" + DataObject.STATUS_DRAFT + "</status>") != -1);
assertTrue(xml.indexOf("<category id=\"13\" />") != -1);
assertTrue(xml.indexOf("<category id=\"19\" />") != -1);
}
Aggregations