Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 14 commits
  • 17 files changed
  • 0 comments
  • 7 contributors
May 04, 2012
Dave Syer dsyer CFID-218: remove uaa mvn tests from BVTs
The plan is to remove the uaa submodule and replace it with a more
stable mechanism for launching the UAA server. The maven test code
would therefore not be available in vcap, so it doesn't make sense
to try and run them.  The tests only hit the UAA anyway, and are
run regularly by the identity team.  The existing BVTs will exercise
all the relevant UAA code paths once vmc starts to use the UAA.

Change-Id: Ie7133b1ef661c01066eba77e38856d8c880460c0
02c6fcb
Maria Shaldibina mariash npm support based on shrinkwrap tests
Change-Id: Ic7ebf9c1bc9054689d98b802326470a89592c61d
4c59459
May 05, 2012
Jennifer Hickey Add test for rake tasks in rails-console
Change-Id: I1ca09655c4ad179b0318181fe9c1854151a8fbfb
1ef469d
May 08, 2012
michael zhang Add pending for not supported service
Change-Id: Ia1139bd9910c2ee81d0ca8686cf36b56182ab6ce
Signed-off-by: michael zhang <zhangcheng@rbcon.com>
c55ada6
May 09, 2012
Maria Shaldibina mariash Merge "npm support based on shrinkwrap tests" 169ade3
Bob Nugmanov bnugmanov add .bvt_parallel.log to .gitignore
Change-Id: Ib93121da496d4ba5bef3851fdacc1256cdc57d94
05929ee
Jennifer Hickey Retry Rails Console login to fix timeout issue
Change-Id: Iff37821ec40b1dde06750f34feab333dbe7ef4a7
aa4ed62
May 10, 2012
Jennifer Hickey Merge "Retry Rails Console login to fix timeout issue" 60d658e
May 11, 2012
Dave Syer dsyer Merge "CFID-218: remove uaa mvn tests from BVTs The plan is to remove…
… the uaa submodule and replace it with a more stable mechanism for launching the UAA server. The maven test code would therefore not be available in vcap, so it doesn't make sense to try and run them. The tests only hit the UAA anyway, and are run regularly by the identity team. The existing BVTs will exercise all the relevant UAA code paths once vmc starts to use the UAA."
e333d77
Jennifer Hickey Add Play Framework tests
Change-Id: I28b413d07b4a78da0e11b49641bc3dd7bcabfdbd
c90171b
May 16, 2012
Thomas Risberg Update to BVTs that tests for Spring apps with 'javaee' namespace and…
… annotation config.

 - Adding BVT for Spring apps that use the 'javaee' namespace

 - Adding BVT for Spring apps that use AnnotationConfigWebApplicationContext

 - Bumping submodule pointer for test assets

Change-Id: I50a5672da507dc28702957773a48821433296d16
92fa906
May 17, 2012
Dave Syer dsyer Add BVT for UAA user approval endpoint
Change-Id: Ife51b91ded3fb5e4c7f5b832eb7d75227fcf31f0
558b387
Yang Yang SlimYang modified vblob bvt to use app_sinatra_service and bump assets pointer
Change-Id: I645753d83343f4f037c5b909b6ac74c71669edff
57e3450
May 18, 2012
Thomas Risberg Merge "Update to BVTs that tests for Spring apps with 'javaee' namesp…
…ace and annotation config."
1cbd153
2  .gitignore
@@ -14,3 +14,5 @@ ci-working-dir
14 14 *.pyc
15 15 .DS_Store
16 16 .build
  17 +.bvt_parallel.log
  18 +play-2.0.1
27 Rakefile
@@ -76,7 +76,7 @@ task 'ci-tests' => ci_steps
76 76 task 'ci-java-tests' => 'java_client:ci_tests'
77 77
78 78 desc "Run really simple tests for UAA service"
79   -task 'uaa-tests' => ['uaa:run', 'bvt:run_uaa']
  79 +task 'uaa-tests' => ['uaa:run']
80 80
81 81 def tests_path
82 82 if @tests_path == nil
@@ -97,15 +97,31 @@ TESTS_TO_BUILD = ["#{TESTS_PATH}/spring/auto-reconfig-test-app",
97 97 "#{TESTS_PATH}/spring/jpa-guestbook",
98 98 "#{TESTS_PATH}/spring/hibernate-guestbook",
99 99 "#{TESTS_PATH}/spring/spring-env",
  100 + "#{TESTS_PATH}/spring/javaee-namespace-app",
  101 + "#{TESTS_PATH}/spring/auto-reconfig-annotation-app",
100 102 "#{TESTS_PATH}/grails/guestbook",
101 103 "#{TESTS_PATH}/java_web/java_tiny_app",
102 104 "#{TESTS_PATH}/lift/hello_lift",
103 105 "#{TESTS_PATH}/lift/lift-db-app",
  106 + "#{TESTS_PATH}/play/computer_database_scala",
  107 + "#{TESTS_PATH}/play/computer_database_autoconfig_disabled",
  108 + "#{TESTS_PATH}/play/computer_database_cf_by_name",
  109 + "#{TESTS_PATH}/play/computer_database_cf_by_type",
  110 + "#{TESTS_PATH}/play/computer_database_jpa",
  111 + "#{TESTS_PATH}/play/computer_database_jpa_mysql",
  112 + "#{TESTS_PATH}/play/computer_database_multi_dbs",
  113 + "#{TESTS_PATH}/play/todolist",
  114 + "#{TESTS_PATH}/play/todolist_with_cfruntime",
  115 + "#{TESTS_PATH}/play/zentasks_cf_by_name",
  116 + "#{TESTS_PATH}/play/zentasks_cf_by_type",
104 117 "#{TESTS_PATH}/standalone/java_app"
105 118 ]
106 119
  120 +PLAY_VERSION="2.0.1"
  121 +
