Permalink
Browse files

add pom and Mavenfile and revised readme

  • Loading branch information...
1 parent adf968f commit 5d8bdc10287bce27b57dac6ab95207bab8eb41fd @mkristian committed Mar 15, 2011
Showing with 610 additions and 11 deletions.
  1. +1 −0 demo/.gitignore
  2. +40 −0 demo/Mavenfile
  3. +22 −11 demo/README.textile
  4. +547 −0 demo/pom.xml
View
@@ -3,3 +3,4 @@ db/*.sqlite3
log/*.log
tmp/**/*
Gemfile.lock
+Gemfile.files
View
@@ -0,0 +1,40 @@
+# -*- mode: ruby -*-
+properties["jruby.plugins.version"] = '0.25.0'
+
+jar('junit:junit', '3.8.2').scope 'test'
+
+jar('org.seleniumhq.selenium.client-drivers:selenium-java-client-driver', '1.0.1').scope 'test'
+
+plugin('org.mortbay.jetty:jetty-maven-plugin') do |jetty|
+ jetty.with(:stopKey => 'foo', :stopPort => 9999)
+ jetty.in_phase('pre-integration-test').execute_goal('run').with(:daemon => true)
+ jetty.in_phase('post-integration-test').execute_goal('stop')
+end
+
+plugin('org.codehaus.mojo:selenium-maven-plugin', '1.1') do |selenium|
+ selenium.in_phase('pre-integration-test').execute_goal("start-server").with(
+ {
+ :background => true,
+ :firefoxProfileTemplate => "${basedir}/src/test/resources/selenium"
+ })
+end
+
+plugin('surefire', '2.6') do |surefire|
+ # skip the test dring test phase
+ surefire.with :skip => true
+ # but execute them during integration-test phase
+ surefire.in_phase('integration-test').execute_goal('test').with :skip => false
+end
+
+execute_in_phase(:initialize) do
+ require 'fileutils'
+
+ if File.exists? 'pom.xml'
+ pom_xml = File.new "pom.xml"
+ pom = File.new "Gemfile.pom"
+ out_of_date = pom_xml.mtime < pom.mtime
+ else
+ out_of_date = true
+ end
+ FileUtils.cp("Gemfile.pom", "pom.xml") if out_of_date
+end
View
@@ -1,48 +1,59 @@
h1. Start the demo application
-h2. with maven3 (jetty)
+p. note: Gemfile.lock is not part of the git repository since it is platform dependent and can not be use for MRI and JRuby at the same time.
+
+h2. with maven3 (using jetty)
bc. mvn rails3:rake -Dargs="db:setup"
-mvn jetty:run -f Gemfile.pom
+mvn jetty:run
p. note: there is no need to have jruby, rubygems, rails installed !!!
-h2. with ruby-maven gem (jetty)
+h2. with ruby-maven gem (using jetty)
-bc. jruby -S gem install ruby-maven --pre
+bc. jruby -S gem install ruby-maven
rmvn rake db:setup
-rmvn jetty-run
+rmvn jetty:run
p. note: you need to have jruby installed but no rails or bundler !!!
-h2. with jruby (webrick)
+h2. with jruby (using webrick) without enforce-ssl
bc. jruby -S bundle install
jruby -S rake db:setup
jruby script/rails server
+p. or with ruby-maven
+
+bc. rmvn rake db:setup
+rmvn rails server
+
+p. enforce-ssl does not work since the server listens only on one port and it is kind of hacky to get SSL working
+
p. note: you to have jruby and bundler installed !!!
-h2. with ruby (webrick)
+h2. with ruby (using webrick) without enforce-ssl
bc. bundle install
rake db:setup
script/rails server
+p. enforce-ssl does not work since the server listens only on one port and it is kind of hacky to get SSL working
+
p. note: you to have bundler installed !!!
h1. Run the integration test (selenium)
-h2. with maven3 (jetty)
+h2. with maven3
bc. mvn rails3:rake -Dargs="db:setup"
-mvn integration-test -f Gemfile.pom
+mvn integration-test
p. note: there is no need to have jruby, rubygems, rails installed !!!
-h2. with ruby-maven gem (jetty)
+h2. with ruby-maven
-bc. jruby -S gem install ruby-maven --pre
+bc. jruby -S gem install ruby-maven
rmvn rake db:setup
rmvn integration-test
Oops, something went wrong.

0 comments on commit 5d8bdc1

Please sign in to comment.