Sha256: bc0d61506f468b9d1ee90494e4efb2f061d7506271b0c4e8d3b25a4102db42cf

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

require File.join(File.dirname(__FILE__), '..', 'test_helper')
require 'bj'

module TaliaCore

  # Test the Generic Xml Import
  class ImportJobHelperTest < Test::Unit::TestCase
    
    def setup
      setup_once(:flush) do
        TaliaUtil::Util.flush_db
        TaliaUtil::Util.flush_rdf
        true
      end
      
      setup_once(:job) do
        Bj::Table::Job.delete_all
        Bj::Table::Job.new.save
        job = Bj::Table::Job.find(:first)
        ENV['JOB_ID'] = job.id.to_s
        job
      end
      
      setup_once(:imported) do
        ENV['xml'] = TestHelper.fixture_file('xml_test.xml')
        importer = TaliaUtil::ImportJobHelper.new
        importer.do_import
        ActiveSource.find('http://xml_test/from_file')
      end
      
    end
    
    def test_import_success
      assert(@imported)
    end
    
    def test_property
      assert_property(@imported['http://localnode.org/localthi'], 'value')
    end
    
    def test_relation
      assert_property(@imported[N::RDF.relatit], DummySource.new('http://localnode.org/as_create_attr_dummy_2'), DummySource.new('http://localnode.org/as_create_attr_dummy_1'))
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
talia_core-0.4.2 test/talia_util/import_job_helper_test.rb
talia_core-0.4.1 test/talia_util/import_job_helper_test.rb
talia_core-0.4.0 test/talia_util/import_job_helper_test.rb