talia_core 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/generators/generator_helpers.rb +35 -2
- data/generators/talia_admin/talia_admin_generator.rb +6 -0
- data/generators/talia_admin/templates/controllers/admin/background_controller.rb +2 -0
- data/generators/talia_admin/templates/controllers/admin/roles_controller.rb +8 -0
- data/generators/talia_admin/templates/controllers/admin/sources_controller.rb +2 -64
- data/generators/talia_admin/templates/controllers/admin/users_controller.rb +3 -41
- data/generators/talia_admin/templates/controllers/admin_controller.rb +1 -1
- data/generators/talia_admin/templates/helpers/admin/roles_helper.rb +2 -0
- data/generators/talia_admin/templates/helpers/admin/users_helper.rb +9 -0
- data/generators/talia_admin/templates/helpers/admin_helper.rb +19 -0
- data/generators/{talia_base → talia_admin}/templates/migrations/populate_users.rb +5 -2
- data/generators/talia_admin/templates/models/role.rb +3 -0
- data/generators/talia_admin/templates/public/stylesheets/backend.css +1 -4
- data/generators/talia_admin/templates/views/admin/index.html.erb +3 -3
- data/generators/talia_admin/templates/views/admin/sources/_show.html.erb +13 -0
- data/generators/talia_admin/templates/views/layouts/admin.html.erb +5 -5
- data/generators/talia_base/talia_base_generator.rb +11 -18
- data/generators/talia_base/templates/README +15 -0
- data/generators/talia_base/templates/app/controllers/sources_controller.rb +125 -7
- data/generators/talia_base/templates/app/helpers/sources_helper.rb +19 -35
- data/generators/talia_base/templates/app/views/sources/index.html.erb +12 -1
- data/generators/talia_base/templates/app/views/sources/semantic_templates/default/default.html.erb +21 -0
- data/generators/talia_base/templates/app/views/sources/semantic_templates/default/province.html.erb +19 -0
- data/generators/talia_base/templates/config/routes.rb +24 -4
- data/generators/talia_base/templates/script/setup_talia_backend +35 -0
- data/lib/loader_helper.rb +8 -1
- data/lib/talia_core/active_source.rb +9 -6
- data/lib/talia_core/active_source_parts/class_methods.rb +2 -1
- data/lib/talia_core/active_source_parts/predicate_handler.rb +12 -0
- data/lib/talia_core/active_source_parts/rdf.rb +1 -1
- data/lib/talia_core/data_types/iip_loader.rb +2 -0
- data/lib/talia_core/dc_resource.rb +1 -1
- data/lib/talia_core/initializer.rb +2 -0
- data/lib/talia_core/semantic_relation.rb +1 -1
- data/lib/talia_util/rake_tasks.rb +2 -2
- data/lib/talia_util/util.rb +1 -1
- data/test/talia_core/active_source_predicate_test.rb +2 -6
- data/test/talia_core/active_source_rdf_test.rb +9 -5
- data/test/talia_core/active_source_test.rb +50 -44
- data/test/talia_core/data_types/data_loader_test.rb +2 -2
- data/test/talia_core/data_types/data_record_test.rb +1 -1
- data/test/talia_core/data_types/file_record_test.rb +4 -3
- data/test/talia_core/data_types/iip_data_test.rb +2 -2
- data/test/talia_core/data_types/image_data_test.rb +1 -1
- data/test/talia_core/data_types/pdf_data_test.rb +1 -1
- data/test/talia_core/data_types/xml_data_test.rb +3 -2
- data/test/talia_core/initializer_test.rb +1 -1
- data/test/talia_core/ordered_source_test.rb +1 -5
- data/test/talia_core/rdf_resource_test.rb +1 -5
- data/test/talia_core/semantic_collection_item_test.rb +3 -7
- data/test/talia_core/source_test.rb +7 -12
- data/test/talia_core/workflow/publication_workflow_test.rb +36 -23
- data/test/talia_util/import_job_helper_test.rb +1 -5
- data/test/test_helper.rb +18 -5
- metadata +11 -52
- data/generators/talia_admin/templates/test/fixtures/users.yml +0 -32
- data/generators/talia_admin/templates/test/unit/user_test.rb +0 -134
- data/generators/talia_admin/templates/views/admin/sources/_data.html.erb +0 -6
- data/generators/talia_admin/templates/views/admin/sources/_data_form.html.erb +0 -15
- data/generators/talia_admin/templates/views/admin/sources/_form.html.erb +0 -7
- data/generators/talia_admin/templates/views/admin/sources/_list.html.erb +0 -3
- data/generators/talia_admin/templates/views/admin/sources/_notice.html.erb +0 -1
- data/generators/talia_admin/templates/views/admin/sources/_predicate.html.erb +0 -22
- data/generators/talia_admin/templates/views/admin/sources/_predicates.html.erb +0 -15
- data/generators/talia_admin/templates/views/admin/sources/_sources.html.erb +0 -17
- data/generators/talia_admin/templates/views/admin/sources/_upload.html.erb +0 -6
- data/generators/talia_admin/templates/views/admin/sources/edit.html.erb +0 -6
- data/generators/talia_admin/templates/views/admin/sources/index.html.erb +0 -5
- data/generators/talia_admin/templates/views/admin/users/_form.html.erb +0 -10
- data/generators/talia_admin/templates/views/admin/users/_form_roles.html.erb +0 -8
- data/generators/talia_admin/templates/views/admin/users/edit.html.erb +0 -12
- data/generators/talia_admin/templates/views/admin/users/index.html.erb +0 -22
- data/generators/talia_admin/templates/views/admin/users/new.html.erb +0 -5
- data/generators/talia_admin/templates/views/admin/users/show.html.erb +0 -6
- data/generators/talia_base/templates/app/controllers/sessions_controller.rb +0 -90
- data/generators/talia_base/templates/app/controllers/source_data/show.html.erb +0 -2
- data/generators/talia_base/templates/app/helpers/source_data/show.html.erb +0 -2
- data/generators/talia_base/templates/app/views/sessions/new.html.erb +0 -33
- data/generators/talia_base/templates/migrations/create_open_id.rb +0 -26
- data/generators/talia_base/templates/migrations/create_roles.rb +0 -20
- data/generators/talia_base/templates/migrations/create_sessions.rb +0 -16
- data/generators/talia_base/templates/migrations/create_users.rb +0 -20
- data/lib/role.rb +0 -12
- data/lib/talia_cl/command_line.rb +0 -39
- data/lib/talia_cl/commands/standalone/cl_options.rb +0 -9
- data/lib/talia_cl/commands/standalone/standalone_generate.rb +0 -75
- data/lib/talia_cl/commands/standalone.rb +0 -25
- data/lib/talia_cl/commands/talia_console/cl_options.rb +0 -55
- data/lib/talia_cl/commands/talia_console/console_commands.rb +0 -37
- data/lib/talia_cl/commands/talia_console/talia_commands.rb +0 -131
- data/lib/talia_cl/commands/talia_console.rb +0 -47
- data/lib/talia_cl/core_commands.rb +0 -11
- data/lib/talia_cl.rb +0 -47
- data/lib/user.rb +0 -116
@@ -6,14 +6,15 @@ require File.join(File.dirname(__FILE__), '..', '..', 'test_helper')
|
|
6
6
|
module TaliaCore
|
7
7
|
|
8
8
|
# Test the DataRecord storage class
|
9
|
-
class XmlDataTest <
|
9
|
+
class XmlDataTest < ActiveSupport::TestCase
|
10
10
|
|
11
11
|
fixtures :active_sources, :data_records
|
12
12
|
|
13
13
|
def setup
|
14
|
+
Fixtures.reset_cache
|
14
15
|
# Sets the file that is used by one test
|
15
16
|
setup_once(:tmp_file) { File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'data_for_test', 'XmlData', 'temp0.xhtml')) }
|
16
|
-
setup_once(:
|
17
|
+
setup_once(:erase) do
|
17
18
|
# If the temp file already exists, it must be deleted
|
18
19
|
File.delete(@tmp_file) if(File.exist?(@tmp_file))
|
19
20
|
true
|
@@ -7,7 +7,7 @@ module TaliaCore
|
|
7
7
|
|
8
8
|
# Just test if the initializer has works correctly. These tests will fail if you
|
9
9
|
# don't use the configuration file supplied with Talia
|
10
|
-
class InitializerTest <
|
10
|
+
class InitializerTest < ActiveSupport::TestCase
|
11
11
|
|
12
12
|
fixtures :active_sources
|
13
13
|
|
@@ -9,11 +9,7 @@ module TaliaCore
|
|
9
9
|
# fixtures :active_sources, :semantic_properties, :semantic_relations
|
10
10
|
|
11
11
|
def setup
|
12
|
-
setup_once(:flush)
|
13
|
-
TaliaUtil::Util.flush_db
|
14
|
-
TaliaUtil::Util.flush_rdf
|
15
|
-
true
|
16
|
-
end
|
12
|
+
setup_once(:flush) { TestHelper::flush_store }
|
17
13
|
end
|
18
14
|
|
19
15
|
def test_resource_type
|
@@ -9,11 +9,7 @@ module TaliaCore
|
|
9
9
|
class RdfResourceTest < Test::Unit::TestCase
|
10
10
|
|
11
11
|
def setup
|
12
|
-
setup_once(:flush)
|
13
|
-
TaliaUtil::Util.flush_rdf
|
14
|
-
TaliaUtil::Util.flush_db
|
15
|
-
true
|
16
|
-
end
|
12
|
+
setup_once(:flush) { TestHelper::flush_store }
|
17
13
|
end
|
18
14
|
|
19
15
|
def test_create
|
@@ -4,16 +4,12 @@ require File.join(File.dirname(__FILE__), '..', 'test_helper')
|
|
4
4
|
module TaliaCore
|
5
5
|
|
6
6
|
# Test the ActiveSource
|
7
|
-
class
|
7
|
+
class SemanticCollectionItemTest < Test::Unit::TestCase
|
8
8
|
|
9
9
|
# fixtures :active_sources, :semantic_properties, :semantic_relations
|
10
10
|
|
11
11
|
def setup
|
12
|
-
setup_once(:flush)
|
13
|
-
TaliaUtil::Util.flush_db
|
14
|
-
TaliaUtil::Util.flush_rdf
|
15
|
-
true
|
16
|
-
end
|
12
|
+
setup_once(:flush) { TestHelper::flush_store }
|
17
13
|
|
18
14
|
setup_once(:fat_object_item) do
|
19
15
|
attributes = {
|
@@ -29,7 +25,7 @@ module TaliaCore
|
|
29
25
|
'property_value' => nil,
|
30
26
|
'object_created_at' => '2009-02-27 00:00:03',
|
31
27
|
'object_updated_at' => '2009-02-27 00:00:04',
|
32
|
-
'object_realtype' => 'Source',
|
28
|
+
'object_realtype' => 'TaliaCore::Source',
|
33
29
|
'object_uri' => 'http://myobject/uri',
|
34
30
|
}
|
35
31
|
fat_rel = SemanticRelation.send(:instantiate, attributes)
|
@@ -28,11 +28,7 @@ module TaliaCore
|
|
28
28
|
|
29
29
|
@params = {"uri"=>"#{N::LOCAL}Guinigi_family", "predicates_attributes"=>@predicates_attributes }
|
30
30
|
|
31
|
-
setup_once(:flush)
|
32
|
-
TaliaUtil::Util.flush_rdf
|
33
|
-
TaliaUtil::Util.flush_db
|
34
|
-
true
|
35
|
-
end
|
31
|
+
setup_once(:flush) { TestHelper::flush_store }
|
36
32
|
|
37
33
|
setup_once(:test_source) do
|
38
34
|
Source.new("http://www.test.org/test/")
|
@@ -86,7 +82,7 @@ module TaliaCore
|
|
86
82
|
# rec = SourceRecord.new
|
87
83
|
source = Source.new("http://www.newstuff.org/my_nuff")
|
88
84
|
assert_not_nil(source)
|
89
|
-
|
85
|
+
assert_property(source.types, N::TALIA.Source)
|
90
86
|
end
|
91
87
|
|
92
88
|
# Test if a source object can be created correctly
|
@@ -94,8 +90,7 @@ module TaliaCore
|
|
94
90
|
# rec = SourceRecord.new
|
95
91
|
source = make_dummy_source("http://www.newstuff.org/createtypes", N::FOAFX.Person, N::FOAFX.Foe)
|
96
92
|
assert_not_nil(source)
|
97
|
-
|
98
|
-
assert_not_nil(source.types.each { |type| type.to_s == N::FOAFX.Person.to_s} )
|
93
|
+
assert_property(source.types, N::FOAFX.Person, N::FOAFX.Foe, source.rdf_selftype)
|
99
94
|
end
|
100
95
|
|
101
96
|
# test grouping by types
|
@@ -240,9 +235,9 @@ module TaliaCore
|
|
240
235
|
my_source.default::author << "napoleon"
|
241
236
|
my_source.save!
|
242
237
|
|
243
|
-
# Expected size of direct predicates: One for the predicate set above
|
244
|
-
# and one for the default type
|
245
|
-
assert_equal(
|
238
|
+
# Expected size of direct predicates: One for the predicate set above,
|
239
|
+
# one for the default type and one for the default type
|
240
|
+
assert_equal(3, my_source.direct_predicates.size, "Direct predicates expected to have 3 elements. Real value: #{my_source.direct_predicates.inspect}")
|
246
241
|
assert(my_source.direct_predicates.include?(N::DEFAULT::author))
|
247
242
|
end
|
248
243
|
|
@@ -271,7 +266,7 @@ module TaliaCore
|
|
271
266
|
|
272
267
|
source.save!
|
273
268
|
|
274
|
-
assert_equal(
|
269
|
+
assert_equal(3, source.grouped_direct_predicates.size)
|
275
270
|
predicates = source.grouped_direct_predicates['default']
|
276
271
|
predicates.each do |group, source_list|
|
277
272
|
source_list.flatten.each do |source|
|
@@ -13,6 +13,20 @@ module TaliaCore
|
|
13
13
|
def setup
|
14
14
|
@user = User.new
|
15
15
|
@user_without_autorization = UserWithoutAuthorization.new
|
16
|
+
|
17
|
+
setup_once(:flush) { TestHelper::flush_store }
|
18
|
+
|
19
|
+
setup_once(:src) do
|
20
|
+
src = TaliaCore::ActiveSource.new(:uri => 'http://publicationworkflowtest')
|
21
|
+
src.save!
|
22
|
+
src
|
23
|
+
end
|
24
|
+
|
25
|
+
setup_once(:src2) do
|
26
|
+
src = TaliaCore::ActiveSource.new(:uri => 'http://publicationworkflowtest2')
|
27
|
+
src.save!
|
28
|
+
src
|
29
|
+
end
|
16
30
|
end
|
17
31
|
|
18
32
|
def test_initial_state_value
|
@@ -25,7 +39,7 @@ module TaliaCore
|
|
25
39
|
|
26
40
|
def test_initial_state
|
27
41
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
28
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
42
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
29
43
|
assert_equal :submitted, record.current_state
|
30
44
|
assert record.submitted?
|
31
45
|
end
|
@@ -38,7 +52,7 @@ module TaliaCore
|
|
38
52
|
|
39
53
|
def test_event_methods_created
|
40
54
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
41
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
55
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
42
56
|
%w(vote! direct_publish! publish!).each do |event|
|
43
57
|
assert record.respond_to?(event)
|
44
58
|
end
|
@@ -46,7 +60,7 @@ module TaliaCore
|
|
46
60
|
|
47
61
|
def test_query_methods_created
|
48
62
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
49
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
63
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
50
64
|
%w(submitted? accepted? rejected? published?).each do |event|
|
51
65
|
assert record.respond_to?(event)
|
52
66
|
end
|
@@ -62,20 +76,20 @@ module TaliaCore
|
|
62
76
|
|
63
77
|
def test_next_state_for_event
|
64
78
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
65
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
79
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
66
80
|
assert_equal :submitted, record.next_state_for_event(:vote)
|
67
81
|
end
|
68
82
|
|
69
83
|
def test_loopback_event
|
70
84
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
71
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
85
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
72
86
|
record.vote! @user, 1
|
73
87
|
assert record.submitted?
|
74
88
|
end
|
75
89
|
|
76
90
|
def test_can_go_to_accepted
|
77
91
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
78
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
92
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
79
93
|
record.vote!(@user, 10)
|
80
94
|
assert_equal :accepted, record.current_state
|
81
95
|
assert_equal 10, record.state_properties[:vote]
|
@@ -83,7 +97,7 @@ module TaliaCore
|
|
83
97
|
|
84
98
|
def test_can_go_to_rejected
|
85
99
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
86
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
100
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
87
101
|
record.vote!(@user, -10)
|
88
102
|
assert_equal :rejected, record.current_state
|
89
103
|
assert_equal(-10, record.state_properties[:vote])
|
@@ -91,7 +105,7 @@ module TaliaCore
|
|
91
105
|
|
92
106
|
def test_ignore_invalid_events
|
93
107
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
94
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
108
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
95
109
|
# this is an invalid event for submitted state
|
96
110
|
record.publish!(@user)
|
97
111
|
assert_equal :submitted, record.current_state
|
@@ -99,7 +113,7 @@ module TaliaCore
|
|
99
113
|
|
100
114
|
def test_direct_publish_event
|
101
115
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
102
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
116
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
103
117
|
record.direct_publish!(@user)
|
104
118
|
assert_equal :published, record.current_state
|
105
119
|
assert_equal 0, record.state_properties[:vote]
|
@@ -107,7 +121,7 @@ module TaliaCore
|
|
107
121
|
|
108
122
|
def test_vote_and_publish_event
|
109
123
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
110
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
124
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
111
125
|
# go to accepted state
|
112
126
|
record.vote! @user, 10
|
113
127
|
assert_equal :accepted, record.current_state
|
@@ -131,7 +145,7 @@ module TaliaCore
|
|
131
145
|
def test_find_first_in_state
|
132
146
|
# clear all records and create a new record
|
133
147
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
134
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
148
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
135
149
|
|
136
150
|
# move current record to publish
|
137
151
|
record.vote! @user, 10
|
@@ -146,7 +160,7 @@ module TaliaCore
|
|
146
160
|
def test_find_all_in_state
|
147
161
|
# clear all records and create a new record
|
148
162
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
149
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
163
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
150
164
|
|
151
165
|
# move current record to publish
|
152
166
|
record.vote! @user, 10
|
@@ -161,34 +175,33 @@ module TaliaCore
|
|
161
175
|
def test_find_all_in_state_with_conditions
|
162
176
|
# clear all records and create a new record
|
163
177
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
164
|
-
TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
165
|
-
TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
178
|
+
TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
179
|
+
TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src2.id)
|
166
180
|
|
167
181
|
# find all with conditions
|
168
182
|
records = TaliaCore::Workflow::PublicationWorkflow.find_in_state(:all, :submitted, :conditions => ['source_id > ?', '0'])
|
169
183
|
|
170
184
|
assert_equal 2, records.size
|
171
|
-
assert_equal
|
185
|
+
assert_equal @src.id, records.first.source_id
|
172
186
|
end
|
173
187
|
|
174
188
|
def test_find_first_in_state_with_conditions
|
175
189
|
# clear all records and create a new record
|
176
190
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
177
|
-
TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
178
|
-
TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
191
|
+
TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
192
|
+
TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src2.id)
|
179
193
|
|
180
194
|
# find all with conditions
|
181
|
-
records = TaliaCore::Workflow::PublicationWorkflow.find_in_state(:first, :submitted, :conditions => ['source_id = ?',
|
195
|
+
records = TaliaCore::Workflow::PublicationWorkflow.find_in_state(:first, :submitted, :conditions => ['source_id = ?', @src.id.to_s])
|
182
196
|
|
183
|
-
|
184
|
-
assert_equal 1, records.source_id
|
197
|
+
assert_equal @src.id, records.source_id
|
185
198
|
end
|
186
199
|
|
187
200
|
def test_count_in_state_with_conditions
|
188
201
|
# clear all records and create a new record
|
189
202
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
190
|
-
TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
191
|
-
TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
203
|
+
TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
204
|
+
TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src2.id)
|
192
205
|
|
193
206
|
cnt0 = TaliaCore::Workflow::PublicationWorkflow.count(:conditions => ['state = ?', 'submitted'])
|
194
207
|
cnt = TaliaCore::Workflow::PublicationWorkflow.count_in_state(:submitted)
|
@@ -212,7 +225,7 @@ module TaliaCore
|
|
212
225
|
def test_not_authorized_user_raises_exception
|
213
226
|
# clear all records and create a new record
|
214
227
|
TaliaCore::Workflow::PublicationWorkflow.delete_all
|
215
|
-
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id =>
|
228
|
+
record = TaliaCore::Workflow::PublicationWorkflow.create(:source_id => @src.id)
|
216
229
|
|
217
230
|
# call vote without user parameter
|
218
231
|
assert_raise(ArgumentError) {
|
@@ -7,11 +7,7 @@ module TaliaCore
|
|
7
7
|
class ImportJobHelperTest < Test::Unit::TestCase
|
8
8
|
|
9
9
|
def setup
|
10
|
-
setup_once(:flush)
|
11
|
-
TaliaUtil::Util.flush_db
|
12
|
-
TaliaUtil::Util.flush_rdf
|
13
|
-
true
|
14
|
-
end
|
10
|
+
setup_once(:flush) { TestHelper::flush_store }
|
15
11
|
|
16
12
|
setup_once(:job) do
|
17
13
|
Bj::Table::Job.delete_all
|
data/test/test_helper.rb
CHANGED
@@ -4,10 +4,17 @@ require 'test/unit'
|
|
4
4
|
require 'core_ext'
|
5
5
|
require "talia_core"
|
6
6
|
require "talia_util/test_helpers"
|
7
|
-
require 'active_support/testing'
|
8
7
|
require 'active_support/test_case'
|
9
8
|
require 'active_record/fixtures'
|
10
9
|
|
10
|
+
class ActiveSupport::TestCase
|
11
|
+
include ActiveRecord::TestFixtures
|
12
|
+
self.fixture_path=File.join(File.dirname(__FILE__), 'fixtures')
|
13
|
+
self.use_instantiated_fixtures = false
|
14
|
+
self.use_transactional_fixtures = true
|
15
|
+
end
|
16
|
+
|
17
|
+
|
11
18
|
module TaliaCore
|
12
19
|
# class Source
|
13
20
|
# public :instantiate_source_or_rdf_object
|
@@ -45,20 +52,26 @@ module TaliaCore
|
|
45
52
|
end
|
46
53
|
end
|
47
54
|
unless(File.exist?(ddir))
|
48
|
-
fixture_dir = File.join(
|
55
|
+
fixture_dir = File.join(ActiveSupport::TestCase.fixture_path, 'data_for_test')
|
49
56
|
puts "Copying fixture data to data directory #{ddir} -> #{fixture_dir}"
|
50
57
|
FileUtils.cp_r(fixture_dir, ddir)
|
51
58
|
end
|
52
59
|
end
|
53
60
|
|
54
61
|
def self.fixture_file(filename)
|
55
|
-
File.join(
|
62
|
+
File.join(ActiveSupport::TestCase.fixture_path, filename)
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.flush_store
|
66
|
+
TaliaUtil::Util.flush_rdf
|
67
|
+
TaliaUtil::Util.flush_db
|
68
|
+
Fixtures.reset_cache if(@@new_ar)
|
69
|
+
true
|
56
70
|
end
|
57
71
|
end
|
58
72
|
|
59
73
|
started = TestHelper.startup
|
60
|
-
|
61
|
-
Test::Unit::TestCase.set_fixture_class :active_sources => TaliaCore::ActiveSource,
|
74
|
+
ActiveSupport::TestCase.set_fixture_class :active_sources => TaliaCore::ActiveSource,
|
62
75
|
:semantic_properties => TaliaCore::SemanticProperty,
|
63
76
|
:semantic_relations => TaliaCore::SemanticRelation,
|
64
77
|
:sources => TaliaCore::Source,
|
metadata
CHANGED
@@ -5,9 +5,9 @@ homepage: http://trac.talia.discovery-project.eu/
|
|
5
5
|
executables:
|
6
6
|
- talia
|
7
7
|
version: !ruby/object:Gem::Version
|
8
|
-
version: 0.4.
|
8
|
+
version: 0.4.3
|
9
9
|
post_install_message:
|
10
|
-
date: 2009-10-
|
10
|
+
date: 2009-10-27 23:00:00 +00:00
|
11
11
|
files:
|
12
12
|
- VERSION.yml
|
13
13
|
- config/database.yml
|
@@ -24,6 +24,7 @@ files:
|
|
24
24
|
- generators/talia_admin/templates/controllers/admin/background_controller.rb
|
25
25
|
- generators/talia_admin/templates/controllers/admin/custom_templates_controller.rb
|
26
26
|
- generators/talia_admin/templates/controllers/admin/locales_controller.rb
|
27
|
+
- generators/talia_admin/templates/controllers/admin/roles_controller.rb
|
27
28
|
- generators/talia_admin/templates/controllers/admin/sources_controller.rb
|
28
29
|
- generators/talia_admin/templates/controllers/admin/translations_controller.rb
|
29
30
|
- generators/talia_admin/templates/controllers/admin/users_controller.rb
|
@@ -31,10 +32,13 @@ files:
|
|
31
32
|
- generators/talia_admin/templates/helpers/admin/background_helper.rb
|
32
33
|
- generators/talia_admin/templates/helpers/admin/custom_templates_helper.rb
|
33
34
|
- generators/talia_admin/templates/helpers/admin/locales_helper.rb
|
35
|
+
- generators/talia_admin/templates/helpers/admin/roles_helper.rb
|
34
36
|
- generators/talia_admin/templates/helpers/admin/sources_helper.rb
|
35
37
|
- generators/talia_admin/templates/helpers/admin/translations_helper.rb
|
36
38
|
- generators/talia_admin/templates/helpers/admin/users_helper.rb
|
37
39
|
- generators/talia_admin/templates/helpers/admin_helper.rb
|
40
|
+
- generators/talia_admin/templates/migrations/populate_users.rb
|
41
|
+
- generators/talia_admin/templates/models/role.rb
|
38
42
|
- generators/talia_admin/templates/public/images/backend/body_bg.gif
|
39
43
|
- generators/talia_admin/templates/public/images/backend/footer_bg.gif
|
40
44
|
- generators/talia_admin/templates/public/images/backend/header.jpg
|
@@ -48,14 +52,12 @@ files:
|
|
48
52
|
- generators/talia_admin/templates/public/javascripts/backend.js
|
49
53
|
- generators/talia_admin/templates/public/javascripts/lowpro.js
|
50
54
|
- generators/talia_admin/templates/public/stylesheets/backend.css
|
51
|
-
- generators/talia_admin/templates/test/fixtures/users.yml
|
52
55
|
- generators/talia_admin/templates/test/functional/admin/custom_templates_controller_test.rb
|
53
56
|
- generators/talia_admin/templates/test/functional/admin/locales_controller_test.rb
|
54
57
|
- generators/talia_admin/templates/test/functional/admin/sources_controller_test.rb
|
55
58
|
- generators/talia_admin/templates/test/functional/admin/translations_controller_test.rb
|
56
59
|
- generators/talia_admin/templates/test/functional/admin/users_controller_test.rb
|
57
60
|
- generators/talia_admin/templates/test/functional/admin_controller_test.rb
|
58
|
-
- generators/talia_admin/templates/test/unit/user_test.rb
|
59
61
|
- generators/talia_admin/templates/views/admin/background/_finished.html.erb
|
60
62
|
- generators/talia_admin/templates/views/admin/background/_pending.html.erb
|
61
63
|
- generators/talia_admin/templates/views/admin/background/_progress.html.erb
|
@@ -69,51 +71,34 @@ files:
|
|
69
71
|
- generators/talia_admin/templates/views/admin/custom_templates/_template_type_form_column.rhtml
|
70
72
|
- generators/talia_admin/templates/views/admin/index.html.erb
|
71
73
|
- generators/talia_admin/templates/views/admin/locales/new.html.erb
|
72
|
-
- generators/talia_admin/templates/views/admin/sources/
|
73
|
-
- generators/talia_admin/templates/views/admin/sources/_data_form.html.erb
|
74
|
-
- generators/talia_admin/templates/views/admin/sources/_form.html.erb
|
75
|
-
- generators/talia_admin/templates/views/admin/sources/_list.html.erb
|
76
|
-
- generators/talia_admin/templates/views/admin/sources/_notice.html.erb
|
77
|
-
- generators/talia_admin/templates/views/admin/sources/_predicate.html.erb
|
78
|
-
- generators/talia_admin/templates/views/admin/sources/_predicates.html.erb
|
79
|
-
- generators/talia_admin/templates/views/admin/sources/_sources.html.erb
|
80
|
-
- generators/talia_admin/templates/views/admin/sources/_upload.html.erb
|
81
|
-
- generators/talia_admin/templates/views/admin/sources/edit.html.erb
|
82
|
-
- generators/talia_admin/templates/views/admin/sources/index.html.erb
|
74
|
+
- generators/talia_admin/templates/views/admin/sources/_show.html.erb
|
83
75
|
- generators/talia_admin/templates/views/admin/translations/_new_translation.html.erb
|
84
76
|
- generators/talia_admin/templates/views/admin/translations/_translation.html.erb
|
85
77
|
- generators/talia_admin/templates/views/admin/translations/edit.html.erb
|
86
|
-
- generators/talia_admin/templates/views/admin/users/_form.html.erb
|
87
|
-
- generators/talia_admin/templates/views/admin/users/_form_roles.html.erb
|
88
|
-
- generators/talia_admin/templates/views/admin/users/edit.html.erb
|
89
|
-
- generators/talia_admin/templates/views/admin/users/index.html.erb
|
90
|
-
- generators/talia_admin/templates/views/admin/users/new.html.erb
|
91
|
-
- generators/talia_admin/templates/views/admin/users/show.html.erb
|
92
78
|
- generators/talia_admin/templates/views/layouts/admin.html.erb
|
93
79
|
- generators/talia_base/USAGE
|
94
80
|
- generators/talia_base/talia_base_generator.rb
|
81
|
+
- generators/talia_base/templates/README
|
95
82
|
- generators/talia_base/templates/app/controllers/custom_templates_controller.rb
|
96
83
|
- generators/talia_base/templates/app/controllers/ontologies_controller.rb
|
97
|
-
- generators/talia_base/templates/app/controllers/sessions_controller.rb
|
98
|
-
- generators/talia_base/templates/app/controllers/source_data/show.html.erb
|
99
84
|
- generators/talia_base/templates/app/controllers/source_data_controller.rb
|
100
85
|
- generators/talia_base/templates/app/controllers/sources_controller.rb
|
101
86
|
- generators/talia_base/templates/app/controllers/types_controller.rb
|
102
87
|
- generators/talia_base/templates/app/helpers/custom_templates_helper.rb
|
103
88
|
- generators/talia_base/templates/app/helpers/ontologies_helper.rb
|
104
89
|
- generators/talia_base/templates/app/helpers/sessions_helper.rb
|
105
|
-
- generators/talia_base/templates/app/helpers/source_data/show.html.erb
|
106
90
|
- generators/talia_base/templates/app/helpers/source_data_helper.rb
|
107
91
|
- generators/talia_base/templates/app/helpers/sources_helper.rb
|
108
92
|
- generators/talia_base/templates/app/helpers/types_helper.rb
|
109
93
|
- generators/talia_base/templates/app/views/ontologies/index.builder
|
110
94
|
- generators/talia_base/templates/app/views/ontologies/show.builder
|
111
|
-
- generators/talia_base/templates/app/views/sessions/new.html.erb
|
112
95
|
- generators/talia_base/templates/app/views/source_data/show.html.erb
|
113
96
|
- generators/talia_base/templates/app/views/sources/_form.html.erb
|
114
97
|
- generators/talia_base/templates/app/views/sources/edit.html.erb
|
115
98
|
- generators/talia_base/templates/app/views/sources/index.html.erb
|
116
99
|
- generators/talia_base/templates/app/views/sources/new.html.erb
|
100
|
+
- generators/talia_base/templates/app/views/sources/semantic_templates/default/default.html.erb
|
101
|
+
- generators/talia_base/templates/app/views/sources/semantic_templates/default/province.html.erb
|
117
102
|
- generators/talia_base/templates/app/views/sources/show.html.erb
|
118
103
|
- generators/talia_base/templates/app/views/types/index.html.erb
|
119
104
|
- generators/talia_base/templates/app/views/types/show.html.erb
|
@@ -124,15 +109,10 @@ files:
|
|
124
109
|
- generators/talia_base/templates/migrations/create_active_sources.rb
|
125
110
|
- generators/talia_base/templates/migrations/create_custom_templates.rb
|
126
111
|
- generators/talia_base/templates/migrations/create_data_records.rb
|
127
|
-
- generators/talia_base/templates/migrations/create_open_id.rb
|
128
112
|
- generators/talia_base/templates/migrations/create_progress_jobs.rb
|
129
|
-
- generators/talia_base/templates/migrations/create_roles.rb
|
130
113
|
- generators/talia_base/templates/migrations/create_semantic_properties.rb
|
131
114
|
- generators/talia_base/templates/migrations/create_semantic_relations.rb
|
132
|
-
- generators/talia_base/templates/migrations/create_sessions.rb
|
133
|
-
- generators/talia_base/templates/migrations/create_users.rb
|
134
115
|
- generators/talia_base/templates/migrations/create_workflows.rb
|
135
|
-
- generators/talia_base/templates/migrations/populate_users.rb
|
136
116
|
- generators/talia_base/templates/migrations/upgrade_relations.rb
|
137
117
|
- generators/talia_base/templates/ontologies/hyper_ontology.owl
|
138
118
|
- generators/talia_base/templates/ontologies/hyper_ontology.pprj
|
@@ -140,6 +120,7 @@ files:
|
|
140
120
|
- generators/talia_base/templates/ontologies/scholar_0.1.owl
|
141
121
|
- generators/talia_base/templates/script/configure_talia
|
142
122
|
- generators/talia_base/templates/script/prepare_images
|
123
|
+
- generators/talia_base/templates/script/setup_talia_backend
|
143
124
|
- generators/talia_base/templates/talia.sh
|
144
125
|
- generators/talia_base/templates/tasks/talia_core.rk
|
145
126
|
- lib/JXslt/jxslt.rb
|
@@ -151,17 +132,6 @@ files:
|
|
151
132
|
- lib/loader_helper.rb
|
152
133
|
- lib/mysql.rb
|
153
134
|
- lib/progressbar.rb
|
154
|
-
- lib/role.rb
|
155
|
-
- lib/talia_cl.rb
|
156
|
-
- lib/talia_cl/command_line.rb
|
157
|
-
- lib/talia_cl/commands/standalone.rb
|
158
|
-
- lib/talia_cl/commands/standalone/cl_options.rb
|
159
|
-
- lib/talia_cl/commands/standalone/standalone_generate.rb
|
160
|
-
- lib/talia_cl/commands/talia_console.rb
|
161
|
-
- lib/talia_cl/commands/talia_console/cl_options.rb
|
162
|
-
- lib/talia_cl/commands/talia_console/console_commands.rb
|
163
|
-
- lib/talia_cl/commands/talia_console/talia_commands.rb
|
164
|
-
- lib/talia_cl/core_commands.rb
|
165
135
|
- lib/talia_core.rb
|
166
136
|
- lib/talia_core/active_source.rb
|
167
137
|
- lib/talia_core/active_source_parts/class_methods.rb
|
@@ -231,7 +201,6 @@ files:
|
|
231
201
|
- lib/talia_util/test_helpers.rb
|
232
202
|
- lib/talia_util/util.rb
|
233
203
|
- lib/talia_util/yaml_import.rb
|
234
|
-
- lib/user.rb
|
235
204
|
- lib/version.rb
|
236
205
|
- tasks/talia_core_tasks.rake
|
237
206
|
- README.rdoc
|
@@ -372,16 +341,6 @@ dependencies:
|
|
372
341
|
- - '>='
|
373
342
|
- !ruby/object:Gem::Version
|
374
343
|
version: 0.0.12
|
375
|
-
- !ruby/object:Gem::Dependency
|
376
|
-
type: :runtime
|
377
|
-
name: ruby-openid
|
378
|
-
version_requirement:
|
379
|
-
version_requirements: !ruby/object:Gem::Requirement
|
380
|
-
version:
|
381
|
-
requirements:
|
382
|
-
- - '>='
|
383
|
-
- !ruby/object:Gem::Version
|
384
|
-
version: 2.1.7
|
385
344
|
- !ruby/object:Gem::Dependency
|
386
345
|
type: :runtime
|
387
346
|
name: builder
|
@@ -1,32 +0,0 @@
|
|
1
|
-
quentin:
|
2
|
-
login: quentin
|
3
|
-
email: quentin@example.com
|
4
|
-
salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
|
5
|
-
crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
|
6
|
-
created_at: <%= 5.days.ago.to_s :db %>
|
7
|
-
open_id: http://quentin.myopenid.com/
|
8
|
-
roles: user_role
|
9
|
-
|
10
|
-
aaron:
|
11
|
-
login: aaron
|
12
|
-
email: aaron@example.com
|
13
|
-
salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
|
14
|
-
crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
|
15
|
-
created_at: <%= 1.days.ago.to_s :db %>
|
16
|
-
|
17
|
-
admin:
|
18
|
-
login: admin
|
19
|
-
email: admin@talia.org
|
20
|
-
salt: c8d13be260ba82f798b06f100152d347cc4840ba
|
21
|
-
crypted_password: ccc2e10b38106d5833fb817407973a996d392310
|
22
|
-
roles: admin_role
|
23
|
-
|
24
|
-
hyper:
|
25
|
-
login: hyper
|
26
|
-
email: system@hyper.org
|
27
|
-
salt: c8d13be260ba82f798b06f100152d347cc4840ba
|
28
|
-
crypted_password: 981668d16c4646a510ed3ffaf28d05fe68035666
|
29
|
-
|
30
|
-
someone:
|
31
|
-
login: someone
|
32
|
-
email: someone@hyper.org
|