diff --git a/src/main/groovy/com/software_ninja/malabar/http/MalabarServer.groovy b/src/main/groovy/com/software_ninja/malabar/http/MalabarServer.groovy index e68319a..93b70bf 100755 --- a/src/main/groovy/com/software_ninja/malabar/http/MalabarServer.groovy +++ b/src/main/groovy/com/software_ninja/malabar/http/MalabarServer.groovy @@ -18,6 +18,31 @@ import java.util.logging.ConsoleHandler; class MalabarServer { def cache = [:]; def config = [ cache :cache ]; + + def MAVEN = 'maven'; + + + def standardizeParams(params) { + Map rtnval = params; + + if( rtnval['pm'] == null ) { + throw new IllegalArgumentException("pm is required"); + } + + if( rtnval['repo'] == null ) { + rtnval['repo'] = MalabarUtil.expandFile("~/.m2/repository/"); + } + + if(rtnval['pmfile'] != null ) { + rtnval['pmfile'] = MalabarUtil.expandFile(rtnval['pmfile']); + } else { + throw new IllegalArgumentException("pmfile is required"); + } + + + return rtnval; + + } def start(String port) { @@ -25,39 +50,38 @@ class MalabarServer { def addr = new InetSocketAddress(Integer.parseInt(port)) def httpServer = com.sun.net.httpserver.HttpServer.create(addr, 0) - def context = httpServer.createContext('/pi/', new JsonHandlerFactory(config).build({params -> - def pmIn = params["pm"]; - def pm = (pmIn == null ? null : MalabarUtil.expandFile(pmIn)); - mph.projectInfo(params["repo"], pm);})); + def context = httpServer.createContext('/pi/', new JsonHandlerFactory(config).build({paramsIn -> + def params = standardizeParams(paramsIn); + mph.projectInfo(params["repo"], params['pm'], params['pmfile']);})); context.getFilters().add(new ParameterFilter()); - context = httpServer.createContext('/parse/', new JsonHandlerFactory(config).build({params -> - String pmIn = params["pm"]; - def pm = (pmIn == null ? null : MalabarUtil.expandFile(pmIn)); - mph.parse(params["repo"], pm, params["script"], params["scriptBody"], - params['parser']);})); + context = httpServer.createContext('/parse/', new JsonHandlerFactory(config).build({paramsIn -> + def params = standardizeParams(paramsIn); + + mph.parse(params["repo"], params['pm'], params['pmfile'], + params["script"], params["scriptBody"], params['parser']);})); context.getFilters().add(new ParameterFilter()); - context = httpServer.createContext('/test/', new JsonHandlerFactory(config).build({params -> - def pmIn = params["pm"]; - def pm = (pmIn == null ? null : MalabarUtil.expandFile(pmIn)); - mph.unitTest(params["repo"], pm, params["script"], params["method"], - params['parser']);})); + context = httpServer.createContext('/test/', new JsonHandlerFactory(config).build({paramsIn -> + def params = standardizeParams(paramsIn); + mph.unitTest(params["repo"], params['pm'], params['pmfile'], + params["script"], params["method"], params['parser']);})); context.getFilters().add(new ParameterFilter()); - context = httpServer.createContext('/exec/', new JsonHandlerFactory(config).build({params -> - def pmIn = params["pm"]; - def pm = (pmIn == null ? null : MalabarUtil.expandFile(pmIn)); - mph.exec(params["repo"], pm, params["class"], params["arg"]);})); + context = httpServer.createContext('/exec/', new JsonHandlerFactory(config).build({paramsIn -> + def params = standardizeParams(paramsIn); + mph.exec(params["repo"], params['pm'], params['pmfile'], + params["class"], params["arg"]);})); context.getFilters().add(new ParameterFilter()); - context = httpServer.createContext('/tags/', new JsonHandlerFactory(config).build({params -> - def pmIn = params["pm"]; - def pm = (pmIn == null ? null : MalabarUtil.expandFile(pmIn)); - mph.tags(params["repo"], pm, params["class"]);})); + context = httpServer.createContext('/tags/', new JsonHandlerFactory(config).build({paramsIn -> + def params = standardizeParams(paramsIn); + mph.tags(params["repo"], params['pm'], params['pmfile'], + params["class"]);})); context.getFilters().add(new ParameterFilter()); - context = httpServer.createContext('/debug/', new JsonHandlerFactory(config).build({params -> + context = httpServer.createContext('/debug/', new JsonHandlerFactory(config).build({paramsIn -> + def params = standardizeParams(paramsIn); def lm = LogManager.getLogManager(); lm.loggerNames.each( { if( it.startsWith("com.software_ninja")) { def l = lm.getLogger(it); @@ -69,12 +93,12 @@ class MalabarServer { def pmIn = params["pm"]; def pm = (pmIn == null ? null : MalabarUtil.expandFile(pmIn)); - mph.debug(params["repo"], pm)})); + mph.debug(params["repo"], params['pm'], params['pmfile'])})); context.getFilters().add(new ParameterFilter()); context = httpServer.createContext('/spawn/', new JsonHandlerFactory(config).build({params -> - + //def params = standardizeParams(paramsIn); com.software_ninja.malabar.lang.NewVM.startSecondJVM(params["version"], params["jdk"], params["port"], params["cwd"], true); @@ -85,10 +109,10 @@ class MalabarServer { "class" : params['class']] })); context.getFilters().add(new ParameterFilter()); - context = httpServer.createContext('/resource/', new JsonHandlerFactory(config).build({params -> - def pmIn = params["pm"]; - def pm = (pmIn == null ? null : MalabarUtil.expandFile(pmIn)); - mph.resource(params["repo"], pm, params["pattern"], params["max"] as int, params['isClass'] as boolean, + context = httpServer.createContext('/resource/', new JsonHandlerFactory(config).build({paramsIn -> + def params = standardizeParams(paramsIn); + mph.resource(params["repo"], params['pm'], params['pmfile'], + params["pattern"], params["max"] as int, params['isClass'] as boolean, params['useRegex'] as boolean);})); context.getFilters().add(new ParameterFilter()); @@ -97,7 +121,7 @@ class MalabarServer { mph.additionalClasspath(params["relative"], params["absolute"]);})); context.getFilters().add(new ParameterFilter()); - context = httpServer.createContext('/stop/', new JsonHandlerFactory(config).build({params -> httpServer.stop(1); System.exit(0); })); + context = httpServer.createContext('/stop/', new JsonHandlerFactory(config).build({paramsIn -> httpServer.stop(1); System.exit(0); })); context.getFilters().add(new ParameterFilter()); diff --git a/src/main/groovy/com/software_ninja/malabar/project/MavenProjectHandler.groovy b/src/main/groovy/com/software_ninja/malabar/project/MavenProjectHandler.groovy index 5bb7dd1..df4a858 100755 --- a/src/main/groovy/com/software_ninja/malabar/project/MavenProjectHandler.groovy +++ b/src/main/groovy/com/software_ninja/malabar/project/MavenProjectHandler.groovy @@ -148,21 +148,22 @@ public class MavenProjectHandler { if( f != null ) f.clear(); } - def lookInCache(pom, func) { + def lookInCache(pm, pmfile, func) { def name = this.getClass().getName(); - def pomFile = new File(MalabarUtil.expandFile(pom as String)); + def pomFile = new File(MalabarUtil.expandFile(pmfile as String)); def mod = pomFile.lastModified(); def cache1 = cache[name]; if(cache1 == null) { cache1 = [:] cache.put(name, cache1); } - - def rtnval = cache1[pom]; + def key = [pm, pmfile]; + def rtnval = cache1[key]; if(rtnval == null || rtnval['timestamp'] != mod) { + log.fine("cache miss:" + pm + " " + pmfile); rtnval = createCacheEntry(pomFile, mod , func); - cache[name].put( pom , rtnval); + cache[name].put( key , rtnval); } return rtnval; } @@ -231,12 +232,12 @@ public class MavenProjectHandler { /** * Load and execute the class. Assumes the class has been compiled/parsed already. */ - def exec(repo, pom, clazzName, args) { + def exec(repo, pm, pmfile, clazzName, args) { log.fine "Start Exec of " + clazzName; try{ - def cached = lookInCache( pom, { fecthProjectInfo(repo, pom)}); + def cached = lookInCache( pm, pmfile, { fecthProjectInfo(repo, pm, pmfile)}); def cl = cached['classLoader']; def clazz = Class.forName(clazzName, true, cl); @@ -250,11 +251,11 @@ public class MavenProjectHandler { /** * Parse the script on disk. Return errors as a list */ - def parse(repo, pom, scriptIn, scriptBody, parserName) { + def parse(repo, pm, pmfile, scriptIn, scriptBody, parserName) { log.fine "Start Parse"; try{ - def cached = lookInCache( pom, { fecthProjectInfo(repo, pom)}); + def cached = lookInCache( pm, pmfile, { fecthProjectInfo(repo, pm, pmfile)}); def parser = cached['parsers'][parserName]; def rtnval = null; @@ -282,9 +283,9 @@ public class MavenProjectHandler { * Run a unit test. Return a list of failures. */ - def unitTest (repo, pm, scriptIn, method, parserName) { + def unitTest (repo, pm, pmfile, scriptIn, method, parserName) { String script = MalabarUtil.expandFile(scriptIn); - def cached = lookInCache( pm, { fecthProjectInfo(repo, pm)}); + def cached = lookInCache( pm, pmfile, { fecthProjectInfo(repo, pm, pmfile)}); try{ def parser = cached['parsers'][parserName]; def parseResult = parser.parse(new File(script)); @@ -329,8 +330,8 @@ public class MavenProjectHandler { * @param isClass If null or true, look for only class names * @param useRegex If null or true, treat pattern as a regex */ - def resource(repo, pm, pattern, max, isClass, useRegex){ - def cached = lookInCache( pm, { fecthProjectInfo(repo, pm)}); + def resource(repo, pm, pmfile, pattern, max, isClass, useRegex){ + def cached = lookInCache( pm, pmfile, { fecthProjectInfo(repo, pm, pmfile)}); def resourceCache = cached['resourceCache']; log.fine "RESOURCE:" + resourceCache + " " + isClass + " " + useRegex + " " + max; if( isClass == null || isClass ){ @@ -350,8 +351,8 @@ public class MavenProjectHandler { * @param isClass If null or true, look for only class names * @param useRegex If null or true, treat pattern as a regex */ - def tags(repo, pm, className){ - def cached = lookInCache( pm, { fecthProjectInfo(repo, pm)}); + def tags(repo, pm, pmfile, className){ + def cached = lookInCache( pm, pmfile, { fecthProjectInfo(repo, pm, pmfile)}); def classLoader = cached.get('classLoader'); new SemanticReflector().asSemanticTag(classLoader.loadClass(className)); @@ -363,8 +364,8 @@ public class MavenProjectHandler { * */ - def debug(repo, pm){ - def cached = lookInCache( pm, { fecthProjectInfo(repo, pm)}); + def debug(repo, pm, pmfile){ + def cached = lookInCache( pm, pmfile, { fecthProjectInfo(repo, pm, pmfile)}); def classLoader = cached.get('classLoader'); [ classpath : classLoader.classPath, projectInfo : cached['projectInfo'], @@ -379,12 +380,12 @@ public class MavenProjectHandler { // Project Info // - def fecthProjectInfo = { repo, pom -> + def fecthProjectInfo = { repo, pm, pmfile -> def repox = (repo == null ? "~/.m2/repository" : repo); try { def x = new MavenProjectsCreator(); - def pjs = x.create(MalabarUtil.expandFile(repox), MalabarUtil.expandFile(pom)) + def pjs = x.create(MalabarUtil.expandFile(repox), MalabarUtil.expandFile(pmfile)) return [runtime: x.resolveDependencies(pjs[0], repox, "runtime"), systemProperties : System.getProperties(), test: x.resolveDependencies(pjs[0], repox, "test")] @@ -395,12 +396,12 @@ public class MavenProjectHandler { ex.printStackTrace(); throw new Exception( ex.getMessage() + " repo:" + MalabarUtil.expandFile(repox) + - " pom:" + MalabarUtil.expandFile(pom), ex); + " pmfile:" + MalabarUtil.expandFile(pmfile), ex); } } - def projectInfo(repo, pom) { - return lookInCache(pom, { fecthProjectInfo(repo, pom)} )['projectInfo']; + def projectInfo(repo, pm, pmfile) { + return lookInCache(pm, pmfile, { fecthProjectInfo(repo, pm, pmfile)} )['projectInfo']; } } diff --git a/src/test/groovy/com/software_ninja/malabar/http/TestMalabarServer.groovy b/src/test/groovy/com/software_ninja/malabar/http/TestMalabarServer.groovy index 7770ca8..0e46d08 100755 --- a/src/test/groovy/com/software_ninja/malabar/http/TestMalabarServer.groovy +++ b/src/test/groovy/com/software_ninja/malabar/http/TestMalabarServer.groovy @@ -87,7 +87,8 @@ class TestMalabarServer { @Test public void testPi(){ - URL url = createGetURL("pi", [pm:root+"/src/test/resources/projects/simple/pom.xml"]); + URL url = createGetURL("pi", [pmfile:root+"/src/test/resources/projects/simple/pom.xml", + pm:'maven']); println url InputStream is = url.openStream(); println readInputStreamAsString(is); @@ -97,13 +98,15 @@ class TestMalabarServer { public @Test void testParse(){ - URL url = createGetURL("parse", [pm:root + "/src/test/resources/projects/simple/pom.xml", + URL url = createGetURL("parse", [pmfile:root + "/src/test/resources/projects/simple/pom.xml", + pm:'maven', script: root + "/src/test/projects/simple/src/test/java/com/software_ninja/test/project/AppTest.java" ]); println url InputStream is = url.openStream(); - url = createGetURL("parse", [pm : root + "/src/test/resources/projects/simple/pom.xml", + url = createGetURL("parse", [pmfile : root + "/src/test/resources/projects/simple/pom.xml", + pm : 'maven', scriptBody: "x=;" ]); is = url.openStream(); println readInputStreamAsString(is); diff --git a/src/test/groovy/com/software_ninja/malabar/lang/TestGroovyParser.groovy b/src/test/groovy/com/software_ninja/malabar/lang/TestGroovyParser.groovy index 0cbd4ce..a5b3278 100755 --- a/src/test/groovy/com/software_ninja/malabar/lang/TestGroovyParser.groovy +++ b/src/test/groovy/com/software_ninja/malabar/lang/TestGroovyParser.groovy @@ -13,11 +13,12 @@ public class TestGroovyParser { String simple = 'src/test/resources/projects/simple/'; String scriptIn = simple + '/src/test/java/com/software_ninja/test/project/AppTest.java'; - String pm = simple + "pom.xml"; + String pmfile = simple + "pom.xml"; + String pm = 'maven'; String repo = "~/.m2/repository"; def mavenProjectHandler = new MavenProjectHandler([cache:[:]]); - def cacheEntry = mavenProjectHandler.lookInCache( pm, { mavenProjectHandler.fecthProjectInfo(repo, pm)}); + def cacheEntry = mavenProjectHandler.lookInCache( pm, pmfile, { mavenProjectHandler.fecthProjectInfo(repo, pm, pmfile)}); def groovyParser = cacheEntry['parsers']['groovy']; diff --git a/src/test/groovy/com/software_ninja/malabar/lang/TestJavaParser.groovy b/src/test/groovy/com/software_ninja/malabar/lang/TestJavaParser.groovy index cd09c3c..4f81bcc 100755 --- a/src/test/groovy/com/software_ninja/malabar/lang/TestJavaParser.groovy +++ b/src/test/groovy/com/software_ninja/malabar/lang/TestJavaParser.groovy @@ -15,11 +15,12 @@ public class TestJavaParser { String simple = 'src/test/resources/projects/simple/'; String scriptIn = simple + '/src/test/java/com/software_ninja/test/project/AppTest.java'; String errorScriptIn = simple + '/src/test/java/com/software_ninja/test/project/ParserTargetWithError.java'; - String pm = simple + "pom.xml"; + String pmfile = simple + "pom.xml"; + String pm = 'maven'; String repo = "~/.m2/repository"; def mavenProjectHandler = new MavenProjectHandler([cache:[:]]); - def cacheEntry = mavenProjectHandler.lookInCache( pm, { mavenProjectHandler.fecthProjectInfo(repo, pm)}); + def cacheEntry = mavenProjectHandler.lookInCache( pm,pmfile, { mavenProjectHandler.fecthProjectInfo(repo, pm, pmfile)}); def javaParser = cacheEntry['parsers']['java']; diff --git a/src/test/groovy/com/software_ninja/malabar/project/TestExec.groovy b/src/test/groovy/com/software_ninja/malabar/project/TestExec.groovy index ba29a60..b69c742 100755 --- a/src/test/groovy/com/software_ninja/malabar/project/TestExec.groovy +++ b/src/test/groovy/com/software_ninja/malabar/project/TestExec.groovy @@ -15,6 +15,7 @@ public class TestExecImpl { private Map config; private MavenProjectHandler mph; private String defaultRepo = System.getProperty("user.home") + "/.m2/repository"; + private String pm = 'maven'; @Before public void init() { @@ -26,13 +27,13 @@ public class TestExecImpl { public void testExec() { String simple = 'src/test/resources/projects/simple/'; String scriptIn = simple + '/src/test/java/com/software_ninja/test/project/App.java'; - String pm = simple + "pom.xml"; + String pmfile = simple + "pom.xml"; String clazzName = "com.software_ninja.test.project.App"; - println 'http://localhost:4429/exec/?pm=' + pm +'&class=' + clazzName + "&repo=" + defaultRepo; - mph.parse(defaultRepo, pm, scriptIn, null, "java"); - mph.exec (defaultRepo, pm, clazzName, null); - mph.exec (defaultRepo, pm, clazzName, ["a", "b", "c"] as String[]); + //println 'http://localhost:4429/exec/?pm=' + pm +'&class=' + clazzName + "&repo=" + defaultRepo; + mph.parse(defaultRepo, pm, pmfile, scriptIn, null, "java"); + mph.exec (defaultRepo, pm, pmfile, clazzName, null); + mph.exec (defaultRepo, pm, pmfile, clazzName, ["a", "b", "c"] as String[]); } } diff --git a/src/test/groovy/com/software_ninja/malabar/project/TestMavenProjectHandler.groovy b/src/test/groovy/com/software_ninja/malabar/project/TestMavenProjectHandler.groovy index 43567af..ac63dce 100755 --- a/src/test/groovy/com/software_ninja/malabar/project/TestMavenProjectHandler.groovy +++ b/src/test/groovy/com/software_ninja/malabar/project/TestMavenProjectHandler.groovy @@ -24,6 +24,7 @@ import groovy.io.FileType class MavenProjectTester { private Map config; + String pm = 'maven'; /** * A generator that takes a list and returns the elements in random order @@ -107,9 +108,9 @@ class MavenProjectTester { File pom = pair.getSecond(); println "processing " + pom; MavenProjectHandler mph = new MavenProjectHandler(config); - Map cacheEntry = mph.lookInCache(pom, { mph.fecthProjectInfo(pair.getFirst(), pom.absolutePath )} ) - Map projectInfo = mph.projectInfo(pair.getFirst(), - pom.absolutePath); + String pmfile = pom.absolutePath; + Map cacheEntry = mph.lookInCache(pm, pmfile, { mph.fecthProjectInfo(pair.getFirst(), pm, pmfile )} ) + Map projectInfo = mph.projectInfo(pair.getFirst(), pm, pom.absolutePath); println "CacheEntry: " + cacheEntry; projectInfo.each { k,v -> println " KEY:" + k; } assertNotNull( projectInfo['test']); @@ -125,7 +126,7 @@ class MavenProjectTester { void testResource(){ File pomFile = new File(this.getClass().getClassLoader().getResource( "pom/jdom-1.0.pom").toURI()); - String pom = pomFile.getAbsolutePath(); + String pmfile = pomFile.getAbsolutePath(); String defaultRepo = System.getProperty("user.home") + "/.m2/repository"; def mph = new MavenProjectHandler(config); for (Triple data : toIterable( triples(integers(), booleans(), booleans()))){ @@ -133,7 +134,7 @@ class MavenProjectTester { boolean isClass = data.getSecond(); boolean useRegex = data.getThird(); def pattern = /S*/; - def result = mph.resource(defaultRepo, pom, pattern, max, isClass, useRegex); + def result = mph.resource(defaultRepo, pm, pmfile, pattern, max, isClass, useRegex); int size = result.size(); assertTrue( "Size should be <= than max size:" + size + " max:" + max, size <= Math.max(max, 0)); //if( size > 0) println result.first(); @@ -143,36 +144,38 @@ class MavenProjectTester { void testResourceFullClass(){ File pomFile = new File(this.getClass().getClassLoader().getResource( "pom/jdom-1.0.pom").toURI()); - String pom = pomFile.getAbsolutePath(); + String pmfile = pomFile.getAbsolutePath(); String defaultRepo = System.getProperty("user.home") + "/.m2/repository"; def mph = new MavenProjectHandler(config); int max = 10 boolean isClass = true; boolean useRegex = false; def pattern = "org.apache.xalan.xsltc.compiler.util.ResultTreeType" - def result = mph.resource(defaultRepo, pom, pattern, max, isClass, useRegex); + def result = mph.resource(defaultRepo, pm, pmfile, pattern, max, isClass, useRegex); } @Test void testTags(){ File pomFile = new File(this.getClass().getClassLoader().getResource( "pom/jdom-1.0.pom").toURI()); - String pom = pomFile.getAbsolutePath(); + String pmfile = pomFile.getAbsolutePath(); + String defaultRepo = System.getProperty("user.home") + "/.m2/repository"; def mph = new MavenProjectHandler(config); def className = "org.apache.xalan.xsltc.compiler.util.ResultTreeType" - def result = mph.tags(defaultRepo, pom, className); + def result = mph.tags(defaultRepo, pm, pmfile, className); } @Test public void testFileUnitTest() throws Exception { String simple = 'src/test/resources/projects/simple/'; String scriptIn = simple + '/src/test/java/com/software_ninja/test/project/AppTest.java'; - String pm = simple + "pom.xml"; + String pmfile = simple + "pom.xml"; + String pm = 'maven'; String repo = "~/.m2/repository"; new File(simple + "target").deleteDir(); def mph = new MavenProjectHandler(config); - def rtnval = mph.unitTest(repo, pm, scriptIn, null, "java"); + def rtnval = mph.unitTest(repo, pm, pmfile, scriptIn, null, "java"); assertEquals("This always fails", rtnval[0][1]); } diff --git a/src/test/groovy/com/software_ninja/malabar/project/TestParser.groovy b/src/test/groovy/com/software_ninja/malabar/project/TestParser.groovy index 2c9973f..8af7d25 100755 --- a/src/test/groovy/com/software_ninja/malabar/project/TestParser.groovy +++ b/src/test/groovy/com/software_ninja/malabar/project/TestParser.groovy @@ -15,6 +15,7 @@ public class TestParserImpl { private Map config; private MavenProjectHandler mph; private String defaultRepo = System.getProperty("user.home") + "/.m2/repository"; + private String pm = 'maven'; @Before public void init() { @@ -26,17 +27,18 @@ public class TestParserImpl { public void testParser() { String simple = 'src/test/resources/projects/simple/'; String scriptIn = simple + '/src/test/java/com/software_ninja/test/project/AppTest.java'; - String pm = simple + "pom.xml"; + String pmfile = simple + "pom.xml"; + String method = "testApp"; - println 'http://localhost:4429/parse/?pm=' + pm +'&script=' + scriptIn ; + //println 'http://localhost:4429/parse/?pm=' + pm +'&script=' + scriptIn ; - def actual = mph.parse(defaultRepo, pm, scriptIn, null, "groovy"); + def actual = mph.parse(defaultRepo, pm, pmfile, scriptIn, null, "groovy"); assertEquals( [], actual) - println mph.parse(defaultRepo, pm, scriptIn, null, "groovy-strict"); + println mph.parse(defaultRepo, pm, pmfile, scriptIn, null, "groovy-strict"); } } diff --git a/src/test/groovy/com/software_ninja/malabar/project/TestUnitTest.groovy b/src/test/groovy/com/software_ninja/malabar/project/TestUnitTest.groovy index f5b9da8..bd75eaa 100644 --- a/src/test/groovy/com/software_ninja/malabar/project/TestUnitTest.groovy +++ b/src/test/groovy/com/software_ninja/malabar/project/TestUnitTest.groovy @@ -15,6 +15,7 @@ public class TestUnitTestImpl { private Map config; private MavenProjectHandler mph; private String defaultRepo = System.getProperty("user.home") + "/.m2/repository"; + private String pm = 'maven'; @Before public void init() { @@ -26,11 +27,12 @@ public class TestUnitTestImpl { public void testUnitTest() { String simple = 'src/test/resources/projects/simple/'; String scriptIn = simple + '/src/test/java/com/software_ninja/test/project/AppTest.java'; - String pm = simple + "pom.xml"; + String pmfile = simple + "pom.xml"; String method = "testApp"; - println 'http://localhost:4429/test/?pm=' + pm +'&script=' + scriptIn + '&method=' + method; - println mph.unitTest (defaultRepo, pm, scriptIn, null, "java"); - println mph.unitTest (defaultRepo, pm, scriptIn, method, "java"); + println String.format( 'http://localhost:4429/test/?pm=%s&pmfile=%s&script=%s&&method=%s', + pm, pmfile, scriptIn, method); + println mph.unitTest (defaultRepo, pm, pmfile, scriptIn, null, "java"); + println mph.unitTest (defaultRepo, pm, pmfile, scriptIn, method, "java"); } }