-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from stefanhahmann/add_file_filter_to_string
Make file filter show the extension, instead of cryptic stuff
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
src/test/java/org/scijava/ui/swing/widget/SwingFileWidgetTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.scijava.ui.swing.widget; | ||
|
||
import org.junit.Test; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class SwingFileWidgetTest | ||
{ | ||
|
||
@Test | ||
public void testFormatFileFilterExtensions() { | ||
final List< String > multipleExtensions = Arrays.asList( "jpg", "jpeg", "png", "gif", "bmp" ); | ||
final List< String > singleExtension = Collections.singletonList( "xml" ); | ||
assertEquals( "*.jpg;*.jpeg;*.png;*.gif;*.bmp", SwingFileWidget.formatFileFilterExtensions( multipleExtensions ) ); | ||
assertEquals( "*.xml", SwingFileWidget.formatFileFilterExtensions( singleExtension ) ); | ||
} | ||
} |