use of org.commonjava.indy.data.StoreDataManager in project indy by Commonjava.
the class GroupDataManagerTCK method createAndDeleteGroup.
@Test
public void createAndDeleteGroup() throws Exception {
final StoreDataManager manager = getFixtureProvider().getDataManager();
final Group grp = new Group("test");
store(grp);
manager.deleteArtifactStore(grp.getKey(), summary, new EventMetadata());
final Group result = manager.query().packageType(MAVEN_PKG_KEY).storeType(Group.class).getByName(grp.getName());
assertThat(result, nullValue());
}
use of org.commonjava.indy.data.StoreDataManager 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.data.StoreDataManager 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.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().packageType(MAVEN_PKG_KEY).storeType(RemoteRepository.class).getByName(repo.getName());
assertThat(result, nullValue());
}
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"));
}
Aggregations