ruboto 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -3
  3. data/README.md +1 -1
  4. data/RELEASE_CANDICATE_DOC.md +22 -5
  5. data/RELEASE_DOC.md +58 -26
  6. data/Rakefile +68 -163
  7. data/Vagrantfile +46 -0
  8. data/assets/rakelib/ruboto.device.rb +170 -0
  9. data/assets/rakelib/ruboto.rake +121 -239
  10. data/assets/rakelib/ruboto.stdlib.rake +1 -1
  11. data/assets/src/org/ruboto/JRubyAdapter.java +1 -0
  12. data/lib/ruboto/sdk_versions.rb +5 -4
  13. data/lib/ruboto/util/emulator.rb +6 -4
  14. data/lib/ruboto/util/setup.rb +40 -23
  15. data/lib/ruboto/util/update.rb +61 -13
  16. data/lib/ruboto/version.rb +1 -1
  17. data/test/activity/dir_and_file_activity_test.rb +3 -3
  18. data/test/activity/json_activity.rb +11 -0
  19. data/test/activity/navigation_activity_test.rb +2 -1
  20. data/test/activity/stack_activity_test.rb +16 -12
  21. data/test/app_test_methods.rb +4 -4
  22. data/test/arjdbc_test.rb +18 -7
  23. data/test/broadcast_receiver_test.rb +1 -1
  24. data/test/gem_test.rb +1 -1
  25. data/test/git_based_gem_test.rb +1 -1
  26. data/test/minimal_app_test.rb +7 -5
  27. data/test/rake_test.rb +3 -3
  28. data/test/ruboto_activity_test.rb +1 -1
  29. data/test/ruboto_gen_test.rb +25 -11
  30. data/test/ruboto_setup_test.rb +1 -1
  31. data/test/ruboto_update_test.rb +3 -3
  32. data/test/sample_broadcast_receiver_test.rb +1 -1
  33. data/test/service_block_test.rb +1 -1
  34. data/test/service_gen_class_test.rb +1 -1
  35. data/test/service_infile_class_test.rb +1 -1
  36. data/test/splash_test.rb +1 -1
  37. data/test/sqldroid_test.rb +1 -1
  38. data/test/test_helper.rb +22 -18
  39. data/test/update_test_methods.rb +1 -1
  40. data/test/updated_example_test_methods.rb +1 -1
  41. data/test/uppercase_package_name_test.rb +3 -3
  42. metadata +20 -3
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('test_helper', File.dirname(__FILE__))
2
2
  require 'fileutils'
3
3
 
4
- class BroadcastReceiverTest < Test::Unit::TestCase
4
+ class BroadcastReceiverTest < Minitest::Test
5
5
  SRC_DIR ="#{APP_DIR}/src"
6
6
 
7
7
  def setup
@@ -1,6 +1,6 @@
1
1
  require File.expand_path("test_helper", File.dirname(__FILE__))
2
2
 
3
- class GemTest < Test::Unit::TestCase
3
+ class GemTest < Minitest::Test
4
4
  def test_rake_gem
5
5
  gem_file = "ruboto-#{Ruboto::VERSION}.gem"
6
6
  File.delete(gem_file) if File.exists?(gem_file)
@@ -2,7 +2,7 @@ require File.expand_path('test_helper', File.dirname(__FILE__))
2
2
  require 'bigdecimal'
3
3
  require 'test/app_test_methods'
4
4
 
5
- class GitBasedGemTest < Test::Unit::TestCase
5
+ class GitBasedGemTest < Minitest::Test
6
6
  def setup
7
7
  generate_app
8
8
  Dir.chdir APP_DIR do
@@ -3,7 +3,7 @@ require File.expand_path('test_helper', File.dirname(__FILE__))
3
3
  if RubotoTest::RUBOTO_PLATFORM == 'STANDALONE'
4
4
  require 'bigdecimal'
5
5
 
6
- class MinimalAppTest < Test::Unit::TestCase
6
+ class MinimalAppTest < Minitest::Test
7
7
  def setup
8
8
  generate_app :included_stdlibs => []
9
9
  end
@@ -20,7 +20,8 @@ if RubotoTest::RUBOTO_PLATFORM == 'STANDALONE'
20
20
  # APK was 8.4MB. JRuby: 1.7.8, ANDROID_TARGET: 10
