use of com.google.refine.model.ProjectStub in project OpenRefine by OpenRefine.
the class ProjectManagerTests method canSaveAllModified.
// TODO test ensureProjectSave in race condition
@Test
public void canSaveAllModified() {
// 5 minute difference
whenGetSaveTimes(project, metadata);
registerProject(project, metadata);
// add a second project to the cache
Project project2 = spy(new ProjectStub(2));
ProjectMetadata metadata2 = mock(ProjectMetadata.class);
// not modified since the last save but within 30 seconds flush limit
whenGetSaveTimes(project2, metadata2, 10);
registerProject(project2, metadata2);
// check that the two projects are not the same
Assert.assertFalse(project.id == project2.id);
SUT.save(true);
verifySaved(project, metadata);
verifySaved(project2, metadata2);
verify(SUT, times(1)).saveWorkspace();
}
Aggregations