diff options
| author | J08nY | 2018-05-28 20:06:18 +0200 |
|---|---|---|
| committer | J08nY | 2018-05-28 20:06:18 +0200 |
| commit | a4e52b21b1dad5f96df409c44e5b4d611bba01b9 (patch) | |
| tree | 36f9d21894fc702a4f544bd0145b403ba3930074 /src/cz/crcs/ectester/standalone/output/XMLTestWriter.java | |
| parent | ff6be88e469608a67945a274ec2180aee3f3ccd2 (diff) | |
| download | ECTester-a4e52b21b1dad5f96df409c44e5b4d611bba01b9.tar.gz ECTester-a4e52b21b1dad5f96df409c44e5b4d611bba01b9.tar.zst ECTester-a4e52b21b1dad5f96df409c44e5b4d611bba01b9.zip | |
Implement tracking of stage of execution of standalone testables.
- Output this stage in all the formats.
Diffstat (limited to '')
| -rw-r--r-- | src/cz/crcs/ectester/standalone/output/XMLTestWriter.java | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java b/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java index 2a35ce3..9332759 100644 --- a/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java +++ b/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java @@ -5,10 +5,11 @@ import cz.crcs.ectester.common.test.TestSuite; import cz.crcs.ectester.common.test.Testable; import cz.crcs.ectester.common.util.ByteUtil; import cz.crcs.ectester.standalone.ECTesterStandalone; -import cz.crcs.ectester.standalone.test.KeyAgreementTestable; -import cz.crcs.ectester.standalone.test.KeyGeneratorTestable; -import cz.crcs.ectester.standalone.test.SignatureTestable; -import cz.crcs.ectester.standalone.test.StandaloneTestSuite; +import cz.crcs.ectester.standalone.test.base.KeyAgreementTestable; +import cz.crcs.ectester.standalone.test.base.KeyGeneratorTestable; +import cz.crcs.ectester.standalone.test.base.SignatureTestable; +import cz.crcs.ectester.standalone.test.base.StandaloneTestable; +import cz.crcs.ectester.standalone.test.suites.StandaloneTestSuite; import org.w3c.dom.Element; import javax.xml.parsers.ParserConfigurationException; @@ -97,18 +98,27 @@ public class XMLTestWriter extends BaseXMLTestWriter { return sigElem; } + private Element stageElement(StandaloneTestable t) { + Element result = doc.createElement("stage"); + result.setTextContent(t.getStage().name()); + return result; + } + @Override protected Element testableElement(Testable t) { Element result = doc.createElement("test"); - if (t instanceof KeyGeneratorTestable) { - result.setAttribute("type", "key-pair-generator"); - result.appendChild(kgtElement((KeyGeneratorTestable) t)); - } else if (t instanceof KeyAgreementTestable) { - result.setAttribute("type", "key-agreement"); - result.appendChild(kaElement((KeyAgreementTestable) t)); - } else if (t instanceof SignatureTestable) { - result.setAttribute("type", "signature"); - result.appendChild(sigElement((SignatureTestable) t)); + if (t instanceof StandaloneTestable) { + if (t instanceof KeyGeneratorTestable) { + result.setAttribute("type", "key-pair-generator"); + result.appendChild(kgtElement((KeyGeneratorTestable) t)); + } else if (t instanceof KeyAgreementTestable) { + result.setAttribute("type", "key-agreement"); + result.appendChild(kaElement((KeyAgreementTestable) t)); + } else if (t instanceof SignatureTestable) { + result.setAttribute("type", "signature"); + result.appendChild(sigElement((SignatureTestable) t)); + } + result.appendChild(stageElement((StandaloneTestable) t)); } return result; } |
