History log of /libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore2Test.java
Revision Date Author Comments
d4b7449574ca69c713a3f2230cb77c68ee642700 06-Sep-2016 Tobias Thierer <tobiast@google.com> Fix 58 libcore tests that caught "expected" Exceptions but didn't fail()

There were no changes to code under test.

4 tests were fixed to not tolerate an Exception:
- libcore.java.util.CollectionsTest#test_CheckedMap_computeIfAbsent
In the case where a Map key is present, computeIfAbsent() should
not invoke the Function, so there is no return value that could
be expected to undergo a type check. The test was changed to
verify that the Function is not invoked.
- libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_sort and
libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_subList_sort
were sorting an already-sorted non-null list that contains no null
values. That logic was redundant and wouldn't have thrown.
- org.apache.harmony.security.tests.java.security.KeyStoreSpiTest#test_engineEntryInstanceOf
(the KeyStoreSpi documentation does not mention whether NPE is thrown;
the implementation comes from upstream and does not throw it).

54 tests were fixed by adding the missing
fail();
No attempt was made to make this failure message specific to the
exception that was expected.

Tests that weren't changed:

- SSLEngineTest.test_wrap_ByteBuffer_ByteBuffer_04() requires
investigation to determine the correct resolution.
A comment was added to the test linking to the corresponding bug.

- ThreadTest#testParkUntilWithUnderflowValue() and
OldNodeChangeEventTest.waitForEvent() were not touched since
it was not clear whether that it was relevent to the test whether
or not the exception was thrown.

- two cases in Files2Test#test_setPosixFilePermissions_NPE() are
left to a future CL

Test:
(croot; make vogar core-tests) \
&& git diff aosp/master --name-only | xargs vogar `cparg core-tests`

Change-Id: I1cd3220a06e331ff049b146b393f78879f07211a
56f51ec72d6bd9d4729e6bf85ef15b8c750e9f35 21-Aug-2012 Brian Carlstrom <bdc@google.com> Updating KeyStore2Test to track change in behavior of KeyStoreSpi.engineSetEntry

Whether the KeyStore.setEntry call throws with an null
ProtectionParameter depends on the KeyStore algorithm.

commit d951031b428eb2885dca51e0484d5d29e0caad44
Author: Brian Carlstrom <bdc@google.com>
Date: Fri Aug 17 17:23:24 2012 -0700

KeyStoreSpi.engineSetEntry should allow null ProtectionParameter

Change-Id: Ibf5be502a70a63abccb6e45dc6b6ff18b2c63ca9

Change-Id: I5df8d577acb8c5e30e20c4606b2a1e8e6b5de0b9
2708f771574cabf703557439843b02d3c5138c86 08-Jun-2011 Brian Carlstrom <bdc@google.com> Test fixes validated on RI and device

Change-Id: I14290efc322406920b2de65924155ef18ee56bab
003f7a4d100cd1527d94bac81a4a3c5a8216c6ee 04-Jun-2011 Brian Carlstrom <bdc@google.com> Make test initialization lazy

Bug: 4311645

Change-Id: I4280d7ddb2a78f0e33564f3b40cfeb5c671e134a
a97292b97350cf4a96d8e94d15de6913708cad6b 16-Sep-2010 Brian Carlstrom <bdc@google.com> Fix KeyStore2Test

Specifically addressing failures in:
- test_getCertificateChainLjava_lang_String
- test_getCertificateLjava_lang_String
- test_setCertificateEntryLjava_lang_StringLjava_security_cert_Certificate

This test tried to be sophisticated by not comparing the certificates
returned from the KeyStore, but their public keys instead, presumably
because it might be okay if a "equals" but not "==" cert is
returned. Of course, then you shouldn't assume that the PublicKeys
will be ==, which the test did. In the RI it turns out that == was
fine. However, in BouncyCastle, the certs were ==, but the PublicKeys
were not, which each call returning a unique instance, causing test
failures.

Test test was also cleaned up to run on RI in addition to dalvik, as
well as to improve the style of the test by more use of assertEquals,
not just in the places were it was required, as well as breaking
complex assertTrue statements into simpler parts.

Bug: 2997410

Change-Id: I50da35c7878c260dddacd67ed78b9d18ae96a41e
e32b21f14d52bac429a9c54fe031f9e92c911d64 18-Jun-2010 Jesse Wilson <jessewilson@google.com> Implementing ZoneInfo.hasSameRules().

Moving TimeZoneTest to OldTimeZoneTest and removing test methods
that are duplicated between libcore and Harmony.

Also adding Objects.equals() to make implementing this easy,
and removing redundant time zone tests. I did a few searches
to find candidate code that could take advantage of this new
utility method and adopted it there.

Change-Id: I133298f1b36d755bd35c1ad0dc0ab366fd164270
f33eae7e84eb6d3b0f4e86b59605bb3de73009f3 13-May-2010 Elliott Hughes <enh@google.com> Remove all trailing whitespace from the dalvik team-maintained parts of libcore.

Gentlemen, you may now set your editors to "strip trailing whitespace"...

Change-Id: I85b2f6c80e5fbef1af6cab11789790b078c11b1b
cec4dd4b1d33f78997603d0f89c0d0e56e64dbcd 26-Apr-2010 Peter Hallam <peterhal@google.com> merge more modules into luni