Example #1
0
  public void testHostedRepositoryReindex() throws Exception {
    fillInRepo();

    indexerManager.reindexRepository(null, "releases", true);

    validateIndexWithIdentify(
        true,
        "86e12071021fa0be4ec809d4d2e08f07b80d4877",
        "org.sonatype.nexus",
        "nexus-indexer",
        "1.0-beta-4");
  }
Example #2
0
  public void testProxyRepositoryReindex() throws Exception {
    fillInRepo();

    reindexRemoteRepositoryAndPublish(getRemoteRepositoryRoot("central"), "central", true, 0);

    makeCentralPointTo(
        "http://localhost:"
            + super.getContainer().getContext().get(PROXY_SERVER_PORT)
            + "/central/");

    indexerManager.reindexRepository(null, "central", true);

    validateIndexWithIdentify(
        true, "057b8740427ee6d7b0b60792751356cad17dc0d9", "log4j", "log4j", "1.2.12");
  }
Example #3
0
  public void testV1IncrementalIndexes() throws Exception {
    // day 1
    makeCentralPointTo(
        "http://localhost:"
            + super.getContainer().getContext().get(PROXY_SERVER_PORT)
            + "/central-inc1-v1/");

    indexerManager.reindexRepository(null, "central", true);

    // validation
    validateIndexWithIdentify(
        true, "cf4f67dae5df4f9932ae7810f4548ef3e14dd35e", "antlr", "antlr", "2.7.6");
    validateIndexWithIdentify(
        false, "83cd2cd674a217ade95a4bb83a8a14f351f48bd0", "antlr", "antlr", "2.7.7");

    validateIndexWithIdentify(
        true, "3640dd71069d7986c9a14d333519216f4ca5c094", "log4j", "log4j", "1.2.8");
    validateIndexWithIdentify(
        false, "057b8740427ee6d7b0b60792751356cad17dc0d9", "log4j", "log4j", "1.2.12");
    validateIndexWithIdentify(
        false, "f0a0d2e29ed910808c33135a3a5a51bba6358f7b", "log4j", "log4j", "1.2.15");

    // day 2
    makeCentralPointTo(
        "http://localhost:"
            + super.getContainer().getContext().get(PROXY_SERVER_PORT)
            + "/central-inc2-v1/");

    indexerManager.reindexRepository(null, "central", true);

    // validation
    validateIndexWithIdentify(
        true, "cf4f67dae5df4f9932ae7810f4548ef3e14dd35e", "antlr", "antlr", "2.7.6");
    validateIndexWithIdentify(
        true, "83cd2cd674a217ade95a4bb83a8a14f351f48bd0", "antlr", "antlr", "2.7.7");

    validateIndexWithIdentify(
        true, "3640dd71069d7986c9a14d333519216f4ca5c094", "log4j", "log4j", "1.2.8");
    validateIndexWithIdentify(
        true, "057b8740427ee6d7b0b60792751356cad17dc0d9", "log4j", "log4j", "1.2.12");
    validateIndexWithIdentify(
        false, "f0a0d2e29ed910808c33135a3a5a51bba6358f7b", "log4j", "log4j", "1.2.15");

    // day 3
    makeCentralPointTo(
        "http://localhost:"
            + super.getContainer().getContext().get(PROXY_SERVER_PORT)
            + "/central-inc3-v1/");

    indexerManager.reindexRepository(null, "central", true);

    // validation
    validateIndexWithIdentify(
        true, "cf4f67dae5df4f9932ae7810f4548ef3e14dd35e", "antlr", "antlr", "2.7.6");
    validateIndexWithIdentify(
        true, "83cd2cd674a217ade95a4bb83a8a14f351f48bd0", "antlr", "antlr", "2.7.7");

    validateIndexWithIdentify(
        true, "3640dd71069d7986c9a14d333519216f4ca5c094", "log4j", "log4j", "1.2.8");
    validateIndexWithIdentify(
        true, "057b8740427ee6d7b0b60792751356cad17dc0d9", "log4j", "log4j", "1.2.12");
    validateIndexWithIdentify(
        true, "f0a0d2e29ed910808c33135a3a5a51bba6358f7b", "log4j", "log4j", "1.2.15");
  }
