From 6278dcdeafadc55fe1a57eec42a0807874377f62 Mon Sep 17 00:00:00 2001 From: Andy Stadler Date: Wed, 22 Sep 2010 12:06:41 -0700 Subject: [PATCH] Fix test failures Methods were used by tests only and being stripped by PG. Bug: 2894378 Change-Id: Ieb1dd0daa8bd380c66a7b1e6151c5e5b22cbe38c --- src/com/android/email/SecurityPolicy.java | 10 ++++----- .../android/email/SecurityPolicyTests.java | 4 ++-- .../adapter/ProvisionParserTests.java | 22 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/com/android/email/SecurityPolicy.java b/src/com/android/email/SecurityPolicy.java index 35613ece0..aee269335 100644 --- a/src/com/android/email/SecurityPolicy.java +++ b/src/com/android/email/SecurityPolicy.java @@ -422,23 +422,23 @@ public class SecurityPolicy { /*package*/ final int mMaxScreenLockTime; /*package*/ final boolean mRequireRemoteWipe; - public int getMinPasswordLength() { + public int getMinPasswordLengthForTest() { return mMinPasswordLength; } - public int getPasswordMode() { + public int getPasswordModeForTest() { return mPasswordMode; } - public int getMaxPasswordFails() { + public int getMaxPasswordFailsForTest() { return mMaxPasswordFails; } - public int getMaxScreenLockTime() { + public int getMaxScreenLockTimeForTest() { return mMaxScreenLockTime; } - public boolean isRequireRemoteWipe() { + public boolean isRequireRemoteWipeForTest() { return mRequireRemoteWipe; } diff --git a/tests/src/com/android/email/SecurityPolicyTests.java b/tests/src/com/android/email/SecurityPolicyTests.java index 5924bceba..b24522053 100644 --- a/tests/src/com/android/email/SecurityPolicyTests.java +++ b/tests/src/com/android/email/SecurityPolicyTests.java @@ -106,10 +106,10 @@ public class SecurityPolicyTests extends ProviderTestCase2 { } PolicySet ps = new PolicySet(0, PolicySet.PASSWORD_MODE_SIMPLE, 0, PolicySet.SCREEN_LOCK_TIME_MAX + 1, false); - assertEquals(PolicySet.SCREEN_LOCK_TIME_MAX, ps.getMaxScreenLockTime()); + assertEquals(PolicySet.SCREEN_LOCK_TIME_MAX, ps.getMaxScreenLockTimeForTest()); ps = new PolicySet(0, PolicySet.PASSWORD_MODE_SIMPLE, PolicySet.PASSWORD_MAX_FAILS_MAX + 1, 0, false); - assertEquals(PolicySet.PASSWORD_MAX_FAILS_MAX, ps.getMaxPasswordFails()); + assertEquals(PolicySet.PASSWORD_MAX_FAILS_MAX, ps.getMaxPasswordFailsForTest()); // All password related fields should be zero when password mode is NONE // Illegal values for these fields should be ignored ps = new PolicySet(999/*length*/, PolicySet.PASSWORD_MODE_NONE, diff --git a/tests/src/com/android/exchange/adapter/ProvisionParserTests.java b/tests/src/com/android/exchange/adapter/ProvisionParserTests.java index 842e4b659..e69d12506 100644 --- a/tests/src/com/android/exchange/adapter/ProvisionParserTests.java +++ b/tests/src/com/android/exchange/adapter/ProvisionParserTests.java @@ -113,11 +113,11 @@ public class ProvisionParserTests extends SyncAdapterTestCase { PolicySet ps = parser.getPolicySet(); assertNotNull(ps); // Check the settings to make sure they were parsed correctly - assertEquals(5*60, ps.getMaxScreenLockTime()); // Screen lock time is in seconds - assertEquals(8, ps.getMinPasswordLength()); - assertEquals(PolicySet.PASSWORD_MODE_STRONG, ps.getPasswordMode()); - assertEquals(20, ps.getMaxPasswordFails()); - assertTrue(ps.isRequireRemoteWipe()); + assertEquals(5*60, ps.getMaxScreenLockTimeForTest()); // Screen lock time is in seconds + assertEquals(8, ps.getMinPasswordLengthForTest()); + assertEquals(PolicySet.PASSWORD_MODE_STRONG, ps.getPasswordModeForTest()); + assertEquals(20, ps.getMaxPasswordFailsForTest()); + assertTrue(ps.isRequireRemoteWipeForTest()); } public void testWapProvisionParser2() throws IOException { @@ -126,7 +126,7 @@ public class ProvisionParserTests extends SyncAdapterTestCase { PolicySet ps = parser.getPolicySet(); assertNotNull(ps); // Password should be set to none; others are ignored in this case. - assertEquals(PolicySet.PASSWORD_MODE_NONE, ps.getPasswordMode()); + assertEquals(PolicySet.PASSWORD_MODE_NONE, ps.getPasswordModeForTest()); } public void testWapProvisionParser3() throws IOException { @@ -135,10 +135,10 @@ public class ProvisionParserTests extends SyncAdapterTestCase { PolicySet ps = parser.getPolicySet(); assertNotNull(ps); // Password should be set to simple - assertEquals(2*60, ps.getMaxScreenLockTime()); // Screen lock time is in seconds - assertEquals(4, ps.getMinPasswordLength()); - assertEquals(PolicySet.PASSWORD_MODE_SIMPLE, ps.getPasswordMode()); - assertEquals(5, ps.getMaxPasswordFails()); - assertTrue(ps.isRequireRemoteWipe()); + assertEquals(2*60, ps.getMaxScreenLockTimeForTest()); // Screen lock time is in seconds + assertEquals(4, ps.getMinPasswordLengthForTest()); + assertEquals(PolicySet.PASSWORD_MODE_SIMPLE, ps.getPasswordModeForTest()); + assertEquals(5, ps.getMaxPasswordFailsForTest()); + assertTrue(ps.isRequireRemoteWipeForTest()); } }