[gant-scm] [10439] gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs: Too many tests for GANT-108 for the Assorted tests, make its own class.

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

[gant-scm] [10439] gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs: Too many tests for GANT-108 for the Assorted tests, make its own class.

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.
[10439] gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs: Too many tests for GANT-108 for the Assorted tests, make its own class.
Revision
10439
Author
russel
Date
2009-11-01 07:01:22 -0600 (Sun, 01 Nov 2009)

Log Message

Too many tests for GANT-108 for the Assorted tests, make its own class.

Modified Paths

Added Paths

Diff

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

--- gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy	2009-11-01 13:01:18 UTC (rev 10438)
+++ gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/Assorted_Test.groovy	2009-11-01 13:01:22 UTC (rev 10439)
@@ -192,63 +192,4 @@
     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 )
-  }
-  
 }

Added: gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/GANT_108_Test.groovy (0 => 10439)

--- gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/GANT_108_Test.groovy	                        (rev 0)
+++ gant/trunk/src/test/groovy/org/codehaus/gant/tests/bugs/GANT_108_Test.groovy	2009-11-01 13:01:22 UTC (rev 10439)
@@ -0,0 +1,97 @@
+//  Gant -- A Groovy way of scripting Ant tasks.
+//
+//  Copyright © 2009 Russel Winder
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
+//  compliance with the License. You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software distributed under the License is
+//  distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+//  implied. See the License for the specific language governing permissions and limitations under the
+//  License.
+//
+//  Author : Russel Winder <russel.winder@...>
+
+package  org.codehaus.gant.tests.bugs
+
+import org.codehaus.gant.tests.GantTestCase
+
+class GANT_108_Test extends GantTestCase {
+  private testString = 'Hello.'
+  private targetName = 'doit'
+  private problemTargetBodyString = """
+def writer = new StringWriter ( )
+def xml = new MarkupBuilder ( writer )
+xml.Configure { Set { println ( '${testString}' ) } }
+println ( writer.toString ( ) )
+"""
+   private workingTargetBodyString = problemTargetBodyString.replace ( 'Set' , 'xml.Set' )
+   private resultString = '''
+<Configure>
+  <Set />
+</Configure>
+'''
+
+  void test_inTargetProblem ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; target ( ' + targetName + ' : "" ) { ' + problemTargetBodyString + ' }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }  
+  void test_inTargetWorking ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; target ( ' + targetName + ' : "" ) { ' + workingTargetBodyString + ' }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }  
+  void test_inFunctionProblem ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; def doMarkup ( ) { ' + problemTargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+  void test_inFunctionWorking ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; def doMarkup ( ) { ' + workingTargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+  void test_inLocalClosureProblem ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; def doMarkup = { ' + problemTargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+  void test_inLocalClosureWorking ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; def doMarkup = { ' + workingTargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+  void test_inBindingClosureProblem ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; doMarkup = { ' + problemTargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+  void test_inBindingClosureWorking ( ) {
+    script = 'import groovy.xml.MarkupBuilder ; doMarkup = { ' + workingTargetBodyString + ' } ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+  void test_evaluatedNeverWasAProblemWithProblem ( ) {
+    script = 'evaluate ( """import groovy.xml.MarkupBuilder ; doMarkup = { ' + problemTargetBodyString + ' }""" ) ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+  void test_evaluatedNeverWasAProblemWithWorking ( ) {
+    script = 'evaluate ( """import groovy.xml.MarkupBuilder ; doMarkup = { ' + workingTargetBodyString + ' }""" ) ; target ( ' + targetName + ' : "" ) { doMarkup ( ) }'
+    assertEquals ( 0 , processCmdLineTargets ( targetName ) )
+    assertEquals ( '' , error )
+    assertEquals ( resultString ( targetName , testString + resultString ) , output )
+  }
+}


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email