use of org.commonjava.indy.model.core.RemoteRepository in project indy by Commonjava.
the class PomDownloadViaGroupListenerTest method run.
@Test
public void run() throws Exception {
final String repo1 = "repo1";
final String group1 = "group1";
server.expect(server.formatUrl(repo1, path), 200, content);
RemoteRepository remote1 = new RemoteRepository(repo1, server.formatUrl(repo1));
client.stores().create(remote1, "adding remote", RemoteRepository.class);
client.stores().create(new Group(group1, remote1.getKey()), "adding group", Group.class);
InputStream is = client.content().get(group, group1, path);
String s = IOUtils.toString(is);
assertThat(s, equalTo(content));
waitForEventPropagation();
// Check .rel exist on group1
boolean exists = client.content().exists(group, group1, pathRel, true);
assertThat(exists, equalTo(true));
// Check .rel exist on remote1
exists = client.content().exists(remote, repo1, pathRel, true);
assertThat(exists, equalTo(true));
// Check .rel content is not empty
InputStream ris = client.content().get(group, group1, pathRel);
String rel = IOUtils.toString(ris);
logger.debug(">>> " + rel);
assertThat(StringUtils.isNotEmpty(rel), equalTo(true));
}
use of org.commonjava.indy.model.core.RemoteRepository in project indy by Commonjava.
the class RelDownloadBeforePomTest method run.
@Test
public void run() throws Exception {
final String repo1 = "repo1";
server.expect(server.formatUrl(repo1, path), 200, content);
RemoteRepository remote1 = new RemoteRepository(repo1, server.formatUrl(repo1));
client.stores().create(remote1, "adding remote", RemoteRepository.class);
// Download .rel before even touching POM
InputStream rel = client.content().get(remote, repo1, pathRel);
assertThat(rel, notNullValue());
String s = IOUtils.toString(rel);
logger.debug(">>> " + s);
assertThat(StringUtils.isNotEmpty(s), equalTo(true));
// check POM is downloaded
boolean exists = client.content().exists(remote, repo1, path, true);
assertThat(exists, equalTo(true));
}
use of org.commonjava.indy.model.core.RemoteRepository in project indy by Commonjava.
the class RepositoryDataManagerTCK method createAndRetrieveCentralRepoProxy.
@Test
public void createAndRetrieveCentralRepoProxy() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final RemoteRepository repo = new RemoteRepository("central", "http://repo1.maven.apache.org/maven2/");
storeRemoteRepository(repo, false);
final RemoteRepository result = manager.query().storeType(RemoteRepository.class).getByName(repo.getName());
assertThat(result.getName(), equalTo(repo.getName()));
assertThat(result.getUrl(), equalTo(repo.getUrl()));
assertThat(result.getUser(), nullValue());
assertThat(result.getPassword(), nullValue());
}
use of org.commonjava.indy.model.core.RemoteRepository in project indy by Commonjava.
the class RepositoryDataManagerTCK method createCentralRepoProxyTwiceAndRetrieveOne.
@Test
public void createCentralRepoProxyTwiceAndRetrieveOne() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final RemoteRepository repo = new RemoteRepository("central", "http://repo1.maven.apache.org/maven2/");
storeRemoteRepository(repo, true);
List<RemoteRepository> result = manager.query().packageType(MAVEN_PKG_KEY).storeType(RemoteRepository.class).getAll();
assertThat(result, notNullValue());
assertThat(result.size(), equalTo(1));
storeRemoteRepository(repo, true);
result = manager.query().packageType(MAVEN_PKG_KEY).storeType(RemoteRepository.class).getAll();
assertThat(result, notNullValue());
assertThat(result.size(), equalTo(1));
}
use of org.commonjava.indy.model.core.RemoteRepository in project indy by Commonjava.
the class RepositoryDataManagerTCK method createAndDeleteCentralRepoProxy.
@Test
public void createAndDeleteCentralRepoProxy() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final RemoteRepository repo = new RemoteRepository("central", "http://repo1.maven.apache.org/maven2/");
storeRemoteRepository(repo, false);
manager.deleteArtifactStore(repo.getKey(), summary, new EventMetadata());
final ArtifactStore result = manager.query().packageType(MAVEN_PKG_KEY).storeType(RemoteRepository.class).getByName(repo.getName());
assertThat(result, nullValue());
}
Aggregations