diff --git a/elastic-job-doc/content/post/release_notes.md b/elastic-job-doc/content/post/release_notes.md
index 619c72c402..d5f2b2e6ad 100644
--- a/elastic-job-doc/content/post/release_notes.md
+++ b/elastic-job-doc/content/post/release_notes.md
@@ -16,6 +16,7 @@ weight=1
### 缺陷修正
1. [ISSUE #74](https://github.com/dangdangdotcom/elastic-job/issues/74) 流式处理且失效转移时,失效转移的分片项不能执行一次即停止
+1. [ISSUE #78](https://github.com/dangdangdotcom/elastic-job/issues/78) Spring方式配置作业监听启用AOP导致不能正常使用问题
## 1.0.5
diff --git a/elastic-job-spring/pom.xml b/elastic-job-spring/pom.xml
index 2816249571..ad0fba9d3f 100644
--- a/elastic-job-spring/pom.xml
+++ b/elastic-job-spring/pom.xml
@@ -28,6 +28,14 @@
- * Licensed 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.
- *
+ * * Licensed 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.
+ * *
+ * * Licensed 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.
+ * *
+ * * Licensed 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.
+ * *
- * Licensed 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
+ * *
+ * * Copyright 1999-2015 dangdang.com.
+ * *
+ * * Licensed 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.
+ * *
- * Licensed 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 + * * + * * Copyright 1999-2015 dangdang.com. + * *
+ * * Licensed 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. + * *
+ * * - * 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 com.dangdang.ddframe.job.fixture; +package com.dangdang.ddframe.job.fixture.listener; import com.dangdang.ddframe.job.api.JobExecutionMultipleShardingContext; import com.dangdang.ddframe.job.api.listener.AbstractDistributeOnceElasticJobListener; +import com.dangdang.ddframe.job.fixture.service.FooService; import javax.annotation.Resource; @@ -42,12 +46,12 @@ public SimpleOnceListener(final long startedTimeoutMilliseconds, final long comp @Override public void doBeforeJobExecutedAtLastStarted(final JobExecutionMultipleShardingContext shardingContext) { - assertThat(startedTimeoutMilliseconds, is(1000L)); + assertThat(startedTimeoutMilliseconds, is(10000L)); assertThat(fooService.foo(), is("this is fooService.")); } @Override public void doAfterJobExecutedAtLastCompleted(final JobExecutionMultipleShardingContext shardingContext) { - assertThat(completedTimeoutMilliseconds, is(2000L)); + assertThat(completedTimeoutMilliseconds, is(20000L)); } } diff --git a/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/service/FooService.java b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/service/FooService.java new file mode 100644 index 0000000000..c26aa7a053 --- /dev/null +++ b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/service/FooService.java @@ -0,0 +1,26 @@ +/* + * * + * * Copyright 1999-2015 dangdang.com. + * *+ * * Licensed 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 com.dangdang.ddframe.job.fixture.service; + +public interface FooService { + + String foo(); +} diff --git a/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/service/FooServiceImpl.java b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/service/FooServiceImpl.java new file mode 100644 index 0000000000..33374417c9 --- /dev/null +++ b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/service/FooServiceImpl.java @@ -0,0 +1,29 @@ +/* + * * + * * Copyright 1999-2015 dangdang.com. + * *+ * * Licensed 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 com.dangdang.ddframe.job.fixture.service; + +public class FooServiceImpl implements FooService { + + @Override + public String foo() { + return "this is fooService."; + } +} diff --git a/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerAndCglibTest.java b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerAndCglibTest.java new file mode 100644 index 0000000000..b00f2f36a0 --- /dev/null +++ b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerAndCglibTest.java @@ -0,0 +1,31 @@ +/* + * * + * * Copyright 1999-2015 dangdang.com. + * *+ * * Licensed 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 com.dangdang.ddframe.job.spring; + +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(locations = "classpath:META-INF/job/withNamespaceAndListenerAndCglib.xml") +public final class WithNamespaceAndListenerAndCglibTest extends AbstractJobSpringIntegrateTest { + + public WithNamespaceAndListenerAndCglibTest() { + super("simpleElasticJob_namespace_listener_cglib", "throughputDataFlowElasticJob_namespace_listener_cglib"); + } +} diff --git a/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/FooServiceImpl.java b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerAndJdkDynamicProxyTest.java similarity index 54% rename from elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/FooServiceImpl.java rename to elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerAndJdkDynamicProxyTest.java index 7e87baf535..8ce3bf05ff 100644 --- a/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/fixture/FooServiceImpl.java +++ b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerAndJdkDynamicProxyTest.java @@ -4,9 +4,9 @@ * Licensed 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. @@ -15,12 +15,14 @@ * */ -package com.dangdang.ddframe.job.fixture; +package com.dangdang.ddframe.job.spring; -public class FooServiceImpl implements FooService { +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(locations = "classpath:META-INF/job/withNamespaceAndListenerAndJdkDynamicProxy.xml") +public final class WithNamespaceAndListenerAndJdkDynamicProxyTest extends AbstractJobSpringIntegrateTest { - @Override - public String foo() { - return "this is fooService."; + public WithNamespaceAndListenerAndJdkDynamicProxyTest() { + super("simpleElasticJob_namespace_listener_jdk_proxy", "throughputDataFlowElasticJob_namespace_listener_jdk_proxy"); } } diff --git a/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerTest.java b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerTest.java index ffddd1e52b..183ca01f29 100644 --- a/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerTest.java +++ b/elastic-job-spring/src/test/java/com/dangdang/ddframe/job/spring/WithNamespaceAndListenerTest.java @@ -20,7 +20,7 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/withNamespaceAndListener.xml") -public final class WithNamespaceAndListenerTest extends AbstractJobSpringIntegrateTest { +public class WithNamespaceAndListenerTest extends AbstractJobSpringIntegrateTest { public WithNamespaceAndListenerTest() { super("simpleElasticJob_namespace_listener", "throughputDataFlowElasticJob_namespace_listener"); diff --git a/elastic-job-spring/src/test/resources/META-INF/job/withNamespace.xml b/elastic-job-spring/src/test/resources/META-INF/job/withNamespace.xml index b1bf51e4fc..d08488970a 100644 --- a/elastic-job-spring/src/test/resources/META-INF/job/withNamespace.xml +++ b/elastic-job-spring/src/test/resources/META-INF/job/withNamespace.xml @@ -1,25 +1,13 @@