Package org.sonatype.nexus.client.core.subsystem.repository

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


  @Test
  public void addRpm()
      throws Exception
  {
    final Repository repository = createYumEnabledRepository(repositoryIdForTest());

    content().upload(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1/test-artifact-0.0.1.rpm"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
    assertThat(primaryXml, containsString("test-artifact"));
  }
View Full Code Here


   */
  @Test
  public void addRpmWithUpperCaseExtension()
      throws Exception
  {
    final Repository repository = createYumEnabledRepository(repositoryIdForTest());

    content().upload(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1/test-artifact-0.0.1.RPM"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
    assertThat(primaryXml, containsString("test-artifact"));
  }
View Full Code Here

  @Test
  public void removeRpm()
      throws Exception
  {
    final Repository repository = createYumEnabledRepository(repositoryIdForTest());

    content().upload(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1/test-artifact-0.0.1.rpm"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    content().delete(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1/test-artifact-0.0.1.rpm")
    );

    waitForNexusToSettleDown();

    final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
    assertThat(primaryXml, not(containsString("test-artifact")));
  }
View Full Code Here

  @Test
  public void removeDirWithRpm()
      throws Exception
  {
    final Repository repository = createYumEnabledRepository(repositoryIdForTest());

    content().upload(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1/test-artifact-0.0.1.rpm"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    content().delete(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1")
    );

    waitForNexusToSettleDown();

    final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
    assertThat(primaryXml, not(containsString("test-artifact")));
  }
View Full Code Here

   */
  @Test
  public void addRpmUnderDotNexus()
      throws Exception
  {
    final Repository repository = createYumEnabledRepository(repositoryIdForTest());

    content().upload(
        repositoryLocation(repository.id(), "test/test-rpm/5.6.7/test-rpm-5.6.7.rpm"),
        testData.resolveFile("/rpms/test-rpm-5.6.7-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    {
      final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
      assertThat(primaryXml, containsString("test-rpm"));
    }

    content().upload(
        repositoryLocation(repository.id(), ".nexus/test/test-artifact/0.0.1/test-artifact-0.0.1.rpm"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    {
      final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
      assertThat(primaryXml, not(containsString("test-artifact")));
      assertThat(primaryXml, containsString("test-rpm"));
    }
  }
View Full Code Here

   */
  @Test
  public void removeRpmAndRegenerate()
      throws Exception
  {
    final Repository repository = createYumEnabledRepository(repositoryIdForTest());

    content().upload(
        repositoryLocation(repository.id(), "test/test-rpm/5.6.7/test-rpm-5.6.7.rpm"),
        testData.resolveFile("/rpms/test-rpm-5.6.7-1.noarch.rpm")
    );
    content().upload(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1/test-artifact-0.0.1.rpm"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
    );

    waitForNexusToSettleDown();

    {
      final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
      assertThat(primaryXml, containsString("test-rpm"));
      assertThat(primaryXml, containsString("test-artifact"));
    }

    content().delete(
        repositoryLocation(repository.id(), "test/test-artifact/0.0.1/test-artifact-0.0.1.rpm")
    );

    waitForNexusToSettleDown();

    {
      final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
      assertThat(primaryXml, not(containsString("test-artifact")));
    }

    final Map<String, String> properties = Maps.newHashMap();
    properties.put("repoId", repository.id());
    properties.put("forceFullScan", Boolean.TRUE.toString());

    scheduler().run("GenerateMetadataTask", properties);

    {
      final String primaryXml = repodata().getMetadata(repository.id(), PRIMARY_XML, String.class);
      assertThat(primaryXml, not(containsString("test-artifact")));
    }
  }
View Full Code Here

  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

  @Test
  public void shouldReFetchProxyMetadata()
      throws Exception
  {
    final Repository repo1 = createYumEnabledRepository(repositoryIdForTest("1"));
    final Repository repo2 = createYumEnabledRepository(repositoryIdForTest("2"));

    final Repository proxyRepo = repositories()
        .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"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
View Full Code Here

  }

  private GroupRepository givenAYumGroupRepoWith2RPMs()
      throws Exception
  {
    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"),
        testData().resolveFile("/rpms/test-artifact-1.2.3-1.noarch.rpm")
View Full Code Here

    repositories().get(repositoryIdForTest());
  }

  @Test
  public void getHosted() {
    final Repository repository = repositories().get("releases");
    assertThat(repository, is(instanceOf(MavenHostedRepository.class)));
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.client.core.subsystem.repository.Repository

Copyright © 2018 www.massapicom. 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.