Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed 1 unnecessary stubbings in SimpleSVNDirEntryHandlerTest.java #283

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class SimpleSVNDirEntryHandlerTest {
@Test
public void testSortByName() {
SimpleSVNDirEntryHandler handler = new SimpleSVNDirEntryHandler(null);
addEntries(handler);
addEntries2(handler);

// TODO: the semantics of using both parameters for handler.getDirs(boolean,boolean)
// doesn't seem to have been defined properly
Expand Down Expand Up @@ -72,7 +72,7 @@ public void testReverseSortByDate() {
@Test
public void testReverseSortByName() {
SimpleSVNDirEntryHandler handler = new SimpleSVNDirEntryHandler(null);
addEntries(handler);
addEntries2(handler);
List<String> dirs = handler.getDirs(false, true);

Assert.assertEquals(4, dirs.size());
Expand All @@ -85,7 +85,7 @@ public void testReverseSortByName() {
@Test
public void testFilter() {
SimpleSVNDirEntryHandler handler = new SimpleSVNDirEntryHandler(".*a.*");
addEntries(handler);
addEntries2(handler);
List<String> dirs = handler.getDirs();

Assert.assertEquals(1, dirs.size());
Expand All @@ -109,4 +109,21 @@ private SVNDirEntry getEntry(String lastChanged, String directoryName) throws Pa
Mockito.when(entry.getName()).thenReturn(directoryName);
return entry;
}

private SVNDirEntry getEntry2(String lastChanged, String directoryName) throws ParseException {
SVNDirEntry entry = Mockito.mock(SVNDirEntry.class);
Mockito.when(entry.getName()).thenReturn(directoryName);
return entry;
}

private void addEntries2(SimpleSVNDirEntryHandler handler) {
try {
handler.handleDirEntry(getEntry2("2011-11-01", "trunk/a"));
handler.handleDirEntry(getEntry2("2011-11-01", "trunk/b"));
handler.handleDirEntry(getEntry2("2011-10-01", "trunk/x"));
handler.handleDirEntry(getEntry2("2011-09-01", "trunk/c"));
} catch (ParseException | SVNException e) {
Assert.fail(e.toString());
}
}
}
Loading