@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"); }
@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"); }
@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"); }
@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"); }
@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"); }
@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"); }