Package org.sonatype.nexus.client.core

Examples of org.sonatype.nexus.client.core.NexusStatus


   * Test that only verifies that Nexus reports itself (the status resource actually, used by {@link NexusClient}) as
   * expected.
   */
  @Test
  public void verifyNexusReportsAsHealthyAndCorrect() {
    final NexusStatus nexusStatus = client().getStatus();
    assertThat(nexusStatus, is(notNullValue()));
    assertThat(nexusStatus.isFirstStart(), is(true)); // should be true
    assertThat(nexusStatus.isInstanceUpgraded(), is(false)); // should be false
    // TODO: Need a generic way to detect the version of the bundle being runned.
    // This below would work with parametrized coordinates, but does not work with "normal" use
    // when DM is used as I have no version it seems, and it's known only in the moment of
    // resolving Nexus GA, but it's seems it's not stored/exposed anywhere.
    // final Artifact nexusBundleArtifact = new DefaultArtifact( nexusBundleCoordinates );
    // assertThat( nexusStatus.getVersion(), is( nexus().getConfiguration(). nexusBundleArtifact.getBaseVersion() ) ); // version
    assertThat(nexusStatus.getEditionShort(), equalTo("OSS"));
  }
View Full Code Here


  public NexusStatus getStatus() {
    try {
      final StatusResource response = serviceResource("status")
          .get(StatusResourceResponse.class)
          .getData();
      return new NexusStatus(response.getAppName(), response.getFormattedAppName(), response.getVersion(),
          response.getApiVersion(), response.getEditionLong(), response.getEditionShort(), response.getState(),
          response.getInitializedAt(), response.getStartedAt(), response.getLastConfigChange(), -1,
          response.isFirstStart(), response.isInstanceUpgraded(), response.isConfigurationUpgraded(),
          response.getBaseUrl());
    }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.client.core.NexusStatus

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.