Package org.sonatype.nexus.rest.model

Examples of org.sonatype.nexus.rest.model.ScheduledServicePropertyResource


  @Test
  public void expireAllRepos()
      throws Exception
  {
    ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
    prop.setKey("repositoryId");
    prop.setValue("all_repo");

    ScheduledServicePropertyResource age = new ScheduledServicePropertyResource();
    age.setKey("evictOlderCacheItemsThen");
    age.setValue(String.valueOf(10));

    TaskScheduleUtil.runTask(EvictUnusedItemsTaskDescriptor.ID, prop, age);
  }
View Full Code Here


    deployArtifacts(getTestResourceAsFile("artifacts/jars"));

    createP2RepositoryAggregatorCapability();

    final ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();
    repo.setKey(P2RepositoryAggregatorTaskDescriptor.REPO_OR_GROUP_FIELD_ID);
    repo.setValue(getTestRepositoryId());
    TaskScheduleUtil.runTask(P2RepositoryAggregatorTaskDescriptor.ID, repo);
    TaskScheduleUtil.waitForAllTasksToStop();

    // ensure link created
    final File file = downloadFile(
View Full Code Here

    super.runOnce();

    // first must be sure there is an index to be published
    RepositoryMessageUtil.updateIndexes("r1", "r2", "r3");

    ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("r4");
    TaskScheduleUtil.runTask("r4", DownloadIndexesTaskDescriptor.ID, repo);

    repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("r5");
    TaskScheduleUtil.runTask("r5", DownloadIndexesTaskDescriptor.ID, repo);
  }
View Full Code Here

    Assert.assertFalse(new File(nexusWorkDir, "storage/g1/.index").exists());
    Assert.assertFalse(new File(nexusWorkDir, "storage/g2/.index").exists());
    Assert.assertFalse(new File(nexusWorkDir, "storage/g3/.index").exists());
    Assert.assertFalse(new File(nexusWorkDir, "storage/g4/.index").exists());

    ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("g4");
    TaskScheduleUtil.runTask("PublishIndexesTaskDescriptor-snapshot", PublishIndexesTaskDescriptor.ID, repo);

    Assert.assertTrue(new File(nexusWorkDir, "storage/r1/.index").exists());
    Assert.assertTrue(new File(nexusWorkDir, "storage/r2/.index").exists());
    Assert.assertTrue(new File(nexusWorkDir, "storage/r3/.index").exists());
View Full Code Here

  @Test
  public void checkMetadata()
      throws Exception
  {
    ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("g4");
    TaskScheduleUtil.runTask("RebuildMavenMetadata-snapshot", RebuildMavenMetadataTaskDescriptor.ID, repo);

    File metadataFile =
        downloadFile(new URL(nexusBaseUrl + "content/repositories/g4/"
            + "nexus977tasks/project/maven-metadata.xml"), "target/downloads/nexus977");
View Full Code Here

    dest = new File(nexusWorkDir, "storage/r3/nexus977tasks/project/3.0/project-3.0.jar");
    dest.getParentFile().mkdirs();
    FileUtils.copyFile(getTestFile("project.jar"), dest);

    ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("g4");
    TaskScheduleUtil.runTask("ReindexTaskDescriptor-snapshot", RepairIndexTaskDescriptor.ID, repo);

    result = getSearchMessageUtil().searchForGav(getTestId(), "project", null, "g4");
    Assert.assertEquals(8, result.size());
  }
View Full Code Here

        "target/downloads/nexus977evict");

    Assert.assertTrue(new File(nexusWorkDir, "storage/r4/nexus977tasks/project/0.8/project-0.8.jar").exists());
    Assert.assertTrue(new File(nexusWorkDir, "storage/r5/nexus977tasks/project/2.1/project-2.1.jar").exists());

    ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("g4");

    ScheduledServicePropertyResource age = new ScheduledServicePropertyResource();
    age.setKey("evictOlderCacheItemsThen");
    age.setValue(String.valueOf(0));

    TaskScheduleUtil.runTask(EvictUnusedItemsTaskDescriptor.ID, repo, age);

    Assert.assertFalse(new File(nexusWorkDir, "storage/r4/nexus977tasks/project/0.8/project-0.8.jar").exists());
    Assert.assertFalse(new File(nexusWorkDir, "storage/r5/nexus977tasks/project/2.1/project-2.1.jar").exists());
View Full Code Here

    super.runOnce();

    File repo = getTestFile("repo");
    FileUtils.copyDirectory(repo, new File(nexusWorkDir, "storage/nexus-test-harness-snapshot-repo"));

    ScheduledServicePropertyResource r = new ScheduledServicePropertyResource();
    r.setKey(RebuildMavenMetadataTaskDescriptor.REPO_OR_GROUP_FIELD_ID);
    r.setValue(REPO_TEST_HARNESS_SNAPSHOT_REPO);

    TaskScheduleUtil.runTask("RebuildMavenMetadata-Nexus4218-snapshot", RebuildMavenMetadataTaskDescriptor.ID, r);

    r.setValue("fake-central");
    TaskScheduleUtil.runTask("RebuildMavenMetadata-Nexus4218-central", RebuildMavenMetadataTaskDescriptor.ID, r);
    TaskScheduleUtil.waitForAllTasksToStop();
  }
View Full Code Here

  {
    File testRepo = new File(nexusWorkDir, "storage/" + this.getTestRepositoryId());
    File testFiles = getTestFile("repo");
    FileUtils.copyDirectory(testFiles, testRepo);

    ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
    prop.setKey("repositoryId");
    prop.setValue(this.getTestRepositoryId());

    TaskScheduleUtil.runTask(UpdateIndexTaskDescriptor.ID, prop);
  }
View Full Code Here

  protected void runOnce()
      throws Exception
  {
    super.runOnce();

    ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("release");
    TaskScheduleUtil.runTask("RebuildMavenMetadata-release", RebuildMavenMetadataTaskDescriptor.ID, repo);

    repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("release2");
    TaskScheduleUtil.runTask("RebuildMavenMetadata-release2", RebuildMavenMetadataTaskDescriptor.ID, repo);

    repo = new ScheduledServicePropertyResource();
    repo.setKey("repositoryId");
    repo.setValue("snapshot");
    TaskScheduleUtil.runTask("RebuildMavenMetadata-snapshot", RebuildMavenMetadataTaskDescriptor.ID, repo);
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.ScheduledServicePropertyResource

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.