21
21
  # APK was 4.3MB. JRuby: 1.7.8, ANDROID_TARGET: 16
22
22
  # APK was 4.4MB. JRuby: 1.7.12, ANDROID_TARGET: 19
23
- # APK was 4.4MB. JRuby: 1.7.14.SNAPSHOT, ANDROID_TARGET: 19
23
+ # APK was 4.4MB. JRuby: 1.7.14, ANDROID_TARGET: 19
24
+ # APK was 4.6MB. JRuby: 1.7.20.dev, ANDROID_TARGET: 19
24
25
  # APK was 4.2MB. JRuby: 9000.dev, ANDROID_TARGET: 10
25
26
  # APK was 4.2MB. JRuby: 9000.dev, ANDROID_TARGET: 15
26
27
  # APK was 4.6MB. JRuby: 9000.dev, ANDROID_TARGET: 16
@@ -33,9 +34,10 @@ if RubotoTest::RUBOTO_PLATFORM == 'STANDALONE'
33
34
  '1.7.10' => 4.4,
34
35
  '1.7.11' => 4.4,
35
36
  '1.7.12' => 4.4,
36
- '1.7.14.dev' => 4.4,
37
- '9000.dev' => 4.6,
38
- }[JRUBY_JARS_VERSION.to_s] || 4.4
37
+ '1.7.14' => 4.4,
38
+ '1.7.20.dev' => 4.6,
39
+ '9.0.0.0.dev' => 4.6,
40
+ }[JRUBY_JARS_VERSION.to_s] || 4.6
39
41
  lower_limit = upper_limit * 0.9
40
42
  version_message ="JRuby: #{JRUBY_JARS_VERSION}, ANDROID_TARGET: #{ANDROID_TARGET}"
41
43
  assert apk_size <= upper_limit, "APK was larger than #{'%.1f' % upper_limit}MB: #{'%.1f' % apk_size.ceil(1)}MB. #{version_message}"
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('test_helper', File.dirname(__FILE__))
2
2
 
3
- class RakeTest < Test::Unit::TestCase
3
+ class RakeTest < Minitest::Test
4
4
  def setup
5
5
  generate_app
6
6
  end
@@ -41,7 +41,7 @@ class RakeTest < Test::Unit::TestCase
41
41
  FileUtils.touch 'src/ruboto_test_app_activity.rb'
42
42
  sleep 1
43
43
  system 'rake debug'
44
- assert_not_equal apk_timestamp, File.mtime("bin/#{APP_NAME}-debug.apk"),
44
+ assert apk_timestamp != File.mtime("bin/#{APP_NAME}-debug.apk"),
45
45
  'APK should have been rebuilt'
46
46
  end
47
47
  end
@@ -51,7 +51,7 @@ class RakeTest < Test::Unit::TestCase
51
51
  apk_timestamp = File.mtime("bin/#{APP_NAME}-debug.apk")
52
52
  FileUtils.touch 'src/not_ruby_source.properties'
53
53
  system 'rake debug'
54
- assert_not_equal apk_timestamp, File.mtime("bin/#{APP_NAME}-debug.apk"),
54
+ assert apk_timestamp != File.mtime("bin/#{APP_NAME}-debug.apk"),
55
55
  'APK should have been rebuilt'
56
56
  end
57
57
  end
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('test_helper', File.dirname(__FILE__))
2
2
 
3
- class RubotoActivityTest < Test::Unit::TestCase
3
+ class RubotoActivityTest < Minitest::Test
4
4
  def setup
5
5
  generate_app
6
6
  end
@@ -2,11 +2,11 @@ require File.expand_path('test_helper', File.dirname(__FILE__))
2
2
  require 'bigdecimal'
3
3
  require 'test/app_test_methods'
4
4
 
5
- class RubotoGenTest < Test::Unit::TestCase
5
+ class RubotoGenTest < Minitest::Test
6
6
  include AppTestMethods
7
7
 
8
8
  def setup
9
- generate_app
9
+ generate_app heap_alloc: 50
10
10
  end
11
11
 
12
12
  def teardown
