view · edit · sidebar · attach · print · history

20110926-update-sort-faster-migel

<< | Index | >>


  1. Testcases ebps
  2. Make migel sort faster
  3. Do not show inactive products or product without ean code
  4. Testcases migel

Goal/Estimate/Evaluation:

  • testcase ebps ebook / 100% / 100%
  • update migel sort faster / 100% / 100%
  • testcase migel / 100% / 80%
  • ebook
    1. update test-cases
    2. kindlegen version problem suspend
  • make migel sorting faster
  • testcases migel sort
Commit
ToDo Tomorrow
  1. Do not show Foto title if there is no monid in ebook
  2. Fix the latest kindlegen error

Testcases ebps

  • lib/ebps/conversion/oebps.rb

Rspec

  masa@masa ~/ywesee/ebps $ ruby1.9 /usr/bin/rspec -fs -c spec/conversion/oebps_spec.rb

  EBPS::Conversion::Oebps.export
    creates all necessary files and compiles the book to a temporary ouput file

  EBPS::Conversion::Oebps.document_to_html
    returns valid xhtml for formatted text and creates appropriate ids
    returns valid xhtml for images
    returns valid xhtml for tables

  EBPS::Conversion::Oebps.with_tmpdir
    creates a new temporary directory

  EBPS::Conversion::Oebps.to_opf
    returns valid xml
    uses config.title if set
    creates the manifest directly from the contents of the tmpdir
    raises a RuntimeError if there's a Html-File without generated ID
    supplied ids for html-files are present in spine

  EBPS::Conversion::Oebps.filename
    replaces empty document titles with 'part'
    replaces whitespace with '_'
    removes non-ascii-chars

  EBPS::Conversion::Oebps.to_ncx
    returns valid xml

  EBPS::Conversion::Oebps.to_index
    returns valid xhtml for the main index
    returns valid xhtml for alphabetical indices

  EBPS::Conversion::Oebps::HtmlFactory class
    format_linked_paragraph should return xhtml for a table celll with a link
    format_picture should return xhtml for a picutre
    format_table should return xhtml for a table

  Finished in 0.59561 seconds
  19 examples, 0 failures

Note

  • Rcov works but it does not calculate the coverage correctly.

Commit

Make migel sort faster

Problem

Ideas

  • Make a method to sort a search result in migel server
  • The sort method of oddb.org calls (a part of) the sorted result in migel server

Two process to show products

  1. migel code: event: migel_search: ex. http://oddb.masa.org/de/gcc/migel_search/migel_code/17.01.02.00.1
    • OddbApp#search_migel_products -> Migelid#search_by_migel_code
  2. search box: event: search: ex. http://oddb.masa.org/de/gcc/search/zone/migel/search_query/SIGVARIS#best_result
    • 1. OddbApp#search_migel_product, 2. OddbApp#search_migel_items -> Migel::Server#search_migel_product

migel_search event

Experiment

  • lib/migel/util/server.rb
      def search_products_by_migel_code(migel_code, sortvalue = nil, reverse = nil)
        if migelid = Migel::Model::Migelid.search_by_migel_code(migel_code).first and products = migelid.products
          if sortvalue
            products = products.sort_by do |item|
              if sortvalue == :ppub
                item.ppub.to_f
              else
                item.send(sortvalue).to_s
              end
            end
          end
          if reverse
            products.reverse!
          end
          products
        end
      end

Run

  • bin/migelid
  • bin/admin
migel> search_products_by_migel_code('34.05.01.07.1').map{|pro| pro.article_name}.join(", ")
-> TENDERWET ACTIVE Cavity Wundkiss 10x10cm, TENDERWET ACTIVE Wundkissen 10x10cm, TENDERWET Wundkissen 10x10cm steril

migel> search_products_by_migel_code('34.05.01.07.1', :article_name).map{|pro| pro.article_name}.join(", ")
-> TENDERWET ACTIVE Cavity Wundkiss 10x10cm, TENDERWET ACTIVE Wundkissen 10x10cm, TENDERWET Wundkissen 10x10cm steril

migel> search_products_by_migel_code('34.05.01.07.1', :article_name, :reverse).map{|pro| pro.article_name}.join(", ")
-> TENDERWET Wundkissen 10x10cm steril, TENDERWET ACTIVE Wundkissen 10x10cm, TENDERWET ACTIVE Cavity Wundkiss 10x10cm

