move configuration class to a seperated packagee
diff --git a/dubbo-samples-annotation/pom.xml b/dubbo-samples-annotation/pom.xml
index 23d7cdb..e59d23d 100644
--- a/dubbo-samples-annotation/pom.xml
+++ b/dubbo-samples-annotation/pom.xml
@@ -31,7 +31,7 @@
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
- <dubbo.version>2.7.4-SNAPSHOT</dubbo.version>
+ <dubbo.version>2.7.3</dubbo.version>
<spring-test.version>4.3.16.RELEASE</spring-test.version>
<junit.version>4.12</junit.version>
<docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
diff --git a/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationConsumerBootstrap.java b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationConsumerBootstrap.java
index 2e2d66b..75f3b43 100644
--- a/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationConsumerBootstrap.java
+++ b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationConsumerBootstrap.java
@@ -19,13 +19,10 @@
package org.apache.dubbo.samples.annotation;
-import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.apache.dubbo.samples.annotation.action.AnnotationAction;
+import org.apache.dubbo.samples.annotation.config.ConsumerConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
public class AnnotationConsumerBootstrap {
@@ -41,12 +38,4 @@
}
- @Configuration
- @EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.annotation.action")
- @PropertySource("classpath:/spring/dubbo-consumer.properties")
- @ComponentScan(value = {"org.apache.dubbo.samples.annotation.action"})
- static public class ConsumerConfiguration {
-
- }
-
}
diff --git a/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationProviderBootstrap.java b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationProviderBootstrap.java
index a22cb60..fc97cd3 100644
--- a/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationProviderBootstrap.java
+++ b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/AnnotationProviderBootstrap.java
@@ -20,13 +20,8 @@
package org.apache.dubbo.samples.annotation;
-import org.apache.dubbo.config.ProviderConfig;
-import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
-
+import org.apache.dubbo.samples.annotation.config.ProviderConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
import java.util.concurrent.CountDownLatch;
@@ -42,16 +37,4 @@
new CountDownLatch(1).await();
}
- @Configuration
- @EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.annotation.impl")
- @PropertySource("classpath:/spring/dubbo-provider.properties")
- static public class ProviderConfiguration {
- @Bean
- public ProviderConfig providerConfig() {
- ProviderConfig providerConfig = new ProviderConfig();
- providerConfig.setTimeout(1000);
- return providerConfig;
- }
- }
-
}
diff --git a/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/config/ConsumerConfiguration.java b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/config/ConsumerConfiguration.java
new file mode 100644
index 0000000..5b508da
--- /dev/null
+++ b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/config/ConsumerConfiguration.java
@@ -0,0 +1,31 @@
+/*
+ * 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.dubbo.samples.annotation.config;
+
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+
+@Configuration
+@EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.annotation.action")
+@PropertySource("classpath:/spring/dubbo-consumer.properties")
+@ComponentScan(value = {"org.apache.dubbo.samples.annotation.action"})
+public class ConsumerConfiguration {
+
+}
diff --git a/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/config/ProviderConfiguration.java b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/config/ProviderConfiguration.java
new file mode 100644
index 0000000..d6a52b5
--- /dev/null
+++ b/dubbo-samples-annotation/src/main/java/org/apache/dubbo/samples/annotation/config/ProviderConfiguration.java
@@ -0,0 +1,36 @@
+/*
+ * 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.dubbo.samples.annotation.config;
+
+import org.apache.dubbo.config.ProviderConfig;
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+
+@Configuration
+@EnableDubbo(scanBasePackages = "org.apache.dubbo.samples.annotation.impl")
+@PropertySource("classpath:/spring/dubbo-provider.properties")
+public class ProviderConfiguration {
+ @Bean
+ public ProviderConfig providerConfig() {
+ ProviderConfig providerConfig = new ProviderConfig();
+ providerConfig.setTimeout(1000);
+ return providerConfig;
+ }
+}
diff --git a/dubbo-samples-annotation/src/test/java/org/apache/dubbo/samples/annotation/AnnotationServicesIT.java b/dubbo-samples-annotation/src/test/java/org/apache/dubbo/samples/annotation/AnnotationServicesIT.java
index aceef35..e7708c6 100644
--- a/dubbo-samples-annotation/src/test/java/org/apache/dubbo/samples/annotation/AnnotationServicesIT.java
+++ b/dubbo-samples-annotation/src/test/java/org/apache/dubbo/samples/annotation/AnnotationServicesIT.java
@@ -19,6 +19,7 @@
import org.apache.dubbo.samples.annotation.action.AnnotationAction;
+import org.apache.dubbo.samples.annotation.config.ConsumerConfiguration;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -27,7 +28,7 @@
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {AnnotationConsumerBootstrap.ConsumerConfiguration.class})
+@ContextConfiguration(classes = {ConsumerConfiguration.class})
public class AnnotationServicesIT {
@Autowired
private AnnotationAction annotationAction;