示例#1
0
  @Test
  public void testZipInputFileTester_NonGpx() throws Exception {
    ZipEntry zipEntryBad = PowerMock.createMock(ZipEntry.class);
    GpxFilenameFilter gpxFilenameFilter = PowerMock.createMock(GpxFilenameFilter.class);

    expect(zipEntryBad.isDirectory()).andReturn(false);
    expect(zipEntryBad.getName()).andReturn("foo.txt");
    expect(gpxFilenameFilter.accept("foo.txt")).andReturn(false);

    PowerMock.replayAll();
    assertFalse(new ZipInputFileTester(gpxFilenameFilter).isValid(zipEntryBad));
    PowerMock.verifyAll();
  }
示例#2
0
 public boolean isValid(ZipEntry zipEntry) {
   return (!zipEntry.isDirectory() && mGpxFilenameFilter.accept(zipEntry.getName()));
 }