0

HP qcを私のrailsアプリケーションと統合したいのですが、Linux OSで、誰かがapiまたはruby gemに取り組んでいますか?

前もって感謝します。

アヌラグサクセナ。

4

2 に答える 2

0

QC OTAライブラリには、RORを直接実装できないという制限があると思います。しかし、回避策があるようです。以下のリンクをチェックしてください。

RailsアプリとHPQCの統合(HP Quality Centre)

于 2012-11-15T07:08:42.657 に答える
0

この投稿をチェックアウト:

RailsActiveresource統合

それ以来、アプリケーションコントローラーを次のように書き直しました。

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リクエストを構成および初期化するためにHPQCGemを構築する予定ですが、少し時間がかかります。

于 2013-01-29T16:58:55.363 に答える