forked from m0smith/malabar-mode-jar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
m0smithgh-28 added exec service to run a main method
- Loading branch information
Matthew O. Smith
committed
Jan 14, 2015
1 parent
bdc35ed
commit 7347289
Showing
7 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version=2.0.8-SNAPSHOT | ||
version=2.1.0-SNAPSHOT | ||
profile=empty | ||
ossrhUsername=m0smith | ||
ossrhPassword=entered-during-uploadArchive-and-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/test/groovy/com/software_ninja/malabar/project/TestExec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
package com.software_ninja.malabar.project; | ||
|
||
import org.junit.Test; | ||
import org.junit.Before; | ||
|
||
import static org.junit.Assert.* | ||
|
||
import com.software_ninja.malabar.MalabarUtil; | ||
import com.software_ninja.malabar.project.MavenProjectHandler; | ||
|
||
|
||
public class TestExecImpl { | ||
|
||
private Map config; | ||
private MavenProjectHandler mph; | ||
private String defaultRepo = System.getProperty("user.home") + "/.m2/repository"; | ||
|
||
@Before | ||
public void init() { | ||
config = [ cache : [:] ]; | ||
mph = new MavenProjectHandler(config); | ||
} | ||
|
||
@Test | ||
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 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[]); | ||
} | ||
|
||
} | ||
|
||
|
1 change: 1 addition & 0 deletions
1
src/test/groovy/com/software_ninja/malabar/project/TestMavenProjectHandler.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
package com.software_ninja.malabar.project; | ||
|
||
import static net.java.quickcheck.generator.PrimitiveGenerators.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
.../projects/simple/src/main/java/com/software_ninja/test/project/ParserTargetWithError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.software_ninja.test.project; | ||
|
||
/** | ||
* Hello world! | ||
* | ||
*/ | ||
|
||
class PreParserTarget{} | ||
|
||
interface PreInterface {} | ||
|
||
public class ParserTargetWithError | ||
{ | ||
public static void main( String[] args ) | ||
{ | ||
System.out.println( "Hello World!" ); | ||
} | ||
|
||
|
||
public boolean getTrue() { | ||
return true; | ||
} | ||
|
||
PreInterface pi = new PreInterface(){}; | ||
|
||
class Inner {} | ||
|
||
static class StaticInner{ x=;} | ||
|
||
} | ||
|