[MAGNOLIA-4820] Chain command contains no commands Created: 07/Feb/13  Updated: 31/Oct/13  Resolved: 07/Jun/13

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 5.0
Fix Version/s: 5.0

Type: Bug Priority: Critical
Reporter: Federico Grilli Assignee: Jozef Chocholacek
Resolution: Fixed Votes: 0
Labels: workflow
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Same As 4.5
Sprint: Beta 3, RC 1

 Description   

The problem lies in info.magnolia.commands.CommandsManager.getCommand(String, String). The
chain command retrieved from the catalog is correctly populated with the actual commands however we then do

 return command.getClass().newInstance();

which gives back an empty (no commands) instance.



 Comments   
Comment by Jozef Chocholacek [ 20/Feb/13 ]

I have fixed the problem by adding a copy() method to the Command interface, but I have problem to write proper test case (to initialize the CommandManager from the mocked config repo), so I am not closing this issue now.

Comment by Eric Hechinger [ 31/May/13 ]

Command constructor class have injected classes. Doing a master.getClass().newInstance() does not support injection.

Please check/validate the proposed solution (already Checked in) and add test cases.

Comment by Samuli Penttilä [ 04/Jun/13 ]

Remove commented code in CommandsManagerTest.setUp() method and either remove or implement CommandsManagerTest.testGetChainCommand() method which is currently not doing anything.

Generated at Mon Feb 12 03:59:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.