Skip to content

Commit

Permalink
WINDUPRULE-450 Add rule for removed xslt method
Browse files Browse the repository at this point in the history
  • Loading branch information
mmelko committed Feb 21, 2020
1 parent 40e9526 commit bb9fe92
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
16 changes: 15 additions & 1 deletion rules-reviewed/camel3/camel2/java-generic-information.windup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
</javaclass>
</when>
<perform>
<hint title="`oorg.apache.camel.util.toolbox.AggregationStrategies` has been moved" effort="1" category-id="mandatory">
<hint title="`org.apache.camel.util.toolbox.AggregationStrategies` has been moved" effort="1" category-id="mandatory">
<message>
The class `org.apache.camel.util.toolbox.AggregationStrategies` has been moved to `org.apache.camel.builder.AggregationStrategies`.
</message>
Expand Down Expand Up @@ -404,5 +404,19 @@
</hint>
</perform>
</rule>
<rule id="java-generic-information-00021">
<when>
<javaclass references="org.apache.camel.util.toolbox.AggregationStrategies.xslt({*})" >
<location>METHOD_CALL</location>
</javaclass>
</when>
<perform>
<hint title="xslt method was removed from `org.apache.camel.util.toolbox.AggregationStrategies`" effort="1" category-id="mandatory">
<message>xslt method was removed from `org.apache.camel.util.toolbox.AggregationStrategies`. Instead use the `XsltAggregationStrategy` from `camel-xslt` JAR directly`</message>
<link href="https://camel.apache.org/manual/latest/camel-3-migration-guide.html#_generic_information"
title="Camel 3 - Migration Guide"/>
</hint>
</perform>
</rule>
</rules>
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.camel.builder.xml.InvalidXPathExpression;

import org.apache.camel.processor.validation.PredicateValidationException;
import org.apache.camel.util.toolbox.AggregationStrategies;

/**
* A Camel Java DSL Router
Expand Down Expand Up @@ -58,7 +59,11 @@ public void configure() {
from("vm:bar?concurrentConsumers=5")
.to("validator:org/apache/camel/component/validator/schema.xsd?headerName=headerToValidate&amp;failOnNullHeader=false");
}
}

public static void main(String[] args) throws Exception {
Object ag = AggregationStrategies.xslt("somePath");
}

@Override
public void configure(CustomRouteBuilder configuration) throws Exception{
if (configuration.getIntercepted() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<rule id="java-generic-information-00008-test">
<when>
<not>
<iterable-filter size="1">
<iterable-filter size="2">
<hint-exists message="The class `org.apache.camel.util.toolbox.AggregationStrategies` has been moved to `org.apache.camel.builder.AggregationStrategies`."/>
</iterable-filter>
</not>
Expand Down Expand Up @@ -257,6 +257,18 @@
<fail message="[java-generic-information] Exception moved hint was not found!" />
</perform>
</rule>
<rule id="java-generic-information-00021-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="xslt method was removed from `org.apache.camel.util.toolbox.AggregationStrategies.*"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[java-generic-information] Exception moved hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>

0 comments on commit bb9fe92

Please sign in to comment.