Example #1
0
func TestBintrayVersionDownloads(t *testing.T) {
	initBintrayTest(t)

	repositoryPath := bintrayConfig.User + "/" + tests.BintrayRepo1
	packagePath := repositoryPath + "/" + tests.BintrayUploadTestPackageName
	versionPath := packagePath + "/" + tests.BintrayUploadTestVersion
	createPackageAndVersion(packagePath, versionPath)

	bintrayCli.Exec("upload", tests.GetTestResourcesPath()+"a/*", versionPath, "--flat=true --recursive=true")
	bintrayCli.Exec("download-ver", versionPath, tests.Out+"/bintray/", "--unpublished=true")

	paths, _ := ioutils.ListFilesRecursive(tests.Out + "/bintray/")
	expected := []string{
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "a1.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "a2.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "a3.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "b1.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "b2.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "b3.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "c1.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "c2.in",
		tests.Out + ioutils.GetFileSeperator() + "bintray" + ioutils.GetFileSeperator() + "c3.in",
	}
	tests.IsExistLocally(expected, paths, t)
	bintrayCli.Exec("package-delete", packagePath, "--quiet=true")
	cleanBintrayTest()
}
func TestArtifactoryMassiveDownloadSpec(t *testing.T) {
	initArtifactoryTest(t)
	prepUploadFiles()
	specFile := tests.GetFilePath(tests.DownloadSpec)
	artifactoryCli.Exec("download", "--spec="+specFile)

	paths, _ := ioutils.ListFilesRecursive(tests.Out + "/")
	tests.IsExistLocally(tests.MassiveDownload, paths, t)
	cleanArtifactoryTest()
}