Package org.sonatype.nexus.rest.model

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


    FileUtils.copyFileToDirectory(newContentXml, repo_nxcm1871_2, false);

    final File newArtifactsXml = new File(localStorageDir, "nxcm1871-3/artifacts.xml");
    FileUtils.copyFileToDirectory(newArtifactsXml, repo_nxcm1871_2, false);

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

    TaskScheduleUtil.runTask(ExpireCacheTaskDescriptor.ID, prop);

    // make sure nexus has the right content after reindex
    final File f2 = downloadFile(
View Full Code Here


    final ScheduledServiceOnceResource task = new ScheduledServiceOnceResource();
    task.setName("name");
    task.setSchedule("once");
    task.setTypeId(EmptyTrashTaskDescriptor.ID);
    ScheduledServicePropertyResource property = new ScheduledServicePropertyResource();
    property.setKey(EmptyTrashTaskDescriptor.OLDER_THAN_FIELD_ID);
    task.setProperties(Lists.newArrayList(property));

    Calendar cal = Calendar.getInstance();

    // simulating client timezone here: calculate offset from current timezone
View Full Code Here

    // verify both repo trashes have the files
    assertThat(releaseTrashFile, FileMatchers.isFile());
    assertThat(snapshotTrashFile, FileMatchers.isFile());

    // empty trash but only on snapshot repo
    ScheduledServicePropertyResource age = new ScheduledServicePropertyResource();
    age.setKey(EmptyTrashTaskDescriptor.OLDER_THAN_FIELD_ID);
    age.setValue("0");
    ScheduledServicePropertyResource repository = new ScheduledServicePropertyResource();
    age.setKey(EmptyTrashTaskDescriptor.REPO_OR_GROUP_FIELD_ID);
    age.setValue(REPO_TEST_HARNESS_SNAPSHOT_REPO);
    TaskScheduleUtil.runTask("Empty Trash Older Than", EmptyTrashTaskDescriptor.ID, age, repository);

    // verify that only releases trash has the file (other was nuked)
View Full Code Here

    Assert.assertTrue("New trash content should be kept! ", newTrashFile.exists());
    Assert.assertTrue("Old trash content should be kept!", oldTrashFile.exists());

    // this is unsupported, disabled for now (UI is not using it either)
    ScheduledServicePropertyResource age = new ScheduledServicePropertyResource();
    age.setKey(EmptyTrashTaskDescriptor.OLDER_THAN_FIELD_ID);
    age.setValue("1");

    TaskScheduleUtil.runTask("Empty Trash Older Than", EmptyTrashTaskDescriptor.ID, age);

    Assert.assertTrue("New trash content should be kept! ", newTrashFile.exists());
    Assert.assertFalse("Old trash content should be removed!", oldTrashFile.exists());
View Full Code Here

  protected void runTask(int days, String repoId)
      throws Exception
  {
    TaskScheduleUtil.waitForAllTasksToStop(); // be sure nothing else is locking tasks

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

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

    TaskScheduleUtil.runTask(EvictUnusedItemsTaskDescriptor.ID, EvictUnusedItemsTaskDescriptor.ID, 300, true,
        prop, age);

    getEventInspectorsUtil().waitForCalmPeriod();
View Full Code Here

    startDate = DateUtils.round(startDate, Calendar.DAY_OF_MONTH);
    scheduledTask.setCronCommand("0 0 12 ? * WED");

    scheduledTask.setTypeId(UpdateIndexTaskDescriptor.ID);

    ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
    prop.setKey("repositoryId");
    prop.setValue("all_repo");
    scheduledTask.addProperty(prop);

    Assert.assertTrue("Expected task to be created: ", TaskScheduleUtil.create(scheduledTask).isSuccess());

    // now check the conf
View Full Code Here

  public void rebuildAttributes()
      throws Exception
  {
    String attributePath = "storage/" + REPO_TEST_HARNESS_REPO + "/.nexus/attributes/nexus640/artifact/1.0.0/";

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

    File jar = new File(nexusWorkDir, attributePath + "artifact-1.0.0.jar");
    Assert.assertTrue("Attribute files should be generated after rebuild", jar.exists());
    File pom = new File(nexusWorkDir, attributePath + "artifact-1.0.0.pom");
View Full Code Here

              "nexus-maven-repository-index.properties.md5", "nexus-maven-repository-index.properties.sha1",
              "nexus-maven-repository-index.zip", "nexus-maven-repository-index.zip.md5",
              "nexus-maven-repository-index.zip.sha1")));
    }

    ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
    prop.setKey("repositoryId");
    prop.setValue("nexus-test-harness-repo");

    TaskScheduleUtil.runTask(PublishIndexesTaskDescriptor.ID, prop);

    Assert.assertTrue(".index should exists after publish index task was run.", index.exists());
  }
View Full Code Here

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

    createP2MetadataGeneratorCapability();

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

    final File p2Artifacts = downloadP2ArtifactsFor("org.ops4j.base", "ops4j-base-lang", "1.2.3");
    assertThat("p2Artifacts has been downloaded", p2Artifacts, is(notNullValue()));
View Full Code Here

    FileUtils.copyFile(pom, dest);

    String sha1 = FileTestingUtils.createSHA1FromFile(pom);
    Assert.assertNotNull(sha1);

    ScheduledServicePropertyResource repo = new ScheduledServicePropertyResource();

    repo.setKey("repositoryId");

    repo.setValue(REPO_TEST_HARNESS_REPO);

    TaskScheduleUtil.runTask("RebuildMavenMetadata-Nexus3233", RebuildMavenMetadataTaskDescriptor.ID, repo);

    RepositoryMessageUtil.updateIndexes(REPO_TEST_HARNESS_REPO);
    TaskScheduleUtil.waitForAllTasksToStop();
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.