diff --git a/core/java/test/net/i2p/data/PrivateKeyTest.java b/core/java/test/net/i2p/data/PrivateKeyTest.java index cb3c3124d..9d25fb449 100644 --- a/core/java/test/net/i2p/data/PrivateKeyTest.java +++ b/core/java/test/net/i2p/data/PrivateKeyTest.java @@ -66,13 +66,15 @@ public class PrivateKeyTest extends StructureTest { byte data[] = new byte[56]; for (int i = 0; i < data.length; i++) data[i] = (byte)(i); - privateKey.setData(data); boolean error = false; try{ + privateKey.setData(data); privateKey.writeBytes(new ByteArrayOutputStream()); }catch(DataFormatException dfe){ error = true; + }catch(IllegalArgumentException exc) { + error = true; } assertTrue(error); } diff --git a/core/java/test/net/i2p/data/PublicKeyTest.java b/core/java/test/net/i2p/data/PublicKeyTest.java index 8ca6282cc..8fed332bd 100644 --- a/core/java/test/net/i2p/data/PublicKeyTest.java +++ b/core/java/test/net/i2p/data/PublicKeyTest.java @@ -66,13 +66,15 @@ public class PublicKeyTest extends StructureTest { byte data[] = new byte[56]; for (int i = 0; i < data.length; i++) data[i] = (byte)(i); - publicKey.setData(data); boolean error = false; try{ + publicKey.setData(data); publicKey.writeBytes(new ByteArrayOutputStream()); }catch(DataFormatException dfe){ error = true; + }catch(IllegalArgumentException exc) { + error = true; } assertTrue(error); } diff --git a/core/java/test/net/i2p/data/SigningPrivateKeyTest.java b/core/java/test/net/i2p/data/SigningPrivateKeyTest.java index bafc3bdac..baa038812 100644 --- a/core/java/test/net/i2p/data/SigningPrivateKeyTest.java +++ b/core/java/test/net/i2p/data/SigningPrivateKeyTest.java @@ -66,13 +66,15 @@ public class SigningPrivateKeyTest extends StructureTest { byte data[] = new byte[56]; for (int i = 0; i < data.length; i++) data[i] = (byte)(i); - signingPrivateKey.setData(data); boolean error = false; try{ + signingPrivateKey.setData(data); signingPrivateKey.writeBytes(new ByteArrayOutputStream()); }catch(DataFormatException dfe){ error = true; + }catch(IllegalArgumentException exc) { + error = true; } assertTrue(error); } diff --git a/core/java/test/net/i2p/data/SigningPublicKeyTest.java b/core/java/test/net/i2p/data/SigningPublicKeyTest.java index f976e53da..b97099e6e 100644 --- a/core/java/test/net/i2p/data/SigningPublicKeyTest.java +++ b/core/java/test/net/i2p/data/SigningPublicKeyTest.java @@ -66,14 +66,17 @@ public class SigningPublicKeyTest extends StructureTest { byte data[] = new byte[56]; for (int i = 0; i < data.length; i++) data[i] = (byte)(i); - publicKey.setData(data); boolean error = false; try{ + publicKey.setData(data); publicKey.writeBytes(new ByteArrayOutputStream()); }catch(DataFormatException dfe){ error = true; + }catch(IllegalArgumentException exc) { + error = true; } + assertTrue(error); }