Revision 8526e03d
Added by Andreas Müller about 4 years ago
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/common/OrderedTermVocabularyTest.java | ||
---|---|---|
146 | 146 |
assertEquals(1, oVoc1.getEqualTerms(otb1).size()); |
147 | 147 |
assertEquals(1, oVoc1.getEqualTerms(otb2).size()); |
148 | 148 |
assertEquals(1, oVoc1.getEqualTerms(otb3).size()); |
149 |
try { |
|
150 |
oVoc1.addTermEqualLevel(otbFree, otb2); |
|
151 |
assertEquals(4, oVoc1.size()); |
|
152 |
assertEquals(2, oVoc1.getEqualTerms(otb2).size()); |
|
153 |
} catch (WrongTermTypeException e) { |
|
154 |
fail(); |
|
155 |
} |
|
149 |
oVoc1.addTermEqualLevel(otbFree, otb2); |
|
150 |
assertEquals(4, oVoc1.size()); |
|
151 |
assertEquals(2, oVoc1.getEqualTerms(otb2).size()); |
|
152 |
|
|
156 | 153 |
//as long as orderedTermVocabulary.terms is a set |
157 | 154 |
//this won't work because terms.add() will not result |
158 | 155 |
//in adding the term |
... | ... | |
205 | 202 |
|
206 | 203 |
@Test |
207 | 204 |
public final void testAddTermEqualLevel() { |
208 |
try { |
|
209 |
System.out.println(otb2.orderIndex); |
|
210 |
oVoc1.addTermEqualLevel(otbFree, otb2); |
|
211 |
} catch (WrongTermTypeException e) { |
|
212 |
fail(); |
|
213 |
} |
|
205 |
System.out.println(otb2.orderIndex); |
|
206 |
oVoc1.addTermEqualLevel(otbFree, otb2); |
|
207 |
|
|
214 | 208 |
assertEquals(1, oVoc1.getLowerTerms(otbFree).size()); |
215 | 209 |
assertEquals(2, oVoc1.getLowerAndEqualTerms(otbFree).size()); |
216 | 210 |
assertEquals(otb1.getLabel(), oVoc1.getNextHigherTerm(otbFree).getLabel()); |
Also available in: Unified diff
fix compile errors after cleanup