* @param element the source element.
*/
private void parseMetaInfo(BeanDefinitionBuilder testCase, Element element) {
Element metaInfoElement = DomUtils.getChildElementByTagName(element, "meta-info");
if (metaInfoElement != null) {
TestCaseMetaInfo metaInfo = new TestCaseMetaInfo();
Element authorElement = DomUtils.getChildElementByTagName(metaInfoElement, "author");
Element creationDateElement = DomUtils.getChildElementByTagName(metaInfoElement, "creationdate");
Element statusElement = DomUtils.getChildElementByTagName(metaInfoElement, "status");
Element lastUpdatedByElement = DomUtils.getChildElementByTagName(metaInfoElement, "last-updated-by");
Element lastUpdatedOnElement = DomUtils.getChildElementByTagName(metaInfoElement, "last-updated-on");
metaInfo.setAuthor(DomUtils.getTextValue(authorElement));
try {
metaInfo.setCreationDate(new SimpleDateFormat("yyyy-MM-dd").parse(DomUtils.getTextValue(creationDateElement)));
} catch (ParseException e) {
throw new BeanCreationException("Unable to parse creation date", e);
}
String status = DomUtils.getTextValue(statusElement);
if (status.equals("DRAFT")) {
metaInfo.setStatus(Status.DRAFT);
} else if (status.equals("READY_FOR_REVIEW")) {
metaInfo.setStatus(Status.READY_FOR_REVIEW);
} else if (status.equals("FINAL")) {
metaInfo.setStatus(Status.FINAL);
} else if (status.equals("DISABLED")) {
metaInfo.setStatus(Status.DISABLED);
}
if (lastUpdatedByElement != null) {
metaInfo.setLastUpdatedBy(DomUtils.getTextValue(lastUpdatedByElement));
}
if (lastUpdatedOnElement != null) {
try {
metaInfo.setLastUpdatedOn(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(DomUtils.getTextValue(lastUpdatedOnElement)));
} catch (ParseException e) {
throw new BeanCreationException("Unable to parse lastupdate date", e);
}
}