107 122 desc "Build the tests. If the git hash associated with the test assets has not changed, nothing is built. To force a build, invoke 'rake build[--force]'"
108 123 task :build, [:force] do |t, args|
  124 + download_play if not File.exists? File.join(Dir.pwd, "play-#{PLAY_VERSION}","play")
109 125 puts "\nBuilding tests"
110 126 sh('git submodule update --init')
111 127 if build_required? args.force
@@ -114,6 +130,7 @@ Please run 'sudo aptitude install maven2 default-jdk' on your Linux box"
114 130 `mvn -v 2>&1`
115 131 raise prompt_message if $?.exitstatus != 0
116 132 ENV['MAVEN_OPTS']="-XX:MaxPermSize=256M"
  133 + ENV['PLAY2_HOME']=File.join(Dir.pwd, "play-#{PLAY_VERSION}")
117 134 TESTS_TO_BUILD.each do |test|
118 135 puts "\tBuilding '#{test}'"
119 136 Dir.chdir test do
@@ -157,6 +174,13 @@ def build_required? (force_build=nil)
157 174 end
158 175 end
159 176
  177 +def download_play
  178 + puts "Downloading and unpacking Play Framework"
  179 + sh("wget http://download.playframework.org/releases/play-#{PLAY_VERSION}.zip")
  180 + sh("unzip -q play-#{PLAY_VERSION}.zip")
  181 + FileUtils.rm_f("play-#{PLAY_VERSION}.zip")
  182 +end
  183 +
160 184 def save_git_hash
161 185 Dir.chdir(tests_path) do
162 186 git_hash = `git rev-parse --short=8 --verify HEAD`
@@ -172,4 +196,3 @@ end
172 196 def do_mvn_clean options=nil
173 197 sh("mvn clean #{options}")
174 198 end
175   -
2  assets
... ... @@ -1 +1 @@
1   -Subproject commit 59e16c6c46a1946a61974b24d2575b89390e1cba
  1 +Subproject commit 31896717d2147ccee687ac7cbd9b0698d825bed1
7 features/autoreconfig.feature
@@ -55,3 +55,10 @@ Feature: Deploy applications that make use of autostaging
55 55 Then I delete all my service
56 56 Then I delete my application
57 57
  58 + @creates_auto_reconfig_annotation_app @creates_services @java @services
  59 + Scenario: start Spring 3.1 Hibernate application with an annotation context using a local DataSource
  60 + Given I deploy a Spring 3.1 Hibernate application with an annotation context using a local DataSource
  61 + Then the Hibernate SessionFactory should be auto-configured
  62 + Then I delete all my service
  63 + Then I delete my application
  64 +
5 features/autostaging.feature
@@ -54,3 +54,8 @@ Feature: Deploy applications that make use of autostaging
54 54 Then I delete all my service
55 55 Then I delete my application
56 56
  57 + @creates_javaee_namespace_app @java
  58 + Scenario: Start Spring Web Application using javaee namespace
  59 + Given I deploy a Spring Web Application that uses the javaee namespace
  60 + Then the application should start with no errors
  61 + Then I delete my application
16 features/canonical_apps_node_version.feature
@@ -36,3 +36,19 @@ Feature: Deploy the node app with different versions and dependencies
36 36 Then I should be able to access my application root and see it's running version v0.6.8
37 37 When I delete my application
38 38 Then it should not be on AppCloud
  39 +
  40 + Scenario: node test deploy app with dependencies version04
  41 + Given I have deployed my application named app_node_dependencies04
  42 + When I query status of my application
  43 + Then I should get the state of my application
  44 + Then I should be able to access my application root and see hello from express
  45 + When I delete my application
  46 + Then it should not be on AppCloud
  47 +
  48 + Scenario: node test deploy app with dependencies version06
  49 + Given I have deployed my application named app_node_dependencies06
  50 + When I query status of my application
  51 + Then I should get the state of my application
  52 + Then I should be able to access my application root and see hello from express
  53 + When I delete my application
  54 + Then it should not be on AppCloud
