Examples of RepositoryProxyResource


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

  @Test
  public void validateUpdateSiteMaxAgeConfig()
      throws Exception
  {
    RepositoryProxyResource updatesiterepo = new RepositoryProxyResource();

    updatesiterepo.setRepoType("proxy");
    updatesiterepo.setId("updatesite");
    updatesiterepo.setName("updatesite");
    updatesiterepo.setBrowseable(true);
    updatesiterepo.setIndexable(false);
    updatesiterepo.setNotFoundCacheTTL(1440);
    updatesiterepo.setArtifactMaxAge(100);
    updatesiterepo.setMetadataMaxAge(200);
    updatesiterepo.setRepoPolicy("RELEASE");
    updatesiterepo.setProvider("eclipse-update-site");
    updatesiterepo.setProviderRole("org.sonatype.nexus.proxy.repository.Repository");
    updatesiterepo.setOverrideLocalStorageUrl(null);
    updatesiterepo.setDefaultLocalStorageUrl(null);
    updatesiterepo.setDownloadRemoteIndexes(false);
    updatesiterepo.setExposed(true);
    updatesiterepo.setChecksumPolicy("WARN");

    final RepositoryResourceRemoteStorage p2proxyRemoteStorage = new RepositoryResourceRemoteStorage();
    p2proxyRemoteStorage.setRemoteStorageUrl("http://updatesite");
    p2proxyRemoteStorage.setAuthentication(null);
    p2proxyRemoteStorage.setConnectionSettings(null);

    updatesiterepo.setRemoteStorage(p2proxyRemoteStorage);

    updatesiterepo = (RepositoryProxyResource) repoUtil.createRepository(updatesiterepo, false);

    updatesiterepo = (RepositoryProxyResource) repoUtil.getRepository(updatesiterepo.getId());

    assertThat(updatesiterepo.getArtifactMaxAge(), is(100));
    assertThat(updatesiterepo.getMetadataMaxAge(), is(200));

    // now do an update
    updatesiterepo.setArtifactMaxAge(300);
    updatesiterepo.setMetadataMaxAge(400);

    repoUtil.updateRepo(updatesiterepo, false);

    updatesiterepo = (RepositoryProxyResource) repoUtil.getRepository(updatesiterepo.getId());

    assertThat(updatesiterepo.getArtifactMaxAge(), is(300));
    assertThat(updatesiterepo.getMetadataMaxAge(), is(400));
  }