migel> search_products_by_migel_code('34.05.01.07.1', :ppub).map{|pro| pro.ppub}.join(", ")
-> 43.10, 54.00, 355.00

migel> search_products_by_migel_code('34.05.01.07.1', :ppub, :reverse).map{|pro| pro.ppub}.join(", ")
-> 355.00, 54.00, 43.10

Result

  • good

Experiment (oddb.org)

  • src/util/oddbapp.rb
    def search_migel_items_by_migel_code(query)
      migel_code = if query =~ /(\d){9}/
                     query.split(/(\d\d)/).select{|x| !x.empty?}.join('.')
                   elsif query =~ /(\d\d\.){4}\d/
                     query
                   end
      if migel_code
        MIGEL_SERVER.search_migel_product_by_migel_code(migel_code)
      end
    end
  • src/state/global.rb
      def migel_search
        #if migel_code = @session.user_input(:migel_code) and product = @session.search_migel_products(migel_code).first
        if migel_code = @session.user_input(:migel_code) and result = @session.app.search_migel_items_by_migel_code(migel_code)
          product = StubProduct.new(result)
          sort_key = @session.user_input(:sortvalue) || @session.user_input(:reverse)
          reverse  = @session.user_input(:reverse)
          ODDB::State::Migel::Items.new(@session, ODDB::Migel::Items.new(product, sort_key, reverse))

Access

Result

  • Good

Next

  • sort
    1. kill the sort function State::Items class
    2. add an argument of sorting in the method
  • src/state/migel/items.rb
  def page
    @pages[@current_page]
  end
  • src/state/global.rb
      def migel_search
        sortvalue = @session.user_input(:sortvalue) || @session.user_input(:reverse)
        reverse  = @session.user_input(:reverse)
        #if migel_code = @session.user_input(:migel_code) and product = @session.search_migel_products(migel_code).first
        if migel_code = @session.user_input(:migel_code) and result = @session.app.search_migel_items_by_migel_code(migel_code, sortvalue, reverse)
          product = StubProduct.new(result)
          #ODDB::State::Migel::Items.new(@session, ODDB::Migel::Items.new(product, sort_key, reverse))
          ODDB::State::Migel::Items.new(@session, ODDB::Migel::Items.new(product))
  • src/util/oddbapp.rb
    def search_migel_items_by_migel_code(query, sortvalue = nil, reverse = nil)
      migel_code = if query =~ /(\d){9}/
                     query.split(/(\d\d)/).select{|x| !x.empty?}.join('.')
                   elsif query =~ /(\d\d\.){4}\d/
                     query
                   end
      if migel_code
        MIGEL_SERVER.search_migel_product_by_migel_code(migel_code, sortvalue, reverse)
      end
    end
  • src/view/migel/items.rb def pages(model, session=@session)
    pages = @session.state.pages
    event = ''
    args  = {}
    if migel_code = @session.user_input(:migel_code)
      event = :migel_search
      args.update({:migel_code => migel_code})
    else
      event = :search
      args.update({
        :search_query => @session.persistent_user_input(:search_query).gsub('/', '%2F'),
        :search_type => @session.persistent_user_input(:search_type),
      })
    end

    # sort
    sortvalue = @session.user_input(:sortvalue) || @session.user_input(:reverse)
    sort_way = @session.user_input(:sortvalue) ? :sortvalue : :reverse
    if sortvalue
      args.update({sort_way => sortvalue})
    end

    View::Pager.new(pages, @session, self, event, args)
end

Access

Result

  • Good

Next

  • move paging function from oddb.org to migel server

search event (searching products by using search box)

Experiment

  • lib/migel/util/server.b
      def search_migel_product(query, lang, sortvalue = nil, reverse = nil)
        # search product by fulltext search
        index_table_name = 'migel_product_fulltext_index_' + lang
        result = ODBA.cache.retrieve_from_index(index_table_name, query)
        products = unless result.empty?
                     #ODBA::DRbWrapper.new(result)
                     result
                   else
                   # search product by name (prefix search)
                     search_method_article_name = 'search_by_article_name_' + lang.downcase.to_s
                     search_method_company_name = 'search_by_company_name_' + lang.downcase.to_s
                     result = Migel::Model::Product.send(search_method_article_name, query) + Migel::Model::Product.send(search_method_company_name, query)
                     #ODBA::DRbWrapper.new(result)
                     result
                   end

        products = if sortvalue
                     sort_products(products, sortvalue, reverse)
                   else
                     sort_products(products, :pharmacode)
                   end
        ODBA::DRbWrapper.new(products)
      end
  • src/util/oddbapp.rb
    def search_migel_items(query, lang, sortvalue = nil, reverse = nil)
      # search event
      # search items by using search box
      if query =~ /^\d{13}$/
        MIGEL_SERVER.product.search_by_ean_code(query)
      elsif query =~ /^\d{6,}$/
        MIGEL_SERVER.product.search_by_pharmacode(query)
      else
        MIGEL_SERVER.search_migel_product(query, lang, sortvalue, reverse)
      end
    end

