Fixed typo in name
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5c554b08 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5c554b08 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5c554b08 Branch: refs/heads/master Commit: 5c554b085629018b21a20c4dcbeb90c6cba30503 Parents: 57449b7 Author: Claus Ibsen <davscl...@apache.org> Authored: Sat Jun 24 23:41:29 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sat Jun 24 23:41:29 2017 +0200 ---------------------------------------------------------------------- .../impl/ShutdownGracefuTimeoutTriggerTest.java | 66 -------------------- .../ShutdownGracefulTimeoutTriggerTest.java | 66 ++++++++++++++++++++ 2 files changed, 66 insertions(+), 66 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/5c554b08/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefuTimeoutTriggerTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefuTimeoutTriggerTest.java b/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefuTimeoutTriggerTest.java deleted file mode 100644 index e419785..0000000 --- a/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefuTimeoutTriggerTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.impl; - -import org.apache.camel.ContextTestSupport; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.builder.RouteBuilder; - -/** - * @version - */ -public class ShutdownGracefuTimeoutTriggerTest extends ContextTestSupport { - - private static String foo = ""; - - public void testShutdownGraceful() throws Exception { - // timeout after 2 seconds - context.getShutdownStrategy().setTimeout(2); - - getMockEndpoint("mock:foo").expectedMessageCount(1); - - template.sendBody("seda:foo", "A"); - template.sendBody("seda:foo", "B"); - template.sendBody("seda:foo", "C"); - template.sendBody("seda:foo", "D"); - template.sendBody("seda:foo", "E"); - - assertMockEndpointsSatisfied(); - - // now stop the route before its complete - foo = foo + "stop"; - context.stop(); - - // should not be able to complete all messages as timeout occurred - assertNotSame("Should not able able to complete all pending messages", "stopABCDE", foo); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - from("seda:foo").to("mock:foo").delay(1000).process(new Processor() { - public void process(Exchange exchange) throws Exception { - foo = foo + exchange.getIn().getBody(String.class); - } - }); - } - }; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/5c554b08/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefulTimeoutTriggerTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefulTimeoutTriggerTest.java b/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefulTimeoutTriggerTest.java new file mode 100644 index 0000000..006924b --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/impl/ShutdownGracefulTimeoutTriggerTest.java @@ -0,0 +1,66 @@ +/** + * 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.impl; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; + +/** + * @version + */ +public class ShutdownGracefulTimeoutTriggerTest extends ContextTestSupport { + + private static String foo = ""; + + public void testShutdownGraceful() throws Exception { + // timeout after 2 seconds + context.getShutdownStrategy().setTimeout(2); + + getMockEndpoint("mock:foo").expectedMessageCount(1); + + template.sendBody("seda:foo", "A"); + template.sendBody("seda:foo", "B"); + template.sendBody("seda:foo", "C"); + template.sendBody("seda:foo", "D"); + template.sendBody("seda:foo", "E"); + + assertMockEndpointsSatisfied(); + + // now stop the route before its complete + foo = foo + "stop"; + context.stop(); + + // should not be able to complete all messages as timeout occurred + assertNotSame("Should not able able to complete all pending messages", "stopABCDE", foo); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + @Override + public void configure() throws Exception { + from("seda:foo").to("mock:foo").delay(1000).process(new Processor() { + public void process(Exchange exchange) throws Exception { + foo = foo + exchange.getIn().getBody(String.class); + } + }); + } + }; + } +} \ No newline at end of file