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

matthew_swift
01.15.2007 d5a18a324ec87740429780265702686837b09a6a
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
commitd5a18a324ec87740429780265702686837b09a6a
tree d6ce3922e1ccccbf180bb0cc22eef3cebdc501a7 tree | zip | gz
parent 8b8e0f00c34b958048ee32e26c6b052f78f379c3 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
opendj-sdk/opends/src/server/org/opends/server/admin/DurationPropertyDefinition.java 43 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/DurationUnit.java 233 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/DurationPropertyDefinitionTest.java 12 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/DurationUnitTest.java 39 ●●●●● diff | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/PasswordPolicyTestCase.java 136 ●●●● diff | view | raw | blame | history