use of org.hamcrest.text.StringContainsInOrder 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 org.hamcrest.text.StringContainsInOrder 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 org.hamcrest.text.StringContainsInOrder 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 org.hamcrest.text.StringContainsInOrder in project artipie by artipie.
the class DebianITCase method pushAndInstallWorks.
@Test
void pushAndInstallWorks() throws Exception {
this.containers.assertExec("Failed to upload deb package", new ContainerResultMatcher(), "curl", "http://artipie:8080/my-debian/main/aglfn_1.7-3_amd64.deb", "--upload-file", "/w/aglfn_1.7-3_amd64.deb");
this.containers.assertExec("Apt-get update failed", new ContainerResultMatcher(), "apt-get", "update");
this.containers.assertExec("Package was not downloaded and unpacked", new ContainerResultMatcher(new IsEqual<>(0), new StringContainsInOrder(new ListOf<>("Unpacking aglfn", "Setting up aglfn"))), "apt-get", "install", "-y", "aglfn");
}
use of org.hamcrest.text.StringContainsInOrder in project maven-adapter by artipie.
the class MavenITCase method downloadsDependency.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void downloadsDependency(final boolean anonymous) throws Exception {
this.init(anonymous);
this.addHellowordToArtipie();
MatcherAssert.assertThat(this.exec("mvn", "-s", "/home/settings.xml", "dependency:get", "-Dartifact=com.artipie:helloworld:0.1"), new StringContainsInOrder(new ListOf<String>(// @checkstyle LineLengthCheck (1 line)
String.format("Downloaded from my-repo: http://host.testcontainers.internal:%d/com/artipie/helloworld/0.1/helloworld-0.1.jar (11 B", this.port), "BUILD SUCCESS")));
}
Aggregations