Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Play 2.1 tests

  • Loading branch information...
commit 25a39c4f031819b1770e4aea1c524f329a95c9f7 1 parent 41ab889
Jennifer Hickey and Maria Shaldibina authored
View
2  .gitignore
@@ -3,7 +3,7 @@
.#*
*~
tools/.build
-tools/play-2.0.1
+tools/play-*
vendor/
!vendor/cache/vcap_logging-1.0.0.gem
.bundle/
2  assets
@@ -1 +1 @@
-Subproject commit b4b39da7d46536aeebca12ddb9a150aaf69780af
+Subproject commit 5802654832e75c05537aa47768f46f5f6046b4bc
View
29 config/assets.yml
@@ -492,71 +492,72 @@ standalone_ruby18_autoconfig:
memory: 64
path: "assets/standalone/ruby_autoconfig"
-play_computer_database_autoconfig_disabled_app:
+play_computer_database_autoconfig_disabled_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/computer_database_autoconfig_disabled.zip"
-play_computer_database_cf_by_name_app:
+play_computer_database_cf_by_name_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/computer_database_cf_by_name.zip"
-play_computer_database_cf_by_type_app:
+play_computer_database_cf_by_type_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/computer_database_cf_by_type.zip"
-play_computer_database_jpa_mysql_app:
+play_computer_database_jpa_mysql_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/computer_database_jpa_mysql.zip"
-play_computer_database_jpa_app:
+play_computer_database_jpa_app_21:
framework: "buildpack"
memory: 256
runtime: "ruby19"
- path: ".assets-binaries/computer_database_jpa.zip"
+ path: ".assets-binaries/computer_database_jpa-2.1.zip"
-play_computer_database_multi_dbs_app:
+play_computer_database_multi_dbs_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/computer_database_multi_dbs.zip"
-play_computer_database_scala_app:
+play_computer_database_scala_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/computer_database_scala.zip"
-play_todolist_app:
+play_todolist_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/todolist.zip"
-play_todolist_with_cfruntime_app:
+
+play_todolist_with_cfruntime_app_21:
framework: "buildpack"
memory: 256
runtime: "ruby19"
- path: ".assets-binaries/todolist_with_cfruntime.zip"
+ path: ".assets-binaries/todolist_with_cfruntime-2.1.zip"
-play_zentasks_cf_by_name_app:
+play_zentasks_cf_by_name_app_20:
framework: "buildpack"
memory: 256
runtime: "ruby19"
path: ".assets-binaries/zentasks_cf_by_name.zip"
-play_zentasks_cf_by_type_app:
+play_zentasks_cf_by_type_app_21:
framework: "buildpack"
memory: 256
runtime: "ruby19"
- path: ".assets-binaries/zentasks_cf_by_type.zip"
+ path: ".assets-binaries/zentasks_cf_by_type-2.1.zip"
auto-reconfig-annotation-app:
framework: "buildpack"
View
201 spec/canonical/java_play_spec.rb
@@ -30,14 +30,13 @@ def verify_file(file_list, file1)
has_file
end
- it "play application with mysql auto-reconfiguration", :mysql => true,
- :p1 => true do
- app = create_push_app("play_todolist_app", nil, nil, [MYSQL_MANIFEST])
+ it "play application with mysql auto-reconfiguration", :mysql => true, :p1 => true do
+ app = create_push_app("play_todolist_app_20", nil, nil, [MYSQL_MANIFEST])
- contents = app.get_response( :get, '/tasks' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/tasks')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
@@ -46,36 +45,35 @@ def verify_file(file_list, file1)
end
it "play application using cloud foundry runtime lib", :mysql => true do
- app = create_push_app("play_todolist_with_cfruntime_app", nil, nil, [MYSQL_MANIFEST])
+ app = create_push_app("play_todolist_with_cfruntime_app_21", nil, nil, [MYSQL_MANIFEST])
- contents = app.get_response( :get, '/tasks' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/tasks')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
log.should include("Found cloudfoundry-runtime lib. " +
- "Auto-reconfiguration disabled")
+ "Auto-reconfiguration disabled")
log.should include("database [default] connected at jdbc:h2")
end
- it "play application using cloud properties for mysql configuration by " +
- "service name", :mysql => true do
- app = create_app("play_zentasks_cf_by_name_app")
+ it "play 2.0 application using cloud properties for mysql configuration by " + "service name", :mysql => true do
+ app = create_app("play_zentasks_cf_by_name_app_20")
service = create_service(MYSQL_MANIFEST, "play_zentasks_cf_by_name_appmysql")
app.push([service])
- contents = app.get_response( :get, '/login' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/login')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
log.should include("Found cloud properties in configuration. " +
- "Auto-reconfiguration disabled")
+ "Auto-reconfiguration disabled")
log.should include("database [default] connected at jdbc:mysql")
files = app.files("/app/lib/")
@@ -84,32 +82,32 @@ def verify_file(file_list, file1)
has_file.should == false
end
- it "play application using cloud properties for mysql configuration " +
- "by service type", :mysql => true do
- app = create_app("play_zentasks_cf_by_type_app")
+ it "play 2.1 application using cloud properties for mysql configuration " +
+ "by service type", :mysql => true do
+ app = create_app("play_zentasks_cf_by_type_app_21")
service = create_service(MYSQL_MANIFEST)
app.push([service])
- contents = app.get_response( :get, '/login' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/login')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
log.should include("Found cloud properties in configuration. " +
- "Auto-reconfiguration disabled")
+ "Auto-reconfiguration disabled")
log.should include("database [default] connected at jdbc:mysql")
end
- it "play application with auto-reconfiguration disabled", :mysql => true do
- app = create_push_app("play_computer_database_autoconfig_disabled_app", nil, nil, [MYSQL_MANIFEST])
+ it "play 2.0 application with auto-reconfiguration disabled", :mysql => true do
+ app = create_push_app("play_computer_database_autoconfig_disabled_app_20", nil, nil, [MYSQL_MANIFEST])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
@@ -117,23 +115,23 @@ def verify_file(file_list, file1)
log.should include("database [default] connected at jdbc:h2")
end
- it "play application using cloud properties for postgresql configuration " +
- "by service name", :postgresql => true do
- app = create_app("play_computer_database_cf_by_name_app")
+ it "play 2.0 application using cloud properties for postgresql configuration " +
+ "by service name", :postgresql => true do
+ app = create_app("play_computer_database_cf_by_name_app_20")
service = create_service(POSTGRESQL_MANIFEST,
- "play_computer_database_cf_by_name_apppostgresql")
+ "play_computer_database_cf_by_name_apppostgresql")
app.push([service])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
log.should include("Found cloud properties in configuration. " +
- "Auto-reconfiguration disabled" )
+ "Auto-reconfiguration disabled")
log.should include("database [default] connected at jdbc:postgresql")
files = app.files("/app/lib/")
@@ -142,23 +140,23 @@ def verify_file(file_list, file1)
has_file.should == false
end
- it "play application using cloud properties for postgresql configuration " +
- "by service type", :postgresql => true do
- app = create_app("play_computer_database_cf_by_type_app")
+ it "play 2.0 application using cloud properties for postgresql configuration " +
+ "by service type", :postgresql => true do
+ app = create_app("play_computer_database_cf_by_type_app_20")
service = create_service(POSTGRESQL_MANIFEST)
app.push([service])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
log.should include("Found cloud properties in configuration. " +
- "Auto-reconfiguration disabled" )
+ "Auto-reconfiguration disabled")
log.should include("database [default] connected at jdbc:postgresql")
files = app.files("/app/lib/")
@@ -167,14 +165,14 @@ def verify_file(file_list, file1)
has_file.should == false
end
- it "play application with mysql JPA auto-reconfiguration",
- :mysql => true do
- app = create_push_app("play_computer_database_jpa_mysql_app", nil, nil, [MYSQL_MANIFEST])
+ it "play 2.0 application with mysql JPA auto-reconfiguration",
+ :mysql => true do
+ app = create_push_app("play_computer_database_jpa_mysql_app_20", nil, nil, [MYSQL_MANIFEST])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
@@ -182,14 +180,14 @@ def verify_file(file_list, file1)
log.should include("database [default] connected at jdbc:mysql")
end
- it "play application with postgresql JPA auto-reconfiguration",
- :postgresql => true, :p1 => true do
- app = create_push_app("play_computer_database_jpa_app", nil, nil, [POSTGRESQL_MANIFEST])
+ it "play 2.1 application with postgresql JPA auto-reconfiguration",
+ :postgresql => true, :p1 => true do
+ app = create_push_app("play_computer_database_jpa_app_21", nil, nil, [POSTGRESQL_MANIFEST])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
@@ -197,30 +195,30 @@ def verify_file(file_list, file1)
log.should include("database [default] connected at jdbc:postgresql")
end
- it "play application with multiple databases", :mysql => true,
- :postgresql => true do
- app = create_push_app("play_computer_database_multi_dbs_app", nil, nil, [POSTGRESQL_MANIFEST, MYSQL_MANIFEST])
+ it "play 2.0 application with multiple databases", :mysql => true,
+ :postgresql => true do
+ app = create_push_app("play_computer_database_multi_dbs_app_20", nil, nil, [POSTGRESQL_MANIFEST, MYSQL_MANIFEST])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
log.should include("Found multiple databases in Play configuration. " +
- "Skipping auto-reconfiguration")
+ "Skipping auto-reconfiguration")
log.should include("database [default] connected at jdbc:h2")
end
- it "play application with postgres auto-reconfiguration",
- :postgresql => true do
- app = create_push_app("play_computer_database_scala_app", nil, nil, [POSTGRESQL_MANIFEST])
+ it "play 2.0 application with postgres auto-reconfiguration",
+ :postgresql => true do
+ app = create_push_app("play_computer_database_scala_app_20", nil, nil, [POSTGRESQL_MANIFEST])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
@@ -228,15 +226,15 @@ def verify_file(file_list, file1)
log.should include("database [default] connected at jdbc:postgresql")
end
- it "play application with multiple database services, one named production",
- :postgresql => true do
- app = create_push_app("play_computer_database_scala_app", nil, nil, [POSTGRESQL_MANIFEST])
- bind_service( POSTGRESQL_MANIFEST, app, 'play-comp-db-app-production' )
+ it "play 2.0 application with multiple database services, one named production",
+ :postgresql => true do
+ app = create_push_app("play_computer_database_scala_app_20", nil, nil, [POSTGRESQL_MANIFEST])
+ bind_service(POSTGRESQL_MANIFEST, app, 'play-comp-db-app-production')
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
@@ -244,29 +242,18 @@ def verify_file(file_list, file1)
log.should include("database [default] connected at jdbc:postgresql")
end
- it "play application with multiple database services", :mysql => true,
- :postgresql => true do
- app = create_push_app("play_computer_database_scala_app", nil, nil, [POSTGRESQL_MANIFEST, MYSQL_MANIFEST])
+ it "play 2.0 application with multiple database services", :mysql => true, :postgresql => true do
+ app = create_push_app("play_computer_database_scala_app_20", nil, nil, [POSTGRESQL_MANIFEST, MYSQL_MANIFEST])
- contents = app.get_response( :get, '/computers' )
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.code.should == 200
+ contents = app.get_response(:get, '/computers')
+ contents.should_not == nil
+ contents.to_str.should_not == nil
+ contents.code.should == 200
log = app.logs
log.should_not == nil
log.should include("Found 0 or multiple database services bound to app. " +
- "Skipping auto-reconfiguration")
+ "Skipping auto-reconfiguration")
log.should include("database [default] connected at jdbc:h2")
end
-
- it "Deploy Play Application using Java 6" do
- app = create_push_app("play_todolist_app")
-
- contents = app.get_response(:get, '/java')
- contents.should_not == nil
- contents.to_str.should_not == nil
- contents.to_str.should =~ /1.6/
- contents.code.should == 200
- end
end
View
98 tools/Rakefile
@@ -45,57 +45,71 @@ end
BUILD_ARTIFACT = File.join(Dir.pwd, ".build")
TESTS_PATH = File.join(Dir.pwd, "../assets")
VCAP_BVT_ASSETS_PACKAGES_HOME = File.join(File.dirname(__FILE__),
- "../.assets-binaries")
-
-TESTS_TO_BUILD = ["#{TESTS_PATH}/spring/auto-reconfig-test-app",
- "#{TESTS_PATH}/spring/auto-reconfig-missing-deps-test-app",
- "#{TESTS_PATH}/spring/app_spring_service",
- "#{TESTS_PATH}/java_web/app_with_startup_delay",
- "#{TESTS_PATH}/java_web/tomcat-version-check-app",
- "#{TESTS_PATH}/spring/roo-guestbook",
- "#{TESTS_PATH}/spring/jpa-guestbook",
- "#{TESTS_PATH}/spring/hibernate-guestbook",
- "#{TESTS_PATH}/spring/spring-env",
- "#{TESTS_PATH}/spring/spring_imagemagick",
- "#{TESTS_PATH}/grails/guestbook",
- "#{TESTS_PATH}/java_web/java_tiny_app",
- "#{TESTS_PATH}/lift/hello_lift",
- "#{TESTS_PATH}/lift/lift-db-app",
- "#{TESTS_PATH}/standalone/java_app",
- "#{TESTS_PATH}/play/computer_database_autoconfig_disabled",
- "#{TESTS_PATH}/play/computer_database_cf_by_name",
- "#{TESTS_PATH}/play/computer_database_cf_by_type",
- "#{TESTS_PATH}/play/computer_database_jpa",
- "#{TESTS_PATH}/play/computer_database_jpa_mysql",
- "#{TESTS_PATH}/play/computer_database_multi_dbs",
- "#{TESTS_PATH}/play/computer_database_scala",
- "#{TESTS_PATH}/play/todolist",
- "#{TESTS_PATH}/play/todolist_with_cfruntime",
- "#{TESTS_PATH}/play/zentasks_cf_by_name",
- "#{TESTS_PATH}/play/zentasks_cf_by_type",
- "#{TESTS_PATH}/spring/auto-reconfig-annotation-app",
- "#{TESTS_PATH}/spring/javaee-namespace-app"
+ "../.assets-binaries")
+
+TESTS_TO_BUILD = [
+ "#{TESTS_PATH}/spring/auto-reconfig-test-app",
+ "#{TESTS_PATH}/spring/auto-reconfig-missing-deps-test-app",
+ "#{TESTS_PATH}/spring/app_spring_service",
+ "#{TESTS_PATH}/java_web/app_with_startup_delay",
+ "#{TESTS_PATH}/java_web/tomcat-version-check-app",
+ "#{TESTS_PATH}/spring/roo-guestbook",
+ "#{TESTS_PATH}/spring/jpa-guestbook",
+ "#{TESTS_PATH}/spring/hibernate-guestbook",
+ "#{TESTS_PATH}/spring/spring-env",
+ "#{TESTS_PATH}/spring/spring_imagemagick",
+ "#{TESTS_PATH}/grails/guestbook",
+ "#{TESTS_PATH}/java_web/java_tiny_app",
+ "#{TESTS_PATH}/lift/hello_lift",
+ "#{TESTS_PATH}/lift/lift-db-app",
+ "#{TESTS_PATH}/standalone/java_app",
+
+ "#{TESTS_PATH}/play/2.0/computer_database_autoconfig_disabled",
+ "#{TESTS_PATH}/play/2.0/computer_database_cf_by_name",
+ "#{TESTS_PATH}/play/2.0/computer_database_cf_by_type",
+ "#{TESTS_PATH}/play/2.0/computer_database_jpa_mysql",
+ "#{TESTS_PATH}/play/2.0/computer_database_multi_dbs",
+ "#{TESTS_PATH}/play/2.0/computer_database_scala",
+ "#{TESTS_PATH}/play/2.0/todolist",
+ "#{TESTS_PATH}/play/2.0/zentasks_cf_by_name",
+
+ "#{TESTS_PATH}/play/2.1/computer_database_jpa-2.1",
+ "#{TESTS_PATH}/play/2.1/todolist_with_cfruntime-2.1",
+ "#{TESTS_PATH}/play/2.1/zentasks_cf_by_type-2.1",
+
+ "#{TESTS_PATH}/spring/auto-reconfig-annotation-app",
+ "#{TESTS_PATH}/spring/javaee-namespace-app"
]
-PLAY_VERSION="2.0.1"
+PLAY_VERSIONS= {"2.0" => "2.0.1", "2.1" => "2.1.0" }
+
desc "Build the tests. If the git hash hasn't change, nothing is built. To force a build, invoke 'rake build[--force]'"
task :build, [:force] do |t, args|
- download_play if not File.exists? File.join(Dir.pwd, "play-#{PLAY_VERSION}","play")
+ puts "Downloading play"
+ PLAY_VERSIONS.each do |major_version, play_version|
+ download_play(play_version) if not File.exists? File.join(Dir.pwd, "play-#{play_version}","play")
+ end
+
puts "\nBuilding tests"
if build_required? args.force
prompt_message = "\nBVT need java development environment to build java-base apps.\n"+
- "Please run 'sudo aptitude install maven2 default-jdk' on your Linux box"
+ "Please run 'sudo aptitude install maven2 default-jdk' on your Linux box"
`mvn -v 2>&1`
raise prompt_message if $?.exitstatus != 0
ENV['MAVEN_OPTS']="-XX:MaxPermSize=256M"
- ENV['PLAY2_HOME']=File.join(Dir.pwd, "play-#{PLAY_VERSION}")
+
update_list = []
+ working_dir = Dir.pwd
+
TESTS_TO_BUILD.each do |test|
puts "\tBuilding '#{test}'"
Dir.chdir test do
- sh('mvn package -DskipTests') do |success, exit_code|
+ play_version_match = /play\/(.*)\//.match(test)
+ ENV['PLAY2_HOME']=File.join(working_dir, "play-#{PLAY_VERSIONS[play_version_match[1]]}") if play_version_match
+ puts "Play home: #{ENV['PLAY2_HOME']}"
+ sh('mvn clean package -DskipTests') do |success, exit_code|
if success
target_file = ''
file_name = ''
@@ -145,11 +159,17 @@ def build_required? (force_build=nil)
end
end
-def download_play
+def download_play(play_version)
puts "Downloading and unpacking Play Framework"
- sh("wget http://download.playframework.org/releases/play-#{PLAY_VERSION}.zip")
- sh("unzip -q play-#{PLAY_VERSION}.zip")
- FileUtils.rm_f("play-#{PLAY_VERSION}.zip")
+
+ if play_version == "2.0.1"
+ sh("wget http://downloads.typesafe.com/releases/play-2.0.1.zip")
+ else
+ sh("wget http://downloads.typesafe.com/play/#{play_version}/play-#{play_version}.zip")
+ end
+
+ sh("unzip -q play-#{play_version}.zip")
+ FileUtils.rm_f("play-#{play_version}.zip")
end
def save_git_hash
Please sign in to comment.
Something went wrong with that request. Please try again.