コード例 #1
0
  @Test
  public void testBaselineWarn() throws Exception {
    Verifier verifier = getVerifier("contentchanged", baselineRepo);

    verifier.getCliOptions().add("-Dtycho.baseline=warn");

    verifier.executeGoals(Arrays.asList("clean", "package"));
    verifier.verifyTextInLog(
        "baseline and build artifacts have same version but different contents");
  }
コード例 #2
0
  @Test
  public void testBaselineFailCommon_newAttachedArtifact() throws Exception {
    Verifier verifier = getVerifier("newattachedartifact", baselineRepo);

    verifier.getCliOptions().add("-Dtycho.baseline=failCommon");

    verifier.executeGoals(Arrays.asList("clean", "package"));

    verifier.verifyTextInLog(
        "baseline and build artifacts have same version but different contents");
  }
コード例 #3
0
  @Test
  public void testContentChangedStrict() throws Exception {
    Verifier verifier = getVerifier("contentchanged", baselineRepo);

    try {
      verifier.executeGoals(Arrays.asList("clean", "package"));
    } catch (VerificationException expected) {
      //
    }
    verifier.verifyTextInLog(
        "baseline and build artifacts have same version but different contents");
  }
コード例 #4
0
  @Test
  public void testBaselineWarn_changedAttachedArtifact() throws Exception {
    Verifier verifier = getVerifier("changedattachedartifact", baselineRepo);

    verifier.getCliOptions().add("-Dtycho.baseline=warn");

    verifier.executeGoals(Arrays.asList("clean", "package"));
    verifier.verifyTextInLog(
        "baseline and build artifacts have same version but different contents");

    File repository = new File(verifier.getBasedir(), "repository/target/repository");
    assertBaselineContents(repository, "plugins/baseline.bundle01.source_1.0.0.1.jar");
  }
コード例 #5
0
  @Test
  public void testBaselineFail_changedAttachedArtifact() throws Exception {
    Verifier verifier = getVerifier("changedattachedartifact", baselineRepo);

    verifier.getCliOptions().add("-Dtycho.baseline=fail");

    try {
      verifier.executeGoals(Arrays.asList("clean", "package"));
    } catch (VerificationException expected) {
      //
    }
    verifier.verifyTextInLog(
        "baseline and build artifacts have same version but different contents");
  }
コード例 #6
0
  @Test
  public void testReplaceCommon() throws Exception {
    Verifier verifier = getVerifier("newattachedartifact", baselineRepo);

    verifier.getCliOptions().add("-Dtycho.baseline=warn");
    verifier.getCliOptions().add("-Dtycho.baseline.replace=common");

    verifier.executeGoals(Arrays.asList("clean", "package"));
    verifier.verifyTextInLog(
        "baseline and build artifacts have same version but different contents");

    File repository = new File(verifier.getBasedir(), "repository/target/repository");
    assertBaselineContents(repository, "features/baseline.feature02_1.0.0.1.jar");

    File basedir = new File(verifier.getBasedir());
    assertFileExists(basedir, "feature02/target/baseline.feature02_root-1.0.0.1-root.zip");
    assertFileDoesNotExist(
        basedir, "repository/target/repository/binary/baseline.feature02_root_1.0.0.1");
  }