| 1 |
package morfologik.stemming; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
import java.nio.charset.Charset; |
| 5 |
import java.util.Collections; |
| 6 |
import java.util.EnumSet; |
| 7 |
import java.util.List; |
| 8 |
import java.util.Locale; |
| 9 |
import java.util.Set; |
| 10 |
|
| 11 |
import org.assertj.core.api.Assertions; |
| 12 |
import org.junit.Test; |
| 13 |
|
| 14 |
public class DictionaryMetadataBuilderTest { |
| 15 |
@Test |
| 16 |
public void testAllConstantsHaveBuilderMethods() throws IOException { |
| 17 |
Set<DictionaryAttribute> keySet = new DictionaryMetadataBuilder() |
| 18 |
.convertCase() |
| 19 |
.encoding(Charset.defaultCharset()) |
| 20 |
.encoding("UTF-8") |
| 21 |
.frequencyIncluded() |
| 22 |
.ignoreAllUppercase() |
| 23 |
.ignoreCamelCase() |
| 24 |
.ignoreDiacritics() |
| 25 |
.ignoreNumbers() |
| 26 |
.ignorePunctuation() |
| 27 |
.separator('+') |
| 28 |
.supportRunOnWords() |
| 29 |
.encoder(EncoderType.SUFFIX) |
| 30 |
.withEquivalentChars(Collections.<Character,List<Character>>emptyMap()) |
| 31 |
.withReplacementPairs(Collections.<String,List<String>>emptyMap()) |
| 32 |
.withInputConversionPairs(Collections.<String,String>emptyMap()) |
| 33 |
.withOutputConversionPairs(Collections.<String,String>emptyMap()) |
| 34 |
.locale(Locale.getDefault()) |
| 35 |
.license("") |
| 36 |
.author("") |
| 37 |
.creationDate("") |
| 38 |
.toMap() |
| 39 |
.keySet(); |
| 40 |
|
| 41 |
Set<DictionaryAttribute> all = EnumSet.allOf(DictionaryAttribute.class); |
| 42 |
all.removeAll(keySet); |
| 43 |
|
| 44 |
Assertions.assertThat(all).isEmpty(); |
| 45 |
} |
| 46 |
} |