protected <S extends UtilsStatus<S, L, D>> Aht exportStatus(Class<S> c) { XmlStatusFactory f = new XmlStatusFactory(StatusQuery.get(StatusQuery.Key.StatusExport, "").getStatus()); Aht xml = new Aht(); for (S s : fUtils.all(c)) { Status status = f.build(s); if (mapGroups.containsKey(c)) { status.setGroup(mapGroups.get(c)); } xml.getStatus().add(status); } return xml; }
public Test build(QAT test) { if (fQa != null) { test = fQa.load(cQAT, test); } Test xml = new Test(); if (q.isSetId()) { xml.setId(test.getId()); } if (q.isSetCode()) { xml.setCode(test.getCode()); } if (q.isSetName()) { xml.setName(test.getName()); } if (q.isSetVisible()) { xml.setVisible(test.getVisible()); } if (q.isSetDuration()) { if (test.getDuration() != null) { xml.setDuration(test.getDuration()); } else { xml.setDuration(0); } } if (q.isSetReference() && test.getReference() != null) { xml.setReference(XmlReferenceFactory.build(test.getReference())); } if (q.isSetDescription() && test.getDescription() != null) { xml.setDescription(XmlDescriptionFactory.build(test.getDescription())); } if (q.isSetPreCondition() && test.getPreCondition() != null) { xml.setPreCondition(XmlPreConditionFactory.build(test.getPreCondition())); } if (q.isSetSteps() && test.getSteps() != null) { xml.setSteps(XmlStepsFactory.build(test.getSteps())); } if (q.isSetExpected() && test.getExpectedResult() != null) { xml.setExpected(XmlExpectedFactory.build(test.getExpectedResult())); } if (q.isSetStatement() && test.getClientStatus() != null) { XmlStatementFactory<QATS, L, D> f = new XmlStatementFactory<QATS, L, D>(null, q.getStatement()); xml.setStatement(f.build(test.getClientStatus())); } if (q.isSetStatus() && test.getDeveloperStatus() != null) { XmlStatusFactory f = new XmlStatusFactory(null, q.getStatus()); xml.setStatus(f.build(test.getDeveloperStatus())); } if (q.isSetResults()) { XmlResultsFactory< L, D, C, R, V, U, A, USER, STAFF, GROUP, QA, QASD, QASS, QAC, QAT, QAU, QAR, QASH, QATD, QATI, QATC, QATS, QARS, QAUS> f = new XmlResultsFactory< L, D, C, R, V, U, A, USER, STAFF, GROUP, QA, QASD, QASS, QAC, QAT, QAU, QAR, QASH, QATD, QATI, QATC, QATS, QARS, QAUS>(q.getResults()); xml.setResults(f.build(test)); } if (q.isSetInfo() && test.getInfo() != null) { XmlInfoFactory< L, D, C, R, V, U, A, USER, STAFF, GROUP, QA, QASD, QASS, QAC, QAT, QAU, QAR, QASH, QATD, QATI, QATC, QATS, QARS, QAUS> f = new XmlInfoFactory< L, D, C, R, V, U, A, USER, STAFF, GROUP, QA, QASD, QASS, QAC, QAT, QAU, QAR, QASH, QATD, QATI, QATC, QATS, QARS, QAUS>(q.getInfo()); xml.setInfo(f.build(test.getInfo())); } if (q.isSetGroups()) { XmlGroupsFactory< L, D, C, R, V, U, A, USER, STAFF, GROUP, QA, QASD, QASS, QAC, QAT, QAU, QAR, QASH, QATD, QATI, QATC, QATS, QARS, QAUS> f = new XmlGroupsFactory< L, D, C, R, V, U, A, USER, STAFF, GROUP, QA, QASD, QASS, QAC, QAT, QAU, QAR, QASH, QATD, QATI, QATC, QATS, QARS, QAUS>(q.getGroups()); xml.setGroups(f.build(test)); } return xml; }