rutema 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +6 -2
- data/Manifest.txt +28 -35
- data/README.txt +3 -2
- data/Rakefile +2 -4
- data/distro_test.sh +5 -0
- data/lib/rutema/gems.rb +0 -3
- data/lib/rutema/reporter.rb +0 -67
- data/lib/rutema/{reporter_ar.rb → reporters/activerecord.rb} +4 -4
- data/lib/rutema/reporters/email.rb +75 -0
- data/lib/rutema/reporters/standard_reporters.rb +5 -0
- data/lib/rutema/specification.rb +1 -0
- data/lib/rutema/system.rb +15 -10
- data/selftest.sh +2 -0
- data/test/distro_test/config/full.rutema +14 -0
- data/test/distro_test/config/jruby.rutema +8 -0
- data/test/distro_test/config/jruby.rutemah +7 -0
- data/test/rutema.rutema +1 -1
- data/test/test_reporter.rb +1 -1
- metadata +42 -61
- data/bin/rutemaweb +0 -9
- data/lib/rutemaweb/main.rb +0 -30
- data/lib/rutemaweb/public/bg_menu.gif +0 -0
- data/lib/rutemaweb/public/bg_submenu.gif +0 -0
- data/lib/rutemaweb/public/run_error.png +0 -0
- data/lib/rutemaweb/public/run_ok.png +0 -0
- data/lib/rutemaweb/public/run_warn.png +0 -0
- data/lib/rutemaweb/public/step_error.png +0 -0
- data/lib/rutemaweb/public/step_ok.png +0 -0
- data/lib/rutemaweb/public/step_warn.png +0 -0
- data/lib/rutemaweb/public/style.css +0 -105
- data/lib/rutemaweb/public/tie_logo.gif +0 -0
- data/lib/rutemaweb/ramaze_controller.rb +0 -150
- data/lib/rutemaweb/ruport_formatter.rb +0 -29
- data/lib/rutemaweb/view/layout.rhtml +0 -47
    
        data/History.txt
    CHANGED
    
    | @@ -1,7 +1,11 @@ | |
| 1 | 
            -
            == 0. | 
| 1 | 
            +
            == 0.8.0 / 2008-07-03
         | 
| 2 | 
            +
            * Split rutemaweb into own gem
         | 
| 3 | 
            +
            * Refactored reporters
         | 
| 4 | 
            +
            * Re-enabled the --step commandline facility of rutemax alowing step-by-step execution and fixed the StepRunner implementation
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            == 0.7.1 / 2008-06-12
         | 
| 2 7 | 
             
            * Added the ruport_formatter.rb file to the manifest (and consequently to the gem)
         | 
| 3 8 | 
             
            * Locked down the active record and ramaze versions to avoid the String#start_with? alias bug from active support 2.1.0 and the Ramaze.start! change 
         | 
| 4 | 
            -
             | 
| 5 9 | 
             
            == 0.7.0 / 2008-05-16
         | 
