-
-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added regular tests for jruby main maven artifact
some tests are not working and get omitted - #2215 and one test got a little workaround for #2216 Sponsored by Lookout Inc.
- Loading branch information
Showing
5 changed files
with
78 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
invoker.goals = install | ||
invoker.mavenOpts = -client | ||
|
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,5 @@ | ||
# jruby scripting container | ||
pom 'org.jruby:jruby', '@project.version@' | ||
|
||
# unit tests | ||
jar 'junit:junit', '4.8.2', :scope => :test |
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>no_group_id_given</groupId> | ||
<artifactId>app</artifactId> | ||
<version>0.0.0</version> | ||
<name>app</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>maven-tools</artifactId> | ||
<version>0.34.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.rubygems</groupId> | ||
<artifactId>zip</artifactId> | ||
<version>2.0.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby</artifactId> | ||
<version>@project.version@</version> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<resources> | ||
<resource> | ||
<directory>src/main/ruby</directory> | ||
</resource> | ||
</resources> | ||
</build> | ||
</project> |
26 changes: 26 additions & 0 deletions
26
maven/jruby/src/it/extended/src/test/java/org/example/SimpleTest.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,26 @@ | ||
package org.example; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import java.util.Arrays; | ||
|
||
import org.jruby.embed.ScriptingContainer; | ||
|
||
import org.junit.Test; | ||
|
||
public class SimpleTest { | ||
|
||
@Test | ||
public void test() throws Exception { | ||
ScriptingContainer container = new ScriptingContainer(); | ||
container.getProvider().getRubyInstanceConfig().setJRubyHome("uri:classloader://META-INF/jruby.home"); | ||
container.getProvider().getRubyInstanceConfig().setLoadPaths(Arrays.asList("../../../", | ||
"../../../test/externals/ruby1.9", | ||
"../../../test/externals/ruby1.9/ruby")); | ||
|
||
String output = (String) container.runScriptlet("Dir.pwd"); | ||
|
||
assertEquals( output, "hello world" ); | ||
} | ||
|
||
} |
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