Author: ningjiang
Date: Tue Oct 7 19:30:42 2008
New Revision: 702683
URL: http://svn.apache.org/viewvc?rev=702683&view=rev
Log:
Fixed the CS errors in camel-core and tried to fix the test failure in slower
box
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationCollection.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorBatchOptionsTest.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationCollectionTest.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationStrategyTest.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/DefaultAggregatorCollectionTest.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/PredicateAggregatorCollectionTest.java
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
Tue Oct 7 19:30:42 2008
@@ -54,8 +54,8 @@
import org.apache.camel.processor.ConvertBodyProcessor;
import org.apache.camel.processor.DelegateProcessor;
import org.apache.camel.processor.Pipeline;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.apache.camel.processor.aggregate.AggregationCollection;
+import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.apache.camel.processor.idempotent.MessageIdRepository;
import org.apache.camel.spi.DataFormat;
import org.apache.camel.spi.ErrorHandlerWrappingStrategy;
@@ -863,7 +863,7 @@
addOutput(loop);
return loop;
}
-
+
public Type throwFault(Throwable fault) {
ThrowFaultType answer = new ThrowFaultType();
answer.setFault(fault);
@@ -983,25 +983,25 @@
return (Type) this;
}
-
+
/**
* Catches an exception type.
*
* @deprecated Please use [EMAIL PROTECTED] #onException(Class)} instead.
Will be removed in Camel 2.0.
- */
+ */
public ExceptionType exception(Class exceptionType) {
return onException(exceptionType);
}
/**
* Catches an exception type.
- */
+ */
public ExceptionType onException(Class exceptionType) {
ExceptionType answer = new ExceptionType(exceptionType);
addOutput(answer);
return answer;
- }
-
+ }
+
/**
* Apply an interceptor route if the predicate is true
*/
@@ -1021,7 +1021,7 @@
/**
* Trace logs the exchange before it goes to the next processing step using
* the [EMAIL PROTECTED] #DEFAULT_TRACE_CATEGORY} logging category.
- *
+ *
* @deprecated Please use <a
href="http://activemq.apache.org/camel/tracer.html>Tracer Support</a>
* instead. Will be removed in Camel 2.0.
*/
@@ -1034,7 +1034,7 @@
* the specified logging category.
*
* @param category the logging category trace messages will sent to.
- *
+ *
* @deprecated Please use <a
href="http://activemq.apache.org/camel/tracer.html>Tracer Support</a>
* instead. Will be removed in Camel 2.0.
*/
@@ -1323,7 +1323,7 @@
ExpressionClause<ProcessorType<Type>> clause = new
ExpressionClause<ProcessorType<Type>>((Type) this);
SetPropertyType answer = new SetPropertyType(name, clause);
addOutput(answer);
- return clause;
+ return clause;
}
/**
@@ -1332,7 +1332,7 @@
public Type removeHeader(String name) {
RemoveHeaderType answer = new RemoveHeaderType(name);
addOutput(answer);
- return (Type) this;
+ return (Type) this;
}
/**
@@ -1348,7 +1348,7 @@
public Type removeProperty(String name) {
RemovePropertyType answer = new RemovePropertyType(name);
addOutput(answer);
- return (Type) this;
+ return (Type) this;
}
/**
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Aggregator.java
Tue Oct 7 19:30:42 2008
@@ -20,10 +20,10 @@
import org.apache.camel.Expression;
import org.apache.camel.Predicate;
import org.apache.camel.Processor;
-import org.apache.camel.processor.aggregate.DefaultAggregationCollection;
+import org.apache.camel.processor.aggregate.AggregationCollection;
import org.apache.camel.processor.aggregate.AggregationStrategy;
+import org.apache.camel.processor.aggregate.DefaultAggregationCollection;
import org.apache.camel.processor.aggregate.PredicateAggregationCollection;
-import org.apache.camel.processor.aggregate.AggregationCollection;
/**
* An implementation of the <a
@@ -73,7 +73,7 @@
return true;
}
}
-
+
return super.isBatchCompleted(index);
}
}
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationCollection.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationCollection.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationCollection.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregationCollection.java
Tue Oct 7 19:30:42 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.camel.processor.aggregate;
import java.util.Collection;
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java
Tue Oct 7 19:30:42 2008
@@ -32,12 +32,11 @@
import org.apache.camel.processor.DeadLetterChannel;
import org.apache.camel.processor.DelegateProcessor;
import org.apache.camel.processor.FilterProcessor;
+import org.apache.camel.processor.Interceptor;
import org.apache.camel.processor.MulticastProcessor;
import org.apache.camel.processor.RecipientList;
import org.apache.camel.processor.SendProcessor;
import org.apache.camel.processor.Splitter;
-import org.apache.camel.processor.Interceptor;
-import org.apache.camel.processor.interceptor.StreamCachingInterceptor;
import org.apache.camel.processor.idempotent.IdempotentConsumer;
import org.apache.camel.processor.idempotent.MemoryMessageIdRepository;
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorBatchOptionsTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorBatchOptionsTest.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorBatchOptionsTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorBatchOptionsTest.java
Tue Oct 7 19:30:42 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.camel.processor.aggregator;
import org.apache.camel.ContextTestSupport;
@@ -25,7 +41,7 @@
.aggregator().header("id")
// wait for 0.5 seconds to aggregate
.batchTimeout(500L)
- // batch size in is the limit of number of exchanges
recieved, so when we have received 100
+ // batch size in is the limit of number of exchanges
received, so when we have received 100
// exchanges then whatever we have in the collection will
be sent
.batchSize(100)
// limit the out batch size to 3 so when we have
aggregated 3 exchanges
@@ -54,9 +70,6 @@
// when we send message 4 then we will reach the collection batch size
limit and the
// exchanges above is the ones we have aggregated in the first batch
template.sendBodyAndHeader("direct:start", "Message 4", "id", "4");
- template.sendBodyAndHeader("direct:start", "Message 3b", "id", "3");
- template.sendBodyAndHeader("direct:start", "Message 3c", "id", "3");
- template.sendBodyAndHeader("direct:start", "Message 1d", "id", "1");
assertMockEndpointsSatisfied();
// END SNIPPET: e2
@@ -74,7 +87,7 @@
.aggregator().header("id")
// wait for 0.5 seconds to aggregate
.batchTimeout(500L)
- // batch size in is the limit of number of exchanges
recieved, so when we have received 100
+ // batch size in is the limit of number of exchanges
received, so when we have received 100
// exchanges then whatever we have in the collection will
be sent
.batchSize(5)
.to("mock:result");
@@ -98,6 +111,8 @@
template.sendBodyAndHeader("direct:start", "Message 1c", "id", "1");
// when we sent the next message we have reached the in batch size
limit and the current
// aggregated exchanges will be sent
+ // wait a while for aggregating in a slower box
+ Thread.sleep(300L);
template.sendBodyAndHeader("direct:start", "Message 3a", "id", "3");
template.sendBodyAndHeader("direct:start", "Message 4", "id", "4");
template.sendBodyAndHeader("direct:start", "Message 3b", "id", "3");
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationCollectionTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationCollectionTest.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationCollectionTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationCollectionTest.java
Tue Oct 7 19:30:42 2008
@@ -1,18 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.camel.processor.aggregator;
-import java.util.Iterator;
-import java.util.List;
+import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.AbstractCollection;
+import java.util.Iterator;
+import java.util.List;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.apache.camel.processor.aggregate.AggregationCollection;
+import org.apache.camel.processor.aggregate.AggregationStrategy;
/**
* Unit test for using our own aggregation collection.
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationStrategyTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationStrategyTest.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationStrategyTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/CustomAggregationStrategyTest.java
Tue Oct 7 19:30:42 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.camel.processor.aggregator;
import org.apache.camel.ContextTestSupport;
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/DefaultAggregatorCollectionTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/DefaultAggregatorCollectionTest.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/DefaultAggregatorCollectionTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/DefaultAggregatorCollectionTest.java
Tue Oct 7 19:30:42 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.camel.processor.aggregator;
import org.apache.camel.ContextTestSupport;
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/PredicateAggregatorCollectionTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/PredicateAggregatorCollectionTest.java?rev=702683&r1=702682&r2=702683&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/PredicateAggregatorCollectionTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/PredicateAggregatorCollectionTest.java
Tue Oct 7 19:30:42 2008
@@ -1,12 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.camel.processor.aggregator;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.processor.aggregate.AggregationCollection;
import org.apache.camel.processor.aggregate.PredicateAggregationCollection;
import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
-import org.apache.camel.processor.aggregate.AggregationCollection;
/**
* Unit test for PredicateAggregatorCollection.
@@ -44,9 +61,9 @@
public void configure() throws Exception {
// START SNIPPET: e1
// create the aggregation collection we will use.
- // - we will correlate the recieved message based on the id
header
+ // - we will correlate the received message based on the id
header
// - as we will just keep the latest message we use the latest
strategy
- // - and finally we stop aggregate if we recieve 2 or more
messages
+ // - and finally we stop aggregate if we receive 2 or more
messages
AggregationCollection ag = new
PredicateAggregationCollection(header("id"),
new UseLatestAggregationStrategy(),
header(Exchange.AGGREGATED_COUNT).isEqualTo(3));