mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
01.15.2007 1430252326f696bd85ad4fa681323e725843bca4
refs
author matthew_swift <matthew_swift@localhost>
Friday, June 1, 2007 19:15 +0200
committer matthew_swift <matthew_swift@localhost>
Friday, June 1, 2007 19:15 +0200
commit1430252326f696bd85ad4fa681323e725843bca4
tree 78554041b6ff893c647222d1ca0a7685ac42c738 tree | zip | gz
parent e03d059778fdaafdfa77b97c14d1696d3e4142bf view | diff
Modify the DurationPropertyDefinition and DurationUnit classes so that they have more user-friendly encode/decode methods:

* the DurationPropertyDefinition encoder is unchanged: it uses the base property's base unit
* the DurationPropertyDefinition decoder now supports a mixed format in addition to the old format: now users can specify durations using a mixture of units such as 1h30m instead of 90m (both are permitted)
* the DurationUnit class has a toString(long) method which applications can use to get the above mixed unit representation (e.g. CLI)

The unit tests are updated. During the precommit the password policy test cases failed because they were testing some invalid durations which were not being checked in the DurationPropertyDefinition test suite. I've put these missing test cases in the DurationPropertyDefinition test suite. In addition, I've numbered the PWP test data entries so that they are easier to debug in future.
5 files modified
463 ■■■■■ changed files
opends/src/server/org/opends/server/admin/DurationPropertyDefinition.java 43 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/DurationUnit.java 233 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/DurationPropertyDefinitionTest.java 12 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/DurationUnitTest.java 39 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/core/PasswordPolicyTestCase.java 136 ●●●● diff | view | raw | blame | history