@@ -53,6 +53,7 @@ class RubotoGenTest < Test::Unit::TestCase
53
53
  # APK was 66.6KB. PLATFORM: CURRENT, ANDROID_TARGET: 15
54
54
  # APK was 74.9KB. PLATFORM: CURRENT, ANDROID_TARGET: 16
55
55
  # APK was 80.4KB. PLATFORM: CURRENT, ANDROID_TARGET: 19
56
+ # APK was 75.1KB. PLATFORM: CURRENT, ANDROID_TARGET: 22
56
57
  # APK was 65.0KB. PLATFORM: FROM_GEM, ANDROID_TARGET: 10
57
58
  # APK was 81.0KB. PLATFORM: FROM_GEM, ANDROID_TARGET: 16
58
59
  # APK was 80.2KB. PLATFORM: FROM_GEM, ANDROID_TARGET: 17
@@ -69,11 +70,18 @@ class RubotoGenTest < Test::Unit::TestCase
69
70
  # APK was 8793.4KB. PLATFORM: STANDALONE, ANDROID_TARGET: 16, JRuby: 1.7.11
70
71
  # APK was 9743.3KB. PLATFORM: STANDALONE, ANDROID_TARGET: 16, JRuby: 1.7.12
71
72
  # APK was 9123.8KB. PLATFORM: STANDALONE, ANDROID_TARGET: 19, JRuby: 1.7.12
72
- # APK was 9745.0KB. PLATFORM: STANDALONE, ANDROID_TARGET: 19, JRuby: 1.7.14.dev
73
+ # APK was 9745.0KB. PLATFORM: STANDALONE, ANDROID_TARGET: 19, JRuby: 1.7.14
74
+ # APK was 9985.8KB. PLATFORM: STANDALONE, ANDROID_TARGET: 19, JRuby: 1.7.17
75
+ # APK was 10052.1KB. PLATFORM: STANDALONE, ANDROID_TARGET: 17, JRuby: 1.7.18
76
+ # APK was 10045.2KB. PLATFORM: STANDALONE, ANDROID_TARGET: 19, JRuby: 1.7.18
77
+ # APK was 10109.9KB. PLATFORM: STANDALONE, ANDROID_TARGET: 21, JRuby: 1.7.19
78
+ # APK was 11010.0KB. PLATFORM: STANDALONE, ANDROID_TARGET: 19, JRuby: 1.7.20.dev
73
79
  # APK was 6689.5KB. PLATFORM: STANDALONE, ANDROID_TARGET: 10, JRuby: 9000.dev
74
80
  # APK was 7012.2KB. PLATFORM: STANDALONE, ANDROID_TARGET: 16, JRuby: 9000.dev
75
81
  # APK was 8015.9KB. PLATFORM: STANDALONE, ANDROID_TARGET: 17, JRuby: 9000.dev
76
82
  # APK was 8232.4KB. PLATFORM: STANDALONE, ANDROID_TARGET: 19, JRuby: 9000.dev
83
+ # APK was 7126.9KB. PLATFORM: STANDALONE, ANDROID_TARGET: 15, JRuby: 9.0.0.0.pre1
84
+ # APK was 8571.4KB. PLATFORM: STANDALONE, ANDROID_TARGET: 21, JRuby: 9.0.0.0.pre1
77
85
  def test_new_apk_size_is_within_limits
78
86
  apk_size = BigDecimal(File.size("#{APP_DIR}/bin/RubotoTestApp-debug.apk").to_s) / 1024
79
87
  version = " PLATFORM: #{RUBOTO_PLATFORM}"
@@ -88,8 +96,13 @@ class RubotoGenTest < Test::Unit::TestCase
88
96
  '1.7.10' => 8800.0,
89
97
  '1.7.11' => 8800.0,
90
98
  '1.7.12' => 9800.0,
91
- '1.7.14.dev' => 9800.0,
92
- '9000.dev' => 8300.0,
99
+ '1.7.14' => 9800.0,
100
+ '1.7.17' => 9999.0,
101
+ '1.7.18' => 10100.0,
102
+ '1.7.19' => 10200.0,
103
+ '1.7.20.dev' => 11111.0,
104
+ '9.0.0.0.dev' => 8300.0,
105
+ '9.0.0.0.pre1' => 8600.0,
93
106
  }[JRUBY_JARS_VERSION.to_s] || 9800.0
