diff options
Diffstat (limited to 'luni/src/test/java/tests/security/cert/CertificateFactory4Test.java')
-rw-r--r-- | luni/src/test/java/tests/security/cert/CertificateFactory4Test.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java index 060a4a2ffa2..18fe0c4e6fd 100644 --- a/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java +++ b/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java @@ -19,6 +19,8 @@ package tests.security.cert; import junit.framework.TestCase; +import dalvik.system.VMRuntime; +import sun.security.jca.Providers; import tests.support.resource.Support_Resources; import tests.support.Support_GetResource; @@ -40,6 +42,22 @@ import java.util.List; public class CertificateFactory4Test extends TestCase { + // Allow access to deprecated BC algorithms in this test, so we can ensure they + // continue to work + @Override + public void setUp() throws Exception { + super.setUp(); + Providers.setMaximumAllowableApiLevelForBcDeprecation( + VMRuntime.getRuntime().getTargetSdkVersion()); + } + + @Override + public void tearDown() throws Exception { + Providers.setMaximumAllowableApiLevelForBcDeprecation( + Providers.DEFAULT_MAXIMUM_ALLOWABLE_TARGET_API_LEVEL_FOR_BC_DEPRECATION); + super.tearDown(); + } + private static final String BASE_URL = Support_GetResource .getResourceURL("/../internalres/"); |