generator

package
v0.0.16 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2023 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCodeGenerators

func GetCodeGenerators() (result map[string]CodeGenerator)

func GetTestSuiteConverters

func GetTestSuiteConverters() (result map[string]TestSuiteConverter)

func RegisterCodeGenerator

func RegisterCodeGenerator(name string, generator CodeGenerator)

func RegisterTestSuiteConverter

func RegisterTestSuiteConverter(name string, converter TestSuiteConverter)

Types

type BoolProp

type BoolProp struct {
	Name  string `xml:"name,attr"`
	Value string `xml:",chardata"`
}

type CodeGenerator

type CodeGenerator interface {
	Generate(testSuite *testing.TestSuite, testcase *testing.TestCase) (result string, err error)
}

CodeGenerator is the interface of code generator

func GetCodeGenerator

func GetCodeGenerator(name string) CodeGenerator

func NewCurlGenerator added in v0.0.14

func NewCurlGenerator() CodeGenerator

func NewGolangGenerator

func NewGolangGenerator() CodeGenerator

func NewGrpcPayloadGenerator added in v0.0.15

func NewGrpcPayloadGenerator() CodeGenerator

type CollectionProp

type CollectionProp struct {
	Name        string        `xml:"name,attr"`
	ElementProp []ElementProp `xml:"elementProp"`
}

type ElementProp

type ElementProp struct {
	Name           string           `xml:"name,attr"`
	Type           string           `xml:"elementType,attr"`
	GUIClass       string           `xml:"guiclass,attr"`
	TestClass      string           `xml:"testclass,attr"`
	Enabled        bool             `xml:"enabled,attr"`
	StringProp     []StringProp     `xml:"stringProp"`
	BoolProp       []BoolProp       `xml:"boolProp"`
	CollectionProp []CollectionProp `xml:"collectionProp"`
}

type HTTPSamplerProxy

type HTTPSamplerProxy struct {
	XMLName     xml.Name      `xml:"HTTPSamplerProxy"`
	Name        string        `xml:"testname,attr"`
	GUIClass    string        `xml:"guiclass,attr"`
	TestClass   string        `xml:"testclass,attr"`
	Enabled     bool          `xml:"enabled,attr"`
	StringProp  []StringProp  `xml:"stringProp"`
	BoolProp    []BoolProp    `xml:"boolProp"`
	ElementProp []ElementProp `xml:"elementProp"`
}

type HashTree

type HashTree struct {
	XMLName xml.Name      `xml:"hashTree"`
	Items   []interface{} `xml:"items"`
}

type Importer added in v0.0.14

type Importer interface {
	Convert(data []byte) (*testing.TestSuite, error)
	ConvertFromFile(dataFile string) (*testing.TestSuite, error)
	ConvertFromURL(dataURL string) (*testing.TestSuite, error)
}

func NewPostmanImporter added in v0.0.14

func NewPostmanImporter() Importer

NewPostmanImporter returns a new postman importer

type JmeterTestPlan

type JmeterTestPlan struct {
	XMLName    xml.Name `xml:"jmeterTestPlan"`
	Version    string   `xml:"version,attr"`
	Properties string   `xml:"properties,attr"`
	JMeter     string   `xml:"jmeter,attr"`
	HashTree   HashTree `xml:"hashTree"`
}

type Pair added in v0.0.14

type Pair struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Paris added in v0.0.14

type Paris []Pair

func (Paris) ToMap added in v0.0.14

func (p Paris) ToMap() (result map[string]string)

type Postman added in v0.0.14

type Postman struct {
	Info PostmanInfo   `json:"info"`
	Item []PostmanItem `json:"item"`
}

type PostmanBody added in v0.0.14

type PostmanBody struct {
	Mode string `json:"mode"`
	Raw  string `json:"raw"`
}

type PostmanCollection added in v0.0.14

type PostmanCollection struct {
	Collection Postman `json:"collection"`
}

type PostmanInfo added in v0.0.14

type PostmanInfo struct {
	Name string
}

type PostmanItem added in v0.0.14

type PostmanItem struct {
	Name    string         `json:"name"`
	Request PostmanRequest `json:"request"`
	Item    []PostmanItem  `json:"item"`
}

type PostmanRequest added in v0.0.14

type PostmanRequest struct {
	Method string      `json:"method"`
	URL    PostmanURL  `json:"url"`
	Header Paris       `json:"header"`
	Body   PostmanBody `json:"body"`
}

type PostmanURL added in v0.0.14

type PostmanURL struct {
	Raw   string   `json:"raw"`
	Path  []string `json:"path"`
	Query Paris    `json:"query"`
}

type ResultCollector

type ResultCollector struct {
	XMLName   xml.Name `xml:"ResultCollector"`
	Enabled   bool     `xml:"enabled,attr"`
	GUIClass  string   `xml:"guiclass,attr"`
	TestClass string   `xml:"testclass,attr"`
	Name      string   `xml:"testname,attr"`
}

type StringProp

type StringProp struct {
	Name  string `xml:"name,attr"`
	Value string `xml:",chardata"`
}

type TestPlan

type TestPlan struct {
	XMLName    xml.Name     `xml:"TestPlan"`
	Name       string       `xml:"testname,attr"`
	GUIClass   string       `xml:"guiclass,attr"`
	TestClass  string       `xml:"testclass,attr"`
	Enabled    bool         `xml:"enabled,attr"`
	StringProp []StringProp `xml:"stringProp"`
}

type TestSuiteConverter

type TestSuiteConverter interface {
	Convert(*testing.TestSuite) (result string, err error)
}

TestSuiteConverter is the interface of test suite converter

func GetTestSuiteConverter

func GetTestSuiteConverter(name string) TestSuiteConverter

type ThreadGroup

type ThreadGroup struct {
	XMLName     xml.Name     `xml:"ThreadGroup"`
	GUIClass    string       `xml:"guiclass,attr"`
	TestClass   string       `xml:"testclass,attr"`
	Enabled     bool         `xml:"enabled,attr"`
	Name        string       `xml:"testname,attr"`
	StringProp  []StringProp `xml:"stringProp"`
	ElementProp ElementProp  `xml:"elementProp"`
}

Jump to

Keyboard shortcuts

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