From 7a5154ca243b6f65f83b3ea14d3dac5510ca15e1 Mon Sep 17 00:00:00 2001 From: tkellner Date: Tue, 11 Mar 2014 23:34:29 +0000 Subject: 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 --- smcc/src/test/java/at/gv/egiz/smcc/CardEmul.java | 2 +- .../src/test/java/at/gv/egiz/smcc/test/AbstractCardTest.java | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'smcc/src/test/java') 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(); } } -- cgit v1.2.3