You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by Zhong ZHENG <he...@gmail.com> on 2005/09/13 12:07:18 UTC
Does the spec require that portlet preference values should be trimmed? A testsuite question.
Hi,
In the testsuite (in Pluto 1.1), SimplePreferenceTest, I found that in the
method checkPreferenceValidator() you are checking if preference attribute
values are trimmed strings:
protected TestResult checkPreferenceValidator(PortletRequest req) {
... ...
try {
preferences.setValue("VALIDATION_TEST_KEY", " Spaces removed by trim ");
preferences.store(); // Validation failed in the store() method: value not
trimmed.
}
catch ... ...
}
That check failed everytime the validator is called: attribute values are
not trimmed by PortletPreferencesImpl. I checked the portlet spec, PLT. 14,
but I didn't find a section saying that preference attribute values should
be trimmed. So, why did you write this checking method? Is that really
required by the spec?
BTW, the validator class loading problem was resolved here:
http://issues.apache.org/jira/browse/PLUTO-159
Regards.
--
ZHENG Zhong
1 Avenue Alphand
75116 Paris, France
+33 6 76 80 45 90
heavyzheng {AT} gmail {D0T} com
http://heavyz.sourceforge.net
http://heavyz.blogspot.com
http://spaces.msn.com/members/zhengzhong
Re: Does the spec require that portlet preference values should be
trimmed? A testsuite question.
Posted by Stefan Hepper <st...@apache.org>.
This is a test to test if the validator is called as required by the spec.
Stefan
Zhong ZHENG wrote:
> Hi,
>
> In the testsuite (in Pluto 1.1), SimplePreferenceTest, I found that in
> the method checkPreferenceValidator() you are checking if preference
> attribute values are trimmed strings:
>
> protected TestResult checkPreferenceValidator(PortletRequest req) {
> ... ...
> try {
> preferences.setValue("VALIDATION_TEST_KEY", " Spaces
> removed by trim ");
> preferences.store(); // Validation failed in the store()
> method: value not trimmed.
> }
> catch ... ...
> }
>
> That check failed everytime the validator is called: attribute values
> are not trimmed by PortletPreferencesImpl. I checked the portlet spec,
> PLT. 14, but I didn't find a section saying that preference attribute
> values should be trimmed. So, why did you write this checking method?
> Is that really required by the spec?
>
> BTW, the validator class loading problem was resolved here:
> http://issues.apache.org/jira/browse/PLUTO-159
>
>
> Regards.
>
> --
>
> ZHENG Zhong
>
> 1 Avenue Alphand
> 75116 Paris, France
> +33 6 76 80 45 90
>
> heavyzheng {AT} gmail {D0T} com
>
> http://heavyz.sourceforge.net
> http://heavyz.blogspot.com
> http://spaces.msn.com/members/zhengzhong
>
>
Re: Does the spec require that portlet preference values should be trimmed? A testsuite question.
Posted by Zhong ZHENG <he...@gmail.com>.
Sorry, I made a stupid mistake:
SimplePreferenceTest.checkPreferencesValidator() just tests if validator is
called and ValidationException is caught...
Just forget this mail... Next time I will be more careful when reading code.
2005/9/13, Zhong ZHENG <he...@gmail.com>:
>
> Hi,
>
> In the testsuite (in Pluto 1.1), SimplePreferenceTest, I found that in the
> method checkPreferenceValidator() you are checking if preference attribute
> values are trimmed strings:
>
> protected TestResult checkPreferenceValidator(PortletRequest req) {
> ... ...
> try {
> preferences.setValue("VALIDATION_TEST_KEY", " Spaces removed by trim ");
> preferences.store(); // Validation failed in the store() method: value
> not trimmed.
> }
> catch ... ...
> }
>
> That check failed everytime the validator is called: attribute values are
> not trimmed by PortletPreferencesImpl. I checked the portlet spec, PLT.
> 14, but I didn't find a section saying that preference attribute values
> should be trimmed. So, why did you write this checking method? Is that
> really required by the spec?
>
> BTW, the validator class loading problem was resolved here:
> http://issues.apache.org/jira/browse/PLUTO-159
>
>
> Regards.
>
> --
>
> ZHENG Zhong
>
> 1 Avenue Alphand
> 75116 Paris, France
> +33 6 76 80 45 90
>
> heavyzheng {AT} gmail {D0T} com
>
> http://heavyz.sourceforge.net
> http://heavyz.blogspot.com
> http://spaces.msn.com/members/zhengzhong
>
>
>
--
ZHENG Zhong
1 Avenue Alphand
75116 Paris, France
+33 6 76 80 45 90
heavyzheng {AT} gmail {D0T} com
http://heavyz.sourceforge.net
http://heavyz.blogspot.com
http://spaces.msn.com/members/zhengzhong