Tests in ProjectManagerTests.java and RefineServletTests.java have had minor fixes to update them to the current code.

doPostRegressionTest() still fails when run in the suite, but passes when run as an isolated test - there appears to be some cross-contamination from tests that I can't figure out atm.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1418 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Iain Sproat 2010-10-01 11:53:27 +00:00
parent 4c3cdabad2
commit 2d47885182
2 changed files with 8 additions and 7 deletions

View File

@ -122,6 +122,7 @@ public class ProjectManagerTests extends RefineTest {
verify(metadata, times(1)).getModified();
verify(project, times(2)).getLastSave();
verify(project, times(1)).dispose();
verify(SUT, never()).saveProject(project);
Assert.assertEquals(SUT.getProject(0), null);
verifyNoMoreInteractions(project);

View File

@ -33,7 +33,7 @@ public class RefineServletTests extends RefineTest {
//variables
final static private String TEST_COMMAND_NAME = "test-command";
final static private String TEST_COMMAND_PATH = "/command/core/test-command/foobar";
final static private String BAD_COMMAND_PATH = "/command-does-not-exist";
final static private String BAD_COMMAND_PATH = "/command/core/command-does-not-exist";
final static private String POST = "POST";
final static private String GET = "GET";
@ -85,7 +85,7 @@ public class RefineServletTests extends RefineTest {
Assert.fail();
}
verifyGetCommandNameCalled();
verifyGetCommandNameCalled(3);
try {
verify(command,times(1)).doGet(request, response);
} catch (ServletException e) {
@ -108,7 +108,7 @@ public class RefineServletTests extends RefineTest {
Assert.fail();
}
verifyGetCommandNameCalled();
verifyGetCommandNameCalled(2);
verifyError404Called();
}
@ -127,7 +127,7 @@ public class RefineServletTests extends RefineTest {
Assert.fail();
}
verifyGetCommandNameCalled();
verifyGetCommandNameCalled(3);
try {
verify(command,times(1)).doPost(request, response);
} catch (ServletException e) {
@ -150,7 +150,7 @@ public class RefineServletTests extends RefineTest {
Assert.fail();
}
verifyGetCommandNameCalled();
verifyGetCommandNameCalled(2);
verifyError404Called();
}
@ -173,8 +173,8 @@ public class RefineServletTests extends RefineTest {
protected void whenGetMethodThenReturn(String method){
when(request.getMethod()).thenReturn(method);
}
protected void verifyGetCommandNameCalled(){
verify(request,times(2)).getPathInfo();
protected void verifyGetCommandNameCalled(int times){
verify(request,times(times)).getPathInfo();
}
protected void verifyError404Called(){
try {