[MAGNOLIA-1986] Magnolia tag libraries lack unit tests Created: 03/Jan/08  Updated: 23/Jan/13  Resolved: 11/Jan/08

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: None
Fix Version/s: 3.5.3, 3.6, 3.5.9

Type: Improvement Priority: Major
Reporter: Ryan Gardner Assignee: Vivian Steller
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File AddUnitTestForOut.patch     Text File AddingTaglibTest-revised.patch    
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)
Date of First Response:

 Description   

I've found a handful of bugs in the tag libraries that have been a real nuisance to isolate. I wrote a MgnlTagTestCase to help create the necessary mock objects to test the existing tags unchanged (i.e. test them as they spit out content to the JspWriter - and verify that the output is what is expected)

In the attached patch, I also have a test started for the cms:out tag - this test case only covers the UUID link output that I logged in another issue ( http://jira.magnolia.info/browse/MAGNOLIA-1978 )

This change should not interfere with anything else - it just adds the ability to more easily generate tests for the tag library functions.



 Comments   
Comment by Ryan Gardner [ 03/Jan/08 ]

This revised version has the standard magnolia header on it.

(One other note: the pom.xml for the magnolia-core was changed to include the same mockrunner dependency that is already being used in the taglib module tests)

Comment by Philipp Bracher [ 11/Jan/08 ]

Thanks a lot

Comment by Magnolia International [ 08/Jul/08 ]

funnily enough, I only just noticed the assertJspContent() methods were never doing any actual assertions. Luckily, the tests still pass once adding it
Thanks though, very useful - i was able to add a couple of tests for MAGNOLIA-2012 in just a minute
Fixed on 3.5 branch (3.5.9 being the next possible release) and trunk (3.6)

Comment by Ryan Gardner [ 08/Jul/08 ]

That's hilarious that I forgot to have the assertJspContents throw an exception or make any assertions... (I should have followed the standard testing practice and verified that a bogus test case throws the exception I was anticipating throwing... it must have been late when I coded that)

I'm glad it was of assistance.

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