181 features/play.feature
... ... @@ -0,0 +1,181 @@
  1 +@smoke
  2 +Feature: Play! application support
  3 +
  4 + As a user of Cloud Foundry
  5 + I want to launch Play! apps
  6 +
  7 + Background: Play! app support
  8 + Given I have registered and logged in
  9 +
  10 + Scenario: Deploy Play Application with postgres auto-reconfiguration
  11 + Given that the postgresql service is available
  12 + Given I have deployed my application named play_computer_database_scala_app without starting
  13 + Then I provision postgresql service without restarting
  14 + Then I start my application named play_computer_database_scala_app
  15 + When I query status of my application
  16 + Then I should get the state of my application
  17 + Then I should be able to access my application URL computers
  18 + Then I should be able to access my application file logs/stdout.log and get text including Auto-reconfiguring default
  19 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:postgresql
  20 + Then I delete all my service
  21 + Then I delete my application
  22 +
  23 + Scenario: Deploy Play Application with mysql auto-reconfiguration
  24 + Given I have deployed my application named play_todolist_app without starting
  25 + Then I provision mysql service without restarting
  26 + Then I start my application named play_todolist_app
  27 + When I query status of my application
  28 + Then I should get the state of my application
  29 + Then I should be able to access my application URL tasks
  30 + Then I should be able to access my application file logs/stdout.log and get text including Auto-reconfiguring default
  31 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:mysql
  32 + Then I delete all my service
  33 + Then I delete my application
  34 +
  35 + Scenario: Deploy Play Application using cloud properties for mysql configuration by service type
  36 + Given I have deployed my application named play_zentasks_cf_by_type_app without starting
  37 + Then I provision mysql service without restarting
  38 + Then I start my application named play_zentasks_cf_by_type_app
  39 + When I query status of my application
  40 + Then I should get the state of my application
  41 + Then I should be able to access my application URL login
  42 + Then I should be able to access my application file logs/stdout.log and get text including Found cloud properties in configuration. Auto-reconfiguration disabled.
  43 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:mysql
  44 + Then I should be able to list application files and not find file app/lib/mysql-connector-java-5.1.12-bin.jar
  45 + Then I delete all my service
  46 + Then I delete my application
  47 +
  48 + Scenario: Deploy Play Application using cloud properties for postgresql configuration by service type
  49 + Given that the postgresql service is available
  50 + Given I have deployed my application named play_computer_database_cf_by_type_app without starting
  51 + Then I provision postgresql service without restarting
  52 + Then I start my application named play_computer_database_cf_by_type_app
  53 + When I query status of my application
  54 + Then I should get the state of my application
  55 + Then I should be able to access my application URL computers
  56 + Then I should be able to access my application file logs/stdout.log and get text including Found cloud properties in configuration. Auto-reconfiguration disabled.
  57 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:postgresql
  58 + Then I should be able to list application files and not find file app/lib/postgresql-9.0-801.jdbc4.jar
  59 + Then I delete all my service
  60 + Then I delete my application
  61 +
  62 + Scenario: Deploy Play Application using cloud properties for mysql configuration by service name
  63 + Given I have deployed my application named play_zentasks_cf_by_name_app without starting
  64 + Then I provision mysql service without restarting
  65 + Then I start my application named play_zentasks_cf_by_name_app
  66 + When I query status of my application
  67 + Then I should get the state of my application
  68 + Then I should be able to access my application URL login
  69 + Then I should be able to access my application file logs/stdout.log and get text including Found cloud properties in configuration. Auto-reconfiguration disabled.
  70 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:mysql
  71 + Then I should be able to list application files and not find file app/lib/mysql-connector-java-5.1.12-bin.jar
  72 + Then I delete all my service
  73 + Then I delete my application
  74 +
  75 + Scenario: Deploy Play Application using cloud properties for postgresql configuration by service name
  76 + Given that the postgresql service is available
  77 + Given I have deployed my application named play_computer_database_cf_by_name_app without starting
  78 + Then I provision postgresql service without restarting
  79 + Then I start my application named play_computer_database_cf_by_name_app
  80 + When I query status of my application
  81 + Then I should get the state of my application
  82 + Then I should be able to access my application URL computers
  83 + Then I should be able to access my application file logs/stdout.log and get text including Found cloud properties in configuration. Auto-reconfiguration disabled.
  84 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:postgresql
  85 + Then I should be able to list application files and not find file app/lib/postgresql-9.0-801.jdbc4.jar
  86 + Then I delete all my service
  87 + Then I delete my application
  88 +
  89 + Scenario: Deploy Play Application with auto-reconfiguration disabled
  90 + Given that the postgresql service is available
  91 + Given I have deployed my application named play_computer_database_autoconfig_disabled_app without starting
  92 + Then I provision postgresql service without restarting
  93 + Then I start my application named play_computer_database_autoconfig_disabled_app
  94 + When I query status of my application
  95 + Then I should get the state of my application
  96 + Then I should be able to access my application URL computers
  97 + Then I should be able to access my application file logs/stdout.log and get text including User disabled auto-reconfiguration
  98 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:h2
  99 + Then I delete all my service
  100 + Then I delete my application
  101 +
  102 + Scenario: Deploy Play Application using cloudfoundry-runtime lib
  103 + Given I have deployed my application named play_todolist_with_cfruntime_app without starting
  104 + Then I provision mysql service without restarting
  105 + Then I start my application named play_todolist_with_cfruntime_app
  106 + When I query status of my application
  107 + Then I should get the state of my application
  108 + Then I should be able to access my application URL tasks
  109 + Then I should be able to access my application file logs/stdout.log and get text including Found cloudfoundry-runtime lib. Auto-reconfiguration disabled
  110 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:h2
  111 + Then I delete all my service
  112 + Then I delete my application
  113 +
  114 + Scenario: Deploy Play Application with multiple database services, one named production
  115 + Given that the postgresql service is available
  116 + Given I have deployed my application named play_computer_database_scala_app without starting
  117 + Then I provision postgresql service without restarting
  118 + Then I provision a postgresql service named play-comp-db-app-production without restarting
  119 + Then I start my application named play_computer_database_scala_app
  120 + When I query status of my application
  121 + Then I should get the state of my application
  122 + Then I should be able to access my application URL computers
  123 + Then I should be able to access my application file logs/stdout.log and get text including Auto-reconfiguring default
  124 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:postgresql
  125 + Then I delete all my service
  126 + Then I delete my application
  127 +
  128 + Scenario: Deploy Play Application with multiple database services
  129 + Given that the postgresql service is available
  130 + Given I have deployed my application named play_computer_database_scala_app without starting
  131 + Then I provision postgresql service without restarting
  132 + Then I provision mysql service without restarting
  133 + Then I start my application named play_computer_database_scala_app
  134 + When I query status of my application
  135 + Then I should get the state of my application
  136 + Then I should be able to access my application URL computers
  137 + Then I should be able to access my application file logs/stdout.log and get text including Found 0 or multiple database services bound to app. Skipping auto-reconfiguration
  138 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:h2
  139 + Then I delete all my service
  140 + Then I delete my application
  141 +
  142 + Scenario: Deploy Play Application with multiple Play databases
  143 + Given that the postgresql service is available
  144 + Given I have deployed my application named play_computer_database_multi_dbs_app without starting
  145 + Then I provision postgresql service without restarting
  146 + Then I start my application named play_computer_database_multi_dbs_app
  147 + When I query status of my application
  148 + Then I should get the state of my application
  149 + Then I should be able to access my application URL computers
  150 + Then I should be able to access my application file logs/stdout.log and get text including Found multiple databases in Play configuration. Skipping auto-reconfiguration
  151 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:h2
  152 + Then I delete all my service
  153 + Then I delete my application
  154 +
  155 + Scenario: Deploy Play Application with mysql JPA auto-reconfiguration
  156 + Given I have deployed my application named play_computer_database_jpa_mysql_app without starting
  157 + Then I provision mysql service without restarting
  158 + Then I start my application named play_computer_database_jpa_mysql_app
  159 + When I query status of my application
  160 + Then I should get the state of my application
  161 + Then I should be able to access my application URL computers
  162 + Then I should be able to access my application file logs/stdout.log and get text including Auto-reconfiguring default
  163 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:mysql
  164 + Then I delete all my service
  165 + Then I delete my application
  166 +
  167 + Scenario: Deploy Play Application with postgresql JPA auto-reconfiguration
  168 + Given that the postgresql service is available
  169 + Given I have deployed my application named play_computer_database_jpa_app without starting
  170 + Then I provision postgresql service without restarting
  171 + Then I start my application named play_computer_database_jpa_app
  172 + When I query status of my application
  173 + Then I should get the state of my application
  174 + Then I should be able to access my application URL computers
  175 + Then I should be able to access my application file logs/stdout.log and get text including Auto-reconfiguring default
  176 + Then I should be able to access my application file logs/stdout.log and get text including database [default] connected at jdbc:postgresql
  177 + Then I delete all my service
  178 + Then I delete my application
  179 +
  180 +
  181 +