94
107
  version << ", JRuby: #{JRUBY_JARS_VERSION.to_s}"
95
108
  else
@@ -99,7 +112,8 @@ class RubotoGenTest < Test::Unit::TestCase
99
112
  16 => 82.0,
100
113
  17 => 81.0,
101
114
  19 => 81.0,
102
- }[ANDROID_TARGET] || 75.0
115
+ 22 => 76.0,
116
+ }[ANDROID_TARGET] || 76.0
103
117
  end
104
118
  lower_limit = upper_limit * 0.8
105
119
  assert apk_size <= upper_limit, "APK was larger than #{'%.1f' % upper_limit}KB: #{'%.1f' % apk_size.ceil(1)}KB.#{version}"
@@ -127,13 +141,13 @@ class RubotoGenTest < Test::Unit::TestCase
127
141
 
128
142
  # FIXME(uwe): Workaround for Ruboto Issue #246
129
143
  java_source = File.read(java_source_file)
130
- File.open(java_source_file, 'w'){|f| f << java_source.gsub(/^(public class .*ArrayAdapter) (.*ArrayAdapter)/, '\1<T> \2<T>').gsub(/T.class/, 'Object.class')}
144
+ File.open(java_source_file, 'w') { |f| f << java_source.gsub(/^(public class .*ArrayAdapter) (.*ArrayAdapter)/, '\1<T> \2<T>').gsub(/T.class/, 'Object.class') }
131
145
  # EMXIF
132
146
 
133
147
  assert File.exists?('src/ruboto_array_adapter.rb')
134
148
  assert File.exists?('test/src/ruboto_array_adapter_test.rb')
135
149
 
136
- File.open('src/ruboto_test_app_activity.rb', 'w'){|f| f << <<EOF}
150
+ File.open('src/ruboto_test_app_activity.rb', 'w') { |f| f << <<EOF }
137
151
  require 'ruboto/activity'
138
152
  require 'ruboto/util/stack'
139
153
  require 'ruboto/widget'
@@ -160,7 +174,7 @@ puts "adapter: \#{adapter.inspect}"
160
174
  end
161
175
  EOF
162
176
 
163
- File.open('test/src/ruboto_test_app_activity_test.rb', 'w'){|f| f << <<EOF}
177
+ File.open('test/src/ruboto_test_app_activity_test.rb', 'w') { |f| f << <<EOF }
164
178
  activity Java::org.ruboto.test_app.RubotoTestAppActivity
165
179
 
166
180
  setup do |activity|
@@ -185,7 +199,7 @@ test('Item click changes text') do |activity|
185
199
  end
186
200
  EOF
187
201
 
188
- File.open('src/ruboto_array_adapter.rb', 'w'){|f| f << <<EOF}
202
+ File.open('src/ruboto_array_adapter.rb', 'w') { |f| f << <<EOF }
189
203
  class Java::AndroidWidget::ArrayAdapter
190
204
  field_reader :mResource, :mFieldId
191
205
  end
@@ -238,7 +252,7 @@ class RubotoArrayAdapter
238
252
  end
239
253
  EOF
240
254
 
241
- File.open('res/layout/list_item.xml', 'w'){|f| f << <<EOF}
255
+ File.open('res/layout/list_item.xml', 'w') { |f| f << <<EOF }
242
256
  <?xml version="1.0" encoding="utf-8"?>
243
257
  <LinearLayout
244
258
  xmlns:android="http://schemas.android.com/apk/res/android"
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('test_helper', File.dirname(__FILE__))
2
2
  require 'net/http'
3
3
 
4
- class RubotoSetupTest < Test::Unit::TestCase
4
+ class RubotoSetupTest < Minitest::Test
5
5
  SDK_DOWNLOAD_PAGE = 'http://developer.android.com/sdk/index.html?hl=sk'
6
6
 
7
7
  def test_if_page_still_exists
@@ -47,14 +47,14 @@ Dir.chdir "#{RubotoTest::PROJECT_DIR}/examples/" do
47
47
  tools_version = m[:tools_version]
48
48
  ruboto_version_no_dots = ruboto_version.gsub('.', '_')