Access

Result

  • Good

Note

  • The result is always sorted by migel_code even if it is reversed
  • In the same migel code, products are sorted or reversed.

Do not show inactive products or product without ean code

Task

Experiment

  • lib/migel/util/server.rb
      def sort_select_products(products, sortvalue, reverse = nil)
        products = products.select do |product|
            product.ean_code != nil and product.status != 'I'
          end.sort_by do |item|
          if sortvalue.to_sym == :ppub
            item.ppub.to_f
          else
            item.send(sortvalue).to_s
          end
        end
        if reverse
          products.reverse!
        end
        products
      end
  • src/view/migel/items.rb
    def sort_link(header_key, matrix, component)
    link = HtmlGrid::Link.new(header_key, @model, @session, self)
    ...
    if search_query = @session.user_input(:search_query)
    ...
    elsif @model.first
    ...
    end
    link
    end
  • src/view/migel/result.rb def migel_code(model)
    #if model.respond_to?(:items) and items = model.items and !items.empty?
    if model.respond_to?(:items) and items = model.items and !items.select{|i| i.ean_code != nil and i.status != 'I'}.empty?
      link = PointerLink.new(:to_s, model, @session, self)
      link.value = model.migel_code
      link.href = @lookandfeel._event_url(:migel_search, {:migel_code => model.migel_code.gsub(/\./, '')})
      link
    else
      model.migel_code
    end
end
  • src/view/migel/product.rb
    class ProductComposite < HtmlGrid::Composite
    def accessories(model)
      acc = model.accessories
      prods = if products = model.products
                products.select{|pro| pro.ean_code != nil and pro.status != 'I'}
              end
      if(!acc.empty?)
        AccessoryList.new(acc, @session, self)
      elsif(!prods.empty?)
        AccessoryOfList.new(prods, @session, self)
      end
    end
    end

Access

Testcases migel

migel server

masa@masa ~/ywesee/migel_dev $ ruby18 /usr/bin/rcov -T spec/suite.rb 
Loaded suite /usr/bin/rcov
Started

Finished in 0.000118 seconds.

0 tests, 0 assertions, 0 failures, 0 errors
................................................................................................

Finished in 0.24738 seconds
96 examples, 0 failures
+----------------------------------------------------+-------+-------+--------+
|                  File                              | Lines |  LOC  |  COV   |
+----------------------------------------------------+-------+-------+--------+
|/home/masa/rubylib/DebugUtils.rb                    |    61 |    51 |  11.8% |
|lib/migel/model.rb                                  |    24 |     5 | 100.0% |
|lib/migel/model/group.rb                            |    40 |    36 | 100.0% |
|lib/migel/model/migelid.rb                          |    87 |    78 | 100.0% |
|lib/migel/model/product.rb                          |    34 |    25 | 100.0% |
|lib/migel/model/subgroup.rb                         |    58 |    52 | 100.0% |
|lib/migel/model_super.rb                            |   195 |   185 |  65.9% |
|lib/migel/util/importer.rb                          |   430 |   394 |  94.2% |
|lib/migel/util/m10l_document.rb                     |    42 |    37 |  32.4% |
|lib/migel/util/multilingual.rb                      |   104 |    94 |  59.6% |
|lib/migel/util/server.rb                            |   260 |   233 |  97.0% |
|lib/migel/util/swissindex.rb                        |    33 |    23 | 100.0% |
|spec/model/group_spec.rb                            |    85 |    76 | 100.0% |
|spec/model/migelid_spec.rb                          |   146 |   131 | 100.0% |
|spec/model/product_spec.rb                          |    60 |    52 | 100.0% |
|spec/model/subgroup_spec.rb                         |   111 |    99 | 100.0% |
|spec/suite.rb                                       |    14 |     8 | 100.0% |
|spec/util/importer_spec.rb                          |   456 |   424 | 100.0% |
|spec/util/server_spec.rb                            |   292 |   278 | 100.0% |
|spec/util/swissindex_spec.rb                        |    35 |    27 | 100.0% |
+----------------------------------------------------+-------+-------+--------+
|Total                                               |  2567 |  2308 |  91.3% |
+----------------------------------------------------+-------+-------+--------+
91.3%   20 file(s)   2567 Lines   2308 LOC

