示例#1
0
func isExistInArtifactoryByProps(expected []string, pattern, props string, t *testing.T) {
	searchFlags := new(commands.SearchFlags)
	searchFlags.ArtDetails = artifactoryDetails
	searchSpec := utils.CreateSpec(pattern, "", props, true, false, false)
	results, err := commands.Search(searchSpec, searchFlags)
	if err != nil {
		t.Error(err)
	}
	tests.CompareExpectedVsActuals(expected, results, t)
}
示例#2
0
func isExistInArtifactory(expected []string, specFile string, t *testing.T) {
	results, _ := searchInArtifactory(specFile)
	if *tests.PrintSearchResult {
		for _, v := range results {
			fmt.Print("\"")
			fmt.Print(v.Path)
			fmt.Print("\"")
			fmt.Print(",")
			fmt.Println("")
		}
	}
	tests.CompareExpectedVsActuals(expected, results, t)
}
示例#3
0
func TestArtifactoryDisplyedPathToDelete(t *testing.T) {
	initArtifactoryTest(t)
	prepUploadFiles()
	prepCopyFiles()

	specFile := tests.GetFilePath(tests.DeleteComplexSpec)
	artifactsToDelete := getPathsToDelete(specFile)
	var displyedPaths []commands.SearchResult
	for _, v := range artifactsToDelete {
		displyedPaths = append(displyedPaths, commands.SearchResult{Path: v.Repo + "/" + v.Path + "/" + v.Name})
	}

	tests.CompareExpectedVsActuals(tests.DeleteDisplyedFiles, displyedPaths, t)
	cleanArtifactoryTest()
}