Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WINDUPRULE-440,443,444,446,447,448,450,451,452,453,454,455,456] Add rules for java generic information chapter #409

Merged
merged 23 commits into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c8eebd7
[WINDUPRULE-437] - camel-rest moved out of camel-core
mmelko Jan 22, 2020
81a03a0
[WINDUPRULE-433] camel-attachements component was moved out of camel-…
mmelko Jan 23, 2020
1ad3789
[WINDUPRULE-435] Camel-dataformat moved out of camel-core
mmelko Jan 28, 2020
25310d9
[WINDUPRULE-432] camel-zip-deflater was moved out of camel-core
mmelko Jan 29, 2020
65e7413
[WINDUPRULE-438] The camel-xpath was moved out of camel-core to separ…
mmelko Jan 29, 2020
2a0906b
[WINDUPRULE-436] camel-language was moved out of camel-core
mmelko Jan 29, 2020
9e241ac
change amount of expected messages due to added components in test ro…
mmelko Feb 19, 2020
46909cd
[WINDUPRULE-440] zip and gzip dataformats were renamed to zipdeflater…
mmelko Jan 29, 2020
622a235
[WINDUPRULE-444] Classes from org.apache.camel.impl has been moved ou…
mmelko Jan 30, 2020
d9fc688
[WINDUPRULE-443] Add rule for removed registries
mmelko Jan 31, 2020
4c55529
[WINDUPRULE-446] Add rule for removed SimpleLoadBalancerSupport class
mmelko Jan 31, 2020
0bf0d4b
[WINDUPRULE-447] Add rule for removed classes
mmelko Feb 3, 2020
e282afa
[WINDUPRULE-447] Add rule for removed classes
mmelko Feb 3, 2020
86cb81b
[WINDUPRULE-448] Add rule for classes moved to org.apache.camel.impl.…
mmelko Feb 4, 2020
ff8be9f
WINDUPRULE-453 Add rule for moved class
mmelko Feb 6, 2020
d524234
WINDUPRULE-454 Add rule for moved class
mmelko Feb 6, 2020
7a31ff6
WINDUPRULE-451 Add rule for removed method
mmelko Feb 7, 2020
21f41d7
WINDUPRULE-456 Add rule for moved annotations
mmelko Feb 11, 2020
175eae4
WINDUPRULE-455 Add rules for xpath related changes
mmelko Feb 12, 2020
47c0d00
WINDUPRULE-452 Add rule for moved PredicateValidationException
mmelko Feb 12, 2020
b679ee0
WINDUPRULE-450 Add rule for removed xslt method
mmelko Feb 14, 2020
b602cad
fix test for moved org.apache.camel.util.component package
mmelko Mar 2, 2020
ca43a94
add changes from review of PR #409
mmelko Mar 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
367 changes: 366 additions & 1 deletion rules-reviewed/camel3/camel2/java-generic-information.windup.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.apache.camel.Exchange;
import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.apache.camel.util.toolbox.AggregationStrategies has been moved;