51 features/rails_console.feature
@@ -5,32 +5,75 @@ Feature: Deploy the rails canonical app and check the console
5 5
6 6 Background: Rails Console
7 7 Given I have registered and logged in
8   - Given I have deployed my application named rails_console_test_app
9 8
10 9 @runs_rails_console
11 10 Scenario: rails test console
12   - Given I have my running application named rails_console_test_app
  11 + Given I have deployed my application named rails_console_test_app
13 12 When I first access console of my application
14 13 Then I should get responses irb():001:0> from console of my application
15 14 When I send command app.class to console of my application
16 15 Then I should get responses app.class,=> ActionDispatch::Integration::Session,irb():002:0> from console of my application
17 16 Then I close console
  17 + Then I delete my application
18 18
19 19 @runs_rails_console
20 20 Scenario: rails test console tab completion
21   - Given I have my running application named rails_console_test_app
  21 + Given I have deployed my application named rails_console_test_app
22 22 When I first access console of my application
23 23 Then I should get responses irb():001:0> from console of my application
24 24 When I send tab completion puts to console of my application
25 25 Then I should get completion results puts from console of my application
26 26 Then I close console
  27 + Then I delete my application
27 28
28 29 @runs_rails_console
29 30 Scenario: rails test console stdout redirect
30   - Given I have my running application named rails_console_test_app
  31 + Given I have deployed my application named rails_console_test_app