49
49
  self.class.class_eval <<EOF
50
- class RubotoUpdatedExample#{ruboto_version_no_dots}Tools#{tools_version}Test < Test::Unit::TestCase
50
+ class RubotoUpdatedExample#{ruboto_version_no_dots}Tools#{tools_version}Test < Minitest::Test
51
51
  include UpdatedExampleTestMethods
52
52
  def setup
53
53
  super('#{ruboto_version}', '#{tools_version}')
54
54
  end
55
55
  end
56
56
 
57
- class RubotoUpdate#{ruboto_version_no_dots}Tools#{tools_version}Test < Test::Unit::TestCase
57
+ class RubotoUpdate#{ruboto_version_no_dots}Tools#{tools_version}Test < Minitest::Test
58
58
  include UpdateTestMethods
59
59
  def setup
60
60
  super('#{ruboto_version}', '#{tools_version}')
@@ -65,7 +65,7 @@ EOF
65
65
 
66
66
  end
67
67
 
68
- class RubotoUpdateTest < Test::Unit::TestCase
68
+ class RubotoUpdateTest < Minitest::Test
69
69
  def setup
70
70
  generate_app :heap_alloc => 16, :update => true
71
71
  end
@@ -15,7 +15,7 @@ class Log
15
15
  end
16
16
  end
17
17
 
18
- class SampleBroadcastReceiverTest < Test::Unit::TestCase
18
+ class SampleBroadcastReceiverTest < Minitest::Test
19
19
  require 'assets/samples/sample_broadcast_receiver'
20
20
 
21
21
  def test_on_receive_calls_log_v
@@ -1,7 +1,7 @@
1
1
  require File.expand_path("test_helper", File.dirname(__FILE__))
2
2
  require 'fileutils'
3
3
 
4
- class ServiceBlockTest < Test::Unit::TestCase
4
+ class ServiceBlockTest < Minitest::Test
5
5
  SRC_DIR = "#{APP_DIR}/src"
6
6
 
7
7
  def setup
@@ -1,7 +1,7 @@
1
1
  require File.expand_path("test_helper", File.dirname(__FILE__))
2
2
  require 'fileutils'
3
3
 
4
- class ServiceGenClassTest < Test::Unit::TestCase
4
+ class ServiceGenClassTest < Minitest::Test
5
5
  SRC_DIR = "#{APP_DIR}/src"
6
6
 
7
7
  def setup
@@ -1,7 +1,7 @@
1
1
  require File.expand_path("test_helper", File.dirname(__FILE__))
2
2
  require 'fileutils'
3
3
 
4
- class ServiceInfileClassTest < Test::Unit::TestCase
4
+ class ServiceInfileClassTest < Minitest::Test
5
5
  SRC_DIR = "#{APP_DIR}/src"
6
6
 
7
7
  def setup
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('test_helper', File.dirname(__FILE__))
2
2
 
3
- class SplashTest < Test::Unit::TestCase
3
+ class SplashTest < Minitest::Test
4
4
  def setup
5
5
  generate_app
6
6
  end
@@ -3,7 +3,7 @@ require File.expand_path('test_helper', File.dirname(__FILE__))
3
3
  # FIXME(uwe): Remove check when we stop supporting Android < 4.0.3
4
4
  if RubotoTest::ANDROID_OS >= 15 || RubotoTest::RUBOTO_PLATFORM != 'STANDALONE'
5
5
 
6
- class SqldroidTest < Test::Unit::TestCase
6
+ class SqldroidTest < Minitest::Test
7
7
  def setup
8
8
  generate_app :bundle => :sqldroid
9
9
  end
@@ -1,7 +1,8 @@
1
1
  lib = File.dirname(File.dirname(__FILE__)) + '/lib'
2
2
  $:.unshift(lib) unless $:.include?(lib)
3
- require 'test/unit'
4
3
  require 'rubygems'
4
+ gem "minitest"
5
+ require 'minitest/autorun'
5
6
  require 'fileutils'
6
7
  require 'yaml'
7
8
  require 'ruboto/sdk_versions'
@@ -107,7 +108,7 @@ module RubotoTest
107
108
  puts "RUBOTO_PLATFORM: #{RUBOTO_PLATFORM}"
108
109
 
