use of org.commonjava.indy.model.core.StoreKey in project indy by Commonjava.
the class GroupDataManagerTCK method createAndRetrieveGroupWithTwoConstituents.
@Test
public void createAndRetrieveGroupWithTwoConstituents() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final Group grp = new Group("test", new StoreKey(StoreType.remote, "central"), new StoreKey(StoreType.remote, "repo2"));
store(grp);
final Group result = manager.query().packageType(MAVEN_PKG_KEY).storeType(Group.class).getByName(grp.getName());
assertThat(result, notNullValue());
assertThat(result.getName(), equalTo(grp.getName()));
final List<StoreKey> repos = result.getConstituents();
assertThat(repos, notNullValue());
assertThat(repos.size(), equalTo(2));
assertThat(repos.get(0), equalTo(new StoreKey(StoreType.remote, "central")));
assertThat(repos.get(1), equalTo(new StoreKey(StoreType.remote, "repo2")));
}
use of org.commonjava.indy.model.core.StoreKey in project indy by Commonjava.
the class GroupDataManagerTCK method createGroupAndRetrieveRepositoryConstituents.
@Test
public void createGroupAndRetrieveRepositoryConstituents() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final Group grp = new Group("test", new StoreKey(StoreType.remote, "central"), new StoreKey(StoreType.remote, "repo2"));
store(grp);
final List<ArtifactStore> result = manager.query().packageType(MAVEN_PKG_KEY).getOrderedConcreteStoresInGroup(grp.getName());
assertThat(result, notNullValue());
assertThat(result.size(), equalTo(2));
ArtifactStore repo = result.get(0);
assertThat(repo, notNullValue());
assertThat(repo.getName(), equalTo("central"));
repo = result.get(1);
assertThat(repo, notNullValue());
assertThat(repo.getName(), equalTo("repo2"));
}
use of org.commonjava.indy.model.core.StoreKey in project indy by Commonjava.
the class GroupDataManagerTCK method createTwoGroupsAndAffectedByForTwoLevel.
@Test
public void createTwoGroupsAndAffectedByForTwoLevel() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final StoreKey central = new StoreKey(StoreType.remote, "central");
Group g1 = new Group("g1", central);
Group g2 = new Group("g2", g1.getKey());
store(g1, g2);
List<StoreKey> keys = Collections.singletonList(central);
Set<StoreKey> gKeys = manager.query().getGroupsAffectedBy(keys).stream().map(Group::getKey).collect(Collectors.toSet());
assertThat(gKeys.contains(g1.getKey()), equalTo(Boolean.TRUE));
//FIXME: should this group:g2 be in result?
assertThat(gKeys.contains(g2.getKey()), equalTo(Boolean.TRUE));
}
use of org.commonjava.indy.model.core.StoreKey in project indy by Commonjava.
the class GroupDataManagerTCK method createGroupAndRetrieveReposForThatGroupInOrder.
@Test
public void createGroupAndRetrieveReposForThatGroupInOrder() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final Group grp = new Group("test", new StoreKey(StoreType.remote, "repo2"), new StoreKey(StoreType.remote, "central"));
store(grp);
final List<ArtifactStore> repos = manager.query().packageType(MAVEN_PKG_KEY).getOrderedConcreteStoresInGroup(grp.getName());
assertThat(repos, notNullValue());
assertThat(repos.size(), equalTo(2));
assertThat(repos.get(0).getName(), equalTo("repo2"));
assertThat(repos.get(1).getName(), equalTo("central"));
}
use of org.commonjava.indy.model.core.StoreKey in project indy by Commonjava.
the class StoreKeyTest method parseWithValidPackageType.
@Test
public void parseWithValidPackageType() {
StoreKey key = StoreKey.fromString("maven:remote:central");
assertThat(key.getPackageType(), equalTo(MAVEN_PKG_KEY));
assertThat(key.getType(), equalTo(remote));
assertThat(key.getName(), equalTo("central"));
key = StoreKey.fromString("generic-http:remote:httprox_stuff");
assertThat(key.getPackageType(), equalTo(GENERIC_PKG_KEY));
assertThat(key.getType(), equalTo(remote));
assertThat(key.getName(), equalTo("httprox_stuff"));
}
Aggregations