From 80e09bd05e69c2517fbb7a1573bdd6f515a36fc8 Mon Sep 17 00:00:00 2001 From: Art O Cathain Date: Sun, 29 Jun 2014 12:18:16 +0100 Subject: work in progress --- .../src/test/java/tests/UncachedKeyringTest.java | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 OpenKeychain/src/test/java/tests/UncachedKeyringTest.java (limited to 'OpenKeychain/src/test') diff --git a/OpenKeychain/src/test/java/tests/UncachedKeyringTest.java b/OpenKeychain/src/test/java/tests/UncachedKeyringTest.java new file mode 100644 index 000000000..05a9c23ef --- /dev/null +++ b/OpenKeychain/src/test/java/tests/UncachedKeyringTest.java @@ -0,0 +1,37 @@ +package tests; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.*; +import org.sufficientlysecure.keychain.pgp.UncachedKeyRing; +import org.sufficientlysecure.keychain.testsupport.*; +import org.sufficientlysecure.keychain.testsupport.KeyringBuilder; +import org.sufficientlysecure.keychain.testsupport.TestDataUtil; + +@RunWith(RobolectricTestRunner.class) +@org.robolectric.annotation.Config(emulateSdk = 18) // Robolectric doesn't yet support 19 +public class UncachedKeyringTest { + + @Test + public void testVerifySuccess() throws Exception { + UncachedKeyRing expectedKeyRing = KeyringBuilder.ring2(); +// Uncomment to prove it's working - the createdDate will then be different +// Thread.sleep(1500); + UncachedKeyRing inputKeyRing = KeyringBuilder.ring1(); + new UncachedKeyringTestingHelper().doTestCanonicalize( + inputKeyRing, expectedKeyRing); + } + + /** + * Just testing my own test code. Should really be using a library for this. + */ + @Test + public void testConcat() throws Exception { + byte[] actual = TestDataUtil.concatAll(new byte[]{1}, new byte[]{2,-2}, new byte[]{5},new byte[]{3}); + byte[] expected = new byte[]{1,2,-2,5,3}; + Assert.assertEquals(java.util.Arrays.toString(expected), java.util.Arrays.toString(actual)); + } + + +} -- cgit v1.2.3