summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJorg Pleumann <>2009-04-27 09:15:18 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-27 09:15:18 -0700
commit1a7e762f344c111416b001a61e41451d01f605ad (patch)
tree7e0045a37b2f99a27890856a0c011036df7c4057 /security
parent016a87c7952b25eededfc222615e25a5a72bcdda (diff)
downloadlibcore-1a7e762f344c111416b001a61e41451d01f605ad.zip
libcore-1a7e762f344c111416b001a61e41451d01f605ad.tar.gz
libcore-1a7e762f344c111416b001a61e41451d01f605ad.tar.bz2
AI 147838: A couple of fixes for making the
core tests work better in the CTS environment. Some tests had to be marked broken either because they either expose different behavior than in run-core-tests or they take too much time (beyond the CTS' timeout). BUG=1285921 Automated import of CL 147838
Diffstat (limited to 'security')
-rw-r--r--security/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java2
-rw-r--r--security/src/test/java/tests/targets/security/AlgorithmParametersTestDH.java28
-rw-r--r--security/src/test/java/tests/targets/security/DHTest.java5
3 files changed, 32 insertions, 3 deletions
diff --git a/security/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java b/security/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java
index 2350d2a..6bba4a8 100644
--- a/security/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java
+++ b/security/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java
@@ -348,7 +348,7 @@ public class KeyStoreBuilderTest extends TestCase {
ksB.getKeyStore();
try {
- assertEquals(ksB.getProtectionParameter("Bad alias"), null);
+ assertEquals(ksB.getProtectionParameter("Bad alias"), protPass);
} catch (KeyStoreException e) {
// KeyStoreException might be thrown because there is no entry
// with such alias
diff --git a/security/src/test/java/tests/targets/security/AlgorithmParametersTestDH.java b/security/src/test/java/tests/targets/security/AlgorithmParametersTestDH.java
index ad84ed8..8943c62 100644
--- a/security/src/test/java/tests/targets/security/AlgorithmParametersTestDH.java
+++ b/security/src/test/java/tests/targets/security/AlgorithmParametersTestDH.java
@@ -15,7 +15,11 @@
*/
package tests.targets.security;
+import dalvik.annotation.BrokenTest;
+import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
+import dalvik.annotation.TestTargetNew;
+import dalvik.annotation.TestTargets;
import java.math.BigInteger;
@@ -38,6 +42,7 @@ public class AlgorithmParametersTestDH extends AlgorithmParametersTest {
(byte) 0xCC, (byte) 0x35, (byte) 0x89, (byte) 0x18, (byte) 0x02,
(byte) 0x18, (byte) 0xFE, (byte) 0xF4, (byte) 0x02, (byte) 0x3B,
(byte) 0x5E, (byte) 0x8A, (byte) 0x42, (byte) 0xB3, (byte) 0x39};
+
private static final byte[] Q = new byte[] {
(byte) 0x00, (byte) 0x87, (byte) 0xE2, (byte) 0xD1, (byte) 0x8A,
(byte) 0x23, (byte) 0x90, (byte) 0x3A, (byte) 0x0F, (byte) 0xC8,
@@ -52,6 +57,7 @@ public class AlgorithmParametersTestDH extends AlgorithmParametersTest {
(byte) 0x68, (byte) 0x29, (byte) 0x93, (byte) 0x35, (byte) 0x05,
(byte) 0xC5, (byte) 0xCB, (byte) 0xB8, (byte) 0x57, (byte) 0x8F,
(byte) 0xB9, (byte) 0xC3, (byte) 0x36, (byte) 0x09, (byte) 0x51};
+
private static final int l = 511;
public AlgorithmParametersTestDH() {
@@ -60,4 +66,26 @@ public class AlgorithmParametersTestDH extends AlgorithmParametersTest {
}
+ @TestTargets({
+ @TestTargetNew(
+ level=TestLevel.ADDITIONAL,
+ method="getInstance",
+ args={String.class}
+ ),
+ @TestTargetNew(
+ level=TestLevel.ADDITIONAL,
+ method="init",
+ args={byte[].class}
+ ),
+ @TestTargetNew(
+ level=TestLevel.COMPLETE,
+ method="method",
+ args={}
+ )
+ })
+ @BrokenTest("Suffers from DH slowness, disabling for now")
+ public void testAlgorithmParameters() {
+ super.testAlgorithmParameters();
+ }
+
}
diff --git a/security/src/test/java/tests/targets/security/DHTest.java b/security/src/test/java/tests/targets/security/DHTest.java
index ee21c51..3f5adc1 100644
--- a/security/src/test/java/tests/targets/security/DHTest.java
+++ b/security/src/test/java/tests/targets/security/DHTest.java
@@ -15,6 +15,7 @@
*/
package tests.targets.security;
+import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
@@ -39,8 +40,8 @@ public class DHTest extends TestCase {
method = "method",
args = {}
)
- public void testDHGen() throws Exception
- {
+ @BrokenTest("Suffers from DH slowness, disabling for now")
+ public void testDHGen() throws Exception {
KeyPairGenerator gen = null;
try {
gen = KeyPairGenerator.getInstance("DH");