Skip to content
Snippets Groups Projects
Commit 97a99e41 authored by Grégory Mantelet's avatar Grégory Mantelet
Browse files

[ADQL] `FeatureSet.unsupportAll()` must un-support all supported features

instead of ONLY those listed in `availableFeatures`.
parent ade12662
No related branches found
No related tags found
No related merge requests found
...@@ -427,8 +427,8 @@ public class FeatureSet implements Iterable<LanguageFeature> { ...@@ -427,8 +427,8 @@ public class FeatureSet implements Iterable<LanguageFeature> {
* @see #getAvailableFeatures() * @see #getAvailableFeatures()
*/ */
public final void unsupportAll() { public final void unsupportAll() {
// unsupport all available features: // unsupport all features currently supported:
for(LanguageFeature feature : availableFeatures) for(LanguageFeature feature : this)
unsupport(feature); unsupport(feature);
// also unsupport any UDF: // also unsupport any UDF:
......
...@@ -215,11 +215,17 @@ public class TestFeatureSet { ...@@ -215,11 +215,17 @@ public class TestFeatureSet {
public void testUnsupportAll() { public void testUnsupportAll() {
FeatureSet set = new FeatureSet(true); FeatureSet set = new FeatureSet(true);
/* here is a custom Language Feature (i.e. not part of the
* availableFeatures list): */
set.support(new LanguageFeature(LanguageFeature.TYPE_UDF, "foo(VARCHAR) -> BOOLEAN", true));
// unsupport all currently supported features:
set.unsupportAll(); set.unsupportAll();
for(LanguageFeature feat : FeatureSet.availableFeatures) {
assertNotNull(feat); // ensure the list of supported features is really empty:
assertFalse(set.supportedFeatures.containsKey(feat.type)); assertEquals(0, set.supportedFeatures.size());
}
// ...and that no non-declared UDF is allowed:
assertFalse(set.isAnyUdfAllowed()); assertFalse(set.isAnyUdfAllowed());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment