Hi Rhett,

Thanks for the pointer. Actually I wanted to reuse a static Java member, so I 
relied on the FieldRetrievingFactoryBean class:

        <bean id="server" class="org.restlet.ext.spring.SpringServer">
                <constructor-arg value="http" />
                <constructor-arg>
                        <bean id="org.restlet.test.RestletTestSuite.PORT"
                                
class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean" />
                </constructor-arg>

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : Rhett Sutphin [mailto:rh...@detailedbalance.net] 
Envoye : mercredi 14 janvier 2009 22:31
A : discuss@restlet.tigris.org
Objet : Re: Patch to parameterize port numbers in JUnit tests

> For Spring it should be possible to inject the static value into the  
> bean property. I don't remember the exact syntax, but we can
> figure this out.

You can configure a PropertyPlaceholderConfigurer into the application  
context:

http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html

It resolves placeholders from either system properties or a configured  
property file / inline list.

Rhett

On Jan 14, 2009, at 1:59 PM, Jerome Louvel wrote:

> Hi Raif,
>
> That sounds like a useful thing to do. I was trying to apply the  
> patch but got issues with the paths of the patched files.
>
> Could you try to use SVN instead to generate it, starting at the  
> root of the SVN trunk instead?
>
> For Spring it should be possible to inject the static value into the  
> bean property. I don't remember the exact syntax, but we can
> figure this out. Any Spring wizard listening?
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
> -----Message d'origine-----
> De : Raif S. Naffah [mailto:tig...@naffah-raif.name]
> Envoye : samedi 10 janvier 2009 07:48
> A : discuss@restlet.tigris.org
> Objet : Patch to parameterize port numbers in JUnit tests
>
> hello there,
>
> the JUnit tests (in org.restlet.test) have hard-wired port numbers  
> which may
> not suit every developer's environment.  this patch introduces a new
> property in the main build.xml, and injects at as a system environment
> variable.
>
> when more than one port is required, the property value is used as a  
> base;
> i.e. second port number is valueOf(property) + 1, etc.
>
> the only test i was not able to parametrize was the Spring test (and  
> its
> .xml file).
>
>
> cheers;
> rsn
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1024775

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1024919

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1028854

Reply via email to