-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes jruby/jruby#3850
- Loading branch information
Showing
6 changed files
with
158 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.jruby.warbler</groupId> | ||
<artifactId>integration-tests</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
|
||
<artifactId>runnable_w_bundler_test</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<name>runnable_w_bundler_test</name> | ||
|
||
<properties> | ||
<test-file>test-file.tmp</test-file> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>2.5</version> | ||
<executions> | ||
<execution> | ||
<id>auto-clean</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>clean</goal> | ||
</goals> | ||
<configuration> | ||
<excludeDefaultDirectories>true</excludeDefaultDirectories> | ||
<filesets> | ||
<fileset> | ||
<directory>${project.build.directory}</directory> | ||
<includes> | ||
<include>${test-file}</include> | ||
</includes> | ||
</fileset> | ||
</filesets> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>jruby-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>warble</id> | ||
<phase>pre-integration-test</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>test-rake-task</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<executable>java</executable> | ||
<workingDirectory>${project.build.directory}</workingDirectory> | ||
<arguments> | ||
<argument>-jar</argument> | ||
<argument>test.jar</argument> | ||
<argument>-S</argument> | ||
<argument>run.rb</argument> | ||
<argument>${project.build.directory}/${test-file}</argument> | ||
</arguments> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<testFilename>${project.build.directory}/${test-file}</testFilename> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'json', '1.8.3' | ||
|
||
#gem 'warbler', :group => 'development' |
18 changes: 18 additions & 0 deletions
18
integration/runnable_w_bundler_test/src/main/ruby/bin/run.rb
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,18 @@ | ||
require 'bundler/setup' | ||
|
||
path = File.join(Gem.loaded_specs['json'].full_gem_path, 'lib') | ||
File.open(ARGV[2], 'w') do |f| | ||
f.puts("hello world") | ||
f.puts path | ||
f.puts $LOAD_PATH | ||
end | ||
|
||
unless $LOAD_PATH.member? path | ||
raise "wrong load path, expected #{path} to be in #{$LOAD_PATH}" | ||
end | ||
|
||
$LOAD_PATH.each do |p| | ||
unless p =~ /^uri:classloader:/ | ||
raise "expected path #{p} to start with uri:classloader:" | ||
end | ||
end |
7 changes: 7 additions & 0 deletions
7
integration/runnable_w_bundler_test/src/main/ruby/config/warble.rb
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,7 @@ | ||
Warbler::Config.new do |config| | ||
config.features = %w(executable) | ||
config.autodeploy_dir = "../../../target" | ||
config.jar_name = "test" | ||
|
||
config.includes = FileList["Gemfile*"] + FileList["bin/*rb"] | ||
end |
22 changes: 22 additions & 0 deletions
22
integration/runnable_w_bundler_test/src/test/java/org/jruby/warbler/RunnableWarTestIT.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,22 @@ | ||
package org.jruby.warbler; | ||
|
||
import java.net.*; | ||
import java.io.*; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.hamcrest.Matcher; | ||
import org.hamcrest.Matchers; | ||
|
||
/** | ||
* Unit test for simple runnable war. | ||
*/ | ||
public class RunnableWarTestIT | ||
{ | ||
@Test | ||
public void testApp() throws Exception | ||
{ | ||
String testFilename = System.getProperty("testFilename"); | ||
File f = new File(testFilename); | ||
Assert.assertTrue(testFilename + "should exist", f.exists()); | ||
} | ||
} |
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