31 32 When I first access console of my application
32 33 Then I should get responses irb():001:0> from console of my application
33 34 When I send command puts 'hi' to console of my application
34 35 Then I should get responses puts 'hi',hi,=> nil,irb():002:0> from console of my application
35 36 Then I close console
  37 + Then I delete my application
  38 +
  39 + @runs_rails_console
  40 + Scenario: rails test console rake tasks
  41 + Given I have deployed my application named rails_console_test_app
  42 + When I first access console of my application
  43 + Then I should get responses irb():001:0> from console of my application
  44 + When I send command `rake routes` to console of my application
  45 + Then I should get response including :action=>\"hello\" from console of my application
  46 + Then I close console
  47 + Then I delete my application
  48 +
  49 + @runs_rails_console
  50 + Scenario: rails test console rake tasks with ruby 1.9
  51 + Given I have deployed my application named rails_console_19_test_app
  52 + When I first access console of my application
  53 + Then I should get responses irb():001:0> from console of my application
  54 + When I send command `rake routes` to console of my application
  55 + Then I should get response including :action=>\"index\" from console of my application
  56 + Then I close console
  57 + Then I delete my application
  58 +
  59 + @runs_rails_console
  60 + Scenario: Rails Console runs tasks with correct ruby 1.8 version in path
  61 + Given I have deployed my application named rails_console_test_app
  62 + When I first access console of my application
  63 + Then I should get responses irb():001:0> from console of my application
  64 + When I send command `ruby --version` to console of my application
  65 + Then I should get response including ruby 1.8 from console of my application
  66 + Then I close console
  67 + Then I delete my application
  68 +
  69 + @runs_rails_console
  70 + Scenario: Rails Console runs tasks with correct ruby 1.9 version in path
  71 + Given I have deployed my application named rails_console_19_test_app
  72 + When I first access console of my application
  73 + Then I should get responses irb():001:0> from console of my application
  74 + When I send command `ruby --version` to console of my application
  75 + Then I should get response including ruby 1.9 from console of my application
  76 + Then I close console
  77 + Then I delete my application
  78 +
36 79
40 features/step_definitions/appcloud_steps.rb
@@ -271,6 +271,11 @@
271 271 end
272 272 end
273 273
  274 +Then /^I provision a postgresql service named (.*) without restarting$/ do |service_name|
  275 + @service = provision_postgresql_service_named @token, service_name
  276 + attach_provisioned_service @app, @service, @token
  277 +end
  278 +
274 279 Given /^I have deployed a (\w+) application named (\w+)$/ do |fw, app_name|
275 280 pending_unless_framework_exists(@token, fw)
276 281 @app = create_app app_name, @token
@@ -688,6 +693,39 @@
688 693 response.should == expected_contents
689 694 end
690 695
  696 +
  697 +Then /^I should be able to access my application file (\S+) and get text including (.+)$/ do |file, expected_contents|
  698 + @instance = '0'
  699 + response = get_app_files @app, @instance, file, @token
  700 + response.should_not == nil
  701 + responses = response.split("\n")
  702 + matched = false
  703 + responses.each do |response|
  704 + matched = true if response=~ /#{Regexp.escape(expected_contents)}/
  705 + end
  706 + matched.should == true
  707 +end
  708 +
  709 +Then /^I should be able to list application files and not find file (\S+)$/ do |file|
  710 + @instance = '0'
  711 + found = true
  712 + begin
  713 + get_app_files @app, @instance, file, @token
  714 + rescue VMC::Client::NotFound, VMC::Client::TargetError
  715 + found=false
  716 + end
  717 + found.should == false
  718 +end
  719 +
  720 +Then /^I should be able to access my application URL (\S+)$/ do |path|
  721 + path = nil if path == "root"
  722 + contents = get_app_contents @app, path
  723 + contents.should_not == nil
  724 + contents.body_str.should_not == nil
  725 + contents.response_code.should == 200
  726 + contents.close
  727 +end
  728 +
691 729 Then /^I should be able to access my application root and see hello from (\w+)$/ do |framework|
692 730 contents = get_app_contents @app
693 731 contents.should_not == nil
@@ -739,6 +777,8 @@
739 777 expected_health = 1.0
740 778 health = poll_until_done @app, expected_health, @token
741 779 health.should == expected_health
  780 + else
  781 + pending "#{requested_service} service is not supported in target environment"
742 782 end
743 783 end
744 784
16 features/step_definitions/autostaging_steps.rb
@@ -374,3 +374,19 @@ def create_and_start_app app, expected_health, service=nil
374 374 # The Roo page returns an extra row for the footer in the table .. hence the "+ 1"
375 375 verify_contents arg1.to_i + 1, response.body_str, "//table/tr"
376 376 end
  377 +
  378 +Given /^I deploy a Spring Web Application that uses the javaee namespace$/ do
  379 + expected_health = 1.0
  380 + create_and_upload_app SPRING_APP_WITH_JAVAEE_NS
  381 + health = start_app_check_health expected_health
  382 + health.should == expected_health
  383 +end
  384 +
  385 +Given /^I deploy a Spring 3.1 Hibernate application with an annotation context using a local DataSource$/ do
  386 + expected_health = 1.0
  387 + create_and_upload_app AUTO_RECONFIG_ANNOTATION_APP
  388 + mysqlsvc = provision_db_service @token
  389 + attach_provisioned_service @app, mysqlsvc, @token
  390 + health = start_app_check_health expected_health
  391 + health.should == expected_health
  392 +end