View Full Code Here

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

  @Test
  public void wrongRemoteUrl()
      throws Exception
  {

    final RepositoryProxyResource resource = (RepositoryProxyResource) repositoryMessageUtil.getRepository(
        "nxcm3339-2"
    );
    resource.getRemoteStorage().setRemoteStorageUrl("http://fake.url/");
    repositoryMessageUtil.updateRepo(resource);

    waitForAllTasksToStop();

    final File installDir = new File("target/eclipse/" + getTestRepositoryId());
View Full Code Here

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

  @Test
  public void validateP2ProxyMaxAgeConfig()
      throws Exception
  {
    RepositoryProxyResource p2repo = new RepositoryProxyResource();

    p2repo.setRepoType("proxy");
    p2repo.setId("p2proxy");
    p2repo.setName("p2proxy");
    p2repo.setBrowseable(true);
    p2repo.setIndexable(false);
    p2repo.setNotFoundCacheTTL(1440);
    p2repo.setArtifactMaxAge(100);
    p2repo.setMetadataMaxAge(200);
    p2repo.setRepoPolicy("RELEASE");
    p2repo.setProvider("p2");
    p2repo.setProviderRole("org.sonatype.nexus.proxy.repository.Repository");
    p2repo.setOverrideLocalStorageUrl(null);
    p2repo.setDefaultLocalStorageUrl(null);
    p2repo.setDownloadRemoteIndexes(false);
    p2repo.setExposed(true);
    p2repo.setChecksumPolicy("WARN");

    final RepositoryResourceRemoteStorage p2proxyRemoteStorage = new RepositoryResourceRemoteStorage();
    p2proxyRemoteStorage.setRemoteStorageUrl("http://p2proxy");
    p2proxyRemoteStorage.setAuthentication(null);
    p2proxyRemoteStorage.setConnectionSettings(null);

    p2repo.setRemoteStorage(p2proxyRemoteStorage);

    p2repo = (RepositoryProxyResource) repoUtil.createRepository(p2repo, false);

    p2repo = (RepositoryProxyResource) repoUtil.getRepository(p2repo.getId());

    assertThat(p2repo.getArtifactMaxAge(), is(100));
    assertThat(p2repo.getMetadataMaxAge(), is(200));

    // now do an update
    p2repo.setArtifactMaxAge(300);
    p2repo.setMetadataMaxAge(400);

    repoUtil.updateRepo(p2repo, false);

    p2repo = (RepositoryProxyResource) repoUtil.getRepository(p2repo.getId());

    assertThat(p2repo.getArtifactMaxAge(), is(300));
    assertThat(p2repo.getMetadataMaxAge(), is(400));
  }
View Full Code Here

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

    }
    catch (final FileNotFoundException expected) {
    }

    // Change the remote url
    final RepositoryProxyResource p2ProxyRepo = (RepositoryProxyResource) repoUtil.getRepository(
        getTestRepositoryId()
    );
    String remoteUrl = p2ProxyRepo.getRemoteStorage().getRemoteStorageUrl();
    remoteUrl = remoteUrl.replace("nxcm2076-1", "nxcm2076-2");
    p2ProxyRepo.getRemoteStorage().setRemoteStorageUrl(remoteUrl);
    repoUtil.updateRepo(p2ProxyRepo, false);

    TaskScheduleUtil.waitForAllTasksToStop();

    artifactsXmlFile = downloadFile(
View Full Code Here

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

  public void proxyRepoTestIndexableWithInvalidURL()
      throws Exception
  {

    // create a repo
    RepositoryProxyResource resource = new RepositoryProxyResource();

    resource.setId("nexus688-proxyRepoTestIndexableWithInvalidURL");
    resource.setRepoType("proxy");
    resource.setName("Create Test Repo");
    resource.setProvider("maven2");
    // format is neglected by server from now on, provider is the new guy in the town
    resource.setFormat("maven2");
    resource.setRepoPolicy(RepositoryPolicy.RELEASE.name());
    resource.setExposed(true);
    resource.setChecksumPolicy("IGNORE");
    resource.setBrowseable(true);
    resource.setIndexable(true);
    resource.setWritePolicy(RepositoryWritePolicy.ALLOW_WRITE.name());

    RepositoryResourceRemoteStorage remoteStorage = new RepositoryResourceRemoteStorage();
    remoteStorage.setRemoteStorageUrl("http://INVALID-URL/");
    resource.setRemoteStorage(remoteStorage);

    // this also validates
    this.messageUtil.createRepository(resource);

    TaskScheduleUtil.waitForAllTasksToStop();

    this.downloadIndexFromRepository(resource.getId(), true);
  }
View Full Code Here

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

  public void proxyRepoTestIndexable()
      throws Exception
  {

    // create a repo
    RepositoryProxyResource resource = new RepositoryProxyResource();

    resource.setId("nexus688-proxyRepoTestIndexable");
    resource.setRepoType("proxy");
    resource.setName("Create Test Repo");
    resource.setProvider("maven2");
    // format is neglected by server from now on, provider is the new guy in the town
    resource.setFormat("maven2");
    resource.setRepoPolicy(RepositoryPolicy.RELEASE.name());
    resource.setChecksumPolicy("IGNORE");
    resource.setBrowseable(true);
    resource.setIndexable(true);
    resource.setExposed(true);
    resource.setWritePolicy(RepositoryWritePolicy.ALLOW_WRITE.name());

    RepositoryResourceRemoteStorage remoteStorage = new RepositoryResourceRemoteStorage();
    remoteStorage.setRemoteStorageUrl("http://INVALID-URL/");
    resource.setRemoteStorage(remoteStorage);

    // this also validates
    this.messageUtil.createRepository(resource);

    TaskScheduleUtil.waitForAllTasksToStop();

    this.downloadIndexFromRepository(resource.getId(), true);
  }
View Full Code Here

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

  public void proxyRepoTestNotIndexable()
      throws Exception
  {

    // create a repo
    RepositoryProxyResource resource = new RepositoryProxyResource();

    resource.setId("nexus688-proxyRepoTestNotIndexable");
    resource.setRepoType("proxy");
    resource.setName("Create Test Repo");
    resource.setProvider("maven2");
    // format is neglected by server from now on, provider is the new guy in the town
    resource.setFormat("maven2");
    resource.setRepoPolicy(RepositoryPolicy.RELEASE.name());
    resource.setChecksumPolicy("IGNORE");
    resource.setBrowseable(true);
    resource.setIndexable(false);
    resource.setExposed(true);
    resource.setWritePolicy(RepositoryWritePolicy.ALLOW_WRITE.name());

    RepositoryResourceRemoteStorage remoteStorage = new RepositoryResourceRemoteStorage();
    remoteStorage.setRemoteStorageUrl("http://INVALID-URL/");
    resource.setRemoteStorage(remoteStorage);

    // this also validates
    this.messageUtil.createRepository(resource);

    TaskScheduleUtil.waitForAllTasksToStop();

    this.downloadIndexFromRepository(resource.getId(), false);
  }
View Full Code Here

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

      throws Exception
  {

    // make sure it is validating the content!
    RepositoryMessageUtil repoUtil = new RepositoryMessageUtil(getXMLXStream(), MediaType.APPLICATION_XML);
    RepositoryProxyResource repo = (RepositoryProxyResource) repoUtil.getRepository(REPO_RELEASE_PROXY_REPO1);
    repo.setFileTypeValidation(true);
    repoUtil.updateRepo(repo);

    String msg = null;

    try {
View Full Code Here

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

    assertThat(repository.isAutoBlocking(), is(true));
  }

  private void doCreateNxcm5131Repo(final String id) {
    final RepositoryResourceResponse request = new RepositoryResourceResponse();
    final RepositoryProxyResource repo = new RepositoryProxyResource();
    repo.setId(id);
    repo.setFormat("nxcm5131");
    repo.setRepoType("proxy");
    repo.setRepoPolicy("MIXED");
    repo.setChecksumPolicy("IGNORE");
    repo.setProvider("nxcm5131");
    repo.setProviderRole("org.sonatype.nexus.proxy.repository.Repository");
    final RepositoryResourceRemoteStorage remoteStorage = new RepositoryResourceRemoteStorage();
    remoteStorage.setRemoteStorageUrl("http://obvious.fake/url");
    repo.setRemoteStorage(remoteStorage);
    request.setData(repo);

    doCreateRepo(request);
  }
View Full Code Here

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

    doCreateRepo(request);
  }

  private void doCreateMaven2Repo(final String id) {
    final RepositoryResourceResponse request = new RepositoryResourceResponse();
    final RepositoryProxyResource repo = new RepositoryProxyResource();
    repo.setId(id);
    repo.setFormat("maven2");
    repo.setRepoType("proxy");
    repo.setRepoPolicy("RELEASE");
    repo.setChecksumPolicy("IGNORE");
    repo.setProvider("maven2");
    repo.setProviderRole("org.sonatype.nexus.proxy.repository.Repository");
    final RepositoryResourceRemoteStorage remoteStorage = new RepositoryResourceRemoteStorage();
    remoteStorage.setRemoteStorageUrl("http://obvious.fake/url");
    repo.setRemoteStorage(remoteStorage);
    request.setData(repo);

    doCreateRepo(request);
  }
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.