We are now a github organisation. You are invited to participate.
Embedded node.js will provide a platform neutral way for running node binary in unittests.
- its easy, much easier as installing right version by hand
- you can change version per test
Stable (Maven Central Repository, Released: 06.10.2013 - wait 24hrs for maven central)
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.nodejs</artifactId>
<version>1.28</version>
</dependency>
Snapshots (Repository http://oss.sonatype.org/content/repositories/snapshots)
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.nodejs</artifactId>
<version>1.29-SNAPSHOT</version>
</dependency>
Initial Version starts with 1.19 SNAPSHOT as extract from Embedded MongoDB Project
- process dep update
- support for node.js v 0.10.20
- api change upgrade (de.flapdoodle.embed.process api change)
- added support for nodejs 0.10.0
- dep version change
- dep version change
- dep version change
- added v0.8.8, v0.9.1 (Unstable)
- maven version range disabled
- more customization, minor bugfixes
- initial cut out
Versions: 0.8.6, any custom Support for Linux, Windows and MacOSX.
public void testNodejs() throws IOException, InterruptedException {
final File helloWorld = Files.createTempFile("node-hello-world.js");
Files.write("console.log(\"Running Hello World inside NodeJS in \"+process.cwd());setTimeout(function(){},1000);", helloWorld);
try {
Nodejs.call(NodejsVersion.Main.V0_8, helloWorld.getAbsolutePath(), System.getProperty("java.io.tmpdir"));
} finally {
Files.forceDelete(helloWorld);
}
}