oats 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/.gitignore +6 -0
  2. data/Gemfile +15 -0
  3. data/README.txt +165 -0
  4. data/Rakefile +2 -0
  5. data/bin/agent +204 -0
  6. data/bin/oats +10 -0
  7. data/bin/occ +29 -0
  8. data/bin/results_cleanup +6 -0
  9. data/doc/COPYING +55 -0
  10. data/doc/LICENSE +55 -0
  11. data/doc/OATS_Framework.doc +0 -0
  12. data/doc/classes/ApplicationLogs.html +239 -0
  13. data/doc/classes/Campaign.html +843 -0
  14. data/doc/classes/CommandlineOptions.html +131 -0
  15. data/doc/classes/Driver.html +182 -0
  16. data/doc/classes/Hash.html +137 -0
  17. data/doc/classes/Ide.html +194 -0
  18. data/doc/classes/MapSelenium.html +197 -0
  19. data/doc/classes/Net.html +107 -0
  20. data/doc/classes/Oats/OatsFilterError.html +119 -0
  21. data/doc/classes/Oats.html +998 -0
  22. data/doc/classes/OatsAssertError.html +119 -0
  23. data/doc/classes/OatsBadInput.html +119 -0
  24. data/doc/classes/OatsData.html +290 -0
  25. data/doc/classes/OatsError.html +117 -0
  26. data/doc/classes/OatsExit.html +117 -0
  27. data/doc/classes/OatsLock.html +254 -0
  28. data/doc/classes/OatsMain.html +182 -0
  29. data/doc/classes/OatsMysqlError.html +113 -0
  30. data/doc/classes/OatsMysqlMissingInput.html +113 -0
  31. data/doc/classes/OatsReportError.html +113 -0
  32. data/doc/classes/OatsSetupError.html +119 -0
  33. data/doc/classes/OatsTestError.html +119 -0
  34. data/doc/classes/OatsTestExit.html +119 -0
  35. data/doc/classes/OatsTestLocateError.html +120 -0
  36. data/doc/classes/OatsVerifyError.html +119 -0
  37. data/doc/classes/Ragent.html +397 -0
  38. data/doc/classes/Rclient.html +236 -0
  39. data/doc/classes/Report.html +368 -0
  40. data/doc/classes/Reports.html +244 -0
  41. data/doc/classes/RestApi.html +333 -0
  42. data/doc/classes/RhttpClient.html +236 -0
  43. data/doc/classes/Rimap.html +170 -0
  44. data/doc/classes/Rmysql.html +176 -0
  45. data/doc/classes/Roptions.html +131 -0
  46. data/doc/classes/Rselenium.html +233 -0
  47. data/doc/classes/Rssh.html +138 -0
  48. data/doc/classes/Runnable.html +174 -0
  49. data/doc/classes/SFTriggers.html +206 -0
  50. data/doc/classes/Selenium/Client/Driver.html +211 -0
  51. data/doc/classes/Selenium/Client.html +107 -0
  52. data/doc/classes/Selenium.html +107 -0
  53. data/doc/classes/SystemCapture.html +304 -0
  54. data/doc/classes/TestCase.html +418 -0
  55. data/doc/classes/TestData.html +235 -0
  56. data/doc/classes/TestList.html +264 -0
  57. data/doc/classes/Tools.html +244 -0
  58. data/doc/classes/Util.html +201 -0
  59. data/doc/classes/Variation.html +206 -0
  60. data/doc/fr_class_index.html +92 -0
  61. data/doc/fr_method_index.html +465 -0
  62. data/doc/index.html +23 -0
  63. data/doc/oats_httpd.conf +32 -0
  64. data/doc/oats_user.yml +25 -0
  65. data/doc/rdoc-style.css +208 -0
  66. data/lib/deep_merge/.gitignore +2 -0
  67. data/lib/deep_merge/core.rb +195 -0
  68. data/lib/deep_merge/deep_merge.rb +1 -0
  69. data/lib/deep_merge/deep_merge_hash.rb +28 -0
  70. data/lib/deep_merge/rails_compat.rb +27 -0
  71. data/lib/oats/application_logs.rb +163 -0
  72. data/lib/oats/build_id.rb +58 -0
  73. data/lib/oats/commandline_options.rb +128 -0
  74. data/lib/oats/diff.rb +278 -0
  75. data/lib/oats/driver.rb +492 -0
  76. data/lib/oats/ide.rb +227 -0
  77. data/lib/oats/keywords.rb +67 -0
  78. data/lib/oats/log4r_init.rb +14 -0
  79. data/lib/oats/mysql.rb +97 -0
  80. data/lib/oats/oats.rb +637 -0
  81. data/lib/oats/oats_data.rb +400 -0
  82. data/lib/oats/oats_exceptions.rb +25 -0
  83. data/lib/oats/oats_lock.rb +261 -0
  84. data/lib/oats/oats_selenium_api.rb +639 -0
  85. data/lib/oats/oselenium.rb +189 -0
  86. data/lib/oats/ossh.rb +36 -0
  87. data/lib/oats/patches_for_eventmachine_12.10.rb +66 -0
  88. data/lib/oats/ragent.rb +321 -0
  89. data/lib/oats/rclient.rb +42 -0
  90. data/lib/oats/report.rb +207 -0
  91. data/lib/oats/roptions.rb +88 -0
  92. data/lib/oats/test_case.rb +510 -0
  93. data/lib/oats/test_data.rb +98 -0
  94. data/lib/oats/test_list.rb +141 -0
  95. data/lib/oats/unixdiff.rb +75 -0
  96. data/lib/oats/util.rb +125 -0
  97. data/lib/oats/version.rb +3 -0
  98. data/lib/oats.rb +36 -0
  99. data/nbproject/configs/agent.properties +0 -0
  100. data/nbproject/configs/gr.properties +0 -0
  101. data/nbproject/project.properties +10 -0
  102. data/nbproject/project.xml +17 -0
  103. data/oats.gemspec +42 -0
  104. data/oats_ini.yml +258 -0
  105. data/oats_tests/Gemfile +18 -0
  106. data/oats_tests/aut_ini.yml +30 -0
  107. data/oats_tests/bin/oats +8 -0
  108. data/oats_tests/environments/qa.yml +4 -0
  109. data/oats_tests/environments/qa_chrome.yml +4 -0
  110. data/oats_tests/examples/core/coreExamples.yml +8 -0
  111. data/oats_tests/examples/core/expectedException.rb +39 -0
  112. data/oats_tests/examples/core/ok_verify.rb +2 -0
  113. data/oats_tests/examples/core/ok_verify.rb_ok/out/myfile.txt +1 -0
  114. data/oats_tests/examples/core/ok_verify.rb_ok/out/myfile2.txt +1 -0
  115. data/oats_tests/examples/core/ok_verify.rb_ok/rats_test.log +2 -0
  116. data/oats_tests/examples/core/unexpectedException.rb +30 -0
  117. data/oats_tests/examples/examples.yml +13 -0
  118. data/oats_tests/examples/gui/guiExamples.yml +7 -0
  119. data/oats_tests/examples/gui/seleniumGoogle.rb +10 -0
  120. data/oats_tests/examples/gui/webdriverGoogle.rb +9 -0
  121. data/oats_tests/examples/keywords/SampleXlList-1.xls +0 -0
  122. data/oats_tests/examples/keywords/SampleXlList-2.xls +0 -0
  123. data/oats_tests/examples/keywords/SampleXlLists.xls +0 -0
  124. data/oats_tests/examples/keywords/keywordsDriver.rb +1 -0
  125. data/oats_tests/examples/keywords/keywordsExamples.yml +8 -0
  126. data/oats_tests/examples/keywords/keywordsTC1.yml +5 -0
  127. data/oats_tests/examples/keywords/keywordsTestlist.yml +16 -0
  128. data/oats_tests/examples/needsWork/addTestDynamically.rb +4 -0
  129. data/oats_tests/examples/needsWork/emailVerify.rb +34 -0
  130. data/oats_tests/examples/needsWork/testSql/rtest.sql +6 -0
  131. data/oats_tests/examples/needsWork/testSql/rtest.yml +11 -0
  132. data/oats_tests/examples/occTest/occTest.rb +13 -0
  133. data/oats_tests/examples/occTest/occTest_1.rb +1 -0
  134. data/oats_tests/examples/occTest/occTest_1_1.rb +1 -0
  135. data/oats_tests/examples/occTest/occTest_1_2.rb +1 -0
  136. data/oats_tests/examples/occTest/occTest_1_3.rb +1 -0
  137. data/oats_tests/examples/occTest/occTest_1_4.rb +1 -0
  138. data/oats_tests/examples/occTest/occTest_2.rb +1 -0
  139. data/oats_tests/examples/occTest/occTest_2_1.rb +1 -0
  140. data/oats_tests/examples/occTest/occTest_2_2.rb +1 -0
  141. data/oats_tests/examples/occTest/occTest_2_3.rb +1 -0
  142. data/oats_tests/examples/occTest/occTest_2_4.rb +1 -0
  143. data/oats_tests/examples/occTest/occTest_3.rb +1 -0
  144. data/oats_tests/examples/occTest/occTest_3_1.rb +1 -0
  145. data/oats_tests/examples/occTest/occTest_3_2.rb +1 -0
  146. data/oats_tests/examples/occTest/occTest_3_3.rb +1 -0
  147. data/oats_tests/examples/occTest/occTest_3_4.rb +1 -0
  148. data/oats_tests/examples/occTest/occTest_4.rb +1 -0
  149. data/oats_tests/examples/occTest/occTestlist.yml +9 -0
  150. data/oats_tests/examples/occTest/occTestlist_1.yml +9 -0
  151. data/oats_tests/examples/occTest/occTestlist_2.yml +9 -0
  152. data/oats_tests/examples/occTest/occTestlist_3.yml +9 -0
  153. data/oats_tests/examples/occTest/variation1.yml +4 -0
  154. data/oats_tests/examples/occTest/variation2.yml +4 -0
  155. data/oats_tests/examples/testFileLocationUnitTests/extn_driver.rb +4 -0
  156. data/oats_tests/examples/testFileLocationUnitTests/folder/oats.yml +3 -0
  157. data/oats_tests/examples/testFileLocationUnitTests/folder/t1.rb +2 -0
  158. data/oats_tests/examples/testFileLocationUnitTests/folder1/t1.yml +2 -0
  159. data/oats_tests/examples/testFileLocationUnitTests/folder1/t1_1.yml +3 -0
  160. data/oats_tests/examples/testFileLocationUnitTests/folder2/oats.yml +3 -0
  161. data/oats_tests/examples/testFileLocationUnitTests/folder2/t1.rb +2 -0
  162. data/oats_tests/examples/testFileLocationUnitTests/folder2/t1.yml +2 -0
  163. data/oats_tests/examples/testFileLocationUnitTests/no_yaml.rb +3 -0
  164. data/oats_tests/examples/testFileLocationUnitTests/post_yaml.rb +1 -0
  165. data/oats_tests/examples/testFileLocationUnitTests/t1.rb +4 -0
  166. data/oats_tests/examples/testFileLocationUnitTests/t1.yml +2 -0
  167. data/oats_tests/examples/testFileLocationUnitTests/t1_1.yml +3 -0
  168. data/oats_tests/examples/testFileLocationUnitTests/testDir/oats.yml +3 -0
  169. data/oats_tests/examples/testFileLocationUnitTests/testDir/t1.rb +2 -0
  170. data/oats_tests/examples/testFileLocationUnitTests/testDir/t1.yml +2 -0
  171. data/oats_tests/examples/testFileLocationUnitTests/testDir2/t1.rb +2 -0
  172. data/oats_tests/examples/testFileLocationUnitTests/testDir2/t1.yml +2 -0
  173. data/oats_tests/examples/testFileLocationUnitTests/unitTestList.yml +36 -0
  174. data/oats_tests/examples/testFileLocationUnitTests/yml_driver.rb +2 -0
  175. data/oats_tests/lib/business.rb +28 -0
  176. data/oats_tests/lib/sample_xl_lists.rb +37 -0
  177. data/test/common_test_unit_setup.rb +21 -0
  178. data/test/test_basic.rb +16 -0
  179. data/test/test_selenium.rb +16 -0
  180. data/test/test_xl_lists.rb +16 -0
  181. metadata +291 -0
