[gant-scm] [10438] gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy: Add tests stemming from GANT-108.

View: New views
1 Messages — Rating Filter:   Alert me  

[gant-scm] [10438] gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy: Add tests stemming from GANT-108.

by russel-9 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
[10438] gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy: Add tests stemming from GANT-108.
Revision
10438
Author
russel
Date
2009-11-01 07:01:18 -0600 (Sun, 01 Nov 2009)

Log Message

Add tests stemming from GANT-108. At the time of committing they fail as per the JIRA issue.

Modified Paths

Diff

Modified: gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy (10437 => 10438)

--- gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy	2009-11-01 13:01:14 UTC (rev 10437)
+++ gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy	2009-11-01 13:01:18 UTC (rev 10438)
@@ -192,4 +192,63 @@
     assertEquals ( ": destination directory \"${ ( new File ( destinationDirectory ) ).absolutePath }\" does not exist or is not a directory\n" , error )
   }
 
+  def gant108TestString = 'Hello.'
+  def gant108TargetName = 'doit'
+  def gant108TargetBodyString = """
+def writer = new StringWriter ( )
+def xml = new MarkupBuilder ( writer )
+xml.Configure { Set { println ( '${gant108TestString}' ) } }
+println ( writer.toString ( ) )
+"""
+   def gant108ResultString = '''
+<Configure>
+  <Set />
+</Configure>
+'''
+
+  void test_GANT_108_MarkupBuilderInTargetProblem ( ) {
+    def testString = 'Hello.'
+    def targetName = 'doit'
+    script = 'import groovy.xml.MarkupBuilder ; target ( ' + targetName + ' : "" ) { ' + gant108TargetBodyString + ' }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + gant108ResultString ) , output )
+  }
+  
+  void test_GANT_108_MarkupBuilderInFunctionProblem ( ) {
+    def testString = 'Hello.'
+    def targetName = 'doit'
+    script = 'import groovy.xml.MarkupBuilder ; def doMarkup ( ) { ' + gant108TargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + gant108ResultString ) , output )
+  }
+
+  void test_GANT_108_MarkupBuilderInLocalClosureProblem ( ) {
+    def testString = 'Hello.'
+    def targetName = 'doit'
+    script = 'import groovy.xml.MarkupBuilder ; def doMarkup = { ' + gant108TargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + gant108ResultString ) , output )
+  }
+
+  void test_GANT_108_MarkupBuilderInBindingClosureProblem ( ) {
+    def testString = 'Hello.'
+    def targetName = 'doit'
+    script = 'import groovy.xml.MarkupBuilder ; doMarkup = { ' + gant108TargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + gant108ResultString ) , output )
+  }
+
+  void test_GANT_108_MarkupBuilderExectedNeverWasAProblem ( ) {
+    def testString = 'Hello.'
+    def targetName = 'doit'
+    script = 'evaluate ( """import groovy.xml.MarkupBuilder ; doMarkup = { ' + gant108TargetBodyString + ' }""" ) ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + gant108ResultString ) , output )
+  }
+  
 }


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email