History log of /libcore/luni/src/test/java/tests/security/cert/X509CertSelectorTest.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
97a3d514797ffddba65aaa50e352538820a52078 25-Apr-2016 Tobias Thierer <tobiast@google.com> Fix use of Object.equals() to compare arrays.

Use == for object identity, Arrays.equals() for value equality.

Bug: 28189207
Change-Id: I3dcae7f5714e5ab7216b255de376a9c3030f94b8
ea966a29384c2008c323460d9bb99bb6cfbb1a62 22-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Fix X509CertSelectorTest test

Fixed
X509CertSelector#test_addSubjectAlternativeNameLintLjava_lang_String. This
CL disables the above test for GeneralNameInterface.Name_RFC822 as the
test was disabled in the earlier Android
releases.

The test was disabled in M
https://android.googlesource.com/platform/libcore/+/bd7a7c87692d3b5be341fbc5022eaa07611ae751/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java
and was reintroduced recently after the test was enabled after some
time it wasn't run:
https://android.googlesource.com/platform/libcore/+/5ef40918006efad4c7194b505c3ad176928711a3/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java

Disabling as it's failing and wasn't being run in M anyway.

Bug: 27706589
(cherry-picked from commit 443c076d6c1e6dafdc17af03ac8205e57a10aa23)
Change-Id: I8b0cc0d8ee2bc6d5f67cd7cce9274b0018c81da1
443c076d6c1e6dafdc17af03ac8205e57a10aa23 22-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Fix X509CertSelectorTest test

Fixed
X509CertSelector#test_addSubjectAlternativeNameLintLjava_lang_String. This
CL disables the above test for GeneralNameInterface.Name_RFC822 as the
test was disabled in the earlier Android
releases.

The test was disabled in M
https://android.googlesource.com/platform/libcore/+/bd7a7c87692d3b5be341fbc5022eaa07611ae751/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java
and was reintroduced recently after the test was enabled after some
time it wasn't run:
https://android.googlesource.com/platform/libcore/+/5ef40918006efad4c7194b505c3ad176928711a3/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java

Disabling as it's failing and wasn't being run in M anyway.

Bug: 27706589
Change-Id: I8b0cc0d8ee2bc6d5f67cd7cce9274b0018c81da1
5ef40918006efad4c7194b505c3ad176928711a3 16-Feb-2016 Shubham Ajmera <shubhamajmera@google.com> Enable X509CertSelectorTest

Fix broken methods -
test_addSubjectAlternativeNameLintLjava_lang_String2,
test_addSubjectAlternativeNameLintLbyte_array2,
test_setSubjectKeyIdentifierLB$.getExtensionValue,
test_setSubjectAlternativeNamesLjava_util_Collection,
test_setPathToNamesLjava_util_Collection,
test_getSubjectAlternativeNames, test_getPathToNames,
test_addPathToNameLintLbyte_array,
test_addSubjectAlternativeNameLintLjava_lang_String,
test_addSubjectAlternativeNameLintLbyte_array. The methods were using
org.apache.harmony.security.asn1.* classes which no more exist and
instead, now use sun.security.x509.* classes.

Support for OID - 2.5.29.30, 2.5.29.37, 2.5.29.19 are removed from
test_setSubjectKeyIdentifierLB$.getExtensionValue as they
were not being used.

Bug: 26352408

Change-Id: I5d54a5b9307ff914471b0856bdc1217dd3af0511
296750b7ff5863ba5beb6120540118ca2c800ce6 25-Mar-2015 Piotr Jastrzebski <haaawk@google.com> Fix X509CertSelectorTest.

According to rfc3280, when using URI as a NameConstraint it's GeneralName should not
contain schema. Details in section 4.2.1.11 of
https://www.ietf.org/rfc/rfc3280.txt

Change-Id: I69bed45508c4091a7a13e70832fe63c77df538a8
5e90575df29d220f285a363160726d402d056b4f 25-Mar-2015 Piotr Jastrzebski <haaawk@google.com> Fix X509CertSelectorTest.

RI doesn't throw exception for following OIDs: "0.20", "1.25", "2.39".
According to documentation here:
http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509CertSelector.html#setSubjectPublicKeyAlgID(java.lang.String)
OID is invalid if first component is different than 0, 1 or 2 or
second component is bigger than 39.

Change-Id: Ib57142c86e6ac131b0e713a11e276715eae10911
beee0a569bf1077f0d3be516fed63661fcedde5c 21-Dec-2012 Brian Carlstrom <bdc@google.com> Fix X509Certificate.getBasicConstraints implementation for DRLCertFactory

Change-Id: I5d1ba078b0f8f9ec8e2950e0da02481e8162a5e6
bd7a7c87692d3b5be341fbc5022eaa07611ae751 05-Oct-2011 Brian Carlstrom <bdc@google.com> Update test now that DNS names starting with a digit are allowed

In change:
commit 2f9e468ed4985edfd5e351faf2089d91e561e41d
Author: Elliott Hughes <enh@google.com>
Date: Fri Oct 9 17:21:46 2009 -0700

Update libcore/security to Harmony r823222.

GeneralName.checkDNS was updated to support RFC 1123 (section 2.1)
which allows DNS names to start with a digit. This updates the test to
track that change by changing the negative test input for parsing DNS
names to not start with a '0'.

Bug: 5411722
Change-Id: Ie037e6d54e3e2c8b603af455ccde31c4558f070f
229e34b182b98e1dba15d3dc6341954986ae2b7a 03-Mar-2011 Brian Carlstrom <bdc@google.com> Removing use of @tests and @Test.* annotations

Change-Id: I89243efdeebe22543c45a2166b634f40c3e78cf8
595db69d9b219f3d2d4598b5cb57c116cd157918 25-Jan-2011 Jesse Wilson <jessewilson@google.com> Rollback an inadvertent API change to X509CertSelector.

Change-Id: I4ae0a881502c8240b952ca4bf574997b1a610b95
5c27fb80ffd335aa45dc8829ba3ecbc18c01e4e8 25-Jan-2011 Jesse Wilson <jessewilson@google.com> Use generics in Harmony's ASN.1, X.501 and X.509.

This change cleans up this code and uses modern Java idioms. It should not
change the behavior.

Change-Id: Ie869ced7c9e18634409ae194aa9a2c2a5e5ca530
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