aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJ08nY2018-02-05 17:26:24 +0100
committerJ08nY2018-02-05 17:26:24 +0100
commitdf3a0cbc285d9a34760034e186d7c7535375df5a (patch)
treebe833e9ba4ac5e075f7cf18d6c9ca9ad90a4dc18 /src
parent8eab5248e36615beae97c7d33bd0c9ac3a87895c (diff)
downloadECTester-df3a0cbc285d9a34760034e186d7c7535375df5a.tar.gz
ECTester-df3a0cbc285d9a34760034e186d7c7535375df5a.tar.zst
ECTester-df3a0cbc285d9a34760034e186d7c7535375df5a.zip
Show library name in test suite output in standalone testing.
Diffstat (limited to 'src')
-rw-r--r--src/cz/crcs/ectester/standalone/output/TextTestWriter.java6
-rw-r--r--src/cz/crcs/ectester/standalone/output/XMLTestWriter.java12
-rw-r--r--src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java9
-rw-r--r--src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java3
-rw-r--r--src/cz/crcs/ectester/standalone/test/SignatureTestable.java3
-rw-r--r--src/cz/crcs/ectester/standalone/test/StandaloneDefaultSuite.java1
-rw-r--r--src/cz/crcs/ectester/standalone/test/StandaloneTestSuite.java8
7 files changed, 36 insertions, 6 deletions
diff --git a/src/cz/crcs/ectester/standalone/output/TextTestWriter.java b/src/cz/crcs/ectester/standalone/output/TextTestWriter.java
index 972af18..716451b 100644
--- a/src/cz/crcs/ectester/standalone/output/TextTestWriter.java
+++ b/src/cz/crcs/ectester/standalone/output/TextTestWriter.java
@@ -3,6 +3,7 @@ package cz.crcs.ectester.standalone.output;
import cz.crcs.ectester.common.output.BaseTextTestWriter;
import cz.crcs.ectester.common.test.TestSuite;
import cz.crcs.ectester.common.test.Testable;
+import cz.crcs.ectester.standalone.test.StandaloneTestSuite;
import java.io.PrintStream;
@@ -22,7 +23,10 @@ public class TextTestWriter extends BaseTextTestWriter {
@Override
protected String deviceString(TestSuite suite) {
- //TODO
+ if (suite instanceof StandaloneTestSuite) {
+ StandaloneTestSuite standaloneSuite = (StandaloneTestSuite) suite;
+ return standaloneSuite.getLibrary().name();
+ }
return "";
}
} \ No newline at end of file
diff --git a/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java b/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java
index d2b16d8..63838cb 100644
--- a/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java
+++ b/src/cz/crcs/ectester/standalone/output/XMLTestWriter.java
@@ -7,6 +7,7 @@ import cz.crcs.ectester.common.util.ByteUtil;
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 org.w3c.dom.Element;
import javax.xml.parsers.ParserConfigurationException;
@@ -113,7 +114,16 @@ public class XMLTestWriter extends BaseXMLTestWriter {
@Override
protected Element deviceElement(TestSuite suite) {
- //TODO
+ if (suite instanceof StandaloneTestSuite) {
+ StandaloneTestSuite standaloneSuite = (StandaloneTestSuite) suite;
+ Element result = doc.createElement("device");
+ result.setAttribute("type", "library");
+
+ Element name = doc.createElement("name");
+ name.setTextContent(standaloneSuite.getLibrary().name());
+ result.appendChild(name);
+ return result;
+ }
return null;
}
}
diff --git a/src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java b/src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java
index dfc6813..1ec132d 100644
--- a/src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java
+++ b/src/cz/crcs/ectester/standalone/output/YAMLTestWriter.java
@@ -7,6 +7,7 @@ import cz.crcs.ectester.common.util.ByteUtil;
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 java.io.PrintStream;
import java.security.Key;
@@ -92,7 +93,13 @@ public class YAMLTestWriter extends BaseYAMLTestWriter {
@Override
protected Map<String, Object> deviceObject(TestSuite suite) {
- //TODO
+ if (suite instanceof StandaloneTestSuite) {
+ StandaloneTestSuite standaloneSuite = (StandaloneTestSuite) suite;
+ Map<String, Object> result = new HashMap<>();
+ result.put("type", "library");
+ result.put("name", standaloneSuite.getLibrary().name());
+ return result;
+ }
return null;
}
}
diff --git a/src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java b/src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java
index 3fca168..c2fec5a 100644
--- a/src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java
+++ b/src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java
@@ -8,6 +8,9 @@ import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.spec.ECParameterSpec;
+/**
+ * @author Jan Jancar johny@neuromancer.sk
+ */
public class KeyGeneratorTestable extends BaseTestable {
private KeyPair kp;
private KeyPairGenerator kpg;
diff --git a/src/cz/crcs/ectester/standalone/test/SignatureTestable.java b/src/cz/crcs/ectester/standalone/test/SignatureTestable.java
index e434337..7b26af7 100644
--- a/src/cz/crcs/ectester/standalone/test/SignatureTestable.java
+++ b/src/cz/crcs/ectester/standalone/test/SignatureTestable.java
@@ -10,6 +10,9 @@ import java.security.SignatureException;
import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey;
+/**
+ * @author Jan Jancar johny@neuromancer.sk
+ */
public class SignatureTestable extends BaseTestable {
private Signature sig;
private ECPrivateKey signKey;
diff --git a/src/cz/crcs/ectester/standalone/test/StandaloneDefaultSuite.java b/src/cz/crcs/ectester/standalone/test/StandaloneDefaultSuite.java
index 42d2e54..572449a 100644
--- a/src/cz/crcs/ectester/standalone/test/StandaloneDefaultSuite.java
+++ b/src/cz/crcs/ectester/standalone/test/StandaloneDefaultSuite.java
@@ -9,6 +9,7 @@ import cz.crcs.ectester.standalone.ECTesterStandalone;
import cz.crcs.ectester.standalone.consts.KeyAgreementIdent;
import cz.crcs.ectester.standalone.consts.KeyPairGeneratorIdent;
import cz.crcs.ectester.standalone.consts.SignatureIdent;
+import cz.crcs.ectester.standalone.libs.ECLibrary;
import javax.crypto.KeyAgreement;
import java.security.KeyPairGenerator;
diff --git a/src/cz/crcs/ectester/standalone/test/StandaloneTestSuite.java b/src/cz/crcs/ectester/standalone/test/StandaloneTestSuite.java
index ad404c8..2949d52 100644
--- a/src/cz/crcs/ectester/standalone/test/StandaloneTestSuite.java
+++ b/src/cz/crcs/ectester/standalone/test/StandaloneTestSuite.java
@@ -3,10 +3,8 @@ package cz.crcs.ectester.standalone.test;
import cz.crcs.ectester.common.cli.TreeCommandLine;
import cz.crcs.ectester.common.output.TestWriter;
import cz.crcs.ectester.common.test.TestSuite;
-import cz.crcs.ectester.data.EC_Store;
import cz.crcs.ectester.standalone.ECTesterStandalone;
-
-import java.security.NoSuchAlgorithmException;
+import cz.crcs.ectester.standalone.libs.ProviderECLibrary;
/**
* @author Jan Jancar johny@neuromancer.sk
@@ -20,4 +18,8 @@ public abstract class StandaloneTestSuite extends TestSuite {
this.cfg = cfg;
this.cli = cli;
}
+
+ public ProviderECLibrary getLibrary() {
+ return cfg.selected;
+ }
}