You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2011/11/12 22:57:23 UTC
svn commit: r1201338 - in
/maven/shared/trunk/maven-script-interpreter/src/test/resources:
bsh-test/verify.bsh groovy-test/verify.groovy
Author: olamy
Date: Sat Nov 12 21:57:23 2011
New Revision: 1201338
URL: http://svn.apache.org/viewvc?rev=1201338&view=rev
Log:
add a more on default global variables
Modified:
maven/shared/trunk/maven-script-interpreter/src/test/resources/bsh-test/verify.bsh
maven/shared/trunk/maven-script-interpreter/src/test/resources/groovy-test/verify.groovy
Modified: maven/shared/trunk/maven-script-interpreter/src/test/resources/bsh-test/verify.bsh
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-script-interpreter/src/test/resources/bsh-test/verify.bsh?rev=1201338&r1=1201337&r2=1201338&view=diff
==============================================================================
--- maven/shared/trunk/maven-script-interpreter/src/test/resources/bsh-test/verify.bsh (original)
+++ maven/shared/trunk/maven-script-interpreter/src/test/resources/bsh-test/verify.bsh Sat Nov 12 21:57:23 2011
@@ -1,5 +1,17 @@
import java.io.*;
+if ( !( basedir instanceof File ) )
+{
+ System.out.println( "Global script variable not defined: basedir or not a File" );
+ throw new RuntimeException("Global script variable not defined: basedir or not a File");
+}
+
+if ( !( context instanceof Map ) )
+{
+ System.out.println( "Global script variable not defined: context or not a Map" );
+ throw new RuntimeException("Global script variable not defined: context or not a Map");
+}
+
File file = new File( basedir, "verify.bsh");
if ( !file.exists())
{
Modified: maven/shared/trunk/maven-script-interpreter/src/test/resources/groovy-test/verify.groovy
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-script-interpreter/src/test/resources/groovy-test/verify.groovy?rev=1201338&r1=1201337&r2=1201338&view=diff
==============================================================================
--- maven/shared/trunk/maven-script-interpreter/src/test/resources/groovy-test/verify.groovy (original)
+++ maven/shared/trunk/maven-script-interpreter/src/test/resources/groovy-test/verify.groovy Sat Nov 12 21:57:23 2011
@@ -1,3 +1,15 @@
+if ( !( basedir instanceof File ) )
+{
+ println "Global script variable not defined: basedir or not a File"
+ throw new RuntimeException("Global script variable not defined: basedir or not a File");
+}
assert (new File( basedir, "verify.groovy" ).exists())
+
+if ( !( context instanceof Map ) )
+{
+ println "Global script variable not defined: context or not a Map"
+ throw new RuntimeException("Global script variable not defined: context or not a Map");
+}
+
System.out.println("foo="+context.get("foo"));
return true