Package org.sonatype.nexus.test.utils

Examples of org.sonatype.nexus.test.utils.RepositoryMessageUtil


  @Before
  public void start()
      throws Exception
  {
    repoUtil = new RepositoryMessageUtil(XStreamFactory.getXmlXStream(), MediaType.APPLICATION_XML);
  }
View Full Code Here


    String repoId = this.getTestRepositoryId();

    // get the index tree
    RequestFacade.doGet(RequestFacade.SERVICE_LOCAL + "repositories/" + repoId + "/index_content/");

    RepositoryMessageUtil repoUtil =
        new RepositoryMessageUtil(this.getXMLXStream(), MediaType.APPLICATION_XML);

    RepositoryResource resource = (RepositoryResource) repoUtil.getRepository(repoId);
    resource.setIndexable(false);
    repoUtil.updateRepo(resource);

    // get the index tree
    RequestFacade.doGet(RequestFacade.SERVICE_LOCAL + "repositories/" + repoId + "/index_content/",
        respondsWithStatusCode(404));
View Full Code Here

  private GroupMessageUtil groupMsgUtil;

  public Nexus2327RepositoryIdValidationIT()
      throws Exception
  {
    repositoryMsgUtil = new RepositoryMessageUtil(this.getXMLXStream(), MediaType.APPLICATION_XML);

    groupMsgUtil = new GroupMessageUtil(this.getXMLXStream(), MediaType.APPLICATION_XML);
  }
View Full Code Here

{
  private final RepositoryMessageUtil repositoryMessageUtil;

  public AbstractNxcm3600IntegrationTest() {
    super(REPO_TEST_HARNESS_RELEASE_REPO);
    this.repositoryMessageUtil = new RepositoryMessageUtil(getXMLXStream(), MediaType.APPLICATION_XML);
  }
View Full Code Here

    }

    // check for auto block
    // TODO: interestingly RepositoryMessageUtil.getStatus() neglects JSON here, so
    // not using it and switched back to XML as it is wired in it this util class.
    RepositoryMessageUtil util = new RepositoryMessageUtil(this.getXMLXStream(), MediaType.APPLICATION_XML);

    RepositoryStatusResource status = util.getStatus(getTestRepositoryId());

    Assert.assertEquals("Repository should be auto-blocked", status.getProxyMode(), ProxyMode.BLOCKED_AUTO.name());

    // stop the error server, start the healthy server
    return500Server.stop();
    serverResource.getServerProvider().start();

    // unblock it manually
    // NEXUS-4410: since this issue is implemented, the lines below are not enough,
    // since NFC will still contain the artifact do be downloaded, so we need to make it manually blocked and then allow proxy
    // those steps DOES clean NFC
    status.setProxyMode(ProxyMode.BLOCKED_MANUAL.name());
    util.updateStatus(status);
    status.setProxyMode(ProxyMode.ALLOW.name());
    util.updateStatus(status);

    // and now, all should go well
    downloadArtifact(getNexusTestRepoUrl(),
        "nexus1111", "artifact", "1.1", "jar", null, "target/downloads");
  }
View Full Code Here

  public void contentValidationFeed()
      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 {
      this.downloadArtifactFromRepository(REPO_RELEASE_PROXY_REPO1, gav, "target/downloads");
View Full Code Here

  @Before
  public void init()
      throws ComponentLookupException
  {
    this.repoUtils = new RepositoryMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    this.groupUtils = new GroupMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
  }
View Full Code Here

  @Before
  public void prepare()
      throws ComponentLookupException
  {
    privUtil = new PrivilegesMessageUtil(getXMLXStream(), MediaType.APPLICATION_XML);
    repoUtil = new RepositoryMessageUtil(getJsonXStream(), MediaType.APPLICATION_JSON);
    groupUtil = new GroupMessageUtil(getXMLXStream(), MediaType.APPLICATION_XML);
  }
View Full Code Here

      assertThat(
          "Nexus log should contain log entry about plugin OR feature having invalid checksum (as both of them are invalid)",
          passed);
    }

    final RepositoryMessageUtil repoUtil =
        new RepositoryMessageUtil(getXMLXStream(), MediaType.APPLICATION_XML);
    final RepositoryStatusResource repoStatusResource = repoUtil.getStatus(getTestRepositoryId());

    assertThat(repoStatusResource.getProxyMode(), is(equalTo(ProxyMode.ALLOW.name())));
    assertThat(repoStatusResource.getLocalStatus(), is(equalTo(LocalStatus.IN_SERVICE.name())));
  }
View Full Code Here

  public void setup()
      throws Exception
  {
    sleepTime = -1;
    pathsTouched = Lists.newArrayList();
    this.repoUtil = new RepositoryMessageUtil(getXMLXStream(), MediaType.APPLICATION_XML);
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.test.utils.RepositoryMessageUtil

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.