Example #4
0
  public void testCurrentIncrementalIndexes() throws Exception {
    // day 1
    reindexRemoteRepositoryAndPublish(getRemoteRepositoryRoot("central-inc1"), "central", false, 0);

    makeCentralPointTo(
        "http://localhost:"
            + super.getContainer().getContext().get(PROXY_SERVER_PORT)
            + "/central-inc1/");

    indexerManager.reindexRepository(null, "central", true);

    // validation
    validateIndexWithIdentify(
        true, "cf4f67dae5df4f9932ae7810f4548ef3e14dd35e", "antlr", "antlr", "2.7.6");
    validateIndexWithIdentify(
        false, "83cd2cd674a217ade95a4bb83a8a14f351f48bd0", "antlr", "antlr", "2.7.7");

    validateIndexWithIdentify(
        true, "3640dd71069d7986c9a14d333519216f4ca5c094", "log4j", "log4j", "1.2.8");
    validateIndexWithIdentify(
        false, "057b8740427ee6d7b0b60792751356cad17dc0d9", "log4j", "log4j", "1.2.12");
    validateIndexWithIdentify(
        false, "f0a0d2e29ed910808c33135a3a5a51bba6358f7b", "log4j", "log4j", "1.2.15");

    // day 2 (1 day passed), so shift both ctxes "in time"
    reindexRemoteRepositoryAndPublish(
        getRemoteRepositoryRoot("central-inc2"), "central", false, -1);
    shiftContextInTime(indexerManager.getRepositoryRemoteIndexContext("central"), -1);

    makeCentralPointTo(
        "http://localhost:"
            + super.getContainer().getContext().get(PROXY_SERVER_PORT)
            + "/central-inc2/");

    indexerManager.reindexRepository(null, "central", true);

    // validation
    validateIndexWithIdentify(
        true, "cf4f67dae5df4f9932ae7810f4548ef3e14dd35e", "antlr", "antlr", "2.7.6");
    validateIndexWithIdentify(
        true, "83cd2cd674a217ade95a4bb83a8a14f351f48bd0", "antlr", "antlr", "2.7.7");

    validateIndexWithIdentify(
        true, "3640dd71069d7986c9a14d333519216f4ca5c094", "log4j", "log4j", "1.2.8");
    validateIndexWithIdentify(
        true, "057b8740427ee6d7b0b60792751356cad17dc0d9", "log4j", "log4j", "1.2.12");
    validateIndexWithIdentify(
        false, "f0a0d2e29ed910808c33135a3a5a51bba6358f7b", "log4j", "log4j", "1.2.15");

    // day 3
    reindexRemoteRepositoryAndPublish(
        getRemoteRepositoryRoot("central-inc3"), "central", false, -1);
    shiftContextInTime(indexerManager.getRepositoryRemoteIndexContext("central"), -1);

    makeCentralPointTo(
        "http://localhost:"
            + super.getContainer().getContext().get(PROXY_SERVER_PORT)
            + "/central-inc3/");

    indexerManager.reindexRepository(null, "central", true);

    // validation
    validateIndexWithIdentify(
        true, "cf4f67dae5df4f9932ae7810f4548ef3e14dd35e", "antlr", "antlr", "2.7.6");
    validateIndexWithIdentify(
        true, "83cd2cd674a217ade95a4bb83a8a14f351f48bd0", "antlr", "antlr", "2.7.7");

    validateIndexWithIdentify(
        true, "3640dd71069d7986c9a14d333519216f4ca5c094", "log4j", "log4j", "1.2.8");
    validateIndexWithIdentify(
        true, "057b8740427ee6d7b0b60792751356cad17dc0d9", "log4j", "log4j", "1.2.12");
    validateIndexWithIdentify(
        true, "f0a0d2e29ed910808c33135a3a5a51bba6358f7b", "log4j", "log4j", "1.2.15");
  }