Package org.sonatype.nexus.rest.model

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


    getEventInspectorsUtil().waitForCalmPeriod();

    // this is just a "preflight", that all is there what we want, not a real test

    // groupId
    SearchNGResponse results = getSearchMessageUtil().searchNGFor("nexus3670");
    Assert.assertEquals(7, results.getData().size());
    // repoId
    Assert.assertEquals("Where got it deployed?",
        results.getData().get(0).getArtifactHits().get(0).getRepositoryId(), REPO_TEST_HARNESS_REPO);
  }
View Full Code Here


      throws Exception
  {
    TaskScheduleUtil.waitForAllTasksToStop();

    // groupId
    SearchNGResponse results = getSearchMessageUtil().searchNGFor("nexus383");
    Assert.assertEquals(results.getData().size(), 2);

    // 3. negative test
    results = getSearchMessageUtil().searchNGFor("nexus-383");
    Assert.assertTrue(results.getData().isEmpty());

    // artifactId
    results = getSearchMessageUtil().searchNGFor("know-artifact-1", null, SearchType.EXACT);
    Assert.assertEquals(1, results.getData().size());

    // artifactId
    results = getSearchMessageUtil().searchNGFor("know-artifact-2", null, SearchType.EXACT);
    Assert.assertEquals(1, results.getData().size());

    // partial artifactId
    results = getSearchMessageUtil().searchNGFor("know-artifact");
    Assert.assertEquals(2, results.getData().size());

    // 3. negative test
    results = getSearchMessageUtil().searchNGFor("unknow-artifacts");
    Assert.assertTrue(results.getData().isEmpty());

    // NEXUS-2724: the member changes should propagate to it's groups too
    // has it propagated to group?
    results =
        getSearchMessageUtil().searchNGForGav("nexus383", "know-artifact-1", "1.0.0", null, null, "public", null);
    Assert.assertEquals(1, results.getData().size());
    results =
        getSearchMessageUtil().searchNGForGav("nexus383", "know-artifact-2", "1.0.0", null, null, "public", null);
    Assert.assertEquals(1, results.getData().size());
  }
View Full Code Here

  @Test
  public void searchForSHA1()
      throws Exception
  {
    // know-artifact-1
    SearchNGResponse result = getSearchMessageUtil().searchSha1NGFor("4ce1d96bd11b8959b32a75c1fa5b738d7b87d408");
    Assert.assertEquals("know-artifact-1 should be found", result.getData().size(), 1);

    // know-artifact-2
    result = getSearchMessageUtil().searchSha1NGFor("230377663ac3b19ad83c99b0afdb056dd580c5c8");
    Assert.assertEquals("know-artifact-2 should be found", result.getData().size(), 1);

    // velo's picture
    result = getSearchMessageUtil().searchSha1NGFor("612c17de73fdc8b9e3f6a063154d89946eb7c6f2");
    Assert.assertEquals("velo's picture should not be found", result.getData().size(), 0);
  }
View Full Code Here

    // config change spawns a lot of events
    getEventInspectorsUtil().waitForCalmPeriod();

    // groupId
    SearchNGResponse results = getSearchMessageUtil().searchNGFor("nexus383");
    Assert.assertTrue(results.getData().isEmpty());

    // artifactId
    results = getSearchMessageUtil().searchNGFor("know-artifact-1");
    Assert.assertTrue(results.getData().isEmpty());

    // artifactId
    results = getSearchMessageUtil().searchNGFor("know-artifact-2");
    Assert.assertTrue(results.getData().isEmpty());

    // partial artifactId
    results = getSearchMessageUtil().searchNGFor("know-artifact");
    Assert.assertTrue(results.getData().isEmpty());

  }
View Full Code Here

    getEventInspectorsUtil().waitForCalmPeriod();

    // Keyword search does collapse results, so we need _1_
    // Since the top level is GAV now only
    SearchNGResponse results = getSearchMessageUtil().searchNGFor("crossArtifact");
    Assert.assertEquals("We need 1 cross artifacts with Quick search!", results.getData().size(), 1);

    // GAV search does not
    results = getSearchMessageUtil().searchNGForGav(gav);
    Assert.assertEquals("We need 1 cross artifacts with GAV search!", results.getData().size(), 1);
  }
View Full Code Here

      throws Exception
  {
    // wait for calm period, since we do content mods and want to see that on index!
    getEventInspectorsUtil().waitForCalmPeriod();

    SearchNGResponse result = getSearchMessageUtil().searchSha1NGFor(sha1);
    Assert.assertEquals("Pom with " + sha1 + " not found " + msg, result.getTotalCount(), 1);
    Assert.assertEquals("Pom with " + sha1 + " not found " + msg, result.getData().size(), 1);
  }
View Full Code Here

    String entityText = doNGSearchForR(queryArgs, repositoryId, searchType);

    XStreamRepresentation representation =
        new XStreamRepresentation(xstream, entityText, MediaType.APPLICATION_XML);

    SearchNGResponse searchResponse = (SearchNGResponse) representation.getPayload(new SearchNGResponse());

    return searchResponse;
  }
View Full Code Here

  {
    wairForAsyncEventsToCalmDown();
    waitForTasksToStop();

    int artifactCount = 30; // this is bellow collapse threshold
    SearchNGResponse result = deployAndSearch(artifactCount, DeployType.RELEASE);
    Assert.assertEquals(artifactCount, result.getData().size());
    ensureLatestIsPresent(result, DeployType.RELEASE, "30");
  }
View Full Code Here

  {
    wairForAsyncEventsToCalmDown();
    waitForTasksToStop();

    int artifactCount = 60; // this is above collapse threshold
    SearchNGResponse result = deployAndSearch(artifactCount, DeployType.RELEASE);
    Assert.assertEquals(1, result.getData().size());
    ensureLatestIsPresent(result, DeployType.RELEASE, "60");
  }
View Full Code Here

  {
    wairForAsyncEventsToCalmDown();
    waitForTasksToStop();

    int artifactCount = 15; // this is bellow collapse threshold (count twice as DeployType.BOTH!)
    SearchNGResponse result = deployAndSearch(artifactCount, DeployType.BOTH);
    Assert.assertEquals(artifactCount * 2, result.getData().size());
    ensureLatestIsPresent(result, DeployType.BOTH, "15");
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.SearchNGResponse

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.