use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class MavenITCase method deploysArtifact.
@ParameterizedTest
@CsvSource({ "helloworld,0.1,0.1", "snapshot,1.0-SNAPSHOT" })
void deploysArtifact(final String type, final String vers) throws Exception {
this.containers.putBinaryToClient(new TestResource(String.format("%s-src/pom.xml", type)).asBytes(), "/w/pom.xml");
this.containers.assertExec("Deploy failed", new ContainerResultMatcher(ContainerResultMatcher.SUCCESS), "mvn", "-B", "-q", "-s", "settings.xml", "deploy", "-Dmaven.install.skip=true");
this.containers.assertExec("Download failed", new ContainerResultMatcher(ContainerResultMatcher.SUCCESS), "mvn", "-B", "-q", "-s", "settings.xml", "-U", "dependency:get", String.format("-Dartifact=com.artipie:%s:%s", type, vers));
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class MavenProxyIT method shouldGetArtifactFromCentralAndSaveInCache.
@Test
void shouldGetArtifactFromCentralAndSaveInCache() throws Exception {
this.containers.assertExec("Artifact wasn't downloaded", new ContainerResultMatcher(new IsEqual<>(0), new StringContains("BUILD SUCCESS")), "mvn", "-s", "settings.xml", "dependency:get", "-Dartifact=args4j:args4j:2.32:jar");
this.containers.assertArtipieContent("Artifact wasn't saved in cache", "/var/artipie/data/my-maven/args4j/args4j/2.32/args4j-2.32.jar", new IsAnything<>());
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class DockerLocalAuthIT method shouldFailPushIfAnonymous.
@Test
void shouldFailPushIfAnonymous() throws IOException {
final String image = "artipie:8080/registry/alpine:3.11";
List.of(Pair.of("Failed to pull origin image", List.of("docker", "pull", "alpine:3.11")), Pair.of("Failed to tag origin image", List.of("docker", "tag", "alpine:3.11", image))).forEach(pair -> pair.accept((msg, cmds) -> {
try {
this.deployment.assertExec(msg, new ContainerResultMatcher(), cmds);
} catch (final IOException err) {
throw new UncheckedIOException(err);
}
}));
this.deployment.assertExec("Push failed with unexpected status, should be 1", new ContainerResultMatcher(new IsEqual<>(1)), "docker", "push", image);
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class DockerOnPortIT method shouldPullPushed.
@Test
void shouldPullPushed() throws Exception {
this.deployment.clientExec("docker", "push", this.image.remote());
this.deployment.clientExec("docker", "image", "rm", this.image.name());
this.deployment.clientExec("docker", "image", "rm", this.image.remote());
this.deployment.assertExec("Filed to pull image", new ContainerResultMatcher(new IsEqual<>(ContainerResultMatcher.SUCCESS), new StringContains(String.format("Status: Downloaded newer image for %s", this.image.remote()))), "docker", "pull", this.image.remote());
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class PhpComposerITCase method canUploadAndInstall.
@Test
void canUploadAndInstall() throws IOException {
final String url = "http://artipie:8080/php";
this.containers.assertExec("Failed to upload composer package archive", new ContainerResultMatcher(), "curl", "-X", "PUT", String.format("%s/%s", url, "log-1.1.4.zip"), "--upload-file", String.format("/w/%s", PhpComposerITCase.PACK), "--verbose");
this.containers.assertExec("Failed to install uploaded package", new ContainerResultMatcher(), "env", "COMPOSER=/w/repo/composer.json", "composer", "install", "--verbose", "--no-cache");
}
Aggregations