1 parent
552a2d5fab
commit
ba9fc8fe89
2 files changed
+27
-2
No files matched your search
@@ -16,8 +16,7 @@ public class TXTFileFilter extends FileFilter {
|
|||||||
/**
|
/**
|
||||||
* Creates a new instance of TXTFileFilter
|
* Creates a new instance of TXTFileFilter
|
||||||
*/
|
*/
|
||||||
public TXTFileFilter() {
|
public TXTFileFilter() {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(java.io.File file) {
|
public boolean accept(java.io.File file) {
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package eva2.tools;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
public class TXTFileFilterTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAccept() throws Exception {
|
||||||
|
TXTFileFilter filter = new TXTFileFilter();
|
||||||
|
assertTrue(filter.accept(new File("foobar.txt")));
|
||||||
|
|
||||||
|
assertTrue(filter.accept(new File("foobar.TXT")));
|
||||||
|
|
||||||
|
assertFalse(filter.accept(new File("foobar.csv")));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetDescription() throws Exception {
|
||||||
|
TXTFileFilter filter = new TXTFileFilter();
|
||||||
|
assertNotNull(filter.getDescription());
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user