Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to BVTs to run tests for different Java versions

 - Testing Spring, Grails, Play and Standalone with Java 6 and Java 7

 - Bumped submodule pointer for assets

Change-Id: Ic0166f5f9e92575bc95e6c72ba86119ded8a1712
  • Loading branch information...
commit 5d530ca62a2b8571e5f9a38c76e781a6c576b565 1 parent d4a945d
Thomas Risberg authored
2  Gemfile
View
@@ -13,7 +13,7 @@ gem "rest-client"
gem "rubyzip", "~> 0.9.4"
gem "terminal-table"
gem "highline"
-gem "vmc", ">= 0.3.16.beta5"
+gem "vmc", ">= 0.3.17"
gem "parallel", "0.5.11"
gem "parallel_tests"
gem "caldecott", "~> 0.0.4"
4 Gemfile.lock
View
@@ -68,7 +68,7 @@ GEM
rack (>= 1.0.0)
tilt (1.3.3)
uuidtools (2.1.2)
- vmc (0.3.16.beta.6)
+ vmc (0.3.17)
addressable (~> 2.2.6)
interact (~> 0.4.0)
json_pure (< 1.7.0, >= 1.5.1)
@@ -98,5 +98,5 @@ DEPENDENCIES
rspec (= 1.3.0)
rubyzip (~> 0.9.4)
terminal-table
- vmc (>= 0.3.16.beta5)
+ vmc (>= 0.3.17)
yajl-ruby
2  assets
@@ -1 +1 @@
-Subproject commit 31896717d2147ccee687ac7cbd9b0698d825bed1
+Subproject commit edc11c9ae657460ece80f07e900b3782a69fadbe
84 features/java_apps_version.feature
View
@@ -0,0 +1,84 @@
+@java @versions
+Feature: Deploy jvm apps with different versions
+
+ As a user with all canonical apps
+ I want to deploy java apps with different versions
+
+ Background: deploying canonical service
+ Given I have registered and logged in
+
+ @spring
+ Scenario: java test deploy app using java 6
+ Given I have deployed my application named app_spring_service
+ Then I should be able to get java version, and I should see 1.6
+ When I delete my application
+ Then it should not be on AppCloud
+
+ @spring @mysql
+ Scenario: java test deploy app using java 7
+ Given I have Java 7 runtime available
+ And I have deployed my application named app_spring_service_7
+ Then I should be able to get java version, and I should see 1.7
+ When I provision mysql service
+ Then I post mysqlabc to mysql service with key abc
+ Then I should be able to get from mysql service with key abc, and I should see mysqlabc
+ Then I delete my service
+ When I delete my application
+ Then it should not be on AppCloud
+
+ @grails @mysql
+ Scenario: start Spring Grails application using Java 6
+ Given I deploy a Spring Grails application using the MySQL DB service
+ Then I should be able to get app status, and I should see 1.6 jvm version
+ Then I delete all my service
+ Then I delete my application
+
+ @grails @mysql
+ Scenario: start Spring Grails application and add some records using Java 7
+ Given I have Java 7 runtime available
+ And I deploy a Spring Grails application using Java 7 and the MySQL DB service
+ Then I should be able to get app status, and I should see 1.7 jvm version
+ When I add 3 records to the Grails application
+ Then I should have the same 3 records on retrieving all records from the Grails application
+ Then I delete all my service
+ Then I delete my application
+
+ @play
+ Scenario: Deploy Play Application using Java 6
+ Given I have deployed my application named play_todolist_app without starting
+ Then I start my application named play_todolist_app
+ Then I should be able to get java version, and I should see 1.6
+ Then I delete my application
+
+ @play @mysql
+ Scenario: Deploy Play Application using Java 7 with mysql auto-reconfiguration
+ Given I have Java 7 runtime available
+ And I have deployed my application named play_todolist_app_7 without starting
+ Then I provision mysql service without restarting
+ Then I start my application named play_todolist_app_7
+ When I query status of my application
+ Then I should be able to get java version, and I should see 1.7
+ Then I should get the state of my application
+ Then I should be able to access my application URL tasks
+ Then I should be able to access my application file logs/stdout.log and get text including Auto-reconfiguring default
+ Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:mysql
+ Then I delete all my service
+ Then I delete my application
+
+ @standalone
+ Scenario: Deploy Standalone App with Java 6 runtime
+ Given I have deployed my application named standalone_java_app
+ Then I should be able to access my application file logs/stdout.log and get text including Java version: 1.6
+ When I delete my application
+ Then it should not be on Cloud Foundry
+
+ @standalone
+ Scenario: Deploy Standalone App with Java 7 runtime
+ Given I have Java 7 runtime available
+ And I have deployed my application named standalone_java_app_7
+ When I query status of my application
+ Then I should get the state of my application
+ Then I should be able to access my application file logs/stdout.log and get text including Java version: 1.7
+ Then I should be able to access my application file logs/stdout.log and get text including Hello from the cloud. Java opts: -Xms256m -Xmx256m -Djava.io.tmpdir=appdir/temp
+ When I delete my application
+ Then it should not be on Cloud Foundry
2  features/standalone_apps.feature
View
@@ -48,7 +48,7 @@ Feature: Standalone application support
Given I have deployed my application named standalone_java_app
When I query status of my application
Then I should get the state of my application
- Then I should be able to access my application file logs/stdout.log and see Hello from the cloud. Java opts: -Xms256m -Xmx256m -Djava.io.tmpdir=appdir/temp
+ Then I should be able to access my application file logs/stdout.log and get text including Hello from the cloud. Java opts: -Xms256m -Xmx256m -Djava.io.tmpdir=appdir/temp
When I delete my application
Then it should not be on Cloud Foundry
36 features/step_definitions/appcloud_steps.rb
View
@@ -936,3 +936,39 @@
Given /^PENDING/ do
pending
end
+
+Given /^I have Java 7 runtime available$/ do
+ # Try to find Java 7
+ java7_ready = true
+
+ # figure out if cloud has Java 7 runtime
+ runtimes = @client.info().to_a().join()
+ if (runtimes =~ /java7/)
+ puts "target cloud has Java 7 runtime"
+ else
+ puts "target cloud does not support Java 7"
+ java7_ready = false
+ end
+
+ if !java7_ready
+ pending "Not running Java 7 test because the Java 7 runtime is not installed"
+ end
+end
+
+Then /^I should be able to get java version, and I should see (\S+)$/ do |value|
+ contents = get_app_contents @app, "java"
+ contents.should_not == nil
+ contents.body_str.should_not == nil
+ contents.response_code.should == 200
+ contents.body_str.should include value
+ contents.close
+end
+
+Then /^I should be able to get app status, and I should see (\S+) jvm version$/ do |value|
+ contents = get_app_contents @app, "/"
+ contents.should_not == nil
+ contents.body_str.should_not == nil
+ contents.response_code.should == 200
+ contents.body_str.should include "JVM version: #{value}"
+ contents.close
+end
6 features/step_definitions/autostaging_steps.rb
View
@@ -316,6 +316,12 @@ def create_and_start_app app, expected_health, service=nil
health.should == expected_health
end
+Given /^I deploy a Spring Grails application using Java 7 and the MySQL DB service$/ do
+ expected_health = 1.0
+ health = create_and_start_app GRAILS_APP_7, expected_health
+ health.should == expected_health
+end
+
When /^I add (\d+) records to the Grails application$/ do |arg1|
@records = {}
uri = get_uri @app, "guest/save"
1  features/support/env.rb
View
@@ -42,6 +42,7 @@
DBRAILS_APP = "dbrails_app"
DBRAILS_BROKEN_APP = "dbrails_broken_app"
GRAILS_APP = "grails_app"
+GRAILS_APP_7 = "grails_app_7"
ROO_APP = "roo_app"
SIMPLE_ERLANG_APP = "mochiweb_test"
SIMPLE_LIFT_APP = "simple-lift-app"
26 features/support/testconfig.yml
View
@@ -76,6 +76,12 @@ grails_app:
memory: 512
path: "assets/grails/guestbook/target"
+grails_app_7:
+ framework: "grails"
+ runtime: java7
+ memory: 512
+ path: "assets/grails/guestbook/target"
+
roo_app:
framework: "spring_web/1.0"
memory: 256
@@ -240,6 +246,12 @@ app_spring_service:
memory: 512
path: "assets/spring/app_spring_service/target"
+app_spring_service_7:
+ framework: "spring"
+ runtime: java7
+ memory: 512
+ path: "assets/spring/app_spring_service/target"
+
my_test_app_env_test_app:
framework: "http://b20nine.com/unknown"
memory: 64
@@ -378,6 +390,14 @@ standalone_java_app:
path: "assets/standalone/java_app/target/appassembler"
no_url: true
+standalone_java_app_7:
+ framework: "standalone"
+ command: "bin/hello-cloud"
+ runtime: java7
+ memory: 256
+ path: "assets/standalone/java_app/target/appassembler"
+ no_url: true
+
standalone_node_app:
framework: "standalone"
command: "node app.js"
@@ -460,6 +480,12 @@ play_todolist_app:
memory: 256
path: "assets/play/todolist/target"
+play_todolist_app_7:
+ framework: "play"
+ runtime: java7
+ memory: 128
+ path: "assets/play/todolist/target"
+
play_zentasks_cf_by_name_app:
framework: "play"
memory: 256
Please sign in to comment.
Something went wrong with that request. Please try again.