Grails
  1. Grails
  2. GRAILS-787 Top level task: Improve Grails unit testing support
  3. GRAILS-991

Add test base classes / meta magic to provide custom test features for different artefacts i.e. TagLibTestCase

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5.5-RC1
    • Component/s: None
    • Labels:
      None

      Activity

      Hide
      Marc Palmer added a comment -

      For example we would have a TagLibTestCase base class, or add some dynamic magic to scaffold the equivalent of:

      
      	def taglib
      	def output
      	
      	void setUp() {
      	   taglib = new MyTagLib()
      	    output = new StringWriter();
      	    taglib.out = new PrintWriter(output)
      	}
      
      	void tearDown() {
      		taglib = null
      	}
      
      
      	void assertOutput(value) {
                       assertEquals( value, output.toString())
      	}
      
      Show
      Marc Palmer added a comment - For example we would have a TagLibTestCase base class, or add some dynamic magic to scaffold the equivalent of: def taglib def output void setUp() { taglib = new MyTagLib() output = new StringWriter(); taglib.out = new PrintWriter(output) } void tearDown() { taglib = null } void assertOutput(value) { assertEquals( value, output.toString()) }
      Hide
      Graeme Rocher added a comment -

      I don't believe this should be necessary as the integration tests do this (see the new unit testing docs)

      Show
      Graeme Rocher added a comment - I don't believe this should be necessary as the integration tests do this (see the new unit testing docs)

        People

        • Assignee:
          Marc Palmer
          Reporter:
          Marc Palmer
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development