-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not run jetty test with jdk6. add same test for tomcat
- Loading branch information
Showing
10 changed files
with
277 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pkg |
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,4 @@ | ||
. | ||
config.ru | ||
gems | ||
specifications |
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,80 @@ | ||
#-*- mode: ruby -*- | ||
|
||
# it is war-file | ||
packaging 'war' | ||
|
||
# get jruby dependencies | ||
properties( 'jruby.version' => '@project.version@', | ||
'jruby.plugins.version' => '1.0.7', | ||
'project.build.sourceEncoding' => 'utf-8', | ||
'public.dir' => '${basedir}/public' ) | ||
|
||
pom( 'org.jruby:jruby', '${jruby.version}' ) | ||
|
||
jar( 'org.jruby.rack:jruby-rack', '1.1.18', | ||
:exclusions => [ 'org.jruby:jruby-complete' ] ) | ||
|
||
|
||
# ruby-maven will dump an equivalent pom.xml | ||
properties[ 'tesla.dump.pom' ] = 'pom.xml' | ||
|
||
# a gem to be used | ||
gem 'flickraw', '0.9.7' | ||
|
||
repository( :url => 'http://rubygems-proxy.torquebox.org/releases', | ||
:id => 'rubygems-releases' ) | ||
|
||
jruby_plugin :gem, :includeRubygemsInResources => true, :includeLibDirectoryInResources => true do | ||
execute_goal :initialize | ||
end | ||
|
||
# not really needed but for completeness: | ||
# pack the war with that ruby-like directory layout | ||
plugin( :war, '2.2', | ||
:warSourceDirectory => '${public.dir}' ) | ||
|
||
resource :directory => '${basedir}', :includes => [ 'config.ru', '.jrubydir' ] | ||
|
||
# start tomcat for the tests | ||
plugin( 'org.codehaus.mojo:tomcat-maven-plugin', '1.1', | ||
:fork => true, :path => '/', | ||
:warSourceDirectory => '${public.dir}' ) do | ||
execute_goals( 'run', | ||
:id => 'run-tomcat', | ||
:phase => 'pre-integration-test' ) | ||
end | ||
|
||
# download files during the tests | ||
execute 'download', :phase => 'integration-test' do | ||
require 'open-uri' | ||
result = open( 'http://localhost:8080' ).string | ||
File.open( 'result', 'w' ) { |f| f.puts result } | ||
puts result | ||
end | ||
|
||
# verify the downloads | ||
execute 'check download', :phase => :verify do | ||
result = File.read( 'result' ) | ||
expected = 'hello world:' | ||
unless result.match( /^#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'self: uri:classloader://config.ru' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'PWD: uri:classloader://' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
expected = 'Gem.path: ."uri:classloader://",' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
# TODO get rid off this over normalization | ||
expected = 'uri:classloader:/gems/flickraw-0.9.7' | ||
unless result.match( /#{expected}/ ) | ||
raise "missed expected string in download: #{expected}" | ||
end | ||
end | ||
# vim: syntax=Ruby |
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,19 @@ | ||
#-*- mode: ruby -*- | ||
|
||
use Rack::ShowExceptions | ||
|
||
require 'hello_world' | ||
|
||
run lambda { |env| | ||
require 'flickraw' | ||
[ | ||
200, | ||
{ | ||
'Content-Type' => 'text/html', | ||
'Cache-Control' => 'public, max-age=86400' | ||
}, | ||
[ "self: #{__FILE__}\n", "PWD: #{Dir.pwd}\n", "Gem.path: #{Gem.path.inspect}\n", Gem.loaded_specs['flickraw'].gem_dir + "\n", HelloWorld.new + "\n" ] | ||
] | ||
} | ||
|
||
# vim: syntax=Ruby |
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 @@ | ||
require 'openssl' | ||
|
||
class HelloWorld < String | ||
def initialize | ||
super "hello world: #{OpenSSL::Random.random_bytes( 16 ).inspect}" | ||
end | ||
end |
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,140 @@ | ||
<?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>j2ee_tomcat_rack</artifactId> | ||
<version>0.0.0</version> | ||
<packaging>war</packaging> | ||
<name>j2ee_tomcat_rack</name> | ||
<properties> | ||
<jruby.version>@project.version@</jruby.version> | ||
<jruby.plugins.version>1.0.7</jruby.plugins.version> | ||
<tesla.dump.pom>pom.xml</tesla.dump.pom> | ||
<public.dir>${basedir}/public</public.dir> | ||
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding> | ||
<tesla.version>0.1.1</tesla.version> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby</artifactId> | ||
<version>${jruby.version}</version> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby.rack</groupId> | ||
<artifactId>jruby-rack</artifactId> | ||
<version>1.1.18</version> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>jruby-complete</artifactId> | ||
<groupId>org.jruby</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>rubygems</groupId> | ||
<artifactId>flickraw</artifactId> | ||
<version>0.9.7</version> | ||
<type>gem</type> | ||
</dependency> | ||
</dependencies> | ||
<repositories> | ||
<repository> | ||
<id>rubygems-releases</id> | ||
<url>http://rubygems-proxy.torquebox.org/releases</url> | ||
</repository> | ||
</repositories> | ||
<build> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}</directory> | ||
<includes> | ||
<include>config.ru</include> | ||
<include>.jrubydir</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>de.saumya.mojo</groupId> | ||
<artifactId>gem-maven-plugin</artifactId> | ||
<version>${jruby.plugins.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>initialize</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<includeRubygemsInResources>true</includeRubygemsInResources> | ||
<includeLibDirectoryInResources>true</includeLibDirectoryInResources> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.2</version> | ||
<configuration> | ||
<warSourceDirectory>${public.dir}</warSourceDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>tomcat-maven-plugin</artifactId> | ||
<version>1.1</version> | ||
<executions> | ||
<execution> | ||
<id>run-tomcat</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<fork>true</fork> | ||
<path>/</path> | ||
<warSourceDirectory>${public.dir}</warSourceDirectory> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-maven-plugin</artifactId> | ||
<version>${tesla.version}</version> | ||
<executions> | ||
<execution> | ||
<id>download</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>execute</goal> | ||
</goals> | ||
<configuration> | ||
<taskId>download</taskId> | ||
<nativePom>Mavenfile</nativePom> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>check download</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>execute</goal> | ||
</goals> | ||
<configuration> | ||
<taskId>check download</taskId> | ||
<nativePom>Mavenfile</nativePom> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.tesla.polyglot</groupId> | ||
<artifactId>tesla-polyglot-ruby</artifactId> | ||
<version>${tesla.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
maven/jruby/src/it/j2ee_tomcat_rack/public/WEB-INF/.gitignore
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,2 @@ | ||
classes | ||
config.ru |
22 changes: 22 additions & 0 deletions
22
maven/jruby/src/it/j2ee_tomcat_rack/public/WEB-INF/web.xml
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 @@ | ||
<!DOCTYPE web-app PUBLIC | ||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" | ||
"http://java.sun.com/dtd/web-app_2_3.dtd"> | ||
<web-app> | ||
<context-param> | ||
<param-name>jruby.rack.layout_class</param-name> | ||
<param-value>JRuby::Rack::ClassPathLayout</param-value> | ||
</context-param> | ||
|
||
<filter> | ||
<filter-name>RackFilter</filter-name> | ||
<filter-class>org.jruby.rack.RackFilter</filter-class> | ||
</filter> | ||
<filter-mapping> | ||
<filter-name>RackFilter</filter-name> | ||
<url-pattern>/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<listener> | ||
<listener-class>org.jruby.rack.RackServletContextListener</listener-class> | ||
</listener> | ||
</web-app> |