oddb.org

  • test/test_util/oddbapp.rb
  • test/test_state/global.rb
  1) Failure:
test_migel_search__fail(ODDB::State::TestGlobal)
    [/usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core_class_methods.rb:64:in `check'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/expectation_director.rb:40:in `call'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:101:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/partial_mock.rb:255:in `user_input'
     /home/masa/ywesee/oddb.org/src/state/global.rb:479:in `migel_search'
     test/test_state/global.rb:771:in `test_migel_search__fail']:
in mock 'flexmock(ODDB::State::TestGlobal::StubSession)': no matching handler found for user_input(:sortvalue)

  2) Failure:
test_migel_search__group(ODDB::State::TestGlobal)
    [/usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core_class_methods.rb:64:in `check'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/expectation_director.rb:40:in `call'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:101:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/partial_mock.rb:255:in `user_input'
     /home/masa/ywesee/oddb.org/src/state/global.rb:479:in `migel_search'
     test/test_state/global.rb:749:in `test_migel_search__group']:
in mock 'flexmock(ODDB::State::TestGlobal::StubSession)': no matching handler found for user_input(:sortvalue)

  3) Error:
test_migel_search__items(ODDB::State::TestGlobal):
NoMethodError: undefined method `search_migel_items_by_migel_code' for #<ODDB::State::TestGlobal::StubApp:0x7fde145c9b18>
    /home/masa/ywesee/oddb.org/src/state/global.rb:482:in `migel_search'
    test/test_state/global.rb:719:in `test_migel_search__items'

  4) Failure:
test_migel_search__limitation_text(ODDB::State::TestGlobal)
    [/usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core_class_methods.rb:64:in `check'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/expectation_director.rb:40:in `call'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:101:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/partial_mock.rb:255:in `user_input'
     /home/masa/ywesee/oddb.org/src/state/global.rb:479:in `migel_search'
     test/test_state/global.rb:761:in `test_migel_search__limitation_text']:
in mock 'flexmock(ODDB::State::TestGlobal::StubSession)': no matching handler found for user_input(:sortvalue)

  5) Failure:
test_migel_search__product(ODDB::State::TestGlobal)
    [/usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core_class_methods.rb:64:in `check'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/expectation_director.rb:40:in `call'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:101:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/partial_mock.rb:255:in `user_input'
     /home/masa/ywesee/oddb.org/src/state/global.rb:479:in `migel_search'
     test/test_state/global.rb:728:in `test_migel_search__product']:
in mock 'flexmock(ODDB::State::TestGlobal::StubSession)': no matching handler found for user_input(:sortvalue)

  6) Failure:
test_migel_search__subgroup(ODDB::State::TestGlobal)
    [/usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core_class_methods.rb:64:in `check'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/expectation_director.rb:40:in `call'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:101:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
     /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/partial_mock.rb:255:in `user_input'
     /home/masa/ywesee/oddb.org/src/state/global.rb:479:in `migel_search'
     test/test_state/global.rb:738:in `test_migel_search__subgroup']:
in mock 'flexmock(ODDB::State::TestGlobal::StubSession)': no matching handler found for user_input(:sortvalue)
  • test/test_state/migel/items.rb Fixed
masa@masa ~/ywesee/oddb.org $ ruby test/test_state/migel/items.rb 
/home/masa/ywesee/oddb.org/src/state/migel/items.rb:13: uninitialized constant ODDB::State::PageFacade (NameError)
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from test/test_state/migel/items.rb:11
  • test/test_view/migel/items.rb
  1) Error:
test_article_name(ODDB::View::Migel::TestSearchedList):
NoMethodError: undefined method `state' for <FlexMock:session>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:41:in `pages'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `new'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `compose_subheader'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:125:in `compose_list'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `each'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `compose_list'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:54:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:129:in `init'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:92:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/items.rb:70:in `new'
    test/test_view/migel/items.rb:70:in `setup'
  2) Error:
