Search in sources :

Example 1 with ProjectStub

use of com.google.refine.tests.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();
}
Also used : Project(com.google.refine.model.Project) ProjectStub(com.google.refine.tests.model.ProjectStub) ProjectMetadata(com.google.refine.ProjectMetadata) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

ProjectMetadata (com.google.refine.ProjectMetadata)1 Project (com.google.refine.model.Project)1 ProjectStub (com.google.refine.tests.model.ProjectStub)1 BeforeTest (org.testng.annotations.BeforeTest)1 Test (org.testng.annotations.Test)1