use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class NugetITCase method shouldPushAndInstallPackage.
@Test
void shouldPushAndInstallPackage() throws Exception {
final String pckgname = UUID.randomUUID().toString();
this.containers.putBinaryToClient(new TestResource("nuget/newtonsoft.json/12.0.3/newtonsoft.json.12.0.3.nupkg").asBytes(), String.format("/w/%s", pckgname));
this.containers.assertExec("Package was not pushed", new ContainerResultMatcher(new IsEqual<>(0), new StringContains("Your package was pushed.")), "dotnet", "nuget", "push", pckgname, "-s", "http://artipie:8080/my-nuget/index.json");
this.containers.assertExec("New project was not created", new ContainerResultMatcher(), "dotnet", "new", "console", "-n", "TestProj");
this.containers.assertExec("Package was not added", new ContainerResultMatcher(new IsEqual<>(0), new StringContainsInOrder(Arrays.asList(// @checkstyle LineLengthCheck (1 line)
"PackageReference for package 'newtonsoft.json' version '12.0.3' added to file '/w/TestProj/TestProj.csproj'", "Restored /w/TestProj/TestProj.csproj"))), "dotnet", "add", "TestProj", "package", "newtonsoft.json", "--version", "12.0.3", "-s", "http://artipie:8080/my-nuget/index.json");
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class PypiITCase method canUpload.
@Test
void canUpload() throws Exception {
this.containers.assertExec("Failed to upload", new ContainerResultMatcher(Matchers.is(0), new StringContainsInOrder(new ListOf<>("Uploading artipietestpkg-0.0.3.tar.gz", "100%"))), "python3", "-m", "twine", "upload", "--repository-url", "http://artipie:8080/my-python/", "-u", "alice", "-p", "123", "/var/artipie/data/artipie/pypi/example-pckg/dist/artipietestpkg-0.0.3.tar.gz");
this.containers.assertArtipieContent("Bad content after upload", "/var/artipie/data/my-python/artipietestpkg/artipietestpkg-0.0.3.tar.gz", Matchers.not("123".getBytes()));
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class PypiITCase method setUp.
@BeforeEach
void setUp() throws IOException {
this.containers.assertExec("Apt-get update failed", new ContainerResultMatcher(), "apt-get", "update");
this.containers.assertExec("Failed to install twine", new ContainerResultMatcher(), "python", "-m", "pip", "install", "twine");
this.containers.assertExec("Failed to upgrade pip", new ContainerResultMatcher(), "python", "-m", "pip", "install", "--upgrade", "pip");
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class RpmITCase method uploadsAndInstallsThePackage.
@Test
void uploadsAndInstallsThePackage() throws Exception {
this.containers.assertExec("Failed to upload rpm package", new ContainerResultMatcher(), "curl", "http://artipie:8080/my-rpm/time-1.7-45.el7.x86_64.rpm", "--upload-file", "/w/time-1.7-45.el7.x86_64.rpm");
this.containers.assertExec("Failed to install time package", new ContainerResultMatcher(new IsEqual<>(0), new StringContainsInOrder(new ListOf<>("time-1.7-45.el7.x86_64", "Complete!"))), "dnf", "-y", "repository-packages", "example", "install");
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class MavenITCase method downloadsArtifact.
@ParameterizedTest
@CsvSource({ "helloworld,0.1", "snapshot,1.0-SNAPSHOT" })
void downloadsArtifact(final String type, final String vers) throws Exception {
final String meta = String.format("com/artipie/%s/maven-metadata.xml", type);
this.containers.putResourceToArtipie(meta, String.join("/", "/var/artipie/data/my-maven", meta));
final String base = String.format("com/artipie/%s/%s", type, vers);
MavenITCase.getResourceFiles(base).stream().map(r -> String.join("/", base, r)).forEach(item -> this.containers.putResourceToArtipie(item, String.join("/", "/var/artipie/data/my-maven", item)));
this.containers.assertExec("Failed to get dependency", new ContainerResultMatcher(), "mvn", "-B", "-q", "-s", "settings.xml", "-e", "dependency:get", String.format("-Dartifact=com.artipie:%s:%s", type, vers));
}
Aggregations