polarion

package
v0.0.0-...-d8b41f4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XunitEndpoint    = "/xunit"
	JobQueueEndpoint = "/xunit-queue"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string, debug bool) *Client

func (*Client) LogIn

func (c *Client) LogIn(username, password string) (*LogInEnvelopResponse, error)

type CreatePlanRequest

type CreatePlanRequest struct {
	ProjectID  string `xml:"plan:projectId"`
	Name       string `xml:"plan:name"`
	ID         string `xml:"plan:id"`
	ParentID   string `xml:"plan:parentId,omitempty"`
	TemplateID string `xml:"plan:templateId"`
}

type CreatePlanRequestBody

type CreatePlanRequestBody struct {
	PlanNS     string            `xml:"xmlns:plan,attr"`
	CreatePlan CreatePlanRequest `xml:"plan:createPlan"`
}

func NewCreatePlanRequest

func NewCreatePlanRequest(projectID, name, id, parentID, templateID string) *CreatePlanRequestBody

type CreatePlanResponseBody

type CreatePlanResponseBody struct {
	FaultBody
}

type CreateTestRunRequest

type CreateTestRunRequest struct {
	Project  string `xml:"tes:project"`
	ID       string `xml:"tes:id"`
	Template string `xml:"tes:template,omitempty"`
}

type CreateTestRunRequestBody

type CreateTestRunRequestBody struct {
	TesNS         string               `xml:"xmlns:tes,attr"`
	CreateTestRun CreateTestRunRequest `xml:"tes:createTestRun"`
}

func NewCreateTestRunRequest

func NewCreateTestRunRequest(projectID, id, templateID string) *CreateTestRunRequestBody

type CreateTestRunResponseBody

type CreateTestRunResponseBody struct {
	URI string `xml:"createTestRunResponse>createTestRunReturn"`
	FaultBody
}

type EnumOptionId

type EnumOptionId struct {
	ID string `xml:"trac:id"`
}

type Fault

type Fault struct {
	Faultcode   string `xml:"faultcode"`
	Faultstring string `xml:"faultstring"`
}

type FaultBody

type FaultBody struct {
	Fault Fault `xml:"Fault"`
}

type GetPlanByIDRequest

type GetPlanByIDRequest struct {
	ProjectID string `xml:"plan:projectId"`
	ID        string `xml:"plan:id"`
}

type GetPlanByIDRequestBody

type GetPlanByIDRequestBody struct {
	PlanNS      string             `xml:"xmlns:plan,attr"`
	GetPlanByID GetPlanByIDRequest `xml:"plan:getPlanById"`
}

func NewGetPlanByIDRequest

func NewGetPlanByIDRequest(projectID, id string) *GetPlanByIDRequestBody

type GetPlanByIDResponseBody

type GetPlanByIDResponseBody struct {
	Plan Plan `xml:"getPlanByIdResponse>getPlanByIdReturn"`
	FaultBody
}

type GetTestRunByIDRequest

type GetTestRunByIDRequest struct {
	ProjectID string `xml:"tes:projectId"`
	ID        string `xml:"tes:id"`
}

type GetTestRunByIDRequestBody

type GetTestRunByIDRequestBody struct {
	TesNS          string                `xml:"xmlns:tes,attr"`
	GetTestRunByID GetTestRunByIDRequest `xml:"tes:getTestRunById"`
}

func NewGetTestRunByIDRequest

func NewGetTestRunByIDRequest(projectID, id string) *GetTestRunByIDRequestBody

type GetTestRunByIDResponseBody

type GetTestRunByIDResponseBody struct {
	TestRun TestRun `xml:"getTestRunByIdResponse>getTestRunByIdReturn"`
	FaultBody
}

type LogInEnvelopResponse

type LogInEnvelopResponse struct {
	XMLName xml.Name            `xml:"Envelope"`
	Header  LogInResponseHeader `xml:"Header"`
	Body    FaultBody           `xml:"Body"`
}

type LogInRequest

type LogInRequest struct {
	XMLName xml.Name         `xml:"soapenv:Envelope"`
	SoapNS  string           `xml:"xmlns:soapenv,attr"`
	SesNS   string           `xml:"xmlns:ses,attr"`
	Header  struct{}         `xml:"soapenv:Header"`
	Body    LogInRequestBody `xml:"soapenv:Body"`
}

func NewLogInRequest

func NewLogInRequest(s LogInRequestBodyLogIn) *LogInRequest

type LogInRequestBody

type LogInRequestBody struct {
	LogIn LogInRequestBodyLogIn `xml:"ses:logIn"`
}

type LogInRequestBodyLogIn

type LogInRequestBodyLogIn struct {
	UserName string `xml:"ses:userName"`
	Password string `xml:"ses:password"`
}

type LogInResponseHeader

type LogInResponseHeader struct {
	SessionID string `xml:"sessionID"`
}

type Plan

type Plan struct {
	ID         string `xml:"id"`
	IsTemplate bool   `xml:"isTemplate"`
	Name       string `xml:"name"`
	Status     Status `xml:"status"`
	Parent     *Plan  `xml:"parent"`
}

type PolarionSessionService

