Update test to accommodate new test for pending operations
git-svn-id: http://google-refine.googlecode.com/svn/trunk@2282 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
97dda9f577
commit
cf206c33bc
@ -54,6 +54,7 @@ import org.testng.annotations.Test;
|
|||||||
|
|
||||||
import com.google.refine.ProjectMetadata;
|
import com.google.refine.ProjectMetadata;
|
||||||
import com.google.refine.model.Project;
|
import com.google.refine.model.Project;
|
||||||
|
import com.google.refine.process.ProcessManager;
|
||||||
import com.google.refine.tests.model.ProjectStub;
|
import com.google.refine.tests.model.ProjectStub;
|
||||||
|
|
||||||
public class ProjectManagerTests extends RefineTest {
|
public class ProjectManagerTests extends RefineTest {
|
||||||
@ -61,6 +62,7 @@ public class ProjectManagerTests extends RefineTest {
|
|||||||
ProjectManagerStub SUT;
|
ProjectManagerStub SUT;
|
||||||
Project project;
|
Project project;
|
||||||
ProjectMetadata metadata;
|
ProjectMetadata metadata;
|
||||||
|
ProcessManager procmgr;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@BeforeTest
|
@BeforeTest
|
||||||
@ -74,6 +76,9 @@ public class ProjectManagerTests extends RefineTest {
|
|||||||
SUT = spy(pm);
|
SUT = spy(pm);
|
||||||
project = mock(Project.class);
|
project = mock(Project.class);
|
||||||
metadata = mock(ProjectMetadata.class);
|
metadata = mock(ProjectMetadata.class);
|
||||||
|
procmgr = mock(ProcessManager.class);
|
||||||
|
when(project.getProcessManager()).thenReturn(procmgr);
|
||||||
|
when(procmgr.hasPending()).thenReturn(false); // always false for now, but should test separately
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterMethod
|
@AfterMethod
|
||||||
@ -155,6 +160,7 @@ public class ProjectManagerTests extends RefineTest {
|
|||||||
SUT.save(true);
|
SUT.save(true);
|
||||||
|
|
||||||
verify(metadata, times(1)).getModified();
|
verify(metadata, times(1)).getModified();
|
||||||
|
verify(project, times(1)).getProcessManager();
|
||||||
verify(project, times(2)).getLastSave();
|
verify(project, times(2)).getLastSave();
|
||||||
verify(project, times(1)).dispose();
|
verify(project, times(1)).dispose();
|
||||||
verify(SUT, never()).saveProject(project);
|
verify(SUT, never()).saveProject(project);
|
||||||
|
Loading…
Reference in New Issue
Block a user