[Building Sakai] JMock

Adrian Fish a.fish at lancaster.ac.uk
Tue Aug 18 07:30:47 PDT 2009


Hi All,

I'm having problems with test failures on an email patch for K1. I'm 
basically trying to call serverConfigurationService.getString by the two 
parameter version and it fails with an unexpected invocation error. I've 
tried to modify the test but I don't know how to avoid using the 
getString(String, null) version.

This works ...

allowing(config).getString(BasicEmailService.JAVAX_MAIL_DEBUG_PROP_NAME, 
null);

With this code ...

String debug =
           
StringUtil.trimToNull(serverConfigurationService.getString(JAVAX_MAIL_DEBUG_PROP_NAME,null)); 


props.put(JAVAX_MAIL_DEBUG_PROP_NAME, (debug == null) ? "false" : "true");

But I'd like to use the two String version like this ...

String debug =
           
StringUtil.trimToNull(serverConfigurationService.getString(JAVAX_MAIL_DEBUG_PROP_NAME,"false")); 


 props.put(JAVAX_MAIL_DEBUG_PROP_NAME, debug);


Does anybody know how you tell JMock to accept any string as a parameter?

Adrian.

-- 
==================================
Adrian Fish
Software Engineer
Centre for e-Science
Bowland Tower South C Floor
Lancaster University
Lancaster
LA1 4YW
email: a.fish at lancaster.ac.uk

http://confluence.sakaiproject.org/display/YAFT/Yaft
http://confluence.sakaiproject.org/display/BLOG/Home
http://confluence.sakaiproject.org/display/AGORA/Home

-------------- next part --------------
A non-text attachment was scrubbed...
Name: a_fish.vcf
Type: text/x-vcard
Size: 289 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090818/45ba6093/attachment.vcf 


More information about the sakai-dev mailing list