Ignore:
Timestamp:
Oct 14, 2009, 5:29:38 PM (15 years ago)
Author:
Tatsukawa, Akimichi
Message:

polishing ADL parser to handle http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/adl_parser/test/remote_adl_test.rb

    r318 r319  
    33class RemoteADLTest < Test::Unit::TestCase
    44  def setup
    5     @adls = []
    6     dirs = ["cluster/", "composition/", "element/", "entry/", "section/", "structure/"]
    7     dirs.each do |dir|
     5    @ehr_adls = []
     6    ehr_dirs = ["cluster", "composition", "element", "entry", "section", "structure"]
     7    ehr_dirs.each do |dir|
    88      doc = Hpricot( open("http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}").read )
    99      (doc/:a).each do |link|
    1010        if link[:href] =~ /.*\.adl\Z/
    11           @adls << "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}#{$~}"
     11          @ehr_adls << "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/openehr/ehr/#{dir}/#{$~}"
     12        end
     13      end
     14    end
     15
     16    @test_adls = []
     17    test_dirs = ["basics","clinical_types","dadl","description","generic_types","language","non-conforming","paths","rm_checking","slots","specialisation","structure","terminology","unicode","validation"]
     18    test_dirs.each do |dir|
     19      doc = Hpricot( open("http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/#{dir}").read )
     20      (doc/:a).each do |link|
     21        if link[:href] =~ /.*\.adl\Z/
     22          @test_adls << "http://www.openehr.org/svn/knowledge/archetypes/dev/adl/test/#{dir}/#{$~}"
    1223        end
    1324      end
     
    1627  end
    1728
    18   must "adls should properly parsed" do
     29
     30  must "test_adls should properly parsed" do
    1931    assert_nothing_raised do
    20       @adls.each do |adl|
     32      @test_adls.each do |adl|
    2133        puts "Processing #{adl}"
    2234        open(adl) do |file|
     
    2739  end
    2840
     41#   must "ehr_adls should properly parsed" do
     42#     assert_nothing_raised do
     43#       @ehr_adls.each do |adl|
     44#         puts "Processing #{adl}"
     45#         open(adl) do |file|
     46#           @parser.parse(file.read, adl)
     47#         end
     48#       end
     49#     end
     50#   end
     51
     52
    2953end
Note: See TracChangeset for help on using the changeset viewer.