26 features/step_definitions/rails_console_steps.rb
... ... @@ -1,8 +1,21 @@
1 1 require 'vmc'
2 2
3 3 When /^I first access console of my application$/ do
4   - prompt = run_console get_app_name @app
5   - @console_response = [prompt]
  4 + #Console may not be available immediately after app start
  5 + #if system is under heavy load. Try a few times.
  6 + 3.times do
  7 + begin
  8 + console_output = run_console get_app_name @app
  9 + #Due to small bug in vmc console_login method, the prompt may or may
  10 + #not be pre-pended with "Switch to inspect mode \n". Pull out the last line
  11 + #just in case
  12 + prompt = console_output.split("\n")[-1]
  13 + @console_response = [prompt]
  14 + break
  15 + rescue VMC::Cli::CliExit
  16 + sleep 1
  17 + end
  18 + end
6 19 end
7 20
8 21 When /^I send command (.+) to console of my application$/ do |cmd|
@@ -20,6 +33,15 @@
20 33 expected_results.should == @console_response
21 34 end
22 35
  36 +Then /^I should get response including (.+) from console of my application$/ do |expected|
  37 + @console_response.should_not == nil
  38 + matched = false
  39 + @console_response.each do |response|
  40 + matched = true if response=~ /#{Regexp.escape(expected)}/
  41 + end
  42 + matched.should == true
  43 +end
  44 +
23 45 Then /^I should get completion results (.+) from console of my application$/ do |expected|
24 46 expected_results = expected.split(",")
25 47 expected_results.should == @console_tab_response
132 features/step_definitions/uaa.rb
... ... @@ -1,11 +1,120 @@
1 1 require 'rest_client'
2 2
  3 +class UaaHelper
  4 + include Singleton
  5 +
  6 + attr_writer :uaabase
  7 +
  8 + def initialize
  9 + @admin_client = ENV['VCAP_BVT_ADMIN_CLIENT'] || "admin"
  10 + @admin_secret = ENV['VCAP_BVT_ADMIN_SECRET'] || "adminsecret"
  11 + puts "** Using admin client: '#{@admin_client}' (set environment variables VCAP_BVT_ADMIN_CLIENT / VCAP_BVT_ADMIN_SECRET to override) **"
  12 + end
  13 +
  14 + def webclient
  15 +
  16 + return @webclient if @webclient
  17 +
  18 + begin
  19 + token = client_token(@admin_client, @admin_secret)
  20 + rescue RestClient::Unauthorized
  21 + puts "Unauthorized admin client (check your config or env vars)"
  22 + end
  23 + return nil unless token
  24 +
  25 + client_id = "testapp"
  26 + begin
  27 + response = JSON.parse(get_url "/oauth/clients/#{client_id}", "Authorization"=>"Bearer #{token}")
  28 + @webclient = {:client_id=>response["client_id"]}
  29 + rescue RestClient::ResourceNotFound
  30 + @webclient = register_client({:client_id=>client_id, :client_secret=>"appsecret", :authorized_grant_types=>["authorization_code"]}, token)
  31 + rescue RestClient::Unauthorized
  32 + puts "Unauthorized admin client not able to create new client"
  33 + end
  34 +
  35 + @webclient
  36 +
  37 + end
  38 +
  39 + def client_token(client_id, client_secret)
  40 + url = @uaabase + "/oauth/token"
  41 + response = RestClient.post url, {:client_id=>client_id, :grant_type=>"client_credentials", :scope=>"read write password"}, {"Accept"=>"application/json", "Authorization"=>basic_auth(client_id, client_secret)}
  42 + response.should_not == nil
  43 + response.code.should == 200
  44 + JSON.parse(response.body)["access_token"]
  45 + end
  46 +
  47 + def login(username, password)
  48 + url = @uaabase + "/login.do"
  49 + response = RestClient.post url, {:username=>username, :password=>password}, {"Accept"=>"application/json"} { |response, request, result| response }
  50 + response.should_not == nil
  51 + response.code.should == 302
  52 + response.headers
  53 + end
  54 +
  55 + def register_client(client, token)
  56 + url = @uaabase + "/oauth/clients"
  57 + response = RestClient.post url, client.to_json, {"Authorization"=>"Bearer #{token}", "Content-Type"=>"application/json"}
  58 + response.should_not == nil
  59 + response.code.should == 201
  60 + client
  61 + end
  62 +
  63 + def basic_auth(id, secret)
  64 + "Basic " + Base64::strict_encode64("#{id}:#{secret}")
  65 + end
  66 +
  67 + def get_url(path,headers={})
  68 + url = @uaabase + path
  69 + headers[:accept] = "application/json"
  70 + response = RestClient.get url, headers
  71 + response.should_not == nil
  72 + response.code.should == 200
  73 + response.body.should_not == nil
  74 + response.body
  75 + end
  76 +
  77 + def get_status(path)
  78 + url = @uaabase + path
  79 + begin
  80 + response = RestClient.get url, {"Accept"=>"application/json"}
  81 + response.code
  82 + rescue RestClient::Exception => e
  83 + e.http_code
  84 + end
  85 + end
  86 +
  87 +end
  88 +
