[Remoterengine-commits] r151 - in pkg/RemoteREngine.test/inst: . java_src testng testng-standalone

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 17 16:39:51 CEST 2009


Author: romain
Date: 2009-09-17 16:39:51 +0200 (Thu, 17 Sep 2009)
New Revision: 151

Added:
   pkg/RemoteREngine.test/inst/testng-standalone/
   pkg/RemoteREngine.test/inst/testng-standalone/build.properties
   pkg/RemoteREngine.test/inst/testng-standalone/build.xml
Modified:
   pkg/RemoteREngine.test/inst/java_src/build.xml
   pkg/RemoteREngine.test/inst/testng/build.xml
Log:
generate build.properties from the main build, so that running the tests does not depend on R features of ant

Modified: pkg/RemoteREngine.test/inst/java_src/build.xml
===================================================================
--- pkg/RemoteREngine.test/inst/java_src/build.xml	2009-09-17 14:21:47 UTC (rev 150)
+++ pkg/RemoteREngine.test/inst/java_src/build.xml	2009-09-17 14:39:51 UTC (rev 151)
@@ -17,7 +17,8 @@
 	  system.file( "policy", "server.policy", package = "RemoteREngine" )
 	</r-set>
 
-
+	
+	
 	<path id="project.classpath">
 		<pathelement location="${client.jar}" />
 		<pathelement location="${jdk15.testing.jar}" />
@@ -70,8 +71,30 @@
 		
 	</target>
 	
+	<target name="generate-build-properties">
+			<r-run><![CDATA[
+			R_PACKAGE_DIR <- Sys.getenv( "R_PACKAGE_DIR" ) 
+			testng.jar    <- file.path( R_PACKAGE_DIR, "java_src", "lib", "testng-5.10-jdk15.jar" )
+			client.jar    <- system.file( "java", "RemoteREngine-client.jar", package = "RemoteREngine" )
+			testcases.jar <- file.path( R_PACKAGE_DIR, "java", "RemoteREngine-test.jar" )
+			rmicodebase   <- paste( "file:/", system.file( "java", "RemoteREngine-client.jar", package = "RemoteREngine" ), sep = "" )
+			client.policy <- system.file( "policy", "client.policy", package = "RemoteREngine" ) 
+			server.policy <- system.file( "policy", "server.policy", package = "RemoteREngine" ) 
+			
+			cat( 
+				"testng.jar=", testng.jar, "\n", 
+				"client.jar=", client.jar, "\n", 
+				"testcases.jar=", testcases.jar, "\n", 
+				"rmicodebase=", rmicodebase, "\n", 
+				"client.policy=", client.policy, "\n" ,
+				"server.policy=", server.policy, "\n", 
+				file = "../testng/build.properties", sep = "" )
+			]]>
+		</r-run>
+
+	</target>
 	
-	<target name="all" depends="compile,build,testng-standalone" />
+	<target name="all" depends="compile,build,testng-standalone,generate-build-properties" />
 	
 </project>
 

Modified: pkg/RemoteREngine.test/inst/testng/build.xml
===================================================================
--- pkg/RemoteREngine.test/inst/testng/build.xml	2009-09-17 14:21:47 UTC (rev 150)
+++ pkg/RemoteREngine.test/inst/testng/build.xml	2009-09-17 14:39:51 UTC (rev 151)
@@ -1,32 +1,8 @@
 <?xml version="1.0"?>
 <project name="RemoteREngine.runtests">
 
-	<!-- TODO: move these into property file generated by main build -->
 	<property file="./build.properties" /> 
-	<r-set property="testng.jar">
-		system.file( "java_src", "lib", "testng-5.10-jdk15.jar", package = "RemoteREngine.test" )
-	</r-set>
-
-	<r-set property="client.jar">
-		system.file( "java", "RemoteREngine-client.jar", package = "RemoteREngine" )
-	</r-set>
 	