109
110
  if RUBOTO_PLATFORM == 'CURRENT'
110
- JRUBY_JARS_VERSION = Gem::Version.new('1.7.12')
111
+ JRUBY_JARS_VERSION = Gem::Version.new('1.7.18')
111
112
  elsif ENV['JRUBY_JARS_VERSION']
112
113
  JRUBY_JARS_VERSION = Gem::Version.new(ENV['JRUBY_JARS_VERSION'])
113
114
  else
@@ -128,16 +129,17 @@ module RubotoTest
128
129
  ENV['LOCAL_GEM_DIR'] = Dir.getwd
129
130
  end
130
131
 
131
- class Test::Unit::TestCase
132
+ class Minitest::Test
132
133
  include RubotoTest
133
134
  extend RubotoTest
134
135
 
135
136
  alias old_run run
136
137
 
137
138
  def run(*args, &block)
138
- mark_test_start("#{self.class.name}\##{respond_to?(:method_name) ? method_name : __name__}")
139
- old_run(*args, &block)
140
- mark_test_end("#{self.class.name}\##{respond_to?(:method_name) ? method_name : __name__}")
139
+ mark_test_start("#{self.class.name}\##{name}")
140
+ result = old_run(*args, &block)
141
+ mark_test_end("#{self.class.name}\##{name}")
142
+ result
141
143
  end
142
144
 
143
145
  def mark_test_start(test_name)
@@ -174,7 +176,7 @@ class Test::Unit::TestCase
174
176
  package = options.delete(:package) || PACKAGE
175
177
  standalone = options.delete(:standalone) || !!included_stdlibs || !!excluded_stdlibs || ENV['RUBOTO_PLATFORM'] == 'STANDALONE'
176
178
  update = options.delete(:update) || false
177
- ruby_version = options.delete(:ruby_version) || (JRUBY_JARS_VERSION.to_s[0..0] == '9' ? 2.1 : 1.9)
179
+ ruby_version = options.delete(:ruby_version) || (JRUBY_JARS_VERSION.to_s[0..0] == '9' ? '2.2' : '1.9')
178
180
 
179
181
  raise "Unknown options: #{options.inspect}" unless options.empty?
180
182
  raise 'Inclusion/exclusion of libs requires standalone mode.' if (included_stdlibs || excluded_stdlibs) && !standalone
@@ -187,7 +189,7 @@ class Test::Unit::TestCase
187
189
  template_dir << "_heap_alloc_#{heap_alloc}" if heap_alloc
188
190
  # template_dir << "_ruby_version_#{ruby_version.to_s.gsub('.', '_')}" if ruby_version
189
191
  template_dir << "_example_#{example}" if example
190
- template_dir << "_bundle_#{[*bundle].join('_')}" if bundle
192
+ template_dir << "_bundle_#{[*bundle].map(&:to_s).join('_').gsub(/[{}\[\]'",:=~<>\/ ]+/, '_')}" if bundle
191
193
  template_dir << '_updated' if update
192
194
  template_dir << '_standalone' if standalone
193
195
  template_dir << "_without_#{excluded_stdlibs.map { |ed| ed.gsub(/[.\/]/, '_') }.join('_')}" if excluded_stdlibs
@@ -199,12 +201,13 @@ class Test::Unit::TestCase
199
201
  if example
200
202
  Dir.chdir TMP_DIR do
201
203
  system "tar xzf #{PROJECT_DIR}/examples/#{APP_NAME}_#{example}.tgz"
204
+ Dir.chdir(APP_NAME) { system '../../bin/ruboto setup -y' }
202
205
  end
203
206
  Dir.chdir APP_DIR do
204
207
  File.open('local.properties', 'w') { |f| f.puts "sdk.dir=#{ANDROID_HOME}" }
205
208
  File.open('test/local.properties', 'w') { |f| f.puts "sdk.dir=#{ANDROID_HOME}" }
206
209
  if standalone
207
- if included_stdlibs || excluded_stdlibs || heap_alloc || ruby_version
210
+ if included_stdlibs || excluded_stdlibs || heap_alloc
208
211
  write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version)
209
212
  end
210
213
  FileUtils.touch 'libs/jruby-core-x.x.x.jar'
