Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ private AbstractBeanDefinition buildServiceBeanDefinition(Service service, Class

MutablePropertyValues propertyValues = beanDefinition.getPropertyValues();

String[] ignoreAttributeNames = of("provider", "monitor", "application", "module", "registry", "protocol", "interface");
String[] ignoreAttributeNames = of("provider", "monitor", "application", "module", "registry", "protocol",
"interface", "interfaceName");

propertyValues.addPropertyValues(new AnnotationPropertyValuesAdapter(service, environment, ignoreAttributeNames));

Expand Down Expand Up @@ -483,4 +484,4 @@ public void setBeanClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.alibaba.dubbo.config.spring.annotation.consumer.AnnotationAction;
import com.alibaba.dubbo.config.spring.api.DemoService;
import com.alibaba.dubbo.config.spring.api.HelloService;
import com.alibaba.dubbo.config.spring.context.annotation.provider.ProviderConfiguration;
import com.alibaba.dubbo.config.spring.filter.MockFilter;
import com.alibaba.dubbo.config.spring.impl.DemoServiceImpl;
import com.alibaba.dubbo.config.spring.impl.HelloServiceImpl;
Expand All @@ -51,6 +52,7 @@
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Collection;
Expand Down Expand Up @@ -106,6 +108,22 @@ public void testServiceClass() {
}
}

@Test
public void testServiceAnnotation() {
AnnotationConfigApplicationContext providerContext = new AnnotationConfigApplicationContext();
providerContext.register(ProviderConfiguration.class);

providerContext.refresh();

ReferenceConfig<HelloService> reference = new ReferenceConfig<HelloService>();
reference.setApplication(new ApplicationConfig("consumer"));
reference.setRegistry(new RegistryConfig(RegistryConfig.NO_AVAILABLE));
reference.setInterface(HelloService.class);
reference.setUrl("dubbo://127.0.0.1:12345");
String hello = reference.get().sayHello("hello");
assertEquals("Hello, hello", hello);
}

@Test
@SuppressWarnings("unchecked")
public void testProviderNestedService() {
Expand Down Expand Up @@ -999,4 +1017,4 @@ public void testGenericServiceConfigThroughSpring() throws Exception {
ctx.destroy();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @since 2.5.9
*/
@Service
@Service(interfaceName = "com.alibaba.dubbo.config.spring.api.HelloService")
public class HelloServiceImpl implements HelloService {

@Override
Expand Down