public class MyAggregationStrategy implements AggregationStrategy {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.CompositeRegistry;
import org.apache.camel.impl.PropertyPlaceholderDelegateRegistry;
import org.apache.camel.util.component.*;
import org.apache.camel.processor.loadbalancer.SimpleLoadBalancerSupport;

import org.apache.camel.impl.FileWatcherReloadStrategy;
import org.apache.camel.impl.CamelPostProcessorHelper;
import org.apache.camel.impl.TypedProcessorFactory;
import org.apache.camel.impl.WebSpherePackageScanClassResolver;

import org.apache.camel.support.ReloadStrategySupport;
import org.apache.camel.management.JmxSystemPropertyKeys;

import org.apache.camel.language.Bean;
import org.apache.camel.language.Simple;
import org.apache.camel.language.SpEL;

import org.apache.camel.InvokeOnHeader;
import org.apache.camel.Constant;
import org.apache.camel.InvokeOnHeaders;

import org.apache.camel.builder.xml.XPathBuilder;
import org.apache.camel.language.XPath;
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
*/
public class MyRouteBuilder extends RouteBuilder {
rest("/say")
.get("/hello").to("direct:hello")
.get("/bye").consumes("application/json")
.post("/bye");

public void configure() {
from("direct:xslt-copy-all")
.to("xslt:xslt/copy-all.xsl")
.to("file:target/messages/others")
.to("log:foo?logMask=true")
.to("mock:result");

from("ref:endpoint1")
.marshal().zip()
.to("browse:orderReceived")
.to("bean:bye");

from("dataset:foo")
.to("direct-vm:bar");
.unmarshal().gzip().process(new UnZippedMessageProcessor());

from("scheduler://foo?delay=60s")
.to("seda:next")
.to("stub:smtp://somehost.foo.com?user=windup");

from("vm:bar?concurrentConsumers=5")
.to("validator:org/apache/camel/component/validator/schema.xsd?headerName=headerToValidate&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) {
configuration.getIntercepted().includeRoutes(configuration);
} else {
camelContext.addRoutes(configuration);
}
LOG.debug("Custom route builder configured: {}", configuration);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

<bean id="function1" class="org.jboss.qe.camel.components.xslt.extensions.MyExtensionFunction1"/>
<bean id="function2" class="org.jboss.qe.camel.components.xslt.extensions.MyExtensionFunction2"/>
<bean id="aggregationStrategy" class="org.apache.camel.util.toolbox.XsltAggregationStrategy">
<constructor-arg value="/xslt/aggregationStrategy.xsl"/>
</bean>

<camelContext id="test-camel-context" xmlns="http://camel.apache.org/schema/spring" autoStartup="true">
<dataFormats>
<jaxb id="myJaxb" prettyPrint="true" contextPath="org.apache.camel.example"/>
<zip id="myzip" prettyPrint="true" contextPath="org.apache.camel.example"/>
<gzip id="mygzip" prettyPrint="true" contextPath="org.apache.camel.example"/>
</dataFormats>
<route>
<from uri="telegram:endpoint1"/>
<to uri="browse:orderReceived"/>
<to uri="bean:bye"/>
</route>
<route>
<from uri="telegram:foo?autorizationToken=wasd"/>
<to uri="direct-vm:bar"></to>

</route>
<route>
<from uri="scheduler://foo?delay=60s"/>
<to uri="seda:next"/>
<to uri="stub:smtp://somehost.foo.com?user=windup"/>
</route>
<route>
<from uri="vm:bar?concurrentConsumers=5"/>
<to uri="validator:org/apache/camel/component/validator/schema.xsd?headerName=headerToValidate&amp;failOnNullHeader=false"/>
</route>
</camelContext>
</beans>
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.util.component.*;

import org.apache.camel.impl.FileWatcherReloadStrategy;
import org.apache.camel.impl.CamelPostProcessorHelper;
import org.apache.camel.impl.TypedProcessorFactory;
import org.apache.camel.impl.WebSpherePackageScanClassResolver;

/**
* A Camel Java DSL Router
Expand All @@ -18,6 +24,7 @@ public void configure() {

from("ref:endpoint1")
.marshal().zip()
.marshal().zipDeflater()
.to("browse:orderReceived")
.to("controlbus:route?routeId=mainRoute&action=stop&async=true")
.to("language:simple:classpath:org/apache/camel/component/language/mysimplescript.txt")
Expand All @@ -34,7 +41,7 @@ public void configure() {
from("vm:bar?concurrentConsumers=5")
.to("validator:org/apache/camel/component/validator/schema.xsd?headerName=headerToValidate&amp;failOnNullHeader=false");

from("ctivemq:MyQueue").choice()
from("activemq:MyQueue").choice()
.when().xpath("in:header('foo') = 'bar'").to("activemq:x")
.when().xpath("in:body() = '<two/>'").to("activemq:y")
.otherwise().to("activemq:MyQueue");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@
</camelContext>

</blueprint>