3 89 Given /^I know the UAA service base URL$/ do
4 90 @uaabase = @client.info[:authorization_endpoint]
  91 + @uaahelper = UaaHelper.instance
  92 + @uaahelper.uaabase = @uaabase
  93 +end
  94 +
  95 +Given /^I have an authenticated user session$/ do
  96 + headers = @uaahelper.login(test_user,test_passwd)
  97 + @cookie = headers[:set_cookie][0]
  98 + headers[:location].should == "#{@uaabase}/"
  99 +end
  100 +
  101 +Given /^there is a registered webapp client$/ do
  102 + @webclient = @uaahelper.webclient
  103 + pending "Client registration unsuccessful" unless @webclient
  104 +end
  105 +
  106 +When /^I get the approval prompts$/ do
  107 + @uaahelper.get_url "/oauth/authorize?response_type=code&client_id=#{@webclient[:client_id]}&redirect_uri=http://anywhere.com", "Cookie" => @cookie
  108 + response = @uaahelper.get_url "/oauth/confirm_access", "Cookie" => @cookie
  109 + @approval = JSON.parse(response)
  110 +end
  111 +
  112 +Then /^the content should contain the correct paths$/ do
  113 + @approval["options"].should_not == nil
5 114 end
6 115
7 116 When /^I get the login prompts$/ do
8   - @prompts = get_url "/login"
  117 + @prompts = @uaahelper.get_url "/login"
9 118 end
10 119
11 120 Then /^the content should contain prompts$/ do
@@ -13,28 +122,9 @@
13 122 end
14 123
15 124 When /^I try and get the user data$/ do
16   - @code = get_status "/Users"
  125 + @code = @uaahelper.get_status "/Users"
17 126 end
18 127
19 128 Then /^the response should be UNAUTHORIZED$/ do
20 129 @code.should == 401
21 130 end
22   -
23   -def get_url(path)
24   - url = @uaabase + path
25   - response = RestClient.get url, {"Accept"=>"application/json"}
26   - response.should_not == nil
27   - response.code.should == 200
28   - response.body.should_not == nil
29   - response.body
30   -end
31   -
32   -def get_status(path)
33   - url = @uaabase + path
34   - begin
35   - response = RestClient.get url, {"Accept"=>"application/json"}
36   - response.code
37   - rescue RestClient::Exception => e
38   - e.http_code
39   - end
40   -end
6 features/step_definitions/vblob_steps.rb
@@ -15,21 +15,21 @@
15 15 end
16 16
17 17 Given /^I create a container in my vblob service through my application$/ do
18   - uri = get_uri(@app, 'container1')
  18 + uri = get_uri(@app, 'service/vblob/container1')
19 19 r = post_uri(uri,'dummy') # here post_uri requires payload, but our service safely ignores the payload, thus really some dummy data to make post_uri happy
20 20 r.response_code.should == 200
21 21 r.close
22 22 end
23 23
24 24 When /^I create an file in my vblob service through my application$/ do
25   - uri = get_uri(@app, 'container1/file1')
  25 + uri = get_uri(@app, 'service/vblob/container1/file1')
26 26 r = post_uri(uri, 'abc')
27 27 r.response_code.should == 200
28 28 r.close
29 29 end
30 30
31 31 Then /^I should be able to get the file$/ do
32   - uri = get_uri @app, "container1/file1"
  32 + uri = get_uri @app, "service/vblob/container1/file1"
33 33 r = get_uri_contents uri
34 34 r.should_not == nil
35 35 r.response_code.should == 200
7 features/support/env.rb
@@ -59,8 +59,10 @@
59 59 BROKERED_SERVICE_APP = "brokered_service_app"
60 60 JAVA_APP_WITH_STARTUP_DELAY = "java_app_with_startup_delay"
61 61 RAILS_CONSOLE_TEST_APP = "rails_console_test_app"
62   -VBLOB_APP = "vblob_app"
  62 +VBLOB_APP = "app_sinatra_service"
63 63 SERVICE_QUOTA_APP = "service_quota_app"
  64 +SPRING_APP_WITH_JAVAEE_NS = "javaee-namespace-app"
  65 +AUTO_RECONFIG_ANNOTATION_APP="auto-reconfig-annotation-app"
64 66
65 67 class Fixnum
66 68 def to_json(options = nil)
@@ -321,6 +323,8 @@ def upload_app_help(app_dir, app)
321 323 Dir.chdir(app_dir) do
322 324 if war_file = Dir.glob('*.war').first
323 325 VMC::Cli::ZipUtil.unpack(war_file, explode_dir)
  326 + elsif zip_file = Dir.glob('*.zip').first
  327 + VMC::Cli::ZipUtil.unpack(zip_file, explode_dir)
324 328 else
325 329 FileUtils.mkdir(explode_dir)
326 330 files = Dir.glob('{*,.[^\.]*}')
@@ -342,6 +346,7 @@ def upload_app_help(app_dir, app)
342 346 total_size += File.size(filename)
343 347 end
344 348
  349 +
345 350 appcloud_resources = @client.check_resources(fingerprints)
346 351 if appcloud_resources
347 352 # We can then delete what we do not need to send.
75 features/support/testconfig.yml
@@ -306,14 +306,20 @@ java_app_with_startup_delay:
306 306 path: "assets/java_web/app_with_startup_delay/target"
307 307
308 308 rails_console_test_app:
309   - framework: "rails/1.0"
  309 + framework: "rails3"
