Examples of GroupRepository


Examples of org.sonatype.nexus.client.core.subsystem.repository.GroupRepository

  @Test
  public void shouldRegenerateGroupRepoWhenMemberRepoIsAdded()
      throws Exception
  {
    final GroupRepository groupRepo = givenAYumGroupRepoWith2RPMs();

    final Repository repo3 = createYumEnabledRepository(repositoryIdForTest("3"));

    content().upload(
        repositoryLocation(repo3.id(), "a_group3/an_artifact3/3.0/an_artifact3-3.0.rpm"),
        testData().resolveFile("/rpms/foo-bar-5.1.2-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    groupRepo.addMember(repo3.id()).save();

    waitForNexusToSettleDown();

    final String primaryXml = getPrimaryXmlOf(groupRepo);
View Full Code Here

Examples of org.sonatype.nexus.client.core.subsystem.repository.GroupRepository

        .create(MavenProxyRepository.class, repositoryIdForTest("proxy"))
        .asProxyOf(repo1.contentUri())
        .withItemMaxAge(0)
        .save();

    final GroupRepository groupRepo = createYumEnabledGroupRepository(
        repositoryIdForTest(), repo2.id(), proxyRepo.id()
    );

    content().upload(
        repositoryLocation(repo1.id(), "a_group1/an_artifact1/1.0/an_artifact1-1.0.rpm"),
View Full Code Here

Examples of org.sonatype.nexus.client.core.subsystem.repository.GroupRepository

  @Test
  public void shouldGenerateGroupRepo()
      throws Exception
  {
    final GroupRepository groupRepo = givenAYumGroupRepoWith2RPMs();

    final String primaryXml = getPrimaryXmlOf(groupRepo);
    assertThat(primaryXml, containsString("test-artifact"));
    assertThat(primaryXml, containsString("test-rpm"));
  }
View Full Code Here

Examples of org.sonatype.nexus.client.core.subsystem.repository.GroupRepository

  {
    final Repository repo1 = createYumEnabledRepository(repositoryIdForTest("1"));
    final Repository repo2 = createYumEnabledRepository(repositoryIdForTest("2"));
    final Repository repoX = createYumEnabledRepository(repositoryIdForTest("X"));

    final GroupRepository groupRepo = createYumEnabledGroupRepository(
        repositoryIdForTest(), repo1.id(), repo2.id(), repoX.id()
    );

    content().upload(
        repositoryLocation(repo1.id(), "a_group1/an_artifact1/1.0/an_artifact1-1.0.rpm"),
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.GroupRepository

    } catch (final Exception e) {
      return list;
    }

    if (combo instanceof GroupRepository) {
      final GroupRepository group = (GroupRepository) combo;
      final List<Repository> repoList = group.getMemberRepositories();
      for (final Repository repo : repoList) {
        list.add(repo.getId());
      }
    } else {
      list.add(combo.getId());
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.GroupRepository

    // we also put a member repo "inhouse-snapshot" out of service.

    // now we ask for something that IS KNOWN TO NOT EXISTS, hence, request will arrive to all members
    // and members of members (recursively), and the response will form a nice tree

    final GroupRepository group =
        getRepositoryRegistry().getRepositoryWithFacet("another-test", GroupRepository.class);

    try {
      group.retrieveItem(new ResourceStoreRequest("/some/path/that/we/know/is/not/existing/123456/12.foo"));
      // anything else should fail
      fail("We expected an exception here!");
    }
    catch (GroupItemNotFoundException e) {
      final String dumpStr = dumpNotFoundReasoning(e, 0);
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.GroupRepository

    final ArrayList<GroupRepository> result = new ArrayList<GroupRepository>();

    for (Repository repo : getRepositories()) {
      if (!repo.getId().equals(repository.getId())
          && repo.getRepositoryKind().isFacetAvailable(GroupRepository.class)) {
        final GroupRepository group = repo.adaptToFacet(GroupRepository.class);

        members:
        for (Repository member : group.getMemberRepositories()) {
          if (repository.getId().equals(member.getId())) {
            result.add(group);
            break members;
          }
        }
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.GroupRepository

  public RepositoryGroupResourceResponse get(Context context, Request request, Response response, Variant variant)
      throws ResourceException
  {
    RepositoryGroupResourceResponse result = new RepositoryGroupResourceResponse();

    GroupRepository groupRepo = null;

    try {
      groupRepo = getRepositoryRegistry().getRepositoryWithFacet(getGroupId(request), GroupRepository.class);
      result.setData(buildGroupResource(request, groupRepo));
    }
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.GroupRepository

  protected void updateRepositoryGroup(RepositoryGroupResource model)
      throws ResourceException
  {
    try {
      GroupRepository group =
          getRepositoryRegistry().getRepositoryWithFacet(model.getId(), GroupRepository.class);

      group.setName(model.getName());

      group.setExposed(model.isExposed());

      ArrayList<String> members = new ArrayList<String>();

      for (RepositoryGroupMemberRepository member : (List<RepositoryGroupMemberRepository>) model
          .getRepositories()) {
        members.add(member.getId());
      }

      group.setMemberRepositoryIds(members);

      getNexusConfiguration().saveConfiguration();
    }
    catch (NoSuchRepositoryAccessException e) {
      // access denied 403
View Full Code Here

Examples of org.sonatype.nexus.proxy.repository.GroupRepository

      template.getConfigurableRepository().setExposed(model.isExposed());

      template.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);

      // we create an empty group
      GroupRepository groupRepository = (GroupRepository) template.create();

      ArrayList<String> memberIds = new ArrayList<String>(model.getRepositories().size());

      for (RepositoryGroupMemberRepository member : (List<RepositoryGroupMemberRepository>) model
          .getRepositories()) {
        memberIds.add(member.getId());
      }

      groupRepository.setMemberRepositoryIds(memberIds);

      getNexusConfiguration().saveConfiguration();
    }
    // FIXME: cstamas or toby?
        /*
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.