use of org.commonjava.indy.data.StoreDataManager 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.data.StoreDataManager 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.data.StoreDataManager 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.data.StoreDataManager in project indy by Commonjava.
the class ContentControllerTest method setup.
@Before
public void setup() throws Exception {
contentMetadata.clear();
fixture.initMissingComponents();
final StoreDataManager storeManager = new MemoryStoreDataManager(true);
final DownloadManager fileManager = new DefaultDownloadManager(storeManager, fixture.getTransferManager(), fixture.getLocationExpander());
final DirectContentAccess dca = new DefaultDirectContentAccess(fileManager, Executors.newSingleThreadExecutor());
final ContentManager contentManager = new DefaultContentManager(storeManager, fileManager, new IndyObjectMapper(true), new SpecialPathManagerImpl(), new MemoryNotFoundCache(), new DefaultContentDigester(dca, new CacheHandle<String, TransferMetadata>("content-metadata", contentMetadata)), Collections.<ContentGenerator>emptySet());
final TemplatingEngine templates = new TemplatingEngine(new GStringTemplateEngine(), new DataFileManager(fixture.getTemp().newFolder("indy-home"), new DataFileEventManager()));
content = new ContentController(storeManager, contentManager, templates, new IndyObjectMapper(true), new MimeTyper());
}
Aggregations