Revision 23230c1f
Added by Andreas Müller over 2 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/metadata/PreferenceResolverTest.java | ||
---|---|---|
20 | 20 |
/** |
21 | 21 |
* @author a.mueller |
22 | 22 |
* @since 29.11.2018 |
23 |
* |
|
24 | 23 |
*/ |
25 | 24 |
public class PreferenceResolverTest { |
26 | 25 |
|
... | ... | |
31 | 30 |
CdmPreference pref4; |
32 | 31 |
PrefKey key; |
33 | 32 |
|
34 |
/** |
|
35 |
* @throws java.lang.Exception |
|
36 |
*/ |
|
37 | 33 |
@Before |
38 | 34 |
public void setUp() throws Exception { |
39 | 35 |
pref1 = CdmPreference.NewInstance(PreferenceSubject.NewInstance("/taxeditor/distributionEditor/"), |
... | ... | |
45 | 41 |
pref3 = CdmPreference.NewInstance(PreferenceSubject.NewInstance("/distributionEditor/"), |
46 | 42 |
PreferencePredicate.AvailableDistributionAreaVocabularies, |
47 | 43 |
"abc"); |
44 |
//same as pref3 for testing exception handling |
|
48 | 45 |
pref3b = CdmPreference.NewInstance(PreferenceSubject.NewInstance("/distributionEditor/"), |
49 | 46 |
PreferencePredicate.AvailableDistributionAreaVocabularies, |
50 | 47 |
"def"); |
... | ... | |
66 | 63 |
Assert.assertSame(pref3, result); |
67 | 64 |
} |
68 | 65 |
|
66 |
//test exception for >1 preferences with equally matching keys |
|
69 | 67 |
@Test |
70 | 68 |
public void testException() { |
71 | 69 |
List<CdmPreference> list; |
... | ... | |
83 | 81 |
Assert.assertEquals(PreferenceResolver.MULTI_BEST_MATCHING, e.getMessage()); |
84 | 82 |
} |
85 | 83 |
} |
86 |
|
|
87 |
|
|
88 |
|
|
89 |
} |
|
84 |
} |
Also available in: Unified diff
cleanup and javadoc