Merge "Fix test failures" into gingerbread

This commit is contained in:
Andy Stadler 2010-09-22 13:18:52 -07:00 committed by Android (Google) Code Review
commit 16657c9c20
3 changed files with 18 additions and 18 deletions

View File

@ -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;
}

View File

@ -106,10 +106,10 @@ public class SecurityPolicyTests extends ProviderTestCase2<EmailProvider> {
}
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,

View File

@ -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());
}
}