use of com.thoughtworks.go.domain.materials.ModifiedFile in project gocd by gocd.
the class TransactionCacheInterceptorTest method shouldOptOutOfCacheServing_forNewItemsInCollection.
@Test
public void shouldOptOutOfCacheServing_forNewItemsInCollection() {
final MaterialInstance materialInstance = savedHg();
final Modification mod = new Modification("loser", "loser commiting a winner stroke", "foo@bar.com", new Date(), "123");
mod.setMaterialInstance(materialInstance);
hibernateDaoSupport.getHibernateTemplate().save(mod);
ModifiedFile foo_c = mod.createModifiedFile("foo.c", "src", ModifiedAction.added);
ModifiedFile bar_c = mod.createModifiedFile("bar.c", "src", ModifiedAction.deleted);
ModifiedFile baz_c = mod.createModifiedFile("baz.c", "src", ModifiedAction.modified);
assertionUtil.assertCacheBehaviourInTxn(new TransactionCacheAssertionUtil.DoInTxn() {
@Override
public void invoke() {
hibernateDaoSupport.getHibernateTemplate().update(mod);
}
});
assertThat(mod.getId(), greaterThan(0l));
assertThat(foo_c.getId(), greaterThan(0l));
assertThat(baz_c.getId(), greaterThan(0l));
}
use of com.thoughtworks.go.domain.materials.ModifiedFile in project gocd by gocd.
the class TfsSDKCommand method getModifiedFiles.
ArrayList<ModifiedFile> getModifiedFiles(Changeset changeset) {
ArrayList<ModifiedFile> files = new ArrayList<>();
for (Change change : changeset.getChanges()) {
ModifiedFile modifiedFile = new ModifiedFile(change.getItem().getServerItem(), "", ModifiedAction.unknown);
files.add(modifiedFile);
}
return files;
}
Aggregations