use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class MavenMultiProxyIT method shouldGetDependency.
@Test
void shouldGetDependency() throws Exception {
this.containers.putResourceToArtipie("artipie-origin", "com/artipie/helloworld/maven-metadata.xml", "/var/artipie/data/origin-maven/com/artipie/helloworld/maven-metadata.xml");
MavenITCase.getResourceFiles("com/artipie/helloworld/0.1").stream().map(item -> String.join("/", "com/artipie/helloworld/0.1", item)).forEach(item -> this.containers.putResourceToArtipie("artipie-origin", item, String.join("/", "/var/artipie/data/origin-maven", item)));
this.containers.assertExec("Artifact wasn't downloaded", new ContainerResultMatcher(new IsEqual<>(0), new StringContains("BUILD SUCCESS")), "mvn", "-s", "settings.xml", "dependency:get", "-Dartifact=com.artipie:helloworld:0.1:jar");
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class NpmITCase method npmInstall.
@Test
void npmInstall() throws Exception {
this.containers.putBinaryToArtipie(new TestResource(String.format("npm/storage/%s/meta.json", NpmITCase.PROJ)).asBytes(), String.format("/var/artipie/data/my-npm/%s/meta.json", NpmITCase.PROJ));
this.containers.putBinaryToArtipie(new TestResource(String.format("npm/storage/%s/-/%s-1.0.1.tgz", NpmITCase.PROJ, NpmITCase.PROJ)).asBytes(), String.format("/var/artipie/data/my-npm/%s/-/%s-1.0.1.tgz", NpmITCase.PROJ, NpmITCase.PROJ));
this.containers.assertExec("Package was not installed", new ContainerResultMatcher(new IsEqual<>(0), new StringContainsInOrder(Arrays.asList(NpmITCase.ADDED_PROJ, "added 1 package"))), "npm", "install", NpmITCase.PROJ, "--registry", NpmITCase.REPO);
this.containers.assertExec("Package was installed", new ContainerResultMatcher(new IsEqual<>(0), new StringContains("@hello/simple-npm-project@1.0.1")), "npm", "list");
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class NpmITCase method npmPublish.
@Test
void npmPublish() throws Exception {
final String tgz = String.format("%s/-/%s-1.0.1.tgz", NpmITCase.PROJ, NpmITCase.PROJ);
this.containers.putBinaryToClient(new TestResource("npm/simple-npm-project/index.js").asBytes(), String.format("/w/%s/index.js", NpmITCase.PROJ));
this.containers.putBinaryToClient(new TestResource("npm/simple-npm-project/package.json").asBytes(), String.format("/w/%s/package.json", NpmITCase.PROJ));
this.containers.assertExec("Package was published", new ContainerResultMatcher(new IsEqual<>(0), new StringContains(NpmITCase.ADDED_PROJ)), "npm", "publish", NpmITCase.PROJ, "--registry", NpmITCase.REPO);
this.containers.assertArtipieContent("Meta json is incorrect", String.format("/var/artipie/data/my-npm/%s/meta.json", NpmITCase.PROJ), new MatcherOf<>(bytes -> {
return Json.createReader(new ByteArrayInputStream(bytes)).readObject().getJsonObject("versions").getJsonObject("1.0.1").getJsonObject("dist").getString("tarball").equals(String.format("/%s", tgz));
}));
this.containers.assertArtipieContent("Tarball should be added to storage", String.format("/var/artipie/data/my-npm/%s", tgz), new IsAnything<>());
}
use of com.artipie.test.ContainerResultMatcher in project artipie by artipie.
the class RpmITCase method setUp.
@BeforeEach
void setUp() throws IOException {
this.containers.assertExec("Dnf install curl failed", new ContainerResultMatcher(), "dnf", "-y", "install", "curl");
this.containers.putBinaryToClient(String.join("\n", "[example]", "name=Example Repository", "baseurl=http://artipie:8080/my-rpm", "enabled=1", "gpgcheck=0").getBytes(), "/etc/yum.repos.d/example.repo");
}
Aggregations