forked from I2P_Developers/i2p.i2p
fix router identity test broken by previous checkin
This commit is contained in:
@ -151,11 +151,23 @@ public class KeysAndCert extends DataStructureImpl {
|
|||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Throws IllegalStateException if keys and cert are not initialized,
|
||||||
|
* as of 0.9.12. Prior to that, returned null.
|
||||||
|
*
|
||||||
|
* @throws IllegalStateException
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Hash calculateHash() {
|
public Hash calculateHash() {
|
||||||
return getHash();
|
return getHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Throws IllegalStateException if keys and cert are not initialized,
|
||||||
|
* as of 0.9.12. Prior to that, returned null.
|
||||||
|
*
|
||||||
|
* @throws IllegalStateException
|
||||||
|
*/
|
||||||
public Hash getHash() {
|
public Hash getHash() {
|
||||||
if (__calculatedHash != null)
|
if (__calculatedHash != null)
|
||||||
return __calculatedHash;
|
return __calculatedHash;
|
||||||
|
@ -103,7 +103,13 @@ public class RouterIdentityTest extends StructureTest {
|
|||||||
|
|
||||||
public void testBadHash() throws Exception {
|
public void testBadHash() throws Exception {
|
||||||
RouterIdentity ident = new RouterIdentity();
|
RouterIdentity ident = new RouterIdentity();
|
||||||
|
boolean error = false;
|
||||||
|
try {
|
||||||
ident.getHash();
|
ident.getHash();
|
||||||
|
} catch (IllegalStateException ise) {
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
assertTrue(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user