# File test/test_DocumentTable.rb, line 18
    def setup
      # for WPM::Driver class
      @driver_call = 0
      @redirect_call = 0
      @redirect_last_page_name = nil
      @redirect_last_query_params = nil

      # for MountMap class
      @modified_count_call = 0
      @set_modified_count_call = 0
      @set_modified_count_last_value = nil
      @document_list_call = 0
      @document_list = [
        { 'document' => 'Page',
          'arguments' => [
            "Hello world.\n",
            'text/plain'
          ],
          'mount_path' => '/hello',
          'mount_mask' => nil,
          'virtual_host' => nil,
          'comment' => 'test of Page'
        },
        { 'document' => 'LocalFile',
          'arguments' => [
            '/home/alice/public_html'
          ],
          'mount_path' => '/~alice',
          'mount_mask' => nil,
          'virtual_host' => 'foo',
          'comment' => 'test of LocalFile'
        }
      ]
      @doc_args_call = 0
      @doc_args_last_doc_name = nil
      @doc_names_call = 0
      @write_document_list_call = 0
      @setup_document_call = 0
      @setup_document_last_doc_type = nil
      @setup_document_last_pos = nil
      @doc_tag_call = 0
      @doc_label_call = 0
      @path_tag_call = 0
      @path_label_call = 0
      @mask_tag_call = 0
      @mask_label_call = 0

      @factory = Rucy::DocumentFactory.new
      page = Object.new
      def page.doc_name
        'Page'
      end
      def page.doc_args
        [ [ 'content', :text, nil ],
          [ 'content-type', :string, 'text/html' ]
        ]
      end
      @factory.add_document(page)
      local = Object.new
      def local.doc_name
        'LocalFile'
      end
      def local.doc_args
        [ [ 'local path', :string, nil ] ]
      end
      @factory.add_document(local)

      # for Rucy::DocumentFactory class
      @filter_names_call = 0
      erb = Object.new
      def erb.filter_name
        'eRuby'
      end
      def erb.filter_args
        [ [ 'safe level', :number, 1 ] ]
      end
      @factory.add_filter(erb)
      ssi = Object.new
      def ssi.filter_name
        'SSI'
      end
      def ssi.filter_args
        [ [ 'SSI commands', :checkset,
            [ [ 'config',   true ],
              [ 'include',  true ],
              [ 'echo',     true ],
              [ 'fsize',    true ],
              [ 'flastmod', true ],
              [ 'exec',     true ]
            ]
          ]
        ]
      end
      @factory.add_filter(ssi)

      # for Rucy::Control class
      @filters_call = 0
      @filter_list = [
        { 'filter' => 'eRuby',
          'arguments' => [ 1 ],
          'attach_path' => '/eRuby',
          'attach_mask' => %/\.rhtml?/,
          'virtual_host' => nil,
          'comment' => 'test of eRuby'
        },
        { 'filter' => 'SSI',
          'arguments' => [
            { 'config'   => true,
              'include'  => true,
              'echo'     => true,
              'fsize'    => true,
              'flastmod' => true,
              'exec'     => false
            }
          ],
          'attach_path' => '/~alice',
          'attach_mask' => %/\.shtml?/,
          'virtual_host' => 'foo',
          'comment' => 'test of SSI'
        }
      ]

      # setup WPM::PageContext class
      loader = WPM::Loader.new('../control/DocumentTable/DocumentTable.rb')
      @DocumentTable = loader.const_get('DocumentTable').new(self, { :control => self, :factory => self })
      assert((@DocumentTable.is_a? WPM::PageContext))
      @DocumentTable.init_context
      @DocumentTable.table_source = self
    end