| 6 10 | 
             
            * Support for tools, paths and context information in the configuration solidified (http://patir.rubyforge.org/rutema/tool_configuration.html for more)
         | 
| 7 11 | 
             
            * Changes in the configuration for Historian and ActiveRecordReporter. Check the distro_test samples
         | 
    
        data/Manifest.txt
    CHANGED
    
    | @@ -1,39 +1,33 @@ | |
| 1 | 
            +
            COPYING.txt
         | 
| 1 2 | 
             
            History.txt
         | 
| 2 3 | 
             
            Manifest.txt
         | 
| 3 4 | 
             
            README.txt
         | 
| 4 | 
            -
            COPYING.txt
         | 
| 5 5 | 
             
            Rakefile
         | 
| 6 | 
            -
            bin/rutemax
         | 
| 7 6 | 
             
            bin/rutemah
         | 
| 8 | 
            -
            bin/ | 
| 7 | 
            +
            bin/rutemax
         | 
| 8 | 
            +
            distro_test.sh
         | 
| 9 9 | 
             
            lib/rutema/configuration.rb
         | 
| 10 | 
            -
            lib/rutema/specification.rb
         | 
| 11 | 
            -
            lib/rutema/system.rb
         | 
| 12 | 
            -
            lib/rutema/reporter.rb
         | 
| 13 | 
            -
            lib/rutema/reporter_ar.rb
         | 
| 14 | 
            -
            lib/rutema/historian.rb
         | 
| 15 | 
            -
            lib/rutema/model.rb
         | 
| 16 10 | 
             
            lib/rutema/db.rb
         | 
| 17 11 | 
             
            lib/rutema/gems.rb
         | 
| 18 | 
            -
            lib/ | 
| 19 | 
            -
            lib/ | 
| 20 | 
            -
            lib/ | 
| 21 | 
            -
            lib/ | 
| 22 | 
            -
            lib/ | 
| 23 | 
            -
            lib/ | 
| 24 | 
            -
            lib/ | 
| 25 | 
            -
            lib/ | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
            test/ | 
| 33 | 
            -
            test/ | 
| 34 | 
            -
            test/ | 
| 35 | 
            -
            test/ | 
| 36 | 
            -
            test/ | 
| 12 | 
            +
            lib/rutema/historian.rb
         | 
| 13 | 
            +
            lib/rutema/model.rb
         | 
| 14 | 
            +
            lib/rutema/reporter.rb
         | 
| 15 | 
            +
            lib/rutema/reporters/activerecord.rb
         | 
| 16 | 
            +
            lib/rutema/reporters/email.rb
         | 
| 17 | 
            +
            lib/rutema/reporters/standard_reporters.rb
         | 
| 18 | 
            +
            lib/rutema/specification.rb
         | 
| 19 | 
            +
            lib/rutema/system.rb
         | 
| 20 | 
            +
            selftest.sh
         | 
| 21 | 
            +
            test/distro_test/config/database.rutema
         | 
| 22 | 
            +
            test/distro_test/config/database.rutemah
         | 
| 23 | 
            +
            test/distro_test/config/full.rutema
         | 
| 24 | 
            +
            test/distro_test/config/jruby.rutema
         | 
| 25 | 
            +
            test/distro_test/config/jruby.rutemah
         | 
| 26 | 
            +
            test/distro_test/config/minimal.rutema
         | 
| 27 | 
            +
            test/distro_test/specs/T001.spec
         | 
| 28 | 
            +
            test/distro_test/specs/T002.spec
         | 
| 29 | 
            +
            test/distro_test/specs/T003.spec
         | 
| 30 | 
            +
            test/distro_test/specs/T004.spec
         | 
| 37 31 | 
             
            test/rutema.rutema
         | 
| 38 32 | 
             
            test/rutema.spec
         | 
| 39 33 | 
             
            test/samples/check.spec
         | 
| @@ -42,11 +36,10 @@ test/samples/teardown.spec | |
| 42 36 | 
             
            test/samples/test.spec
         | 
| 43 37 | 
             
            test/samples/tests/no_title.spec
         | 
| 44 38 | 
             
            test/samples/tests/sample.spec
         | 
| 45 | 
            -
            test/ | 
| 46 | 
            -
            test/ | 
| 47 | 
            -
            test/ | 
| 48 | 
            -
            test/ | 
| 49 | 
            -
            test/ | 
| 50 | 
            -
            test/ | 
| 51 | 
            -
            test/distro_test/specs/T004.spec
         | 
| 39 | 
            +
            test/test_configuration.rb
         | 
| 40 | 
            +
            test/test_historian.rb
         | 
| 41 | 
            +
            test/test_model.rb
         | 
| 42 | 
            +
            test/test_reporter.rb
         | 
| 43 | 
            +
            test/test_specification.rb
         | 
| 44 | 
            +
            test/test_system.rb
         | 
| 52 45 |  | 
    
        data/README.txt
    CHANGED
    
    | @@ -9,11 +9,12 @@ For more information look at http://patir.rubyforge.org/rutema | |
| 9 9 | 
             
            == FEATURES/PROBLEMS:
         | 
| 10 10 | 
             
            * Unified test execution environment for automated and manual tests
         | 
| 11 11 | 
             
            * Extensible reports and notifications in various formats (email, rss, pdf, html etc.)
         | 
| 12 | 
            -
            * Web frontend and command line report generation tools for browsing the test results database
         | 
| 12 | 
            +
            * Web frontend and command line report generation tools for browsing the test results database (with rutemaweb)
         | 
| 13 13 | 
             
            * Comprehensive history of test execution
         | 
| 14 14 | 
             
            * A well defined way to create a project specific test specification format
         | 
| 15 15 |  | 
| 16 16 | 
             
            == SYNOPSIS:
         | 
| 17 | 
            +
             | 
| 17 18 | 
             
            See http://patir.rubyforge.org/rutema/distro_test.html for an introductory example.
         | 
| 18 19 |  | 
| 19 20 | 
             
            == REQUIREMENTS:
         | 
| @@ -21,9 +22,9 @@ See http://patir.rubyforge.org/rutema/distro_test.html for an introductory examp | |
| 21 22 | 
             
            * mailfactory (http://rubyforge.org/projects/mailfactory/)
         | 
| 22 23 | 
             
            * activerecord (http://ar.rubyonrails.com/)
         | 
| 23 24 | 
             
            * sqlite3 (http://rubyforge.org/projects/sqlite-ruby/)
         | 
| 24 | 
            -
            * ramaze (http://www.ramaze.net/)
         | 
| 25 25 | 
             
            * ruport (http://rubyreports.org/)
         | 
| 26 26 | 
             
            * acts_as_reportable
         | 
| 27 | 
            +
            * highline
         | 
| 27 28 |  | 
| 28 29 | 
             
            == INSTALL:
         | 
| 29 30 | 
             
            * gem install rutema
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -14,15 +14,13 @@ Hoe.new('rutema', "#{Rutema::Version::STRING}") do |p| | |
| 14 14 | 
             
              p.description = p.paragraphs_of('README.txt', 1..5).join("\n\n")
         | 
| 15 15 | 
             
              p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
         | 
| 16 16 | 
             
              p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
         | 
| 17 | 
            -
              p.extra_deps<<['patir',">=0.5. | 
| 17 | 
            +
              p.extra_deps<<['patir',">=0.5.6"]
         | 
| 18 18 | 
             
              p.extra_deps<<['highline']
         | 
| 19 19 | 
             
              p.extra_deps<<['mailfactory']
         | 
| 20 20 | 
             
              p.extra_deps<<['activerecord','=2.0.2']
         | 
| 21 21 | 
             
              p.extra_deps<<['ruport']
         | 
| 22 22 | 
             
              p.extra_deps<<['acts_as_reportable']
         | 
| 23 | 
            -
              p. | 
| 24 | 
            -
              p.extra_deps<<['erubis']
         | 
| 25 | 
            -
              p.spec_extras={:executables=>["rutemax","rutemah","rutemaweb"],
         | 
| 23 | 
            +
              p.spec_extras={:executables=>["rutemax","rutemah"],
         | 
| 26 24 | 
             
                :default_executable=>"rutemax"}
         | 
| 27 25 | 
             
            end
         | 
| 28 26 |  | 
    
        data/distro_test.sh
    ADDED
    
    
    
        data/lib/rutema/gems.rb
    CHANGED
    
    
    
        data/lib/rutema/reporter.rb
    CHANGED
    
    | @@ -20,73 +20,6 @@ module Rutema | |
| 20 20 | 
             
                end
         | 
| 21 21 | 
             
              end
         | 
| 22 22 |  | 
| 23 | 
            -
              #The following configuration keys are used by EmailReporter:
         | 
| 24 | 
            -
              #
         | 
| 25 | 
            -
              #:server - the smtp server to use
         | 
| 26 | 
            -
              #
         | 
| 27 | 
            -
              #:port - the port to use (defaults to 25)
         | 
| 28 | 
            -
              #
         | 
| 29 | 
            -
              #:sender - the sender of the email (defaults to rutema@domain)
         | 
| 30 | 
            -
              #
         | 
| 31 | 
            -
              #:recipients - an array of strings with the recipients of the report emails
         | 
| 32 | 
            -
              #
         | 
| 33 | 
            -
              #The :logger key is set by the Coordinator
         | 
| 34 | 
            -
              #
         | 
| 35 | 
            -
              #Customization keys:
         | 
| 36 | 
            -
              #
         | 
| 37 | 
            -
              #:subject - the string of this key will be prefixed as a subject for the email
         | 
| 38 | 
            -
              class EmailReporter
         | 
| 39 | 
            -
                attr_reader :last_message
         | 
| 40 | 
            -
                def initialize definition
         | 
| 41 | 
            -
                  #get the logger
         | 
| 42 | 
            -
                  @logger=definition[:logger]
         | 
| 43 | 
            -
                  @logger||=Patir.setup_logger
         | 
| 44 | 
            -
                  #extract the parameters from the definition
         | 
| 45 | 
            -
                  #address and port of the smtp server
         | 
| 46 | 
            -
                  @server=definition[:server]
         | 
| 47 | 
            -
                  @port=definition[:port]
         | 
| 48 | 
            -
                  @port||=25
         | 
| 49 | 
            -
                  #the domain we're coming from
         | 
| 50 | 
            -
                  @domain=definition[:domain]
         | 
| 51 | 
            -
                  #construct the mail factory object
         | 
| 52 | 
            -
                  @mail = MailFactory.new()
         | 
| 53 | 
            -
                  @mail.from = definition[:sender]
         | 
| 54 | 
            -
                  @mail.from||="rutema@#{@domain}"
         | 
| 55 | 
            -
                  @recipients=definition[:recipients]
         | 
| 56 | 
            -
                  @mail.to=@recipients
         | 
| 57 | 
            -
                  #customize
         | 
| 58 | 
            -
                  @subject=definition[:subject]
         | 
| 59 | 
            -
                  @subject||=""
         | 
| 60 | 
            -
                  #this is a way to test without sending
         | 
| 61 | 
            -
                  @dummy=true if definition[:dummy]
         | 
| 62 | 
            -
                  @logger.info("Reporter '#{self.to_s}' registered")
         | 
| 63 | 
            -
                end
         | 
| 64 | 
            -
             | 
| 65 | 
            -
                def to_s
         | 
| 66 | 
            -
                  list=@recipients.join(', ')
         | 
| 67 | 
            -
                  "EmailReporter - #{@server}:#{@port} from #{@mail.from} to #{list}"
         | 
| 68 | 
            -
                end
         | 
| 69 | 
            -
                
         | 
| 70 | 
            -
                def report specifications,runner_states,parse_errors,configuration
         | 
| 71 | 
            -
                  @mail.subject = "#{@subject}"
         | 
| 72 | 
            -
                  @mail.text = Rutema.text_report(runner_states,parse_errors)
         | 
| 73 | 
            -
                  begin
         | 
| 74 | 
            -
                    if @mail.to.empty?
         | 
| 75 | 
            -
                      @logger.error("No recipients for the report mail")
         | 
| 76 | 
            -
                    else
         | 
| 77 | 
            -
                      #
         | 
| 78 | 
            -
                      #~ if @password
         | 
| 79 | 
            -
                      #~ #if a password is defined, use cram_md5 authentication
         | 
| 80 | 
            -
                      #~ else
         | 
| 81 | 
            -
                      Net::SMTP.start(@server, @port, @domain) {|smtp| smtp.sendmail(@mail.to_s(),@mail.from,@mail.to)} unless @dummy
         | 
| 82 | 
            -
                      #~ end
         | 
| 83 | 
            -
                    end#recipients empty
         | 
| 84 | 
            -
                  rescue
         | 
| 85 | 
            -
                    @logger.error("Sending of email report failed: #{$!}")
         | 
| 86 | 
            -
                  end
         | 
| 87 | 
            -
                  @mail.to_s
         | 
| 88 | 
            -
                end
         | 
| 89 | 
            -
              end
         | 
| 90 23 | 
             
              private
         | 
| 91 24 | 
             
              def self.text_report runner_states,parse_errors
         | 
| 92 25 | 
             
                msg="Parse errors: #{parse_errors.size}"
         | 
| @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            #  Copyright (c) 2007 Vassilis Rizopoulos. All rights reserved.
         | 
| 2 | 
            -
            $:.unshift File.join(File.dirname(__FILE__),"..")
         | 
| 2 | 
            +
            $:.unshift File.join(File.dirname(__FILE__),"..","..")
         | 
| 3 3 | 
             
            require 'yaml'
         | 
| 4 4 | 
             
            require 'rutema/reporter'
         | 
| 5 5 | 
             
            require 'rutema/model'
         | 
| @@ -9,18 +9,18 @@ require 'rutema/gems' | |
| 9 9 | 
             
            module Rutema
         | 
| 10 10 | 
             
              #The ActiveRecordReporter will store the results of a test run in a database using ActiveRecord.
         | 
| 11 11 | 
             
              #
         | 
| 12 | 
            -
              #The DBMSs supported are dependent on the platform: either SQLite3 or h2 (jruby)
         | 
| 12 | 
            +
              #The DBMSs supported are dependent on the platform: either SQLite3 (MRI) or h2 (jruby)
         | 
| 13 13 | 
             
              class ActiveRecordReporter<Reporter
         | 
| 14 14 | 
             
                #The required keys in this reporter's configuration are:
         | 
| 15 15 | 
             
                # :db - the database configuration. A Hash with the DB adapter information
         | 
| 16 16 | 
             
                #  :db=>{:database=>"sample.rb"}
         | 
| 17 17 | 
             
                #
         | 
| 18 | 
            -
                # | 
| 18 | 
            +
                #Optionally you can pass a Logger instance with the :logger key
         | 
| 19 19 | 
             
                def initialize definition
         | 
| 20 20 | 
             
                  @logger=definition[:logger]
         | 
| 21 21 | 
             
                  @logger||=Patir.setup_logger
         | 
| 22 22 | 
             
                  database_configuration = definition[:db]
         | 
| 23 | 
            -
                  raise "No database configuration defined" unless database_configuration
         | 
| 23 | 
            +
                  raise "No database configuration defined, missing :db configuration key." unless database_configuration
         | 
| 24 24 | 
             
                  unless database_configuration[:database]==":memory:"
         | 
| 25 25 | 
             
                    @dbfile=File.expand_path(database_configuration[:database]) 
         | 
| 26 26 | 
             
                  else
         | 
| @@ -0,0 +1,75 @@ | |
| 1 | 
            +
            #  Copyright (c) 2007 Vassilis Rizopoulos. All rights reserved.
         | 
| 2 | 
            +
            $:.unshift File.join(File.dirname(__FILE__),"..","..")
         | 
| 3 | 
            +
            require 'rutema/reporter'
         | 
| 4 | 
            +
            require 'rutema/specification'
         | 
| 5 | 
            +
            require 'rutema/gems'
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            module Rutema
         | 
| 8 | 
            +
              #The following configuration keys are used by EmailReporter:
         | 
| 9 | 
            +
              #
         | 
| 10 | 
            +
              #:server - the smtp server to use
         | 
| 11 | 
            +
              #
         | 
| 12 | 
            +
              #:port - the port to use (defaults to 25)
         | 
| 13 | 
            +
              #
         | 
| 14 | 
            +
              #:sender - the sender of the email (defaults to rutema@domain)
         | 
| 15 | 
            +
              #
         | 
| 16 | 
            +
              #:recipients - an array of strings with the recipients of the report emails
         | 
| 17 | 
            +
              #
         | 
| 18 | 
            +
              #The :logger key is set by the Coordinator
         | 
| 19 | 
            +
              #
         | 
| 20 | 
            +
              #Customization keys:
         | 
| 21 | 
            +
              #
         | 
| 22 | 
            +
              #:subject - the string of this key will be prefixed as a subject for the email
         | 
| 23 | 
            +
              class EmailReporter
         | 
| 24 | 
            +
                attr_reader :last_message
         | 
| 25 | 
            +
                def initialize definition
         | 
| 26 | 
            +
                  #get the logger
         | 
| 27 | 
            +
                  @logger=definition[:logger]
         | 
| 28 | 
            +
                  @logger||=Patir.setup_logger
         | 
| 29 | 
            +
                  #extract the parameters from the definition
         | 
| 30 | 
            +
                  #address and port of the smtp server
         | 
| 31 | 
            +
                  @server=definition[:server]
         | 
| 32 | 
            +
                  @port=definition[:port]
         | 
| 33 | 
            +
                  @port||=25
         | 
| 34 | 
            +
                  #the domain we're coming from
         | 
| 35 | 
            +
                  @domain=definition[:domain]
         | 
| 36 | 
            +
                  #construct the mail factory object
         | 
| 37 | 
            +
                  @mail = MailFactory.new()
         | 
| 38 | 
            +
                  @mail.from = definition[:sender]
         | 
| 39 | 
            +
                  @mail.from||="rutema@#{@domain}"
         | 
| 40 | 
            +
                  @recipients=definition[:recipients]
         | 
| 41 | 
            +
                  @mail.to=@recipients
         | 
| 42 | 
            +
                  #customize
         | 
| 43 | 
            +
                  @subject=definition[:subject]
         | 
| 44 | 
            +
                  @subject||=""
         | 
| 45 | 
            +
                  #this is a way to test without sending
         | 
| 46 | 
            +
                  @dummy=true if definition[:dummy]
         | 
| 47 | 
            +
                  @logger.info("Reporter '#{self.to_s}' registered")
         | 
| 48 | 
            +
                end
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                def to_s
         | 
| 51 | 
            +
                  list=@recipients.join(', ')
         | 
| 52 | 
            +
                  "EmailReporter - #{@server}:#{@port} from #{@mail.from} to #{list}"
         | 
| 53 | 
            +
                end
         | 
| 54 | 
            +
                
         | 
| 55 | 
            +
                def report specifications,runner_states,parse_errors,configuration
         | 
| 56 | 
            +
                  @mail.subject = "#{@subject}"
         | 
| 57 | 
            +
                  @mail.text = Rutema.text_report(runner_states,parse_errors)
         | 
| 58 | 
            +
                  begin
         | 
| 59 | 
            +
                    if @mail.to.empty?
         | 
| 60 | 
            +
                      @logger.error("No recipients for the report mail")
         | 
| 61 | 
            +
                    else
         | 
| 62 | 
            +
                      #
         | 
| 63 | 
            +
                      #~ if @password
         | 
| 64 | 
            +
                      #~ #if a password is defined, use cram_md5 authentication
         | 
| 65 | 
            +
                      #~ else
         | 
| 66 | 
            +
                      Net::SMTP.start(@server, @port, @domain) {|smtp| smtp.sendmail(@mail.to_s(),@mail.from,@mail.to)} unless @dummy
         | 
| 67 | 
            +
                      #~ end
         | 
| 68 | 
            +
                    end#recipients empty
         | 
| 69 | 
            +
                  rescue
         | 
| 70 | 
            +
                    @logger.error("Sending of email report failed: #{$!}")
         | 
| 71 | 
            +
                  end
         | 
| 72 | 
            +
                  @mail.to_s
         | 
| 73 | 
            +
                end
         | 
| 74 | 
            +
              end
         | 
| 75 | 
            +
            end
         | 
    
        data/lib/rutema/specification.rb
    CHANGED
    
    
    
        data/lib/rutema/system.rb
    CHANGED
    
    | @@ -3,15 +3,15 @@ $:.unshift File.join(File.dirname(__FILE__),"..") | |
| 3 3 | 
             
            require 'rexml/document'
         | 
| 4 4 | 
             
            require 'rutema/specification'
         | 
| 5 5 | 
             
            require 'rutema/configuration'
         | 
| 6 | 
            -
            require 'rutema/ | 
| 6 | 
            +
            require 'rutema/reporters/standard_reporters'
         | 
| 7 7 | 
             
            require 'rutema/gems'
         | 
| 8 8 |  | 
| 9 9 | 
             
            module Rutema
         | 
| 10 10 | 
             
              #This module defines the version numbers for the library
         | 
| 11 11 | 
             
              module Version
         | 
| 12 12 | 
             
                MAJOR=0
         | 
| 13 | 
            -
                MINOR= | 
| 14 | 
            -
                TINY= | 
| 13 | 
            +
                MINOR=8
         | 
| 14 | 
            +
                TINY=0
         | 
| 15 15 | 
             
                STRING=[ MAJOR, MINOR, TINY ].join( "." )
         | 
| 16 16 | 
             
              end
         | 
| 17 17 | 
             
              #Is raised when an error is found in a specification
         | 
| @@ -318,7 +318,7 @@ module Rutema | |
| 318 318 | 
             
                    @logger.info("Parsing teardown specification from '#{@configuration.teardown}'")
         | 
| 319 319 | 
             
                    teardown=@parser.parse_specification(@configuration.teardown).scenario
         | 
| 320 320 | 
             
                  end
         | 
| 321 | 
            -
                  if @configuration. | 
| 321 | 
            +
                  if @configuration.use_step_by_step
         | 
| 322 322 | 
             
                    @logger.info("Using StepRunner")
         | 
| 323 323 | 
             
                    return StepRunner.new(setup,teardown,@logger)
         | 
| 324 324 | 
             
                  else
         | 
| @@ -484,7 +484,7 @@ module Rutema | |
| 484 484 | 
             
                  return state
         | 
| 485 485 | 
             
                end
         | 
| 486 486 | 
             
                def run_step step
         | 
| 487 | 
            -
                  @logger. | 
| 487 | 
            +
                  @logger.info("Running step #{step.number} - #{step.step_type}")
         | 
| 488 488 | 
             
                  if step.has_cmd? && step.cmd.respond_to?(:run)
         | 
| 489 489 | 
             
                    step.cmd.run
         | 
| 490 490 | 
             
                  else
         | 
| @@ -508,14 +508,17 @@ module Rutema | |
| 508 508 |  | 
| 509 509 | 
             
              #StepRunner halts before every step and asks if it should be executed or not.
         | 
| 510 510 | 
             
              class StepRunner<Runner
         | 
| 511 | 
            +
                def initialize setup=nil, teardown=nil,logger=nil
         | 
| 512 | 
            +
                  @questioner=HighLine.new
         | 
| 513 | 
            +
                  super(setup,teardown,logger)
         | 
| 514 | 
            +
                end
         | 
| 511 515 | 
             
                def run_step step
         | 
| 512 | 
            -
                  if  | 
| 513 | 
            -
                    return super
         | 
| 516 | 
            +
                  if @questioner.agree("Execute #{step.to_s}?")
         | 
| 517 | 
            +
                    return super(step)
         | 
| 514 518 | 
             
                  else
         | 
| 515 | 
            -
                     | 
| 516 | 
            -
                    msg="#{step.number} - #{step.step_type} - #{state[:state]}"
         | 
| 519 | 
            +
                    msg="#{step.number} - #{step.step_type} - #{step.status}"
         | 
| 517 520 | 
             
                    @logger.info(msg)
         | 
| 518 | 
            -
                    return  | 
| 521 | 
            +
                    return step
         | 
| 519 522 | 
             
                  end
         | 
| 520 523 | 
             
                end
         | 
| 521 524 | 
             
              end
         | 
| @@ -529,6 +532,7 @@ module Rutema | |
| 529 532 | 
             
                  begin
         | 
| 530 533 | 
             
                    raise "No configuration file defined!" if !@config_file
         | 
| 531 534 | 
             
                    @configuration=RutemaXConfigurator.new(@config_file,@logger).configuration
         | 
| 535 | 
            +
                    @configuration.use_step_by_step=@step
         | 
| 532 536 | 
             
                    Dir.chdir(File.dirname(@config_file)) do 
         | 
| 533 537 | 
             
                      @coordinator=Coordinator.new(@configuration,@logger)
         | 
| 534 538 | 
             
                      application_flow
         | 
| @@ -551,6 +555,7 @@ module Rutema | |
| 551 555 | 
             
                    opt.on("--config FILE", "-c FILE",String,"Loads the configuration from FILE") { |@config_file|}
         | 
| 552 556 | 
             
                    opt.on("--log FILE", "-l FILE",String,"Redirects the log output to FILE") { |@log_file|}
         | 
| 553 557 | 
             
                    opt.on("--check","Runs just the check test"){@check=true}
         | 
| 558 | 
            +
                    opt.on("--step","Runs test cases step by step"){@step=true}
         | 
| 554 559 | 
             
                    opt.on("-v", "--version","Displays the version") { $stdout.puts("v#{Version::STRING}");exit 0 }
         | 
| 555 560 | 
             
                    opt.on("--help", "-h", "-?", "This text") { $stdout.puts opt; exit 0 }
         | 
| 556 561 | 
             
                    opt.on("The commands are:")
         | 
    
        data/selftest.sh
    ADDED
    
    
| @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            configuration.parser={:class=>Rutema::MinimalXMLParser}
         | 
| 2 | 
            +
            configuration.reporter={:class=>Rutema::ActiveRecordReporter, :database=>"sample.db"}
         | 
| 3 | 
            +
            configuration.tests=[
         | 
| 4 | 
            +
            "../specs/T001.spec",
         | 
| 5 | 
            +
            "../specs/T002.spec",
         | 
| 6 | 
            +
            "../specs/T003.spec",
         | 
| 7 | 
            +
            "../specs/T004.spec"
         | 
| 8 | 
            +
            ]
         | 
| 9 | 
            +
            configuration.tool={:name=>"test",:path=>".",:configuration=>{:key=>"value"}}
         | 
| 10 | 
            +
            configuration.path={:name=>"test",:path=>"."}
         | 
| 11 | 
            +
            configuration.context={:key=>"value"}
         | 
| 12 | 
            +
            configuration.check="."
         | 
| 13 | 
            +
            configuration.teardown="."
         | 
| 14 | 
            +
            configuration.setup="."
         | 
| @@ -0,0 +1,8 @@ | |
| 1 | 
            +
            configuration.parser={:class=>Rutema::MinimalXMLParser}
         | 
| 2 | 
            +
            configuration.reporter={:class=>Rutema::ActiveRecordReporter, :db=>{:database=>"h2"}}
         | 
| 3 | 
            +
            configuration.tests=[
         | 
| 4 | 
            +
            "../specs/T001.spec",
         | 
| 5 | 
            +
            "../specs/T002.spec",
         | 
| 6 | 
            +
            "../specs/T003.spec",
         | 
| 7 | 
            +
            "../specs/T004.spec"
         | 
| 8 | 
            +
            ]
         | 
| @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            #include the configuration from database.rutema
         | 
| 2 | 
            +
            configuration.load_from_file("database.rutema")
         | 
| 3 | 
            +
            #This is the verbose version of the configuration entry:
         | 
| 4 | 
            +
            #configuration.db=:database=>"db/h2",:adapter=>"jdbch2"}
         | 
| 5 | 
            +
            #For the time being the adapter is being automatically set according to the platform we're running on, so the :adapter is ignored
         | 
| 6 | 
            +
            #SQLite for MRI and h2 for jRuby
         | 
| 7 | 
            +
            configuration.db={:database=>"db/h2"}
         | 
    
        data/test/rutema.rutema
    CHANGED
    
    | @@ -1,3 +1,3 @@ | |
| 1 1 | 
             
            configuration.parser={:class=>Rutema::MinimalXMLParser}
         | 
| 2 | 
            -
            configuration.reporter={:class=>Rutema::ActiveRecordReporter, : | 
| 2 | 
            +
            configuration.reporter={:class=>Rutema::ActiveRecordReporter, :db=>{:database=>"rutema.db"}}
         | 
| 3 3 | 
             
            configuration.tests=["rutema.spec"]
         | 
    
        data/test/test_reporter.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: rutema
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.8.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors: 
         | 
| 7 7 | 
             
            - Vassilis Rizopoulos
         | 
| @@ -9,20 +9,22 @@ autorequire: | |
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 11 |  | 
| 12 | 
            -
            date: 2008- | 
| 12 | 
            +
            date: 2008-07-03 00:00:00 +02:00
         | 
| 13 13 | 
             
            default_executable: rutemax
         | 
| 14 14 | 
             
            dependencies: 
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 16 16 | 
             
              name: patir
         | 
| 17 | 
            +
              type: :runtime
         | 
| 17 18 | 
             
              version_requirement: 
         | 
| 18 19 | 
             
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 19 20 | 
             
                requirements: 
         | 
| 20 21 | 
             
                - - ">="
         | 
| 21 22 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 22 | 
            -
                    version: 0.5. | 
| 23 | 
            +
                    version: 0.5.6
         | 
| 23 24 | 
             
                version: 
         | 
| 24 25 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 25 26 | 
             
              name: highline
         | 
| 27 | 
            +
              type: :runtime
         | 
| 26 28 | 
             
              version_requirement: 
         | 
| 27 29 | 
             
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 28 30 | 
             
                requirements: 
         | 
| @@ -32,6 +34,7 @@ dependencies: | |
| 32 34 | 
             
                version: 
         | 
| 33 35 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 34 36 | 
             
              name: mailfactory
         | 
| 37 | 
            +
              type: :runtime
         | 
| 35 38 | 
             
              version_requirement: 
         | 
| 36 39 | 
             
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 37 40 | 
             
                requirements: 
         | 
| @@ -41,6 +44,7 @@ dependencies: | |
| 41 44 | 
             
                version: 
         | 
| 42 45 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 43 46 | 
             
              name: activerecord
         | 
| 47 | 
            +
              type: :runtime
         | 
| 44 48 | 
             
              version_requirement: 
         | 
| 45 49 | 
             
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 46 50 | 
             
                requirements: 
         | 
| @@ -50,6 +54,7 @@ dependencies: | |
| 50 54 | 
             
                version: 
         | 
| 51 55 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 52 56 | 
             
              name: ruport
         | 
| 57 | 
            +
              type: :runtime
         | 
| 53 58 | 
             
              version_requirement: 
         | 
| 54 59 | 
             
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 55 60 | 
             
                requirements: 
         | 
| @@ -59,24 +64,7 @@ dependencies: | |
| 59 64 | 
             
                version: 
         | 
| 60 65 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 61 66 | 
             
              name: acts_as_reportable
         | 
| 62 | 
            -
               | 
| 63 | 
            -
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 64 | 
            -
                requirements: 
         | 
| 65 | 
            -
                - - ">="
         | 
| 66 | 
            -
                  - !ruby/object:Gem::Version 
         | 
| 67 | 
            -
                    version: "0"
         | 
| 68 | 
            -
                version: 
         | 
| 69 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 70 | 
            -
              name: ramaze
         | 
| 71 | 
            -
              version_requirement: 
         | 
| 72 | 
            -
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 73 | 
            -
                requirements: 
         | 
| 74 | 
            -
                - - "="
         | 
| 75 | 
            -
                  - !ruby/object:Gem::Version 
         | 
| 76 | 
            -
                    version: 0.3.9.1
         | 
| 77 | 
            -
                version: 
         | 
| 78 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 79 | 
            -
              name: erubis
         | 
| 67 | 
            +
              type: :runtime
         | 
| 80 68 | 
             
              version_requirement: 
         | 
| 81 69 | 
             
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 82 70 | 
             
                requirements: 
         | 
| @@ -86,63 +74,57 @@ dependencies: | |
| 86 74 | 
             
                version: 
         | 
| 87 75 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 88 76 | 
             
              name: hoe
         | 
| 77 | 
            +
              type: :development
         | 
| 89 78 | 
             
              version_requirement: 
         | 
| 90 79 | 
             
              version_requirements: !ruby/object:Gem::Requirement 
         | 
| 91 80 | 
             
                requirements: 
         | 
| 92 81 | 
             
                - - ">="
         | 
| 93 82 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 94 | 
            -
                    version: 1. | 
| 83 | 
            +
                    version: 1.7.0
         | 
| 95 84 | 
             
                version: 
         | 
| 96 | 
            -
            description: "== DESCRIPTION: rutema is a test execution tool with a twist. It allows you to combine test tools while it takes care of logging, reporting, archiving of results and formalizes execution of automated and manual tests. It's purpose is to make testing in heterogeneous environments easier.   For more information look at http://patir.rubyforge.org/rutema == FEATURES/PROBLEMS: * Unified test execution environment for automated and manual tests * Extensible reports and notifications in various formats (email, rss, pdf, html etc.) * Web frontend and command line report generation tools for browsing the test results database * Comprehensive history of test execution * A well defined way to create a project specific test specification format  == SYNOPSIS: | 
| 85 | 
            +
            description: "== DESCRIPTION: rutema is a test execution tool with a twist. It allows you to combine test tools while it takes care of logging, reporting, archiving of results and formalizes execution of automated and manual tests. It's purpose is to make testing in heterogeneous environments easier.   For more information look at http://patir.rubyforge.org/rutema == FEATURES/PROBLEMS: * Unified test execution environment for automated and manual tests * Extensible reports and notifications in various formats (email, rss, pdf, html etc.) * Web frontend and command line report generation tools for browsing the test results database (with rutemaweb) * Comprehensive history of test execution * A well defined way to create a project specific test specification format  == SYNOPSIS:  See http://patir.rubyforge.org/rutema/distro_test.html for an introductory example.  == REQUIREMENTS: * patir (http://patir.rubyforge.org) * mailfactory (http://rubyforge.org/projects/mailfactory/) * activerecord (http://ar.rubyonrails.com/) * sqlite3 (http://rubyforge.org/projects/sqlite-ruby/) * ruport (http://rubyreports.org/) * acts_as_reportable * highline"
         | 
| 97 86 | 
             
            email: riva@braveworld.net
         | 
| 98 87 | 
             
            executables: 
         | 
| 99 88 | 
             
            - rutemax
         | 
| 100 89 | 
             
            - rutemah
         | 
| 101 | 
            -
            - rutemaweb
         | 
| 102 90 | 
             
            extensions: []
         | 
| 103 91 |  | 
| 104 92 | 
             
            extra_rdoc_files: 
         | 
| 93 | 
            +
            - COPYING.txt
         | 
| 105 94 | 
             
            - History.txt
         | 
| 106 95 | 
             
            - Manifest.txt
         | 
| 107 96 | 
             
            - README.txt
         | 
| 108 | 
            -
            - COPYING.txt
         | 
| 109 97 | 
             
            files: 
         | 
| 98 | 
            +
            - COPYING.txt
         | 
| 110 99 | 
             
            - History.txt
         | 
| 111 100 | 
             
            - Manifest.txt
         | 
| 112 101 | 
             
            - README.txt
         | 
| 113 | 
            -
            - COPYING.txt
         | 
| 114 102 | 
             
            - Rakefile
         | 
| 115 | 
            -
            - bin/rutemax
         | 
| 116 103 | 
             
            - bin/rutemah
         | 
| 117 | 
            -
            - bin/ | 
| 104 | 
            +
            - bin/rutemax
         | 
| 105 | 
            +
            - distro_test.sh
         | 
| 118 106 | 
             
            - lib/rutema/configuration.rb
         | 
| 119 | 
            -
            - lib/rutema/specification.rb
         | 
| 120 | 
            -
            - lib/rutema/system.rb
         | 
| 121 | 
            -
            - lib/rutema/reporter.rb
         | 
| 122 | 
            -
            - lib/rutema/reporter_ar.rb
         | 
| 123 | 
            -
            - lib/rutema/historian.rb
         | 
| 124 | 
            -
            - lib/rutema/model.rb
         | 
| 125 107 | 
             
            - lib/rutema/db.rb
         | 
| 126 108 | 
             
            - lib/rutema/gems.rb
         | 
| 127 | 
            -
            - lib/ | 
| 128 | 
            -
            - lib/ | 
| 129 | 
            -
            - lib/ | 
| 130 | 
            -
            - lib/ | 
| 131 | 
            -
            - lib/ | 
| 132 | 
            -
            - lib/ | 
| 133 | 
            -
            - lib/ | 
| 134 | 
            -
            - lib/ | 
| 135 | 
            -
            -  | 
| 136 | 
            -
            -  | 
| 137 | 
            -
            -  | 
| 138 | 
            -
            -  | 
| 139 | 
            -
            -  | 
| 140 | 
            -
            -  | 
| 141 | 
            -
            - test/ | 
| 142 | 
            -
            - test/ | 
| 143 | 
            -
            - test/ | 
| 144 | 
            -
            - test/ | 
| 145 | 
            -
            - test/ | 
| 109 | 
            +
            - lib/rutema/historian.rb
         | 
| 110 | 
            +
            - lib/rutema/model.rb
         | 
| 111 | 
            +
            - lib/rutema/reporter.rb
         | 
| 112 | 
            +
            - lib/rutema/reporters/activerecord.rb
         | 
| 113 | 
            +
            - lib/rutema/reporters/email.rb
         | 
| 114 | 
            +
            - lib/rutema/reporters/standard_reporters.rb
         | 
| 115 | 
            +
            - lib/rutema/specification.rb
         | 
| 116 | 
            +
            - lib/rutema/system.rb
         | 
| 117 | 
            +
            - selftest.sh
         | 
| 118 | 
            +
            - test/distro_test/config/database.rutema
         | 
| 119 | 
            +
            - test/distro_test/config/database.rutemah
         | 
| 120 | 
            +
            - test/distro_test/config/full.rutema
         | 
| 121 | 
            +
            - test/distro_test/config/jruby.rutema
         | 
| 122 | 
            +
            - test/distro_test/config/jruby.rutemah
         | 
| 123 | 
            +
            - test/distro_test/config/minimal.rutema
         | 
| 124 | 
            +
            - test/distro_test/specs/T001.spec
         | 
| 125 | 
            +
            - test/distro_test/specs/T002.spec
         | 
| 126 | 
            +
            - test/distro_test/specs/T003.spec
         | 
| 127 | 
            +
            - test/distro_test/specs/T004.spec
         | 
| 146 128 | 
             
            - test/rutema.rutema
         | 
| 147 129 | 
             
            - test/rutema.spec
         | 
| 148 130 | 
             
            - test/samples/check.spec
         | 
| @@ -151,13 +133,12 @@ files: | |
| 151 133 | 
             
            - test/samples/test.spec
         | 
| 152 134 | 
             
            - test/samples/tests/no_title.spec
         | 
| 153 135 | 
             
            - test/samples/tests/sample.spec
         | 
| 154 | 
            -
            - test/ | 
| 155 | 
            -
            - test/ | 
| 156 | 
            -
            - test/ | 
| 157 | 
            -
            - test/ | 
| 158 | 
            -
            - test/ | 
| 159 | 
            -
            - test/ | 
| 160 | 
            -
            - test/distro_test/specs/T004.spec
         | 
| 136 | 
            +
            - test/test_configuration.rb
         | 
| 137 | 
            +
            - test/test_historian.rb
         | 
| 138 | 
            +
            - test/test_model.rb
         | 
| 139 | 
            +
            - test/test_reporter.rb
         | 
| 140 | 
            +
            - test/test_specification.rb
         | 
| 141 | 
            +
            - test/test_system.rb
         | 
| 161 142 | 
             
            has_rdoc: true
         | 
| 162 143 | 
             
            homepage: 
         | 
| 163 144 | 
             
            post_install_message: 
         | 
| @@ -181,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 181 162 | 
             
            requirements: []
         | 
| 182 163 |  | 
| 183 164 | 
             
            rubyforge_project: patir
         | 
| 184 | 
            -
            rubygems_version: 1. | 
| 165 | 
            +
            rubygems_version: 1.2.0
         | 
| 185 166 | 
             
            signing_key: 
         | 
| 186 167 | 
             
            specification_version: 2
         | 
| 187 168 | 
             
            summary: rutema is a test execution and management framework for heterogeneous testing environments
         | 
    
        data/bin/rutemaweb
    DELETED
    
    
    
        data/lib/rutemaweb/main.rb
    DELETED
    
    | @@ -1,30 +0,0 @@ | |
| 1 | 
            -
            $:.unshift File.join(File.dirname(__FILE__),"..")
         | 
| 2 | 
            -
            require 'rutemaweb/ramaze_controller'
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            def start_ramaze
         | 
| 5 | 
            -
              logger=Patir.setup_logger
         | 
| 6 | 
            -
              db_file=parse_command_line(ARGV)
         | 
| 7 | 
            -
              db_file=File.expand_path(db_file)
         | 
| 8 | 
            -
              Rutema.connect_to_ar(db_file,logger)  
         | 
| 9 | 
            -
              Ramaze.start :force=>true
         | 
| 10 | 
            -
            end
         | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
            def parse_command_line args
         | 
| 14 | 
            -
              args.options do |opt|
         | 
| 15 | 
            -
                opt.on("Usage:")
         | 
| 16 | 
            -
                opt.on("rutemaweb [options] database_file")
         | 
| 17 | 
            -
                opt.on("Options:")
         | 
| 18 | 
            -
                opt.on("--debug", "-d","Turns on debug messages") { $DEBUG=true }
         | 
| 19 | 
            -
                opt.on("-v", "--version","Displays the version") { $stdout.puts("v#{Version::STRING}");exit 0 }
         | 
| 20 | 
            -
                opt.on("--help", "-h", "-?", "This text") { $stdout.puts opt; exit 0 }
         | 
| 21 | 
            -
                opt.parse!
         | 
| 22 | 
            -
                #and now the rest
         | 
| 23 | 
            -
                if args.empty?
         | 
| 24 | 
            -
                  $stdout.puts opt 
         | 
| 25 | 
            -
                  exit 0
         | 
| 26 | 
            -
                else
         | 
| 27 | 
            -
                  return args.shift
         | 
| 28 | 
            -
                end
         | 
| 29 | 
            -
              end
         | 
| 30 | 
            -
            end
         | 
| Binary file | 
| Binary file | 
| Binary file | 
| Binary file | 
| Binary file | 
| Binary file | 
| Binary file | 
| Binary file | 
| @@ -1,105 +0,0 @@ | |
| 1 | 
            -
            /* CSS Document */
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            /*PAGE LAYOUT*/
         | 
| 4 | 
            -
            body {
         | 
| 5 | 
            -
            	margin-left: 0px;
         | 
| 6 | 
            -
            	margin-top: 0px;
         | 
| 7 | 
            -
            	margin-right: 0px;
         | 
| 8 | 
            -
            	margin-bottom: 0px;
         | 
| 9 | 
            -
            }
         | 
| 10 | 
            -
            table {
         | 
| 11 | 
            -
            	font: 0.9em Tahoma, sans-serif;
         | 
| 12 | 
            -
            	color: #666666;
         | 
| 13 | 
            -
            	text-align: center;
         | 
| 14 | 
            -
            	
         | 
| 15 | 
            -
            }
         | 
| 16 | 
            -
            #logo{float:left; background-image:url(/tie_logo.gif); width:234px; height:213px;}
         | 
| 17 | 
            -
            #topheader{float:right; width:566px; height:97px; background-color:#F0F0F0; position:relative}
         | 
| 18 | 
            -
            #toplinks{position:absolute; right:10px; top:10px;}
         | 
| 19 | 
            -
            #menu{float:right; width:566px; height:32px; background-image:url(/bg_menu.gif); background-repeat:repeat-x;}
         | 
| 20 | 
            -
            #submenu{float:right; width:566px; height:32px; background-image:url(/bg_submenu.gif); background-position:top; background-repeat:repeat-x;}
         | 
| 21 | 
            -
            #contenttext{float:right; width:566px;}
         | 
| 22 | 
            -
            #contentnopanel{float:left; width:800px}
         | 
| 23 | 
            -
            #leftpanel{float:left; width:234px;}
         | 
| 24 | 
            -
            #footer{float:left; width:800px; background-color:#F0F0F0; padding:10px;}
         | 
| 25 | 
            -
            #footernopanel{float:left; width:800px; background-color:#F0F0F0; padding:10px;}
         | 
| 26 | 
            -
            /*GRAY PANEL*/
         | 
| 27 | 
            -
            .graypanel{
         | 
| 28 | 
            -
            	border:solid 1px #666666; background-color:#F7F7F7; padding:10px; margin:10px;
         | 
| 29 | 
            -
            }
         | 
| 30 | 
            -
             | 
| 31 | 
            -
            /*TEXT STYLES*/
         | 
| 32 | 
            -
            .bodytext {
         | 
| 33 | 
            -
            	font: 0.9em Tahoma, sans-serif;
         | 
| 34 | 
            -
            	color: #666666;
         | 
| 35 | 
            -
            }
         | 
| 36 | 
            -
             | 
| 37 | 
            -
            .titletext {
         | 
| 38 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 39 | 
            -
            	font-size:26px;
         | 
| 40 | 
            -
            	font-weight:bold;
         | 
| 41 | 
            -
            	color:#CC0000;
         | 
| 42 | 
            -
            }
         | 
| 43 | 
            -
            .whitetitle {
         | 
| 44 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 45 | 
            -
            	font-size:36px;
         | 
| 46 | 
            -
            	font-weight:bold;
         | 
| 47 | 
            -
            	color:#FFFFFF;
         | 
| 48 | 
            -
            }
         | 
| 49 | 
            -
            .smalltitle {
         | 
| 50 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 51 | 
            -
            	font-size:20px;
         | 
| 52 | 
            -
            	font-weight:bold;
         | 
| 53 | 
            -
            	color:#CC0000;
         | 
| 54 | 
            -
            }
         | 
| 55 | 
            -
            .smallwhitetext {
         | 
| 56 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 57 | 
            -
            	font-size: 11px;
         | 
| 58 | 
            -
            	font-weight:bold;
         | 
| 59 | 
            -
            	color: #FFFFFF;
         | 
| 60 | 
            -
            }
         | 
| 61 | 
            -
            .smallwhitetext a{
         | 
| 62 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 63 | 
            -
            	font-size: 11px;
         | 
| 64 | 
            -
            	font-weight:bold;
         | 
| 65 | 
            -
            	color: #FFFFFF;
         | 
| 66 | 
            -
            	text-decoration:none;
         | 
| 67 | 
            -
            }
         | 
| 68 | 
            -
            .smallwhitetext a:hover{
         | 
| 69 | 
            -
            	text-decoration:underline;
         | 
| 70 | 
            -
            }
         | 
| 71 | 
            -
            .smallgraytext {
         | 
| 72 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 73 | 
            -
            	font-size: 11px;
         | 
| 74 | 
            -
            	font-weight:bold;
         | 
| 75 | 
            -
            	color:#999999;
         | 
| 76 | 
            -
            }
         | 
| 77 | 
            -
            .smallgraytext a{
         | 
| 78 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 79 | 
            -
            	font-size: 11px;
         | 
| 80 | 
            -
            	font-weight:bold;
         | 
| 81 | 
            -
            	color:#999999;
         | 
| 82 | 
            -
            	text-decoration:none;
         | 
| 83 | 
            -
            }
         | 
| 84 | 
            -
            .smallgraytext a:hover{
         | 
| 85 | 
            -
            	text-decoration:underline;
         | 
| 86 | 
            -
            }
         | 
| 87 | 
            -
            .smallredtext {
         | 
| 88 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 89 | 
            -
            	font-size: 11px;
         | 
| 90 | 
            -
            	font-weight:bold;
         | 
| 91 | 
            -
            	color:#CC0000;
         | 
| 92 | 
            -
            }
         | 
| 93 | 
            -
            .smallredtext a{
         | 
| 94 | 
            -
            	font: 0.7em Tahoma, sans-serif;
         | 
| 95 | 
            -
            	font-size: 11px;
         | 
| 96 | 
            -
            	font-weight:bold;
         | 
| 97 | 
            -
            	color:#CC0000;
         | 
| 98 | 
            -
            	text-decoration:none;
         | 
| 99 | 
            -
            }
         | 
| 100 | 
            -
            .smallredtext a:hover{
         | 
| 101 | 
            -
            	text-decoration:underline;
         | 
| 102 | 
            -
            }
         | 
| 103 | 
            -
            .vtable tr td {
         | 
| 104 | 
            -
            	text-align: left;
         | 
| 105 | 
            -
            }
         | 
| Binary file | 
| @@ -1,150 +0,0 @@ | |
| 1 | 
            -
            #  Copyright (c) 2008 Vassilis Rizopoulos. All rights reserved.
         | 
| 2 | 
            -
            $:.unshift File.join(File.dirname(__FILE__),"..")
         | 
| 3 | 
            -
            require 'rutema/system'
         | 
| 4 | 
            -
            require 'rutemaweb/ruport_formatter.rb'
         | 
| 5 | 
            -
            require 'rutema/gems'
         | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
            module Rutema
         | 
| 9 | 
            -
              module UI
         | 
| 10 | 
            -
                class MainController < Ramaze::Controller
         | 
| 11 | 
            -
                  map '/'
         | 
| 12 | 
            -
                  engine :Erubis
         | 
| 13 | 
            -
                  layout :layout
         | 
| 14 | 
            -
                  #Time format to use for the start and stop times
         | 
| 15 | 
            -
                  TIME_FORMAT="%y%m%d - %H:%M:%S"
         | 
| 16 | 
            -
                  #image filename to use for succesfull scenarios
         | 
| 17 | 
            -
                  IMG_SCE_OK="/run_ok.png"
         | 
| 18 | 
            -
                  #image filename to use for failed scenarios
         | 
| 19 | 
            -
                  IMG_SCE_ERROR="/run_error.png"
         | 
| 20 | 
            -
                  #image filename to use for unexecuted scenarios
         | 
| 21 | 
            -
                  IMG_SCE_WARN="/run_warn.png"
         | 
| 22 | 
            -
                  #image filename to use for succesfull steps
         | 
| 23 | 
            -
                  IMG_STEP_OK="/step_ok.png"
         | 
| 24 | 
            -
                  #image filename to use for failed steps
         | 
| 25 | 
            -
                  IMG_STEP_ERROR="/step_error.png"
         | 
| 26 | 
            -
                  #image filename to use for unexecuted steps
         | 
| 27 | 
            -
                  IMG_STEP_WARN="/step_warn.png"
         | 
| 28 | 
            -
                  def index
         | 
| 29 | 
            -
                    @panel_content=panel_content(:runs)
         | 
| 30 | 
            -
                    @content="<p>This is the rutema web interface.<br/>It allows you to browse the contents of the test results database.</p><p>Currently you can view the results for each separate run, the results for a specific scenario (a complete list of all steps executed in the scenario with standard and error output logs) or the complete execution history of a scenario.</p>"
         | 
| 31 | 
            -
                  end
         | 
| 32 | 
            -
                  def run run_id=""
         | 
| 33 | 
            -
                    @panel_content=panel_content(:runs)
         | 
| 34 | 
            -
                    if !run_id.empty?
         | 
| 35 | 
            -
                      @content=single_run(run_id)
         | 
| 36 | 
            -
                    end
         | 
| 37 | 
            -
                  end
         | 
| 38 | 
            -
                  def scenario scenario_id=""
         | 
| 39 | 
            -
                    @panel_content=panel_content(:scenarios)
         | 
| 40 | 
            -
                    if !scenario_id.empty?
         | 
| 41 | 
            -
                      if scenario_id.to_i==0
         | 
| 42 | 
            -
                        @content=scenario_by_name(scenario_id)
         | 
| 43 | 
            -
                      else
         | 
| 44 | 
            -
                        @content=scenario_in_a_run(scenario_id)
         | 
| 45 | 
            -
                      end
         | 
| 46 | 
            -
                    end
         | 
| 47 | 
            -
                  end
         | 
| 48 | 
            -
                  private 
         | 
| 49 | 
            -
                  #Renders the summary of all runs for a single scenario
         | 
| 50 | 
            -
                  def scenario_by_name scenario_id
         | 
| 51 | 
            -
                    ret=""
         | 
| 52 | 
            -
                    begin
         | 
| 53 | 
            -
                      table=Rutema::Model::Scenario.report_table(:all,:conditions=>["name = :spec_name",{:spec_name=>scenario_id}])
         | 
| 54 | 
            -
                      if table.empty?
         | 
| 55 | 
            -
                        ret="<p>no results for #{scenario_id}</p>"
         | 
| 56 | 
            -
                      else
         | 
| 57 | 
            -
                        table.replace_column("status") do |r| 
         | 
| 58 | 
            -
                          scenario_status_snippet(r)
         | 
| 59 | 
            -
                        end
         | 
| 60 | 
            -
                        table.replace_column("version") {|r| r.version ? r.version : "N/A"}
         | 
| 61 | 
            -
                        table.replace_column("start_time"){|r| r.stop_time ? r.start_time.strftime(TIME_FORMAT) : nil}
         | 
| 62 | 
            -
                        table.replace_column("stop_time"){|r| r.stop_time.strftime(TIME_FORMAT)}
         | 
| 63 | 
            -
                        table.reorder("status","run_id","version","start_time","stop_time")
         | 
| 64 | 
            -
                        ret<<table.to_html
         | 
| 65 | 
            -
                      end
         | 
| 66 | 
            -
                    rescue
         | 
| 67 | 
            -
                      puts $!
         | 
| 68 | 
            -
                      "<p>could not retrieve data for #{scenario_id}</p>"
         | 
| 69 | 
            -
                    end
         | 
| 70 | 
            -
                    return ret
         | 
| 71 | 
            -
                  end
         | 
| 72 | 
            -
                  #Renders the information for a specific executed scenario
         | 
| 73 | 
            -
                  #giving a detailed list of the steps, with status and output
         | 
| 74 | 
            -
                  def scenario_in_a_run scenario_id
         | 
| 75 | 
            -
                    table=Rutema::Model::Step.report_table(:all,:conditions=>["scenario_id = :scenario_id",{:scenario_id=>scenario_id}])
         | 
| 76 | 
            -
                    if table.empty?
         | 
| 77 | 
            -
                      ret="<p>no results for #{scenario_id}</p>"
         | 
| 78 | 
            -
                    else
         | 
| 79 | 
            -
                      table.replace_column("status") do |r| 
         | 
| 80 | 
            -
                        img_src=IMG_STEP_WARN if "not_executed"==r.status
         | 
| 81 | 
            -
                        img_src=IMG_STEP_OK if "success"==r.status
         | 
| 82 | 
            -
                        img_src=IMG_STEP_ERROR if "error"==r.status
         | 
| 83 | 
            -
                        "<img src=\"#{img_src}\" align=\"center\"/>"
         | 
| 84 | 
            -
                      end
         | 
| 85 | 
            -
                      ret=table.to_vhtml
         | 
| 86 | 
            -
                    end
         | 
| 87 | 
            -
                    return ret
         | 
| 88 | 
            -
                  end
         | 
| 89 | 
            -
                  #will render a hash in a table of key||value rows 
         | 
| 90 | 
            -
                  def context_table context
         | 
| 91 | 
            -
                    ret="<table><tr>"
         | 
| 92 | 
            -
                    context.each do |k,v|
         | 
| 93 | 
            -
                      ret<<"<td>#{k.to_s}</td><td>#{v.to_s}</td>"
         | 
| 94 | 
            -
                    end
         | 
| 95 | 
            -
                    ret<<"</tr></table>"
         | 
| 96 | 
            -
                  end
         | 
| 97 | 
            -
                  #Renders the information for a single run providing the context and a list of the scenarios
         | 
| 98 | 
            -
                  def single_run run_id
         | 
| 99 | 
            -
                    ret=""
         | 
| 100 | 
            -
                    begin
         | 
| 101 | 
            -
                      run=Rutema::Model::Run.find(run_id)
         | 
| 102 | 
            -
                    rescue
         | 
| 103 | 
            -
                      return "Could not find #{run_id}"
         | 
| 104 | 
            -
                    end
         | 
| 105 | 
            -
                    if run.context
         | 
| 106 | 
            -
                      ret<<context_table(run.context)
         | 
| 107 | 
            -
                    end
         | 
| 108 | 
            -
                    table=Rutema::Model::Scenario.report_table(:all,:conditions=>["run_id = :run_id",{:run_id=>run_id}],:except=>["run_id"])
         | 
| 109 | 
            -
                    if table.empty?
         | 
| 110 | 
            -
                      return "No scenarios for run #{run_id}"
         | 
| 111 | 
            -
                    else
         | 
| 112 | 
            -
                      table.replace_column("status") do |r| 
         | 
| 113 | 
            -
                        scenario_status_snippet(r)
         | 
| 114 | 
            -
                      end
         | 
| 115 | 
            -
                      table.replace_column("version") {|r| r.version ? r.version : "N/A"}
         | 
| 116 | 
            -
                      table.replace_column("start_time"){|r| r.stop_time ? r.start_time.strftime(TIME_FORMAT) : nil}
         | 
| 117 | 
            -
                      table.replace_column("stop_time"){|r| r.stop_time.strftime(TIME_FORMAT)}
         | 
| 118 | 
            -
                      table.reorder("status","name","version","start_time","stop_time")
         | 
| 119 | 
            -
                      ret<<table.to_html
         | 
| 120 | 
            -
                    end
         | 
| 121 | 
            -
                    return ret
         | 
| 122 | 
            -
                  end
         | 
| 123 | 
            -
                  #Gives the HTML to use for the status column of a scenario list
         | 
| 124 | 
            -
                  def scenario_status_snippet r
         | 
| 125 | 
            -
                    if "not_executed"==r.status
         | 
| 126 | 
            -
                      "<img src=\"#{IMG_SCE_WARN}\"  align=\"center\"/>"
         | 
| 127 | 
            -
                    else
         | 
| 128 | 
            -
                      img_src=IMG_SCE_OK if "success"==r.status
         | 
| 129 | 
            -
                      img_src=IMG_SCE_ERROR if "error"==r.status
         | 
| 130 | 
            -
                      "<a href=\"/scenario/#{r.data["id"]}\"><img src=\"#{img_src}\" align=\"center\"/></a>"
         | 
| 131 | 
            -
                    end
         | 
| 132 | 
            -
                  end
         | 
| 133 | 
            -
                  def panel_content context
         | 
| 134 | 
            -
                    ret=""
         | 
| 135 | 
            -
                    if context==:runs
         | 
| 136 | 
            -
                      #<img src="run_error.png" align="center"/><a href="index.html" class="smallgraytext">1 - 28.06.2007</a>
         | 
| 137 | 
            -
                      Rutema::Model::Run.find(:all,:select=>"id").reverse.each do |r|
         | 
| 138 | 
            -
                        ret<<"<a class=\"smallgreytext\" href=\"/run/#{r.id}\">Run #{r.id}</a><br/>"
         | 
| 139 | 
            -
                      end
         | 
| 140 | 
            -
                    elsif context==:scenarios
         | 
| 141 | 
            -
                      result=Rutema::Model::Scenario.find(:all).collect{|r| r.name}
         | 
| 142 | 
            -
                      result.uniq.sort.each do |r|
         | 
| 143 | 
            -
                        ret<<"<a class=\"smallgreytext\" href=\"/scenario/#{r}\">#{r}</a><br/>"
         | 
| 144 | 
            -
                      end
         | 
| 145 | 
            -
                    end
         | 
| 146 | 
            -
                    return ret
         | 
| 147 | 
            -
                  end
         | 
| 148 | 
            -
                end
         | 
| 149 | 
            -
              end
         | 
| 150 | 
            -
            end
         | 
| @@ -1,29 +0,0 @@ | |
| 1 | 
            -
            $:.unshift File.join(File.dirname(__FILE__),"..")
         | 
| 2 | 
            -
            require 'rutema/gems'
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            # Create a new table for each record and a row for each record element
         | 
| 5 | 
            -
            class VerticalTableFormatter < Ruport::Formatter::HTML 
         | 
| 6 | 
            -
              
         | 
| 7 | 
            -
              renders :vhtml, :for => Ruport::Controller::Table
         | 
| 8 | 
            -
              
         | 
| 9 | 
            -
              def build_table_body
         | 
| 10 | 
            -
                data.each do |row|
         | 
| 11 | 
            -
                  build_row(row)
         | 
| 12 | 
            -
                end
         | 
| 13 | 
            -
              end
         | 
| 14 | 
            -
              
         | 
| 15 | 
            -
              def build_table_header
         | 
| 16 | 
            -
              end
         | 
| 17 | 
            -
              
         | 
| 18 | 
            -
              def build_table_footer
         | 
| 19 | 
            -
              end
         | 
| 20 | 
            -
              
         | 
| 21 | 
            -
              def build_row(data = self.data)
         | 
| 22 | 
            -
                output << "<table class=\"vtable\"><colgroup><col width=\"100\"><col></colgroup>\n"
         | 
| 23 | 
            -
                output << "<tr><td colspan=\"2\"><em>#{data['name']}</em></td></tr>"
         | 
| 24 | 
            -
                %w(status duration).each { |k| output << "<tr><td>#{k}:</td><td>#{data.get(k)}</td></tr>\n" }
         | 
| 25 | 
            -
                %w(output error).each { |k| output << "<tr><td colspan=\"2\">#{k}:</td></tr><tr><td colspan=\"2\"><pre>#{data.get(k)}</pre></td></tr>\n" if data.get(k).size > 0 }
         | 
| 26 | 
            -
                output << "</table>\n"
         | 
| 27 | 
            -
              end
         | 
| 28 | 
            -
              
         | 
| 29 | 
            -
            end
         | 
| @@ -1,47 +0,0 @@ | |
| 1 | 
            -
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         | 
| 2 | 
            -
            <html xmlns="http://www.w3.org/1999/xhtml">
         | 
| 3 | 
            -
            <head>
         | 
| 4 | 
            -
            	<meta name="author" content="Vassilis Rizopoulos" />
         | 
| 5 | 
            -
            	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
         | 
| 6 | 
            -
            	<link rel="stylesheet" href="/style.css" type="text/css" />
         | 
| 7 | 
            -
            	<title>Rutema Historian</title>
         | 
| 8 | 
            -
            </head>
         | 
| 9 | 
            -
            <body>
         | 
| 10 | 
            -
            	<div id="page" align="center">
         | 
| 11 | 
            -
            		<div id="content" style="width:800px">
         | 
| 12 | 
            -
            			<div id="logo">
         | 
| 13 | 
            -
            				<div style="margin-top:70px" class="whitetitle">rutema</div>
         | 
| 14 | 
            -
            			</div>
         | 
| 15 | 
            -
            			<div id="topheader">
         | 
| 16 | 
            -
            				<div align="left" class="bodytext">
         | 
| 17 | 
            -
            				</div>
         | 
| 18 | 
            -
            				<div id="toplinks" class="smallgraytext">
         | 
| 19 | 
            -
            				</div>
         | 
| 20 | 
            -
            			</div>
         | 
| 21 | 
            -
            			<div id="menu">
         | 
| 22 | 
            -
            				<div align="right" class="smallwhitetext" style="padding:9px;">
         | 
| 23 | 
            -
            					<a href="/">Home</a> | <a href="/run">Runs</a> | <a href="/scenario">Scenarios</a>
         | 
| 24 | 
            -
            				</div>
         | 
| 25 | 
            -
            			</div>
         | 
| 26 | 
            -
            			<div id="submenu">
         | 
| 27 | 
            -
            				<div align="right" class="smallgraytext" style="padding:9px;"></div>
         | 
| 28 | 
            -
            			</div>
         | 
| 29 | 
            -
            			<div id="contenttext">
         | 
| 30 | 
            -
            				<div style="padding:10px">
         | 
| 31 | 
            -
            					<span class="titletext">Summary</span>
         | 
| 32 | 
            -
            				</div>
         | 
| 33 | 
            -
            				<div class="bodytext" style="padding:12px;" align="justify"><%=@content%></div>
         | 
| 34 | 
            -
            			</div>
         | 
| 35 | 
            -
            			<div id="leftpanel">
         | 
| 36 | 
            -
            				<div align="justify" class="graypanel">
         | 
| 37 | 
            -
            					<%=@panel_content%>
         | 
| 38 | 
            -
            				</div>
         | 
| 39 | 
            -
            			</div>
         | 
| 40 | 
            -
            			<div id="footer" class="smallgraytext">
         | 
| 41 | 
            -
            				<a href="/">Home</a> | <a href="http://patir.rubyforge.org/rutema">about rutema</a> | 
         | 
| 42 | 
            -
            				© 2008 <a href="http://www.braveworld.net/riva" target="_blank">Vassilis Rizopoulos</a> 
         | 
| 43 | 
            -
            			</div>
         | 
| 44 | 
            -
            		</div>
         | 
| 45 | 
            -
            	</div>
         | 
| 46 | 
            -
            </body>
         | 
| 47 | 
            -
            </html>
         |