test_companyname(ODDB::View::Migel::TestSearchedList):
NoMethodError: undefined method `state' for <FlexMock:session>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:41:in `pages'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `new'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `compose_subheader'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:125:in `compose_list'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `each'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `compose_list'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:54:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:129:in `init'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:92:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/items.rb:70:in `new'
    test/test_view/migel/items.rb:70:in `setup'

  3) Error:
test_size(ODDB::View::Migel::TestSearchedList):
NoMethodError: undefined method `state' for <FlexMock:session>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:41:in `pages'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `new'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `compose_subheader'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:125:in `compose_list'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `each'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `compose_list'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:54:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:129:in `init'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:92:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/items.rb:70:in `new'
    test/test_view/migel/items.rb:70:in `setup'

  4) Error:
test_sort_link(ODDB::View::Migel::TestSearchedList):
NoMethodError: undefined method `state' for <FlexMock:session>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:41:in `pages'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `new'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `compose_subheader'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:125:in `compose_list'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `each'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `compose_list'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:54:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:129:in `init'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:92:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/items.rb:70:in `new'
    test/test_view/migel/items.rb:70:in `setup'

  5) Error:
test_sort_link__reverse(ODDB::View::Migel::TestSearchedList):
NoMethodError: undefined method `state' for <FlexMock:session>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:41:in `pages'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `new'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:131:in `compose_subheader'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:125:in `compose_list'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `each'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:123:in `compose_list'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:54:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:129:in `init'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:92:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/items.rb:70:in `new'
    test/test_view/migel/items.rb:70:in `setup'

  6) Error:
test_migel_code(ODDB::View::Migel::TestSubHeader):
NoMethodError: undefined method `state' for <FlexMock:session>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/items.rb:41:in `pages'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/items.rb:36:in `new'
    test/test_view/migel/items.rb:36:in `setup'

6 tests, 0 assertions, 0 failures, 6 errors
  • test/test_view/migel/result.rb Fixed
  1) Error:
test_migel_code__items(ODDB::View::Migel::TestList):
NoMethodError: undefined method `ean_code' for <FlexMock:item>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/result.rb:103:in `migel_code'
    /home/masa/ywesee/oddb.org/src/view/migel/result.rb:103:in `select'
    /home/masa/ywesee/oddb.org/src/view/migel/result.rb:103:in `migel_code'
    test/test_view/migel/result.rb:83:in `test_migel_code__items'

10 tests, 9 assertions, 0 failures, 1 errors
  • test/test_view/migel/product.rb
  1) Error:
test_backtracking(ODDB::View::Migel::TestProduct):
NoMethodError: undefined method `ean_code' for "product":String
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `accessories'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `select'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `accessories'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    /home/masa/ywesee/oddb.org/src/view/publictemplate.rb:53:in `new'
    /home/masa/ywesee/oddb.org/src/view/publictemplate.rb:53:in `content'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /home/masa/ywesee/oddb.org/src/view/publictemplate.rb:50:in `init'
    /home/masa/ywesee/oddb.org/src/view/privatetemplate.rb:16:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/product.rb:447:in `new'
    test/test_view/migel/product.rb:447:in `setup'

  2) Error:
test_accessories(ODDB::View::Migel::TestProductComposite):
NoMethodError: undefined method `ean_code' for <FlexMock:product>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `accessories'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `select'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `accessories'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/product.rb:279:in `new'
    test/test_view/migel/product.rb:279:in `setup'

  3) Error:
test_accessories_acc_empty(ODDB::View::Migel::TestProductComposite):
NoMethodError: undefined method `ean_code' for <FlexMock:product>:FlexMock
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:105:in `method_missing'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:191:in `flexmock_wrap'
    /usr/lib64/ruby/gems/1.8/gems/flexmock-0.8.6/lib/flexmock/core.rb:98:in `method_missing'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `accessories'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `select'
    /home/masa/ywesee/oddb.org/src/view/migel/product.rb:146:in `accessories'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:280:in `compose_component'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'
    /usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'
    test/test_view/migel/product.rb:279:in `new'
    test/test_view/migel/product.rb:279:in `setup'

28 tests, 29 assertions, 0 failures, 3 errors

Next

  • Check coverage
view · edit · sidebar · attach · print · history
Page last modified on September 26, 2011, at 04:59 PM