310 310 memory: 256
311 311 path: "assets/rails3/app_rails_service"
312 312
  313 +rails_console_19_test_app:
  314 + framework: "rails3"
  315 + memory: 256
  316 + path: "assets/rails3/hello_vcap"
  317 + runtime: ruby19
  318 +
313 319 vblob_app:
314 320 framework: "http://b20nine.com/unknown"
315 321 memory: 256
316   - path: "assets/sinatra/vblob_app"
  322 + path: "assets/sinatra/app_sinatra_service"
317 323
318 324 service_quota_app:
319 325 framework: "http://b20nine.com/unknown"
@@ -439,3 +445,68 @@ broken_gem_app:
439 445 memory: 64
440 446 path: "assets/sinatra/broken_gem_app"
441 447
  448 +play_computer_database_scala_app:
  449 + framework: "play"
  450 + memory: 128
  451 + path: "assets/play/computer_database_scala/target"
  452 +
  453 +play_todolist_app:
  454 + framework: "play"
  455 + memory: 128
  456 + path: "assets/play/todolist/target"
  457 +
  458 +play_zentasks_cf_by_name_app:
  459 + framework: "play"
  460 + memory: 128
  461 + path: "assets/play/zentasks_cf_by_name/target"
  462 +
  463 +play_zentasks_cf_by_type_app:
  464 + framework: "play"
  465 + memory: 128
  466 + path: "assets/play/zentasks_cf_by_type/target"
  467 +
  468 +play_computer_database_autoconfig_disabled_app:
  469 + framework: "play"
  470 + memory: 128
  471 + path: "assets/play/computer_database_autoconfig_disabled/target"
  472 +
  473 +play_todolist_with_cfruntime_app:
  474 + framework: "play"
  475 + memory: 128
  476 + path: "assets/play/todolist_with_cfruntime/target"
  477 +
  478 +play_computer_database_jpa_app:
  479 + framework: "play"
  480 + memory: 128
  481 + path: "assets/play/computer_database_jpa/target"
  482 +
  483 +play_computer_database_jpa_mysql_app:
  484 + framework: "play"
  485 + memory: 128
  486 + path: "assets/play/computer_database_jpa_mysql/target"
  487 +
  488 +play_computer_database_multi_dbs_app:
  489 + framework: "play"
  490 + memory: 128
  491 + path: "assets/play/computer_database_multi_dbs/target"
  492 +
  493 +play_computer_database_cf_by_name_app:
  494 + framework: "play"
  495 + memory: 128
  496 + path: "assets/play/computer_database_cf_by_name/target"
  497 +
  498 +play_computer_database_cf_by_type_app:
  499 + framework: "play"
  500 + memory: 128
  501 + path: "assets/play/computer_database_cf_by_type/target"
  502 +
  503 +javaee-namespace-app:
  504 + framework: "spring_web/1.0"
  505 + startup: "thin start"
  506 + memory: 256
  507 + path: "assets/spring/javaee-namespace-app/target"
  508 +
  509 +auto-reconfig-annotation-app:
  510 + framework: "spring_web/1.0"
  511 + memory: 512
  512 + path: "assets/spring/auto-reconfig-annotation-app/target"
8 features/uaa.feature
@@ -11,6 +11,14 @@ Feature: UAA Service
11 11 Then the content should contain prompts
12 12
13 13 @uaa @smoke
  14 + Scenario: Get approval prompts
  15 + Given I am registered
  16 + Given I have an authenticated user session
  17 + Given there is a registered webapp client
  18 + When I get the approval prompts
  19 + Then the content should contain the correct paths
  20 +
  21 + @uaa @smoke
14 22 Scenario: Get Users data
15 23 When I try and get the user data
16 24 Then the response should be UNAUTHORIZED
9 rakelib/bvt.rake
@@ -36,15 +36,6 @@ namespace :bvt do
36 36 sh "bundle exec cucumber --tags @services"
37 37 end
38 38
39   - task :run_uaa do
40   - config_path=ENV['CLOUD_FOUNDRY_CONFIG_PATH']?"-DCLOUD_FOUNDRY_CONFIG_PATH=#{ENV['CLOUD_FOUNDRY_CONFIG_PATH']} ":''
41   - logfile = File.join(Dir.tmpdir, "uaa.bvt.log")
42   - sh "cd #{CoreComponents.root}/uaa/uaa; MAVEN_OPTS=\"#{ENV['MAVEN_OPTS']}\" mvn -P vcap #{config_path}-Duaa.integration.test=true -Dtest=*IntegrationTests test | tee #{logfile} | grep 'BUILD SUCCESSFUL'" do |ok,status|
43   - logmsg = `tail -20 #{logfile}`
44   - ok or fail "UAA integration tests failed...truncated logs:\n#{logmsg}\nUAA integration tests failed"
45   - end
46   - end
47   -
48 39 desc "Run the Basic Viability Tests with jUnit output"
49 40 task :run_for_ci do
50 41 # Don't fail the Rake run if a test fails.

No commit comments for this range

Something went wrong with that request. Please try again.