@@ -228,7 +231,7 @@ class Test::Unit::TestCase
228
231
  end
229
232
  Dir.chdir APP_DIR do
230
233
  write_gemfile(bundle) if bundle
231
- if included_stdlibs || excluded_stdlibs || heap_alloc || ruby_version
234
+ if included_stdlibs || excluded_stdlibs || heap_alloc
232
235
  sleep 1
233
236
  write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version)
234
237
  system 'rake build_xml jruby_adapter'
@@ -265,7 +268,7 @@ class Test::Unit::TestCase
265
268
  end
266
269
 
267
270
  def update_app
268
- system "#{RUBOTO_CMD} update app"
271
+ system "#{RUBOTO_CMD} update app #{"--with-jruby #{JRUBY_JARS_VERSION}" if RUBOTO_PLATFORM == 'STANDALONE'}"
269
272
  assert_equal 0, $?, "update app failed with return code #$?"
270
273
  end
271
274
 
@@ -307,21 +310,22 @@ class Test::Unit::TestCase
307
310
  end
308
311
 
309
312
  def write_ruboto_yml(included_stdlibs, excluded_stdlibs, heap_alloc, ruby_version)
310
- yml = YAML.dump({'included_stdlibs' => included_stdlibs,
311
- 'excluded_stdlibs' => excluded_stdlibs,
312
- # 'ruby_version' => ruby_version,
313
- 'heap_alloc' => heap_alloc,
314
- })
313
+ options = {}
314
+ options['included_stdlibs'] = included_stdlibs if included_stdlibs
315
+ options['excluded_stdlibs'] = excluded_stdlibs if excluded_stdlibs
316
+ options['ruby_version'] = ruby_version if ruby_version
317
+ options['heap_alloc'] = heap_alloc if heap_alloc
318
+ yml = YAML.dump(options)
315
319
  puts "Adding ruboto.yml:\n#{yml}"
316
320
  File.open('ruboto.yml', 'w') { |f| f << yml }
317
321
  end
318
322
 
319
323
  def write_gemfile(bundle)
320
- gems = [*bundle]
324
+ gems = [*bundle].map{|g| g.is_a?(Symbol) ? g.to_s : g}
321
325
  puts "Adding Gemfile.apk: #{gems.join(' ')}"
322
326
  File.open('Gemfile.apk', 'w') do |f|
323
327
  f << "source 'http://rubygems.org/'\n\n"
324
- gems.each { |g| f << "gem #{[*g].map { |gp| "'#{gp}'" }.join(', ')}\n" }
328
+ gems.each { |g| f << "gem #{[*g].map { |gp| (gp.is_a?(Symbol) ? gp.to_s : gp).inspect }.join(', ')}\n" }
325
329
  end
326
330
  end
327
331
 
@@ -5,7 +5,7 @@ module UpdateTestMethods
5
5
 
6
6
  def setup(old_ruboto_version, old_tools_version)
7
7
  @old_ruboto_version = old_ruboto_version
8
- generate_app :example => "#{old_ruboto_version}_tools_r#{old_tools_version}"
8
+ generate_app example: "#{old_ruboto_version}_tools_r#{old_tools_version}"
9
9
  end
10
10
 
11
11
  def teardown
@@ -7,7 +7,7 @@ module UpdatedExampleTestMethods
7
7
 
8
8
  def setup(old_ruboto_version, old_tools_version)
9
9
  @old_ruboto_version = old_ruboto_version
10
- generate_app :example => "#{old_ruboto_version}_tools_r#{old_tools_version}", :update => true
10
+ generate_app example: "#{old_ruboto_version}_tools_r#{old_tools_version}", update: true
11
11
  end
12
12
 
13
13
  def teardown
@@ -1,9 +1,9 @@
1
- require File.expand_path('test_helper', File.dirname(__FILE__))
1
+ require_relative 'test_helper'
2
2
 
3
- class UppercasePackageNameTest < Test::Unit::TestCase
3
+ class UppercasePackageNameTest < Minitest::Test
4
4
 
5
5
  def setup
6
- generate_app :package => 'org.ruboto.TestApp'
6
+ generate_app package: 'org.ruboto.TestApp'
7
7
  end
8
8
 
9
9
  def teardown