tests: fix createkey test

This commit is contained in:
Vincent Breitmoser 2014-07-09 17:41:01 +02:00
parent a9c3d6b507
commit 09529bc47e

View File

@ -27,6 +27,7 @@ public class UncachedKeyringTest {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
// show Log.x messages in system.out
ShadowLog.stream = System.out; ShadowLog.stream = System.out;
} }
@ -46,13 +47,11 @@ public class UncachedKeyringTest {
UncachedKeyRing ring = op.createSecretKeyRing(parcel, log, 0); UncachedKeyRing ring = op.createSecretKeyRing(parcel, log, 0);
if (ring == null) { if (ring == null) {
log.print(activity); throw new AssertionError("key creation failed");
throw new AssertionError("oh no");
} }
if (!"swagerinho".equals(ring.getMasterKeyId())) { if (!"swagerinho".equals(ring.getPublicKey().getPrimaryUserId())) {
log.print(activity); throw new AssertionError("incorrect primary user id");
throw new AssertionError("oh noo");
} }
} }
@ -66,7 +65,7 @@ public class UncachedKeyringTest {
UncachedKeyRing canonicalizedRing = inputKeyRing.canonicalize(log, 0); UncachedKeyRing canonicalizedRing = inputKeyRing.canonicalize(log, 0);
if (canonicalizedRing == null) { if (canonicalizedRing == null) {
throw new AssertionError("Canonicalization failed; messages: [" + log.toString() + "]"); throw new AssertionError("Canonicalization failed; messages: [" + log + "]");
} }
HashSet onlyA = new HashSet<KeyringTestingHelper.Packet>(); HashSet onlyA = new HashSet<KeyringTestingHelper.Packet>();