Project

General

Profile

« Previous | Next » 

Revision 955457ed

Added by Andreas Kohlbecker about 10 years ago

correcting documentation and adapting test - #3904 (EuroMed: Implement filtering rules for Distributions)

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/DescriptionUtility.java
58 58
     * sub area</i> and both areas have the same computed status only the
59 59
     * information on the sub area should be reported, whereas the super area
60 60
     * should be ignored. This rule is optional, see parameter
61
     * <code>subAreaPreference</code>. NOTE: this rule only applies only to non computed areas, since the second rule is applied first!.</li>
61
     * <code>subAreaPreference</code>. (NOTE: this rule only applies only to non computed areas, since the second rule is applied first!.TODO this is no longer valid since the second rule has been removed)</li>
62 62
     * <li><b>Marked area filter</b>: Skip distributions where the area has a {@link Marker} with one of the specified {@link MarkerType}s
63 63
     * </ol>
64 64
     *
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/utility/DescriptionUtilityTest.java
76 76
        Assert.assertEquals(1, filteredDistributions.size());
77 77
        Assert.assertEquals("expecting to see computed status INTRODUCED even it has lower preference than NATIVE", PresenceTerm.INTRODUCED(), filteredDistributions.iterator().next().getStatus());
78 78

  
79
       /* In computed distributions, distributions in parent areas are
80
        * preferred over those for direct sub areas if they have the same
81
        * status
79
       /* distributions for parent areas are only
80
        * removed if direct sub areas have the same status and if subAreaPreference=TRUE which is not the case here
82 81
        */
83

  
84 82
        Distribution parentComputedDistribution = Distribution.NewInstance(berlin, PresenceTerm.INTRODUCED());
85 83
        parentComputedDistribution.addMarker(Marker.NewInstance(MarkerType.COMPUTED(), true));
86 84
        distributions.add(parentComputedDistribution);
87 85

  
88 86
        filteredDistributions = DescriptionUtility.filterDistributions(distributions, subAreaPreference, statusOrderPreference, hideMarkedAreas);
89
        Assert.assertEquals(1, filteredDistributions.size());
90
        Assert.assertEquals("expecting to see the computed status from the parent area INTRODUCED", PresenceTerm.INTRODUCED(), filteredDistributions.iterator().next().getStatus());
87
        Assert.assertEquals(2, filteredDistributions.size());
91 88

  
92 89
    }
93 90

  

Also available in: Unified diff