use of org.commonjava.indy.client.core.helper.PathInfo in project indy by Commonjava.
the class AbstractContentTimeoutWorkingTest method setupRepo.
@Before
public void setupRepo() throws Exception {
final String repoId = "test-repo";
final String pomPath = "org/foo/bar/1.0/bar-1.0.pom";
final String pomUrl = server.formatUrl(repoId, pomPath);
// mocking up a http server that expects access to a .pom
final String datetime = (new Date()).toString();
server.expect(pomUrl, 200, String.format("pom %s", datetime));
// set up remote repository pointing to the test http server, and timeout little later
final String changelog = "Timeout Testing: " + name.getMethodName();
final RemoteRepository repository = createRemoteRepository(repoId);
client.stores().create(repository, changelog, RemoteRepository.class);
// ensure the pom exist before the timeout checking
final PathInfo result = client.content().getInfo(remote, repoId, pomPath);
assertThat("no result", result, notNullValue());
assertThat("doesn't exist", result.exists(), equalTo(true));
// force storage
client.content().get(remote, repoId, pomPath).close();
pomFile = Paths.get(fixture.getBootOptions().getIndyHome(), "var/lib/indy/storage", MAVEN_PKG_KEY, remote.singularEndpointName() + "-" + repoId, pomPath).toFile();
assertThat("pom doesn't exist: " + pomFile, this.pomFile.exists(), equalTo(true));
}
Aggregations