coupler 0.0.1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitmodules +3 -0
- data/.rvmrc +1 -0
- data/.vimrc +40 -0
- data/Gemfile +27 -0
- data/Gemfile.lock +71 -0
- data/LICENSE +20 -0
- data/NOTES +6 -0
- data/README.rdoc +18 -0
- data/Rakefile +42 -0
- data/TODO +11 -0
- data/VERSION +1 -0
- data/bin/coupler +7 -0
- data/db/.gitignore +6 -0
- data/db/migrate/001_initial_schema.rb +166 -0
- data/db/migrate/002_stub.rb +4 -0
- data/db/migrate/003_stub.rb +4 -0
- data/db/migrate/004_create_comparisons.rb +28 -0
- data/db/migrate/005_move_database_name.rb +19 -0
- data/db/migrate/006_upgrade_comparisons.rb +34 -0
- data/db/migrate/007_add_which_to_comparisons.rb +23 -0
- data/db/migrate/008_add_result_field_to_transformations.rb +33 -0
- data/db/migrate/009_add_generated_flag_to_fields.rb +13 -0
- data/db/migrate/010_create_imports.rb +24 -0
- data/db/migrate/011_add_primary_key_type.rb +13 -0
- data/db/migrate/012_add_transformed_with_to_resources.rb +13 -0
- data/db/migrate/013_add_run_count_to_scenarios.rb +13 -0
- data/db/migrate/014_add_last_accessed_at_to_some_tables.rb +13 -0
- data/db/migrate/015_add_run_number_to_results.rb +15 -0
- data/db/migrate/016_fix_scenario_run_count.rb +27 -0
- data/db/migrate/017_rename_comparison_columns.rb +14 -0
- data/db/migrate/018_fix_scenario_linkage_type.rb +8 -0
- data/db/migrate/019_add_columns_to_imports.rb +24 -0
- data/db/migrate/020_rename_import_columns.rb +12 -0
- data/db/migrate/021_add_fields_to_connections.rb +15 -0
- data/db/migrate/022_remove_database_name_from_resources.rb +11 -0
- data/features/connections.feature +28 -0
- data/features/matchers.feature +35 -0
- data/features/projects.feature +11 -0
- data/features/resources.feature +62 -0
- data/features/scenarios.feature +45 -0
- data/features/step_definitions/coupler_steps.rb +145 -0
- data/features/step_definitions/matchers_steps.rb +26 -0
- data/features/step_definitions/resources_steps.rb +12 -0
- data/features/step_definitions/scenarios_steps.rb +7 -0
- data/features/step_definitions/transformations_steps.rb +3 -0
- data/features/support/env.rb +128 -0
- data/features/transformations.feature +22 -0
- data/features/wizard.feature +10 -0
- data/gfx/coupler-header.svg +213 -0
- data/gfx/coupler-sidebar.svg +656 -0
- data/gfx/coupler.svg +184 -0
- data/gfx/icon.svg +75 -0
- data/lib/coupler/base.rb +63 -0
- data/lib/coupler/config.rb +128 -0
- data/lib/coupler/data_uploader.rb +20 -0
- data/lib/coupler/database.rb +31 -0
- data/lib/coupler/extensions/connections.rb +57 -0
- data/lib/coupler/extensions/exceptions.rb +58 -0
- data/lib/coupler/extensions/imports.rb +43 -0
- data/lib/coupler/extensions/jobs.rb +21 -0
- data/lib/coupler/extensions/matchers.rb +64 -0
- data/lib/coupler/extensions/projects.rb +62 -0
- data/lib/coupler/extensions/resources.rb +89 -0
- data/lib/coupler/extensions/results.rb +100 -0
- data/lib/coupler/extensions/scenarios.rb +50 -0
- data/lib/coupler/extensions/transformations.rb +70 -0
- data/lib/coupler/extensions/transformers.rb +58 -0
- data/lib/coupler/extensions.rb +16 -0
- data/lib/coupler/helpers.rb +121 -0
- data/lib/coupler/import_buffer.rb +48 -0
- data/lib/coupler/logger.rb +16 -0
- data/lib/coupler/models/common_model.rb +104 -0
- data/lib/coupler/models/comparison.rb +166 -0
- data/lib/coupler/models/connection.rb +59 -0
- data/lib/coupler/models/field.rb +55 -0
- data/lib/coupler/models/import.rb +238 -0
- data/lib/coupler/models/job.rb +42 -0
- data/lib/coupler/models/jobify.rb +17 -0
- data/lib/coupler/models/matcher.rb +36 -0
- data/lib/coupler/models/project.rb +40 -0
- data/lib/coupler/models/resource.rb +287 -0
- data/lib/coupler/models/result.rb +92 -0
- data/lib/coupler/models/scenario/runner.rb +357 -0
- data/lib/coupler/models/scenario.rb +115 -0
- data/lib/coupler/models/transformation.rb +117 -0
- data/lib/coupler/models/transformer/runner.rb +28 -0
- data/lib/coupler/models/transformer.rb +110 -0
- data/lib/coupler/models.rb +30 -0
- data/lib/coupler/runner.rb +76 -0
- data/lib/coupler/scheduler.rb +56 -0
- data/lib/coupler.rb +34 -0
- data/log/.gitignore +1 -0
- data/misc/README +5 -0
- data/misc/jruby-json.license +57 -0
- data/misc/rack-flash.license +22 -0
- data/script/dbconsole.rb +5 -0
- data/src/edu/vanderbilt/coupler/Main.java +116 -0
- data/src/edu/vanderbilt/coupler/jruby.properties +1 -0
- data/tasks/annotations.rake +84 -0
- data/tasks/db.rake +120 -0
- data/tasks/environment.rake +12 -0
- data/tasks/jeweler.rake +43 -0
- data/tasks/package.rake +58 -0
- data/tasks/rdoc.rake +13 -0
- data/tasks/test.rake +63 -0
- data/tasks/vendor.rake +43 -0
- data/test/README.txt +6 -0
- data/test/config.yml +9 -0
- data/test/coupler/models/test_import.rb +221 -0
- data/test/factories.rb +91 -0
- data/test/fixtures/duplicate-keys.csv +5 -0
- data/test/fixtures/no-headers.csv +50 -0
- data/test/fixtures/people.csv +51 -0
- data/test/fixtures/varying-row-size.csv +4 -0
- data/test/helper.rb +156 -0
- data/test/integration/extensions/test_connections.rb +80 -0
- data/test/integration/extensions/test_imports.rb +94 -0
- data/test/integration/extensions/test_jobs.rb +52 -0
- data/test/integration/extensions/test_matchers.rb +134 -0
- data/test/integration/extensions/test_projects.rb +82 -0
- data/test/integration/extensions/test_resources.rb +150 -0
- data/test/integration/extensions/test_results.rb +89 -0
- data/test/integration/extensions/test_scenarios.rb +88 -0
- data/test/integration/extensions/test_transformations.rb +113 -0
- data/test/integration/extensions/test_transformers.rb +80 -0
- data/test/integration/test_field.rb +45 -0
- data/test/integration/test_import.rb +78 -0
- data/test/integration/test_running_scenarios.rb +379 -0
- data/test/integration/test_transformation.rb +56 -0
- data/test/integration/test_transforming.rb +154 -0
- data/test/table_sets.rb +76 -0
- data/test/unit/models/test_common_model.rb +130 -0
- data/test/unit/models/test_comparison.rb +619 -0
- data/test/unit/models/test_connection.rb +115 -0
- data/test/unit/models/test_field.rb +99 -0
- data/test/unit/models/test_import.rb +130 -0
- data/test/unit/models/test_job.rb +115 -0
- data/test/unit/models/test_matcher.rb +82 -0
- data/test/unit/models/test_project.rb +102 -0
- data/test/unit/models/test_resource.rb +564 -0
- data/test/unit/models/test_result.rb +90 -0
- data/test/unit/models/test_scenario.rb +199 -0
- data/test/unit/models/test_transformation.rb +193 -0
- data/test/unit/models/test_transformer.rb +188 -0
- data/test/unit/test_base.rb +60 -0
- data/test/unit/test_data_uploader.rb +27 -0
- data/test/unit/test_database.rb +23 -0
- data/test/unit/test_helpers.rb +58 -0
- data/test/unit/test_logger.rb +10 -0
- data/test/unit/test_models.rb +12 -0
- data/test/unit/test_runner.rb +76 -0
- data/test/unit/test_scheduler.rb +66 -0
- data/uploads/.gitignore +2 -0
- data/vendor/java/.gitignore +5 -0
- data/webroot/public/css/960.css +1 -0
- data/webroot/public/css/dataTables.css +1057 -0
- data/webroot/public/css/jquery-ui.css +572 -0
- data/webroot/public/css/jquery.treeview.css +68 -0
- data/webroot/public/css/reset.css +1 -0
- data/webroot/public/css/style.css +504 -0
- data/webroot/public/css/text.css +1 -0
- data/webroot/public/favicon.ico +0 -0
- data/webroot/public/images/12_col.gif +0 -0
- data/webroot/public/images/16_col.gif +0 -0
- data/webroot/public/images/add.png +0 -0
- data/webroot/public/images/ajax-loader.gif +0 -0
- data/webroot/public/images/cog.png +0 -0
- data/webroot/public/images/coupler.png +0 -0
- data/webroot/public/images/foo.png +0 -0
- data/webroot/public/images/hammer.png +0 -0
- data/webroot/public/images/header.png +0 -0
- data/webroot/public/images/home.gif +0 -0
- data/webroot/public/images/jobs.gif +0 -0
- data/webroot/public/images/sidebar-bottom.png +0 -0
- data/webroot/public/images/sidebar.png +0 -0
- data/webroot/public/images/treeview-default-line.gif +0 -0
- data/webroot/public/images/treeview-default.gif +0 -0
- data/webroot/public/images/ui-anim_basic_16x16.gif +0 -0
- data/webroot/public/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/webroot/public/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/webroot/public/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/webroot/public/images/ui-bg_highlight-hard_30_565356_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-hard_75_888588_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-soft_30_6e3b3a_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-soft_35_8e8b8e_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/webroot/public/images/ui-icons_222222_256x240.png +0 -0
- data/webroot/public/images/ui-icons_2e83ff_256x240.png +0 -0
- data/webroot/public/images/ui-icons_454545_256x240.png +0 -0
- data/webroot/public/images/ui-icons_888888_256x240.png +0 -0
- data/webroot/public/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/webroot/public/images/ui-icons_ffffff_256x240.png +0 -0
- data/webroot/public/js/ajaxupload.js +673 -0
- data/webroot/public/js/application.js +40 -0
- data/webroot/public/js/jquery-ui.combobox.js +98 -0
- data/webroot/public/js/jquery-ui.js +9867 -0
- data/webroot/public/js/jquery-ui.min.js +559 -0
- data/webroot/public/js/jquery.dataTables.min.js +587 -0
- data/webroot/public/js/jquery.min.js +154 -0
- data/webroot/public/js/jquery.timeago.js +140 -0
- data/webroot/public/js/jquery.tooltip.min.js +19 -0
- data/webroot/public/js/jquery.treeview.min.js +15 -0
- data/webroot/public/js/resource.js +11 -0
- data/webroot/public/js/results.js +56 -0
- data/webroot/public/js/transformations.js +95 -0
- data/webroot/views/connections/index.erb +5 -0
- data/webroot/views/connections/list.erb +34 -0
- data/webroot/views/connections/new.erb +55 -0
- data/webroot/views/connections/show.erb +36 -0
- data/webroot/views/imports/edit.erb +60 -0
- data/webroot/views/imports/form.erb +81 -0
- data/webroot/views/imports/new.erb +89 -0
- data/webroot/views/index.erb +12 -0
- data/webroot/views/jobs/index.erb +7 -0
- data/webroot/views/jobs/list.erb +24 -0
- data/webroot/views/layout.erb +38 -0
- data/webroot/views/matchers/form.erb +250 -0
- data/webroot/views/matchers/list.erb +32 -0
- data/webroot/views/projects/form.erb +14 -0
- data/webroot/views/projects/index.erb +96 -0
- data/webroot/views/projects/show.erb +24 -0
- data/webroot/views/resources/edit.erb +88 -0
- data/webroot/views/resources/index.erb +5 -0
- data/webroot/views/resources/list.erb +27 -0
- data/webroot/views/resources/new.erb +121 -0
- data/webroot/views/resources/show.erb +86 -0
- data/webroot/views/resources/transform.erb +2 -0
- data/webroot/views/results/csv.erb +12 -0
- data/webroot/views/results/details.erb +15 -0
- data/webroot/views/results/index.erb +2 -0
- data/webroot/views/results/list.erb +22 -0
- data/webroot/views/results/record.erb +24 -0
- data/webroot/views/results/show.erb +68 -0
- data/webroot/views/scenarios/index.erb +5 -0
- data/webroot/views/scenarios/list.erb +20 -0
- data/webroot/views/scenarios/new.erb +99 -0
- data/webroot/views/scenarios/run.erb +2 -0
- data/webroot/views/scenarios/show.erb +50 -0
- data/webroot/views/sidebar.erb +106 -0
- data/webroot/views/transformations/create.erb +115 -0
- data/webroot/views/transformations/for.erb +16 -0
- data/webroot/views/transformations/index.erb +2 -0
- data/webroot/views/transformations/list.erb +29 -0
- data/webroot/views/transformations/new.erb +126 -0
- data/webroot/views/transformations/preview.erb +46 -0
- data/webroot/views/transformers/edit.erb +6 -0
- data/webroot/views/transformers/form.erb +58 -0
- data/webroot/views/transformers/index.erb +2 -0
- data/webroot/views/transformers/list.erb +25 -0
- data/webroot/views/transformers/new.erb +5 -0
- data/webroot/views/transformers/preview.erb +23 -0
- data/webroot/views/transformers/show.erb +0 -0
- metadata +558 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
module Coupler
|
4
|
+
class TestHelpers < Coupler::Test::UnitTest
|
5
|
+
include ::Coupler::Helpers
|
6
|
+
|
7
|
+
def test_error_messages_for
|
8
|
+
valid_object = mock("valid object", :errors => [])
|
9
|
+
assert_equal "", error_messages_for(valid_object)
|
10
|
+
|
11
|
+
invalid_object = mock("invalid object")
|
12
|
+
invalid_object.expects(:errors).twice.returns([[:base, ['foo']], [:pants, ['are dirty', 'are smelly']]])
|
13
|
+
result = error_messages_for(invalid_object)
|
14
|
+
|
15
|
+
doc = Nokogiri::HTML(result)
|
16
|
+
assert (div = doc.at("div.errors"))
|
17
|
+
assert (ul = div.at('ul'))
|
18
|
+
|
19
|
+
assert_equal 3, (li = ul.css('li')).length
|
20
|
+
assert_equal "foo", li[0].inner_html
|
21
|
+
assert_equal "Pants are dirty", li[1].inner_html
|
22
|
+
assert_equal "Pants are smelly", li[2].inner_html
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_delete_link
|
26
|
+
expected = %^<a href="/foo/bar" onclick="if (confirm('Are you sure?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href; var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m); f.submit(); }; return false;">Foo bar</a>^
|
27
|
+
assert_equal expected, delete_link("Foo bar", "/foo/bar")
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_timeago
|
31
|
+
now = Time.now
|
32
|
+
dt = now.send(:to_datetime)
|
33
|
+
expected = %{<div class="timeago" title="#{dt.to_s}">#{now.to_s}</div>}
|
34
|
+
assert_equal expected, timeago(now)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_timeago_with_nil_time
|
38
|
+
assert_equal "Never", timeago(nil)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_timeago_with_additional_classes
|
42
|
+
now = Time.now
|
43
|
+
dt = now.send(:to_datetime)
|
44
|
+
expected = %{<div class="timeago leet" title="#{dt.to_s}">#{now.to_s}</div>}
|
45
|
+
assert_equal expected, timeago(now, "leet")
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_form_tag_for
|
49
|
+
obj = Models::Project.new
|
50
|
+
result = form_tag_for(obj, :base_url => "/projects")
|
51
|
+
assert_equal %{<form action="/projects" method="post">}, result
|
52
|
+
|
53
|
+
obj = Factory(:project)
|
54
|
+
result = form_tag_for(obj, :base_url => "/projects")
|
55
|
+
assert_equal %{<form action="/projects/#{obj.id}" method="post"><div style="display: none;"><input type="hidden" name="_method" value="put" /></div>}, result
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
module Coupler
|
4
|
+
class TestModels < Coupler::Test::UnitTest
|
5
|
+
def test_lazy_loading_accepts_strings
|
6
|
+
assert_nothing_raised do
|
7
|
+
# This happens because Forgery calls const_missing directly with a string
|
8
|
+
Models.const_missing("Resource")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
module Coupler
|
4
|
+
class TestRunner < Coupler::Test::UnitTest
|
5
|
+
def setup
|
6
|
+
super
|
7
|
+
@scheduler = stub("scheduler", :is_started? => true, :start => nil)
|
8
|
+
Scheduler.stubs(:instance).returns(@scheduler)
|
9
|
+
@database = stub("database", :migrate! => nil)
|
10
|
+
Database.stubs(:instance).returns(@database)
|
11
|
+
@app = stub('rack app')
|
12
|
+
@handler = stub('rack handler', :new => @app)
|
13
|
+
Rack::Handler.stubs(:get).returns(@handler)
|
14
|
+
@thread = stub('mongrel thread', :join => nil)
|
15
|
+
@mongrel = stub('mongrel', :register => nil, :run => @thread)
|
16
|
+
Mongrel::HttpServer.stubs(:new).returns(@mongrel)
|
17
|
+
@settings = stub('settings', :bind => '0.0.0.0', :port => 123)
|
18
|
+
Base.stubs(:set => nil, :settings => @settings)
|
19
|
+
end
|
20
|
+
|
21
|
+
def capture_stdout
|
22
|
+
begin
|
23
|
+
out = StringIO.new
|
24
|
+
$stdout = out
|
25
|
+
yield
|
26
|
+
return out
|
27
|
+
ensure
|
28
|
+
$stdout = STDOUT
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
test "starts scheduler" do
|
33
|
+
@scheduler.expects(:start)
|
34
|
+
capture_stdout { Runner.new([]) }
|
35
|
+
end
|
36
|
+
|
37
|
+
test "starts web server" do
|
38
|
+
Mongrel::HttpServer.expects(:new).with('0.0.0.0', 123, 950, 0, 60).returns(@mongrel)
|
39
|
+
@handler.expects(:new).with(Coupler::Base).returns(@app)
|
40
|
+
@mongrel.expects(:register).with('/', @app)
|
41
|
+
@mongrel.expects(:run).returns(@thread)
|
42
|
+
Coupler::Base.expects(:set).with(:running, true)
|
43
|
+
@thread.expects(:join)
|
44
|
+
capture_stdout { Runner.new([]) }
|
45
|
+
end
|
46
|
+
|
47
|
+
test "shutting down" do
|
48
|
+
@scheduler.expects(:shutdown)
|
49
|
+
@mongrel.expects(:stop)
|
50
|
+
capture_stdout { r = Runner.new([]); r.shutdown }
|
51
|
+
end
|
52
|
+
|
53
|
+
test "migrates the database" do
|
54
|
+
@database.expects(:migrate!)
|
55
|
+
capture_stdout { Runner.new([]) }
|
56
|
+
end
|
57
|
+
|
58
|
+
test "sets web port" do
|
59
|
+
argv = %w{--port=37222}
|
60
|
+
Base.expects(:set).with(:port, 37222)
|
61
|
+
capture_stdout { Runner.new(argv) }
|
62
|
+
end
|
63
|
+
|
64
|
+
test "sets data path" do
|
65
|
+
argv = %w{--dir=/tmp/coupler}
|
66
|
+
Base.expects(:set).with(:data_path, '/tmp/coupler')
|
67
|
+
capture_stdout { Runner.new(argv) }
|
68
|
+
end
|
69
|
+
|
70
|
+
test "sets environment" do
|
71
|
+
argv = %w{--environment=development}
|
72
|
+
Base.expects(:set).with(:environment, :development)
|
73
|
+
capture_stdout { Runner.new(argv) }
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
module Coupler
|
4
|
+
class TestScheduler < Coupler::Test::UnitTest
|
5
|
+
test "schedule transform job" do
|
6
|
+
resource = mock('resource')
|
7
|
+
Models::Job.expects(:create).with({
|
8
|
+
:name => "transform",
|
9
|
+
:resource => resource,
|
10
|
+
:status => "scheduled"
|
11
|
+
})
|
12
|
+
|
13
|
+
Scheduler.instance.schedule_transform_job(resource)
|
14
|
+
end
|
15
|
+
|
16
|
+
test "schedule run scenario job" do
|
17
|
+
scenario = mock('scenario')
|
18
|
+
Models::Job.expects(:create).with({
|
19
|
+
:name => "run_scenario",
|
20
|
+
:scenario => scenario,
|
21
|
+
:status => "scheduled"
|
22
|
+
})
|
23
|
+
|
24
|
+
Scheduler.instance.schedule_run_scenario_job(scenario)
|
25
|
+
end
|
26
|
+
|
27
|
+
test "run_jobs executes first scheduled job" do
|
28
|
+
running_dataset = mock('dataset')
|
29
|
+
scheduled_dataset = mock('dataset')
|
30
|
+
job = mock('job')
|
31
|
+
|
32
|
+
seq = sequence('query')
|
33
|
+
Models::Job.expects(:filter).with(:status => 'running').returns(running_dataset).in_sequence(seq)
|
34
|
+
running_dataset.expects(:count).returns(0).in_sequence(seq)
|
35
|
+
Models::Job.expects(:filter).with(:status => 'scheduled').returns(scheduled_dataset).in_sequence(seq)
|
36
|
+
scheduled_dataset.expects(:order).with(:created_at).returns(scheduled_dataset).in_sequence(seq)
|
37
|
+
scheduled_dataset.expects(:first).returns(job).in_sequence(seq)
|
38
|
+
Thread.expects(:new).with(job).yields(job).in_sequence(seq)
|
39
|
+
job.expects(:execute).in_sequence(seq)
|
40
|
+
Scheduler.instance.run_jobs
|
41
|
+
end
|
42
|
+
|
43
|
+
test "run_jobs does not execute job if one already running" do
|
44
|
+
running_dataset = mock('dataset')
|
45
|
+
|
46
|
+
Models::Job.expects(:filter).with(:status => 'running').returns(running_dataset)
|
47
|
+
running_dataset.expects(:count).returns(1)
|
48
|
+
Models::Job.expects(:filter).with(:status => 'scheduled').never
|
49
|
+
Scheduler.instance.run_jobs
|
50
|
+
end
|
51
|
+
|
52
|
+
test "start and shutdown" do
|
53
|
+
scheduler = Scheduler.instance
|
54
|
+
thread = stub('thread')
|
55
|
+
Thread.expects(:new).once.returns(thread)
|
56
|
+
scheduler.start
|
57
|
+
assert scheduler.is_started?
|
58
|
+
|
59
|
+
scheduler.start # don't start again
|
60
|
+
|
61
|
+
thread.expects(:exit).once
|
62
|
+
scheduler.shutdown
|
63
|
+
assert !scheduler.is_started?
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/uploads/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.container_12,.container_16{margin-left:auto;margin-right:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16{display:inline;float:left;position:relative;margin-left:10px;margin-right:10px}.container_12 .grid_3,.container_16 .grid_4{width:220px}.container_12 .grid_6,.container_16 .grid_8{width:460px}.container_12 .grid_9,.container_16 .grid_12{width:700px}.container_12 .grid_12,.container_16 .grid_16{width:940px}.alpha{margin-left:0}.omega{margin-right:0}.container_12 .grid_1{width:60px}.container_12 .grid_2{width:140px}.container_12 .grid_4{width:300px}.container_12 .grid_5{width:380px}.container_12 .grid_7{width:540px}.container_12 .grid_8{width:620px}.container_12 .grid_10{width:780px}.container_12 .grid_11{width:860px}.container_16 .grid_1{width:40px}.container_16 .grid_2{width:100px}.container_16 .grid_3{width:160px}.container_16 .grid_5{width:280px}.container_16 .grid_6{width:340px}.container_16 .grid_7{width:400px}.container_16 .grid_9{width:520px}.container_16 .grid_10{width:580px}.container_16 .grid_11{width:640px}.container_16 .grid_13{width:760px}.container_16 .grid_14{width:820px}.container_16 .grid_15{width:880px}.container_12 .prefix_3,.container_16 .prefix_4{padding-left:240px}.container_12 .prefix_6,.container_16 .prefix_8{padding-left:480px}.container_12 .prefix_9,.container_16 .prefix_12{padding-left:720px}.container_12 .prefix_1{padding-left:80px}.container_12 .prefix_2{padding-left:160px}.container_12 .prefix_4{padding-left:320px}.container_12 .prefix_5{padding-left:400px}.container_12 .prefix_7{padding-left:560px}.container_12 .prefix_8{padding-left:640px}.container_12 .prefix_10{padding-left:800px}.container_12 .prefix_11{padding-left:880px}.container_16 .prefix_1{padding-left:60px}.container_16 .prefix_2{padding-left:120px}.container_16 .prefix_3{padding-left:180px}.container_16 .prefix_5{padding-left:300px}.container_16 .prefix_6{padding-left:360px}.container_16 .prefix_7{padding-left:420px}.container_16 .prefix_9{padding-left:540px}.container_16 .prefix_10{padding-left:600px}.container_16 .prefix_11{padding-left:660px}.container_16 .prefix_13{padding-left:780px}.container_16 .prefix_14{padding-left:840px}.container_16 .prefix_15{padding-left:900px}.container_12 .suffix_3,.container_16 .suffix_4{padding-right:240px}.container_12 .suffix_6,.container_16 .suffix_8{padding-right:480px}.container_12 .suffix_9,.container_16 .suffix_12{padding-right:720px}.container_12 .suffix_1{padding-right:80px}.container_12 .suffix_2{padding-right:160px}.container_12 .suffix_4{padding-right:320px}.container_12 .suffix_5{padding-right:400px}.container_12 .suffix_7{padding-right:560px}.container_12 .suffix_8{padding-right:640px}.container_12 .suffix_10{padding-right:800px}.container_12 .suffix_11{padding-right:880px}.container_16 .suffix_1{padding-right:60px}.container_16 .suffix_2{padding-right:120px}.container_16 .suffix_3{padding-right:180px}.container_16 .suffix_5{padding-right:300px}.container_16 .suffix_6{padding-right:360px}.container_16 .suffix_7{padding-right:420px}.container_16 .suffix_9{padding-right:540px}.container_16 .suffix_10{padding-right:600px}.container_16 .suffix_11{padding-right:660px}.container_16 .suffix_13{padding-right:780px}.container_16 .suffix_14{padding-right:840px}.container_16 .suffix_15{padding-right:900px}.container_12 .push_3,.container_16 .push_4{left:240px}.container_12 .push_6,.container_16 .push_8{left:480px}.container_12 .push_9,.container_16 .push_12{left:720px}.container_12 .push_1{left:80px}.container_12 .push_2{left:160px}.container_12 .push_4{left:320px}.container_12 .push_5{left:400px}.container_12 .push_7{left:560px}.container_12 .push_8{left:640px}.container_12 .push_10{left:800px}.container_12 .push_11{left:880px}.container_16 .push_1{left:60px}.container_16 .push_2{left:120px}.container_16 .push_3{left:180px}.container_16 .push_5{left:300px}.container_16 .push_6{left:360px}.container_16 .push_7{left:420px}.container_16 .push_9{left:540px}.container_16 .push_10{left:600px}.container_16 .push_11{left:660px}.container_16 .push_13{left:780px}.container_16 .push_14{left:840px}.container_16 .push_15{left:900px}.container_12 .pull_3,.container_16 .pull_4{left:-240px}.container_12 .pull_6,.container_16 .pull_8{left:-480px}.container_12 .pull_9,.container_16 .pull_12{left:-720px}.container_12 .pull_1{left:-80px}.container_12 .pull_2{left:-160px}.container_12 .pull_4{left:-320px}.container_12 .pull_5{left:-400px}.container_12 .pull_7{left:-560px}.container_12 .pull_8{left:-640px}.container_12 .pull_10{left:-800px}.container_12 .pull_11{left:-880px}.container_16 .pull_1{left:-60px}.container_16 .pull_2{left:-120px}.container_16 .pull_3{left:-180px}.container_16 .pull_5{left:-300px}.container_16 .pull_6{left:-360px}.container_16 .pull_7{left:-420px}.container_16 .pull_9{left:-540px}.container_16 .pull_10{left:-600px}.container_16 .pull_11{left:-660px}.container_16 .pull_13{left:-780px}.container_16 .pull_14{left:-840px}.container_16 .pull_15{left:-900px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:after{clear:both;content:' ';display:block;font-size:0;line-height:0;visibility:hidden;width:0;height:0}* html .clearfix{height:1%}
|