You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by vb...@apache.org on 2008/09/23 21:13:24 UTC

svn commit: r698299 - /incubator/buildr/trunk/lib/buildr/java/tests.rb

Author: vborja
Date: Tue Sep 23 12:13:24 2008
New Revision: 698299

URL: http://svn.apache.org/viewvc?rev=698299&view=rev
Log:
New way to control dependencies: module provides .version and .dependencies methods replacing VERSION and REQUIRES constants.  Version number can be specified in buildr.yaml file (e.g. ant: 1.7.2)

Modified:
    incubator/buildr/trunk/lib/buildr/java/tests.rb

Modified: incubator/buildr/trunk/lib/buildr/java/tests.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/tests.rb?rev=698299&r1=698298&r2=698299&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/tests.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/tests.rb Tue Sep 23 12:13:24 2008
@@ -294,6 +294,23 @@
       end
     end          
 
+    class << self
+      def version
+        Buildr.settings.build['testng'] || VERSION
+      end
+      
+      def dependencies
+        ["org.testng:testng:jar:jdk15:#{version}"]+ JMock.dependencies
+      end  
+      
+    private
+      def const_missing(const)
+        return super unless const == :REQUIRES # TODO: remove in 1.5
+        Buildr.application.deprecated "Please use TestNG.dependencies/.version instead of TestNG::REQUIRES/VERSION"
+        dependencies
+      end
+    end          
+
     def tests(dependencies) #:nodoc:
       filter_classes(dependencies, 
                      :class_annotations => %w{org.testng.annotations.Test},
@@ -321,4 +338,4 @@
 
 
 Buildr::TestFramework << Buildr::JUnit
-Buildr::TestFramework << Buildr::TestNG
\ No newline at end of file
+Buildr::TestFramework << Buildr::TestNG