Date timeEnd = new Date();
// Changelog beforeUpstreamCheckin to end should contain both upstream and downstream changes. upstream change
// should NOT include Test.java
ChangeLogScmResult result =
provider.changeLog( mainRepository, fileSet, timeBeforeUpstreamCheckin, timeEnd, 0, branch );
assertTrue( "changelog beforeUpstreamCheckin to end", result.isSuccess() );
List<ChangeSet> changeSets = result.getChangeLog().getChangeSets();
assertThat( changeSets.size(), is( 2 ) );
assertThat( changeSets, hasItems( changeSet( "Upstream changes", "/readme.txt" ),
changeSet( "downstream workspace promote", "/./pom.xml",
"/./src/test/java/Test.java" ) ) );
// Changelog beforeUpstreamCheckin to beforeDownstreamCheckin should include just upstream change including
// Test.java
result =
provider.changeLog( mainRepository, fileSet, timeBeforeUpstreamCheckin, timeBeforeDownstreamCheckin, 0,
branch );
assertTrue( "changelog beforeUpstreamCheckin to beforeDownstreamCheckin", result.isSuccess() );
changeSets = result.getChangeLog().getChangeSets();
assertThat( changeSets.size(), is( 1 ) );
assertThat( changeSets.get( 0 ), changeSet( "Upstream changes", "/readme.txt", "/src/test/java/Test.java" ) );
// Changelog beforeDownstreamCheckin to end should include just downstream change
result = provider.changeLog( mainRepository, fileSet, timeBeforeDownstreamCheckin, timeEnd, 0, branch );
assertTrue( "changelog beforeDownstreamCheckin to end", result.isSuccess() );
changeSets = result.getChangeLog().getChangeSets();
assertThat( changeSets.size(), is( 1 ) );
assertThat( changeSets.get( 0 ), changeSet( "downstream workspace promote", "/./pom.xml",
"/./src/test/java/Test.java" ) );
// Changelog beforeDownstreamPromote to end should be empty
result = provider.changeLog( mainRepository, fileSet, timeBeforeDownstreamPromote, timeEnd, 0, branch );
assertTrue( "changelog beforeDownstreamPromote to end", result.isSuccess() );
changeSets = result.getChangeLog().getChangeSets();
assertThat( changeSets.size(), is( 0 ) );
}