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

Examples of org.sonatype.nexus.client.core.subsystem.routing.Status


  }

  @Test
  public void checkPublicGroupResponse() {
    // public
    final Status publicStatus = routing().getStatus("public");
    assertThat(publicStatus.getPublishedStatus(), equalTo(Outcome.FAILED));
    assertThat(publicStatus.getDiscoveryStatus(), is(nullValue()));
  }
View Full Code Here


  }

  @Test
  public void checkReleasesHostedResponse() {
    // releases
    final Status releasesStatus = routing().getStatus("releases");
    assertThat(releasesStatus.getPublishedStatus(), equalTo(Outcome.FAILED));
    assertThat(releasesStatus.getDiscoveryStatus(), is(nullValue()));
  }
View Full Code Here

  }

  @Test
  public void checkCentralProxyResponse() {
    // central
    final Status centralStatus = routing().getStatus("central");
    assertThat(centralStatus.getPublishedStatus(), equalTo(Outcome.FAILED));
    assertThat(centralStatus.getDiscoveryStatus(), is(notNullValue()));
    assertThat(centralStatus.getDiscoveryStatus().getDiscoveryLastStatus(), equalTo(Outcome.UNDECIDED));
  }
View Full Code Here

  @Test
  public void prefixFileLooksSane()
      throws Exception
  {
    // central
    Status centralStatus = routing().getStatus("central");
    assertThat(centralStatus.getPublishedStatus(), equalTo(Outcome.SUCCEEDED));
    assertThat(centralStatus.getPublishedUrl(), is(notNullValue()));
    assertThat(centralStatus.getDiscoveryStatus(), is(notNullValue()));
    assertThat(centralStatus.getDiscoveryStatus().getDiscoveryLastStatus(), equalTo(Outcome.SUCCEEDED));

    // let's check some sanity (just blindly check that some expected entries are present)
    try (final InputStream entityStream = getPrefixFileFrom(centralStatus.getPublishedUrl());) {
      final LineNumberReader lnr = new LineNumberReader(new InputStreamReader(entityStream, "UTF-8"));
      boolean hasAbbot = false;
      boolean hasComApple = false;
      boolean hasOrgSonatype = false;
      String currentLine = lnr.readLine();
View Full Code Here

  @Test
  public void prefixFileIsUnchanged()
      throws IOException
  {
    // central
    final Status centralStatus = routing().getStatus("central");
    // let's verify that Nexus did not modify the prefix file got from Central (req: Nexus must publish prefix file
    // as-is, as it was received from remote). both should be equal on byte level.
    try (final InputStream nexusPrefixFile = getPrefixFileFrom(centralStatus.getPublishedUrl());
         final InputStream centralPrefixFile =
             getPrefixFileFrom("http://repo1.maven.org/maven2/.meta/prefixes.txt");) {
      ByteStreams.equal(new InputSupplier<InputStream>()
                        {
                          @Override
View Full Code Here

      // update the WL of proxy repo to have new prefixes file picked up
      routing().updatePrefixFile(proxyRepository.id());

      // wait for update to finish since it's async op, client above returned immediately
      // but update happens in a separate thread. Still this should be quick operation as prefix file is used
      Status proxyStatus = routing().getStatus(proxyRepository.id());
      // sit and wait for remote discovery (or the timeout Junit @Rule will kill us)
      while (proxyStatus.getPublishedStatus() != Outcome.SUCCEEDED) {
        Thread.sleep(10000);
        proxyStatus = routing().getStatus(proxyRepository.id());
      }

      // nuke the repo cache
View Full Code Here

      // update the WL of proxy repo to have new prefixes file picked up
      routing().updatePrefixFile(proxyRepository.id());

      // wait for update to finish since it's async op, client above returned immediately
      // but update happens in a separate thread. Still this should be quick operation as prefix file is used
      Status proxyStatus = routing().getStatus(proxyRepository.id());
      // sit and wait for remote discovery (or the timeout Junit @Rule will kill us)
      while (proxyStatus.getPublishedStatus() != Outcome.FAILED) {
        Thread.sleep(10000);
        proxyStatus = routing().getStatus(proxyRepository.id());
      }

      // nuke the repo cache
View Full Code Here

  }

  @Test
  public void checkPublicGroupResponse() {
    // public
    final Status publicStatus = routing().getStatus("public");
    assertThat(publicStatus.getPublishedStatus(), equalTo(Outcome.SUCCEEDED));
  }
View Full Code Here

  }

  @Test
  public void checkReleasesHostedResponse() {
    // releases
    final Status releasesStatus = routing().getStatus("releases");
    assertThat(releasesStatus.getPublishedStatus(), equalTo(Outcome.SUCCEEDED));
    assertThat(releasesStatus.getDiscoveryStatus(), is(nullValue()));
  }
View Full Code Here

  }

  @Test
  public void checkCentralProxyResponse() {
    // central
    final Status centralStatus = routing().getStatus("central");
    assertThat(centralStatus.getPublishedStatus(), equalTo(Outcome.SUCCEEDED));
    assertThat(centralStatus.getDiscoveryStatus(), is(notNullValue()));
    assertThat(centralStatus.getDiscoveryStatus().getDiscoveryLastStatus(), equalTo(Outcome.SUCCEEDED));
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.client.core.subsystem.routing.Status

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.