@@ -0,0 +1,141 @@
1
+ module Oats
2
+
3
+ # TestList has array of variations
4
+ class TestList
5
+ # Path of test relative to the dir_tests library
6
+ attr_reader :id
7
+ # Absolute path to the test.yml
8
+ attr_reader :path
9
+ # Array of Variation structures
10
+ attr_accessor :variations
11
+ # Parent variation, start and end times
12
+ attr_accessor :parent_variation, :start_time, :end_time, :pre_test, :post_test
13
+ @@current = nil
14
+ # Currently active test list
15
+ def TestList.current
16
+ @@current
17
+ end
18
+ def TestList.current=(list)
19
+ @@current = list
20
+ end
21
+
22
+ def TestList.txt_tests(pth)
23
+ list = IO.readlines(pth)
24
+ list = list.collect{|x| f=x.chomp.sub(/#.*/,'').strip}
25
+ return list.delete_if { |x| x == '' }
26
+ end
27
+
28
+ def add_variation(var)
29
+ lv = self.variations.last
30
+ lv.end_time = Time.now.to_i if lv and ! lv.end_time
31
+ if variations.empty? or variations.last.name != 'default'
32
+ variations << Variation.new(var,self)
33
+ else
34
+ variations.last.name = var
35
+ variations.last.start_time = Time.now.to_i
36
+ end
37
+ end
38
+
39
+ def testlist_hash
40
+ variation = nil
41
+ top_level_variations = self.variations[0]
42
+ unless top_level_variations.nil? or top_level_variations.tests.nil?
43
+ cur_test_list = top_level_variations.tests[0]
44
+ if cur_test_list
45
+ if cur_test_list.instance_of?(TestCase)
46
+ variation = top_level_variations
47
+ else
48
+ variation = cur_test_list.variations[0]
49
+ end
50
+ # Oats seems to set the end_time of variations incorrectly as equal to
51
+ # start time until very end. Compensate for it by borrowing the time from the TestList
52
+ variation.end_time = cur_test_list.end_time
53
+ end
54
+ end
55
+ return nil unless variation
56
+ return variation.variation_hash(pre_test, post_test)
57
+ end
58
+
59
+ def initialize(id, path)
60
+ @id = id
61
+ @path = path
62
+ @start_time = Time.now.to_i
63
+ @variations = []
64
+ add_variation('default')
65
+ $log.info "**** TEST LIST [#{@id}]" if id
66
+ # raise OatsError, "Encountered recursive inclusion of test lists: [#{tree_id}]"
67
+ if @@current # Make this list a child of current list
68
+ @parent_variation = @@current.variations.last
69
+ @parent_variation.tests << self
70
+ else # record the root
71
+ $oats_info['test_files'] = self
72
+ end
73
+ @@current = self # Repoint the current list
74
+ end
75
+ end
76
+
77
+ # TestList has an array of these
78
+ class Variation
79
+ attr_reader :tests
80
+ attr_accessor :start_time, :env_name, :name, :list_name, :end_time, :total, :pass, :fail, :skip, :parent
81
+ def initialize(var,list)
82
+ @parent = list
83
+ @name = var
84
+ @tests = []
85
+ @start_time = Time.now.to_i
86
+ end
87
+
88
+
89
+ def variation_hash(pre_test, post_test)
90
+ err_msg = nil
91
+ testlist = self
92
+ $log ||= Rails.logger
93
+ testlist.tests.each_with_index do |tst,idx|
94
+ unless tst.instance_of?(TestCase)
95
+ msg = "Expected a test case in #{testlist.list_name} but got:"
96
+ $log.error "#{msg} #{tst.inspect}"
97
+ msg = "... in job:"
98
+ $log.error "#{msg} #{self.inspect}"
99
+ msg = "Deleting the TestList #{tst.id}"
100
+ err_msg = "Deleted unexpected sub-TestList: #{tst.id}"
101
+ $log.error msg
102
+ testlist.tests.delete(tst)
103
+ next
104
+ end
105
+ end
106
+ testlist.parent = nil
107
+
108
+ thash = {
109
+ 'fail' => testlist.fail,
110
+ 'pass' => testlist.pass,
111
+ 'skip' => testlist.skip,
112
+ 'total' => testlist.total,
113
+ 'start_time' => testlist.start_time,
114
+ 'end_time' => testlist.end_time,
115
+ 'tests' => []
116
+ }
117
+ if pre_test and ! pre_test.errors.empty?
118
+ thash['tests'].push(pre_test)
119
+ thash['fail'] = thash['fail'] ? (thash['fail'] +1) : 1
120
+ end
121
+ if post_test and ! post_test.errors.empty?
122
+ thash['tests'].push(post_test)
123
+ thash['fail'] = thash['fail'] ? (thash['fail'] +1) : 1
124
+ end
125
+ thash['results_error'] = err_msg if err_msg
126
+ testlist.tests.each do |t|
127
+ tc = { 'id' => t.id,
128
+ 'status' => t.status,
129
+ 'error_capture_file' => t.error_capture_file,
130
+ 'result' => t.result,
131
+ 'timed_out' => t.timed_out?,
132
+ 'start_time' => t.start_time,
133
+ 'end_time' => t.end_time }
134
+ tc['errors'] = t.errors if t.errors
135
+ thash['tests'].push tc
136
+ end
137
+ return thash
138
+ end
139
+
140
+ end
141
+ end
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env ruby
2
+ $:.push = File.dirname(__FILE__)
3
+ require 'diff'
4
+
5
+
6
+ def loadfile(filename)
7
+ lines = nil
8
+ File.open(filename, "r") { |f|
9
+ lines = f.readlines
10
+ }
11
+ return lines
12
+ end
13
+
14
+ def diffrange(a, b)
15
+ if (a == b)
16
+ "#{a}"
17
+ else
18
+ "#{a},#{b}"
19
+ end
20
+ end
21
+
22
+ class Diff
23
+ def to_diff(io = $defout)
24
+ offset = 0
25
+ @diffs.each { |b|
26
+ first = b[0][1]
27
+ length = b.length
28
+ action = b[0][0]
29
+ addcount = 0
30
+ remcount = 0
31
+ b.each { |l|
32
+ if l[0] == "+"
33
+ addcount += 1
34
+ elsif l[0] == "-"
35
+ remcount += 1
36
+ end
37
+ }
38
+ if addcount == 0
39
+ puts "#{diffrange(first+1, first+remcount)}d#{first+offset}"
40
+ elsif remcount == 0
41
+ puts "#{first-offset}a#{diffrange(first+1, first+addcount)}"
42
+ else
43
+ puts "#{diffrange(first+1, first+remcount)}c#{diffrange(first+offset+1, first+offset+addcount)}"
44
+ end
45
+ lastdel = (b[0][0] == "-")
46
+ b.each { |l|
47
+ if l[0] == "-"
48
+ offset -= 1
49
+ print "< "
50
+ elsif l[0] == "+"
51
+ offset += 1
52
+ if lastdel
53
+ lastdel = false
54
+ puts "---"
55
+ end
56
+ print "> "
57
+ end
58
+ print l[2]
59
+ }
60
+ }
61
+ end
62
+ end
63
+
64
+ if $0 == __FILE__
65
+
66
+ file1 = ARGV.shift
67
+ file2 = ARGV.shift
68
+
69
+ ary1 = loadfile file1
70
+ ary2 = loadfile file2
71
+
72
+ diff = Diff.new(ary1, ary2)
73
+ diff.to_diff
74
+
75
+ end
data/lib/oats/util.rb ADDED
@@ -0,0 +1,125 @@
1
+ autoload :Process, 'win32/process'
2
+
3
+ module Oats
4
+ module Util
5
+
6
+ # def Util.cygwin_fix_path(file,dir = nil)
7
+ # end
8
+ def Util.expand_path(file,dir = nil)
9
+ file = File.expand_path(file, dir)
10
+ file.sub!('/',':/') if file.sub!('/cygdrive/','')
11
+ file
12
+ end
13
+
14
+ # Returns a unique path in dir using basename of file_name.
15
+ # file_name:: Appends '_count' to the the basename if the file already exists.
16
+ # dir:: if not given, uses the dirname of file_name. If file_name does not
17
+ # have dirname, assumes dir = '.' If dir does not exist, it is created.
18
+ def Util.file_unique(file_name, dir = nil)
19
+ new_path, existing_path = Util.file_examine(file_name, dir)
20
+ return new_path
21
+ end
22
+
23
+ # Returns the file path for the existing file with the highest _count in dir
24
+ # dir:: if not given, uses the dirname of file_name. If file_name does not
25
+ # have dirname, assumes dir = '.' If dir does not exist, it is created.
26
+ def Util.file_latest(file_name, dir = nil)
27
+ new_path, existing_path = Util.file_examine(file_name, dir)
28
+ return existing_path
29
+ end
30
+
31
+ # Returns a unique path in dir using basename of file_name for a new file
32
+ # and also return the file path for the existing file with the highest _count
33
+ # in dir.
34
+ # file_name:: Appends '_count' to the the basename if the file already exists.
35
+ # dir:: if not given, uses the dirname of file_name. If file_name does not
36
+ # have dirname, assumes dir = '.' If dir does not exist, it is created.
37
+ def Util.file_examine(file_name, dir = nil)
38
+ fname = File.basename(file_name)
39
+ dir ||= File.dirname(file_name)
40
+ dir = '.' unless dir
41
+ existing_path = nil
42
+ path = File.join dir, fname
43
+ if File.directory?(dir)
44
+ (1..100).each do |cnt|
45
+ break unless File.exist?(path)
46
+ existing_path = path
47
+ extn = File.extname(path)
48
+ if extn
49
+ base = path.sub(/#{extn}\z/,'')
50
+ base.sub!(/(_\d*)?\z/,"_#{cnt}")
51
+ path = base + extn
52
+ else
53
+ path = File.join dir, file_name + "_#{cnt}"
54
+ end
55
+ end
56
+ else
57
+ FileUtils.mkdir_p(dir)
58
+ end
59
+ existing_path = Util.expand_path(existing_path) unless existing_path.nil?
60
+ return Util.expand_path(path), existing_path
61
+ end
62
+
63
+ # Kill process occupying a port
64
+ def Util.clear_port(port,log)
65
+ matching_busy_port_line = IO.popen('netstat -a -o').readlines.grep(Regexp.new(port.to_s)).first
66
+ return unless matching_busy_port_line and matching_busy_port_line =~ /LISTENING/
67
+ pid = matching_busy_port_line.chomp!.sub(/.*LISTENING *(\d+).*/,'\1')
68
+ log.warn "Likely busy port: [#{matching_busy_port_line}]"
69
+ # Cygwin specific code
70
+ # pid_line = IO.popen("pslist #{pid}").readlines.grep(Regexp.new('java.*'+pid.to_s)).first
71
+ # log.warn pid_line
72
+ # begin
73
+ log.warn "Will attempt to kill the PID #{pid}"
74
+ signal = 'KILL'
75
+ killed = Process.kill(signal,pid.to_i)
76
+ if killed.empty?
77
+ log.warn "Failed to kill the process"
78
+ return false
79
+ else
80
+ log.warn "Successfully killed the process."
81
+ return true
82
+ end
83
+ end
84
+
85
+ # Kill process using a handle
86
+ # Util.clear_handle('oats_in_progress.lock','java','ruby') willl kill
87
+ def Util.clear_handle(hstring,*proc_names)
88
+ pid = nil
89
+ proc_name = nil
90
+ handle_string = nil
91
+ line = nil
92
+ matches = IO.popen("handle #{hstring}").readlines
93
+ matches.each do |lvar|
94
+ line = lvar
95
+ line =~ /(.*) pid:(.*) .*: (.*)/
96
+ next unless $1
97
+ proc_name = $1.strip
98
+ pid = $2.strip
99
+ handle_string = $3.strip
100
+ if handle_string =~ /#{hstring}/
101
+ proc_names.each do |name|
102
+ break if proc_name =~ /#{name}/
103
+ end
104
+ end
105
+ end
106
+ return unless pid
107
+ puts "Likely locking process: [#{line}]"
108
+ # Cygwin specific code
109
+ # pid_line = IO.popen("pslist #{pid}").readlines.grep(Regexp.new('java.*'+pid.to_s)).first
110
+ # log.warn pid_line
111
+ # begin
112
+ puts "Will attempt to kill the PID #{pid}"
113
+ signal = 'KILL'
114
+ killed = Process.kill(signal,pid.to_i)
115
+ if killed.empty?
116
+ puts "Failed to kill the process"
117
+ return false
118
+ else
119
+ puts "Successfully killed the process."
120
+ return true
121
+ end
122
+ end
123
+
124
+ end
125
+ end
@@ -0,0 +1,3 @@
1
+ module Oats
2
+ VERSION = "0.0.1"
3
+ end
data/lib/oats.rb ADDED
@@ -0,0 +1,36 @@
1
+
2
+ defined? Jruby && JRuby.objectspace = true # avoid error http://rubyforge.org/pipermail/nokogiri-talk/2010-April/000355.html
3
+
4
+ $oats_execution = {} # Keeps variables that persists throughout a agents life, across testlists
5
+ # Need to be before reading classes to allow the loaded classes register themselves here
6
+ # In agent mode, this will contain 'options'.
7
+ # Classes of OATS can check existence of this to determine whether called by OATS or OCC
8
+
9
+ require 'pp'
10
+ require 'oats/commandline_options'
11
+ options = Oats::CommandlineOptions.options
12
+ $oats_execution['options'] = options
13
+ if options['execution:occ:agent_nickname'] || options['execution:occ:agent_port'] || options['_:command']
14
+ $oats_execution['agent'] = options # Existence of this from now on implies running in agent mode
15
+ end
16
+
17
+ ENV['OATS_HOME'] ||= File.expand_path( '..', File.dirname(__FILE__) )
18
+ ENV['OATS_TESTS'] ||= options['_:dir_tests'] || (ENV['OATS_HOME'] + '/oats_tests')
19
+
20
+ $:.unshift(ENV['OATS_TESTS'] + '/lib')
21
+
22
+ require 'oats/keywords'
23
+
24
+ # GEMS needed by OATS.
25
+ require 'rubygems'
26
+ require "bundler/setup"
27
+ #Bundler.require
28
+ #gem 'log4r'
29
+ #require 'deep_merge' # Need modified version of https://github.com/danielsdeleo/deep_merge for 1.9 compatibility
30
+ require 'log4r' # http://log4r.sourceforge.net/rdoc/index.html
31
+
32
+ require 'oats/driver'
33
+ require 'oats/oats_lock'
34
+
35
+ #ENV['OATS_HOME'] ||= Oats::Util.expand_path( '..', File.dirname(__FILE__) )
36
+ require 'oats/oats' # Interface methods to user methods implemented in other modules
File without changes
File without changes
@@ -0,0 +1,10 @@
1
+ file.reference.oats-lib=lib
2
+ file.reference.oats-tests=tests
3
+ javac.classpath=
4
+ main.file=oats
5
+ platform.active=Ruby
6
+ source.encoding=UTF-8
7
+ src.bin.dir=bin
8
+ test.lib.dir=lib
9
+ test.oats_tests.dir=oats_tests
10
+ test.test.dir=test
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://www.netbeans.org/ns/project/1">
3
+ <type>org.netbeans.modules.ruby.rubyproject</type>
4
+ <configuration>
5
+ <data xmlns="http://www.netbeans.org/ns/ruby-project/1">
6
+ <name>oats</name>
7
+ <source-roots>
8
+ <root id="src.bin.dir"/>
9
+ </source-roots>
10
+ <test-roots>
11
+ <root id="test.test.dir"/>
12
+ <root id="test.oats_tests.dir"/>
13
+ <root id="test.lib.dir"/>
14
+ </test-roots>
15
+ </data>
16
+ </configuration>
17
+ </project>
data/oats.gemspec ADDED
@@ -0,0 +1,42 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "oats/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "oats"
7
+ s.version = Oats::VERSION
8
+ s.authors = ["Levent Atasoy"]
9
+ s.email = ["levent.atasoy@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{A flexible automated system integration regression test framework.}
12
+ s.description = %q{A flexible automated system integration regression test framework.}
13
+
14
+ s.rubyforge_project = "oats"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ # s.test_files = ["test/test_cgi_wrapper.rb" ]
19
+ s.executables = %w{oats}
20
+ s.require_paths = ["lib"]
21
+
22
+ # s.extra_rdoc_files = ["CHANGELOG", "COPYING", "lib/mongrel/camping.rb", "LICENSE", "README"]
23
+ # s.has_rdoc = true
24
+ # s.homepage = %q{http://mongrel.rubyforge.org}
25
+ # s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Mongrel", "--main", "README"
26
+ s.date = %q{2012-05-22}
27
+ s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
28
+
29
+ s.add_dependency 'log4r'
30
+ s.add_dependency 'net-http-persistent' unless RUBY_VERSION !~ /^1.9/ # Speed up 1.8 connections
31
+
32
+ if ENV['OS'] == 'Windows_NT' or ENV['OATS_AGENT'] # Triggers possible intent to use agent
33
+ s.add_dependency 'win32-process'
34
+ else
35
+ s.add_dependency 'json'
36
+ s.add_dependency 'em-http-request'
37
+ if ENV['OS'] == 'Linux' # Seems to be needed by Ubuntu
38
+ s.add_dependency 'execjs'
39
+ s.add_dependency 'therubyracer'
40
+ end
41
+ end
42
+ end