Search in sources :

Example 6 with StoreDataManager

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());
}
Also used : Group(org.commonjava.indy.model.core.Group) StoreDataManager(org.commonjava.indy.data.StoreDataManager) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) Test(org.junit.Test)

Example 7 with StoreDataManager

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());
}
Also used : RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) StoreDataManager(org.commonjava.indy.data.StoreDataManager) Test(org.junit.Test)

Example 8 with StoreDataManager

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));
}
Also used : RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) StoreDataManager(org.commonjava.indy.data.StoreDataManager) Test(org.junit.Test)

Example 9 with StoreDataManager

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());
}
Also used : ArtifactStore(org.commonjava.indy.model.core.ArtifactStore) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) StoreDataManager(org.commonjava.indy.data.StoreDataManager) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) Test(org.junit.Test)

Example 10 with StoreDataManager

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"));
}
Also used : Group(org.commonjava.indy.model.core.Group) ArtifactStore(org.commonjava.indy.model.core.ArtifactStore) StoreDataManager(org.commonjava.indy.data.StoreDataManager) StoreKey(org.commonjava.indy.model.core.StoreKey) Test(org.junit.Test)

Aggregations

StoreDataManager (org.commonjava.indy.data.StoreDataManager)14 Test (org.junit.Test)12 Group (org.commonjava.indy.model.core.Group)8 StoreKey (org.commonjava.indy.model.core.StoreKey)6 RemoteRepository (org.commonjava.indy.model.core.RemoteRepository)5 ArtifactStore (org.commonjava.indy.model.core.ArtifactStore)4 EventMetadata (org.commonjava.maven.galley.event.EventMetadata)3 DirectContentAccess (org.commonjava.indy.content.DirectContentAccess)2 DownloadManager (org.commonjava.indy.content.DownloadManager)2 DefaultContentDigester (org.commonjava.indy.core.content.DefaultContentDigester)2 DefaultDirectContentAccess (org.commonjava.indy.core.content.DefaultDirectContentAccess)2 DefaultDownloadManager (org.commonjava.indy.core.content.DefaultDownloadManager)2 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)2 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)2 KojiClient (com.redhat.red.build.koji.KojiClient)1 GStringTemplateEngine (groovy.text.GStringTemplateEngine)1 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)1 ContentDigester (org.commonjava.indy.content.ContentDigester)1 ContentManager (org.commonjava.indy.content.ContentManager)1 IndyLocationExpander (org.commonjava.indy.content.IndyLocationExpander)1