如何将HP Quality Center与rails集成?

时间:2012-09-20 09:02:27

标签: ruby-on-rails ruby qc

我想将HP qc与我的rails应用程序集成在Linux操作系统上,是否有人在任何api或ruby gem上工作?

提前致谢。

Anurag Saxena。

2 个答案:

答案 0 :(得分:0)

我猜QC OTA库存在一些限制,阻止了使用ROR直接实现。但似乎有一种解决方法。看看下面的链接。

Rails App Integration with HPQC (HP Quality Centre)

答案 1 :(得分:0)

结帐这篇文章:

Rails Activeresource Integration

我已经重写了应用程序控制器,如下所示:

class ApplicationController < ActionController::Base
  protect_from_forgery
  helper_method :Sessions

  $HPQC_HOST = "http://hpqc.example.com:8080"
  $HPQC_REST_URL = "#{$HPQC_HOST}/qcbin/rest/domains/<your_domain>/projects/<your_project>"
  $HPQC_LOGIN_URL = "#{$HPQC_HOST}/qcbin/authentication-point/authenticate"
  $HPQC_LOGOUT_URL = "#{$HPQC_HOST}/qcbin/authentication-point/logout"


  def allow_cross_domain_access
    response.headers["Access-Control-Allow-Origin"] = "*"
    response.headers["Access-Control-Allow-Methods"] = "*"
    response.headers["Access-Control-Allow-Headers"] = "x-requested-with"
  end

  def getAuthenticatedCurl
    @conn = Curl::Easy.new($HPQC_LOGIN_URL)
    @conn.verbose = true
    @conn.http_auth_types = :basic
    @conn.userpwd = '<your_username>:<your_password>'
    @conn.enable_cookies = true
    @conn.cookiejar = 'cookies.txt'
    @conn.perform #creates the first cookie instance, which allows subsequent calls to the HPQC API
    #return _conn
    puts "connected...."
  end
end

简单地说,这些方法是您的RoR应用程序的ApplicationController,然后从每个控制器调用它们来访问HPQC。然后构建一个XML请求并使用Curl :: Easy Gem(即@ conn.post_body)将请求发布到HPQC。

我打算构建一个HPQC Gem来配置和初始化HPQC请求,但这需要我一点时间!