-	<r-set property="testcases.jar">
-		system.file( "java", "RemoteREngine-test.jar", package = "RemoteREngine.test" )
-	</r-set>
-	
-	<r-set property="rmicodebase">
-	  paste( "file:/", system.file( "java", "RemoteREngine-client.jar", package = "RemoteREngine" ), sep = "" )
-	</r-set>
-
-	<r-set property="client.policy">
-	  system.file( "policy", "client.policy", package = "RemoteREngine" )
-	</r-set>
-
-	<r-set property="server.policy">
-	  system.file( "policy", "server.policy", package = "RemoteREngine" )
-	</r-set>
-	
 	<property name="testng.reports" value="reports" />
 	
 	<path id="testng.classpath">
@@ -35,28 +11,7 @@
 	</path>
 	
 	<taskdef resource="testngtasks" classpath="${testng.jar}"/>
-	
-	<!--
-		<target name="setup.rmicodebase" description="Build codebase for TestNG tests to use class files" >
-		  <pathconvert targetos="unix" property="rmicodebase" refid="testng.classpath" >
-				<map from="C:" to="file:/c:" />
-	    	<map from="D:" to="file:/d:" />
-				<map from="E:" to="file:/e:" />
-				<map from="F:" to="file:/f:" />
-				<map from="G:" to="file:/g:" />
-	    </pathconvert>
-	</target>
-	-->
-	                 
 	<target name="runtests" description="Run TestNG Unit Tests">
-		<echo>
-client.jar    : ${client.jar}
-testcases.jar : ${testcases.jar}
-rmicodebase   : ${rmicodebase}
-client.policy : ${client.policy}
-server.policy : ${server.policy}
-testng.jar    : ${testng.jar}
-		</echo>
 		<mkdir dir="${testng.reports}" />
 		
 		<testng 

Added: pkg/RemoteREngine.test/inst/testng-standalone/build.properties
===================================================================
--- pkg/RemoteREngine.test/inst/testng-standalone/build.properties	                        (rev 0)
+++ pkg/RemoteREngine.test/inst/testng-standalone/build.properties	2009-09-17 14:39:51 UTC (rev 151)
@@ -0,0 +1,10 @@
+
+testng.jar=lib/testng-5.10-jdk15.jar
+client.jar=lib/RemoteREngine-client.jar
+testcases.jar=lib/RemoteREngine-test.jar
+
+client.policy=policy/client.policy
+server.policy=policy/server.policy
+
+testng.reports=reports
+

Added: pkg/RemoteREngine.test/inst/testng-standalone/build.xml
===================================================================
--- pkg/RemoteREngine.test/inst/testng-standalone/build.xml	                        (rev 0)
+++ pkg/RemoteREngine.test/inst/testng-standalone/build.xml	2009-09-17 14:39:51 UTC (rev 151)
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<project name="RemoteREngine.runtests">
+	
+	<property file="./build.properties" />
+
+	<path id="testng.classpath">
+		<pathelement location="${client.jar}" />
+		<pathelement location="${testcases.jar}" />
+	</path>
+	
+	<taskdef resource="testngtasks" classpath="${testng.jar}"/>
+
+	<target name="runtests" description="Run TestNG Unit Tests">
+		<mkdir dir="${testng.reports}" />
+		
+		<!-- is there another way to get the full path ? -->
+		<path id="codebasepath">
+			<pathelement location="${client.jar}" />
+		</path>
+		<pathconvert targetos="unix" property="rmicodebase" refid="codebasepath" />
+		
+		<testng 
+			classpathref="testng.classpath"	
+			outputDir="${testng.reports}"
+			verbose="2"
+			haltonfailure="true" >
+				
+				<jvmarg value="-Djava.security.policy=policy/client.policy" />
+				<jvmarg value="-Djava.rmi.server.codebase=file:/${rmicodebase}" />
+				
+				<xmlfileset dir="." includes="testng.xml"/>
+		</testng>
+	</target>
+
+</project>



More information about the Remoterengine-commits mailing list