type PolarionSessionService interface {
	GetPlanByID(projectID, id string) (*Plan, error)
	CreatePlan(projectID, name, id, parentID, templateID string) error
	GetTestRunByID(projectID, id string) (*TestRun, error)
	CreateTestRun(projectID, id, templateID string) (string, error)
	UpdateTestRun(uri string, title string, isTemplate bool, plannedIn string) error
}

type PolarionXUnit

type PolarionXUnit struct {
	XMLName    xml.Name                  `xml:"testsuites"`
	Properties []formatter.JUnitProperty `xml:"properties>property,omitempty"`
	Suites     []PolarionXUnitTestSuite
}

func JUnitToPolarionXUnit

func JUnitToPolarionXUnit(junit *formatter.JUnitTestSuite, projectID, title, templateID string) (*PolarionXUnit, error)

type PolarionXUnitTestCase

type PolarionXUnitTestCase struct {
	formatter.JUnitTestCase

	Properties []formatter.JUnitProperty `xml:"properties>property,omitempty"`
}

type PolarionXUnitTestSuite

type PolarionXUnitTestSuite struct {
	formatter.JUnitTestSuite

	TestCases []PolarionXUnitTestCase `xml:"testcase"`
}

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(username, password, url string, debug bool) (*Session, error)

func (*Session) CreatePlan

func (s *Session) CreatePlan(projectID, name, id, parentID, templateID string) error

func (*Session) CreateTestRun

func (s *Session) CreateTestRun(projectID, id, templateID string) (string, error)

func (*Session) GetPlanByID

func (s *Session) GetPlanByID(projectID, id string) (*Plan, error)

func (*Session) GetTestRunByID

func (s *Session) GetTestRunByID(projectID, id string) (*TestRun, error)

func (*Session) UpdateTestRun

func (s *Session) UpdateTestRun(uri string, title string, isTemplate bool, plannedIn string) error

type SessionRequest

type SessionRequest struct {
	XMLName xml.Name             `xml:"soapenv:Envelope"`
	SoapNS  string               `xml:"xmlns:soapenv,attr"`
	Header  SessionRequestHeader `xml:"soapenv:Header"`
	Body    interface{}          `xml:"soapenv:Body"`
}

func NewSessionRequest

func NewSessionRequest(sessionID string, body interface{}) *SessionRequest

type SessionRequestHeader

type SessionRequestHeader struct {
	SesNS     string `xml:"xmlns:ses,attr"`
	SessionID string `xml:"ses:sessionID"`
}

type SessionResponse

type SessionResponse struct {
	Header struct{}    `xml:"Header"`
	Body   interface{} `xml:"Body"`
}

type Status

type Status struct {
	ID string `xml:"id"`
}

type TestRun

type TestRun struct {
	ID         string `xml:"id"`
	IsTemplate bool   `xml:"isTemplate"`
	Title      string `xml:"title"`
	Status     Status `xml:"status"`
}

type UpdateTestRunRequest

type UpdateTestRunRequest struct {
	URI          string                            `xml:"uri,attr"`
	Title        string                            `xml:"tes1:title,omitempty"`
	IsTemplate   bool                              `xml:"tes1:isTemplate,omitempty"`
	CustomFields []UpdateTestRunRequestCustomField `xml:"tes1:customFields>trac:Custom,omitempty"`
}

type UpdateTestRunRequestBody

type UpdateTestRunRequestBody struct {
	TesNS         string               `xml:"xmlns:tes,attr"`
	Tes1NS        string               `xml:"xmlns:tes1,attr"`
	TracNS        string               `xml:"xmlns:trac,attr"`
	UpdateTestRun UpdateTestRunRequest `xml:"tes:updateTestRun>tes:content"`
}

func NewUpdateTestRunRequest

func NewUpdateTestRunRequest(uri string, title string, isTemplate bool, plannedIn string) *UpdateTestRunRequestBody

type UpdateTestRunRequestCustomField

type UpdateTestRunRequestCustomField struct {
	Key   string      `xml:"trac:key"`
	Value interface{} `xml:"trac:value"`
}

type UpdateTestRunResponseBody

type UpdateTestRunResponseBody struct {
	FaultBody
}

type XUnitImportResponse

type XUnitImportResponse struct {
	Files struct {
		File struct {
			JobIDs []int `json:"job-ids"`
		} `json:"file.xml"`
	} `json:"files"`
}

type XUnitImporter

type XUnitImporter struct {
	// contains filtered or unexported fields
}

func NewXUnitImporter

func NewXUnitImporter(url, username, password string) *XUnitImporter

func (*XUnitImporter) GetJobStatus

func (x *XUnitImporter) GetJobStatus(id int) (XUnitJobStatus, error)

func (*XUnitImporter) Import

func (x *XUnitImporter) Import(xunit *PolarionXUnit) (int, error)

type XUnitImporterService

type XUnitImporterService interface {
	Import(xunit *PolarionXUnit) (int, error)
	GetJobStatus(id int) (XUnitJobStatus, error)
}

type XUnitJobStatus

type XUnitJobStatus string
const (
	ReadyStatus   XUnitJobStatus = "READY"
	RunningStatus XUnitJobStatus = "RUNNING"
	SuccessStatus XUnitJobStatus = "SUCCESS"
)

type XUnitJobStatusRespons

type XUnitJobStatusRespons struct {
	Jobs []struct {
		Status XUnitJobStatus `json:"status"`
	} `json:"jobs"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL