Issue Details (XML | Word | Printable)

Key: EMLPAGE-1
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: David Chui
Reporter: David Chui
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Confluence Mail Page Plugin

Refactor MailPageAction class to improve testability

Created: 24/Sep/07 08:27 PM   Updated: 24/Sep/07 08:49 PM
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 1.3
Security Level: public (Anyone can view the issue)

Time Tracking:
Original Estimate: 30 minutes
Original Estimate - 30 minutes
Remaining Estimate: 15 minutes
Time Spent - 15 minutes Remaining Estimate - 15 minutes
Time Spent: 15 minutes
Time Spent - 15 minutes Remaining Estimate - 15 minutes

Labels:


 Description  « Hide
Some test cases fail with the error below when the plugin is built against Confluence 2.5.7 at BDAC.
java.lang.NoSuchMethodError: com.atlassian.core.util.ClassLoaderUtils.getBundle(Ljava/lang/String;Ljava/util/Locale;Ljava/lang/Class;)Ljava/util/ResourceBundle;
	at com.atlassian.confluence.util.i18n.DefaultI18NBean.&init&(DefaultI18NBean.java:52)
	at com.atlassian.confluence.util.i18n.DefaultI18NBeanFactory.getI18NBean(DefaultI18NBeanFactory.java:13)
	at com.atlassian.confluence.core.ConfluenceActionSupport.getI18n(ConfluenceActionSupport.java:601)
	at com.atlassian.confluence.util.GeneralUtil.getI18n(GeneralUtil.java:1352)
	at com.atlassian.confluence.mail.template.VelocityMailBuilder.getInitialContext(VelocityMailBuilder.java:119)
	at com.atlassian.confluence.mail.template.VelocityMailBuilder.getRenderedMailQueueItem(VelocityMailBuilder.java:59)
	at com.atlassian.confluence.ext.mailpage.MailPageAction.execute(MailPageAction.java:38)
	at com.atlassian.confluence.ext.mailpage.MailPageActionTest.testExecute(MailPageActionTest.java:269)

This task is about refactoring the MailPageAction so that the tests won't fail. To be specific, instead of directly instantiating an instance of VelocityMailBuilder, it will obtain an instance of it from a protected method. Therefore, the test cases can extend the action class and override the method to return a mock of VelocityMailBuilder which prevents the control from going to GeneralUtil.getI18n.



 All   Comments   Work Log   Change History   FishEye   Crucible   Builds      Sort Order: Ascending order - Click to sort in descending order
David Chui added a comment - 24/Sep/07 08:28 PM
There seems to be no way I could assign this to myself. Please ignore this email. I'm suppose to be the assignee.