summaryrefslogtreecommitdiff
path: root/smcc/src/test
diff options
context:
space:
mode:
authortkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2014-03-11 23:34:29 +0000
committertkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2014-03-11 23:34:29 +0000
commit7a5154ca243b6f65f83b3ea14d3dac5510ca15e1 (patch)
tree6949653b8fad67ad84b355cf78ebdc538d55c032 /smcc/src/test
parent3f54fc75c3cf1910d8e62903e099ac645e7c80d8 (diff)
downloadmocca-7a5154ca243b6f65f83b3ea14d3dac5510ca15e1.tar.gz
mocca-7a5154ca243b6f65f83b3ea14d3dac5510ca15e1.tar.bz2
mocca-7a5154ca243b6f65f83b3ea14d3dac5510ca15e1.zip
Concurrent card access tests work now due to recent changes
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1308 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smcc/src/test')
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/CardEmul.java2
-rw-r--r--smcc/src/test/java/at/gv/egiz/smcc/test/AbstractCardTest.java12
2 files changed, 5 insertions, 9 deletions
diff --git a/smcc/src/test/java/at/gv/egiz/smcc/CardEmul.java b/smcc/src/test/java/at/gv/egiz/smcc/CardEmul.java
index ac964471..5d78871e 100644
--- a/smcc/src/test/java/at/gv/egiz/smcc/CardEmul.java
+++ b/smcc/src/test/java/at/gv/egiz/smcc/CardEmul.java
@@ -86,7 +86,7 @@ public class CardEmul extends Card {
if (exclThread == Thread.currentThread()) {
exclThread = null;
} else if (exclThread == null) {
- throw new CardException("Exclusive access has not been assigned.");
+ throw new IllegalStateException("Exclusive access has not been assigned.");
} else {
throw new CardException(
"Exclusive access has not been assigned to current thread.");
diff --git a/smcc/src/test/java/at/gv/egiz/smcc/test/AbstractCardTest.java b/smcc/src/test/java/at/gv/egiz/smcc/test/AbstractCardTest.java
index 28ad9090..f6faafe6 100644
--- a/smcc/src/test/java/at/gv/egiz/smcc/test/AbstractCardTest.java
+++ b/smcc/src/test/java/at/gv/egiz/smcc/test/AbstractCardTest.java
@@ -168,7 +168,7 @@ public abstract class AbstractCardTest extends AbstractCardTestBase {
}
- @Test(expected = CancelledException.class)
+ @Test
public void testSignSIGConcurrent() throws SignatureCardException,
InterruptedException, CardNotSupportedException,
NoSuchAlgorithmException, IOException {
@@ -180,10 +180,8 @@ public abstract class AbstractCardTest extends AbstractCardTestBase {
try {
signatureCard.getCertificate(KeyboxName.SECURE_SIGNATURE_KEYPAIR, null);
- assertTrue(false);
- return null;
+ return "123456".toCharArray();
} catch (SignatureCardException e) {
- // expected
throw new CancelledException();
}
@@ -195,7 +193,7 @@ public abstract class AbstractCardTest extends AbstractCardTestBase {
}
- @Test(expected = CancelledException.class)
+ @Test
public void testSignDECConcurrent() throws SignatureCardException,
InterruptedException, CardNotSupportedException,
NoSuchAlgorithmException, IOException {
@@ -207,10 +205,8 @@ public abstract class AbstractCardTest extends AbstractCardTestBase {
try {
signatureCard.getCertificate(KeyboxName.CERTIFIED_KEYPAIR, null);
- assertTrue(false);
- return null;
+ return "1234".toCharArray();
} catch (SignatureCardException e) {
- // expected
throw new CancelledException();
}
}