use of org.commonjava.indy.data.StoreDataManager in project indy by Commonjava.
the class RepositoryDataManagerTCK method createTwoReposAndRetrieveAll.
@Test
public void createTwoReposAndRetrieveAll() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final RemoteRepository repo = new RemoteRepository("central", "http://repo1.maven.apache.org/maven2/");
storeRemoteRepository(repo);
final RemoteRepository repo2 = new RemoteRepository("test", "http://www.google.com");
storeRemoteRepository(repo2);
final List<RemoteRepository> repositories = manager.query().getAllRemoteRepositories(MAVEN_PKG_KEY);
assertThat(repositories, notNullValue());
assertThat(repositories.size(), equalTo(2));
Collections.sort(repositories, new Comparator<RemoteRepository>() {
@Override
public int compare(final RemoteRepository r1, final RemoteRepository r2) {
return r1.getName().compareTo(r2.getName());
}
});
ArtifactStore r = repositories.get(0);
assertThat(r.getName(), equalTo(repo.getName()));
r = repositories.get(1);
assertThat(r.getName(), equalTo(repo2.getName()));
}
use of org.commonjava.indy.data.StoreDataManager in project indy by Commonjava.
the class GroupDataManagerTCK method createSameGroupTwiceAndRetrieveOne.
@Test
public void createSameGroupTwiceAndRetrieveOne() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final Group grp = new Group("test");
store(grp, grp);
final List<Group> result = manager.query().getAllGroups(MAVEN_PKG_KEY);
assertThat(result, notNullValue());
assertThat(result.size(), equalTo(1));
}
use of org.commonjava.indy.data.StoreDataManager in project indy by Commonjava.
the class GroupDataManagerTCK method createTwoGroupsAndAffectedByForOneLevel.
@Test
public void createTwoGroupsAndAffectedByForOneLevel() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final StoreKey central = new StoreKey(remote, "central");
final StoreKey repo2 = new StoreKey(remote, "repo2");
Group g1 = new Group("g1", central);
Group g2 = new Group("g2", repo2);
store(g1, g2);
List<StoreKey> keys = asList(central, repo2);
Set<StoreKey> gKeys = manager.query().getGroupsAffectedBy(keys).stream().map(Group::getKey).collect(Collectors.toSet());
assertThat(gKeys.contains(g1.getKey()), equalTo(Boolean.TRUE));
assertThat(gKeys.contains(g2.getKey()), equalTo(Boolean.TRUE));
}
use of org.commonjava.indy.data.StoreDataManager in project indy by Commonjava.
the class GroupDataManagerTCK method createTwoGroupsAndRetrieveBoth.
@Test
public void createTwoGroupsAndRetrieveBoth() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final Group grp = new Group("test");
final Group grp2 = new Group("test2");
store(grp, grp2);
final List<Group> result = manager.query().getAllGroups(MAVEN_PKG_KEY);
assertThat(result, notNullValue());
assertThat(result.size(), equalTo(2));
Collections.sort(result, new Comparator<Group>() {
@Override
public int compare(final Group g1, final Group g2) {
return g1.getName().compareTo(g2.getName());
}
});
Group g = result.get(0);
assertThat(g.getName(), equalTo(grp.getName()));
g = result.get(1);
assertThat(g.getName(), equalTo(grp2.getName()));
}
use of org.commonjava.indy.data.StoreDataManager 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().getRemoteRepository(MAVEN_PKG_KEY, repo.getName());
assertThat(result, nullValue());
}
Aggregations