Created
August 8, 2012 16:34
-
-
Save elefevre/3296455 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ConnectorExecutionCleanerTest { | |
private static final Connector CONNECTOR = new Connector("type", "name"); | |
private LocalWorkStore mockLocalWorkStore = mock(LocalWorkStore.class); | |
private LocalDataStore mockLocalDataStore = mock(LocalDataStore.class); | |
private Statistics mockStatistics = mock(Statistics.class); | |
private SystemProcessStatus mockSystemProcessStatus = mock(SystemProcessStatus.class); | |
private ConnectorExecutionCleaner cleaner = new ConnectorExecutionCleaner(mockLocalWorkStore, mockLocalDataStore, mockStatistics, mockSystemProcessStatus); | |
@Test | |
public void can_clean_all_execution_files() throws IOException { | |
when(mockLocalWorkStore.listFiles()).thenReturn( | |
Lists.<String>newArrayList("err.txt", "out.txt", "session.lock", "pid.out", "run")); | |
cleaner.clean(CONNECTOR); | |
verify(mockLocalWorkStore).delete(CONNECTOR, "err.txt"); | |
verify(mockLocalWorkStore).delete(CONNECTOR, "out.txt"); | |
verify(mockLocalWorkStore).delete(CONNECTOR, "session.lock"); | |
verify(mockLocalWorkStore).delete(CONNECTOR, "run"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment