|
[
Permlink
| « Hide
]
Hoi Lam added a comment - 03/Mar/05 06:39 AM
The member "format" has been added to the ControlMemberTypes.Date annotation. Users can use it to specify the date format they want to use.
I see the folloowing error when running "ant build" from trunk/controls/test:
[apt] D:\beehive\controls\test\src\units\org\apache\beehive\controls\test\java\property\Member TypeTest.java:67: A value assigned to a control property does not satisfy its constraints. Cause: Va lue assigned to a date property is not in the specified format. [apt] private PersonControlBean thisPerson; Repro: 1. Copy the attached PersonControl.java into trunk\controls\test\src\controls\org\apache\beehive\controls\test\controls\property\constraint; 2. Copy the attached MemberTypeTest.java into trunk\controls\test\src\units\org\apache\beehive\controls\test\java\property 3. from trunk\controls\test, run "ant build" Update the java test to overwrite the previous one.
Update PersonControl.java to overwrite the previous one.
OK, JIRA doesn't allow me to delete previously attached, nor overwriting.
Please ignore the PersonControl.java and MemberTypeTest.java attached at 17/Jun/05 07:19 PM. You could find the time of attached by clicking "Manage Attachment". The issue here was that the maxValue constraint for the AnnotationMemberTypes.Date annotation was not in the proper date format. minValue and maxValue must be in the format specified by the format attribute.
I have resolved this issue by added more detailed error messages, which explain which date was not in the right format. The resolution is part of the patch for The above issue failed b/c the maxValue was set to an improper format. Set it to "Sun, Jul 4, '04", for example, and the code will work.
!!The error message is erroneous though!! - even though the maxValue is wrong, it prints out the value set in the client, for the above code the error is: Cause: The value, Wed, Jul 4, '01, assigned to maxValue date constraint property is not in the specified format of: EEE, MMM d, ''yy Where the value - Wed, Jul 4, '01 - is not the maxValue (and not the problem), but it is instead the value being sent by the client. Verified fixed using local beehive build synced to SVN 393036 by running the test case: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/src/units/org/apache/beehive/controls/test/java/property/MemberTypeTest.java This bug can be closed, though I think the error message should be changed. It appears the error message is incorrect, I'll take another look at this one.
Chad, this is a simple patch that changes the value displayed in the error messages for AnnotationMemberTypes.Date maxValue and minValue constraint violations. It seemed to be a simple change so I thought I would take a crack at it. Can you take a second to review the diff and submit it to svn if you find it useful?
Thanks, --Andrew When I use the test attached by James against the attached patch the new error message is...
[apt] /dev/svn/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/MemberTypeTest.java:69: A value assigned to a control property does not satisfy its constraints. Cause: The value, 2007/01/31, assigned to maxValue date constraint property is not in the specified format of: EEE, MMM d, ''yy [apt] private PersonControlBean thisPerson; [apt] ^ [apt] 1 error I believe this is the expected error for the attached version of this testcase. Patch applied svn rev 417526. Assiging to matt for verification / closure.
Verified as closed, the error now reads:
A value assigned to a control property does not satisfy its constraints. Cause: The value, Wed, Jul 4, '04, assigned to a date property is not in the specified format of: yyyy/MM/dd After changing to the proper format, code compiles. Verified with version: 417573M |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||