This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new a50810b  test: verify the process of exported provider in single 
registry center (#8501)
a50810b is described below

commit a50810b1a6321eb468ed1d626d7cea2abe1ec038
Author: Xiong, Pin <[email protected]>
AuthorDate: Sun Aug 15 09:35:12 2021 -0500

    test: verify the process of exported provider in single registry center 
(#8501)
    
    1. Check if the exporter exported by RegistryProtocolListener, 
ServiceListener and ExporterListener
    2. Check if the provider works well by Filter
---
 ...gistryCenterExportProviderExporterListener.java |  33 +++
 .../SingleRegistryCenterExportProviderFilter.java  |  86 ++++++++
 ...egistryCenterExportProviderIntegrationTest.java | 230 +++++++++++++++++++++
 ...nterExportProviderRegistryProtocolListener.java |  69 +++++++
 .../SingleRegistryCenterExportProviderService.java |  28 +++
 ...gleRegistryCenterExportProviderServiceImpl.java |  30 +++
 ...egistryCenterExportProviderServiceListener.java |  34 +++
 .../org.apache.dubbo.config.ServiceListener        |   1 +
 ....registry.integration.RegistryProtocolListener} |   4 +-
 .../services/org.apache.dubbo.rpc.ExporterListener |   1 +
 .../META-INF/services/org.apache.dubbo.rpc.Filter  |   1 +
 11 files changed, 514 insertions(+), 3 deletions(-)

diff --git 
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderExporterListener.java
 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderExporterListener.java
new file mode 100644
index 0000000..1eca462
--- /dev/null
+++ 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderExporterListener.java
@@ -0,0 +1,33 @@
+/*
+ * 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.integration.single.exportprovider;
+
+import org.apache.dubbo.common.constants.CommonConstants;
+import org.apache.dubbo.common.extension.Activate;
+import org.apache.dubbo.integration.AbstractRegistryCenterExporterListener;
+
+@Activate(group = CommonConstants.PROVIDER, order = 1000)
+public class SingleRegistryCenterExportProviderExporterListener extends 
AbstractRegistryCenterExporterListener {
+
+    /**
+     * Returns the interface of exported service.
+     */
+    @Override
+    protected Class<?> getInterface() {
+        return SingleRegistryCenterExportProviderService.class;
+    }
+}
diff --git 
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderFilter.java
 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderFilter.java
new file mode 100644
index 0000000..79cbc93
--- /dev/null
+++ 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderFilter.java
@@ -0,0 +1,86 @@
+/*
+ * 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.integration.single.exportprovider;
+
+import org.apache.dubbo.common.constants.CommonConstants;
+import org.apache.dubbo.common.extension.Activate;
+import org.apache.dubbo.rpc.Filter;
+import org.apache.dubbo.rpc.Invocation;
+import org.apache.dubbo.rpc.Invoker;
+import org.apache.dubbo.rpc.RpcException;
+import org.apache.dubbo.rpc.Result;
+
+@Activate(group = CommonConstants.PROVIDER, order = 10000)
+public class SingleRegistryCenterExportProviderFilter implements 
Filter,Filter.Listener {
+
+    /**
+     * The filter is called or not
+     */
+    private boolean called = false;
+
+    /**
+     * There has error after invoked
+     */
+    private boolean error = false;
+
+    /**
+     * The returned result
+     */
+    private String response;
+    /**
+     * Always call invoker.invoke() in the implementation to hand over the 
request to the next filter node.
+     *
+     * @param invoker
+     * @param invocation
+     */
+    @Override
+    public Result invoke(Invoker<?> invoker, Invocation invocation) throws 
RpcException {
+        called = true;
+        return invoker.invoke(invocation);
+    }
+
+    @Override
+    public void onResponse(Result appResponse, Invoker<?> invoker, Invocation 
invocation) {
+        response = appResponse.getValue().toString();
+    }
+
+    @Override
+    public void onError(Throwable t, Invoker<?> invoker, Invocation 
invocation) {
+        error = true;
+    }
+
+    /**
+     * Returns if the filter has called.
+     */
+    public boolean hasCalled() {
+        return called;
+    }
+
+    /**
+     * Returns if there exists error.
+     */
+    public boolean hasError() {
+        return error;
+    }
+
+    /**
+     * Returns the response.
+     */
+    public String getResponse() {
+        return response;
+    }
+}
diff --git 
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderIntegrationTest.java
 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderIntegrationTest.java
new file mode 100644
index 0000000..e8d342e
--- /dev/null
+++ 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderIntegrationTest.java
@@ -0,0 +1,230 @@
+/*
+ * 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.integration.single.exportprovider;
+
+import org.apache.dubbo.common.constants.CommonConstants;
+import org.apache.dubbo.common.extension.ExtensionLoader;
+import org.apache.dubbo.config.ServiceConfig;
+import org.apache.dubbo.config.ReferenceConfig;
+import org.apache.dubbo.config.ServiceListener;
+import org.apache.dubbo.config.ApplicationConfig;
+import org.apache.dubbo.config.ProtocolConfig;
+import org.apache.dubbo.config.bootstrap.DubboBootstrap;
+import org.apache.dubbo.integration.IntegrationTest;
+import org.apache.dubbo.registry.integration.RegistryProtocolListener;
+import org.apache.dubbo.registrycenter.DefaultSingleRegistryCenter;
+import org.apache.dubbo.registrycenter.SingleRegistryCenter;
+import org.apache.dubbo.rpc.ExporterListener;
+import org.apache.dubbo.rpc.Filter;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+import static org.apache.dubbo.rpc.Constants.SCOPE_LOCAL;
+
+/**
+ * The testcases are only for checking the core process of exporting provider.
+ */
+public class SingleRegistryCenterExportProviderIntegrationTest implements 
IntegrationTest {
+
+    private static final Logger logger = 
LoggerFactory.getLogger(SingleRegistryCenterExportProviderIntegrationTest.class);
+
+    /**
+     * Define the provider application name.
+     */
+    private static String PROVIDER_APPLICATION_NAME = 
"single-registry-center-for-export-provider";
+
+    /**
+     * The name for getting the specified instance, which is loaded using SPI.
+     */
+    private static String SPI_NAME = "singleConfigCenterExportProvider";
+
+    /**
+     * Define the protocol's name.
+     */
+    private static String PROTOCOL_NAME = CommonConstants.DUBBO;
+    /**
+     * Define the protocol's port.
+     */
+    private static int PROTOCOL_PORT = 20800;
+
+    /**
+     * Define the {@link ServiceConfig} instance.
+     */
+    private ServiceConfig<SingleRegistryCenterExportProviderService> 
serviceConfig;
+
+    /**
+     * Define a registry center.
+     */
+    private SingleRegistryCenter registryCenter;
+
+    /**
+     * Define a {@link RegistryProtocolListener} instance.
+     */
+    private SingleRegistryCenterExportProviderRegistryProtocolListener 
registryProtocolListener;
+
+    /**
+     * Define a {@link ExporterListener} instance.
+     */
+    private SingleRegistryCenterExportProviderExporterListener 
exporterListener;
+
+    /**
+     * Define a {@link Filter} instance.
+     */
+    private SingleRegistryCenterExportProviderFilter filter;
+
+    /**
+     * Define a {@link ServiceListener} instance.
+     */
+    private SingleRegistryCenterExportProviderServiceListener serviceListener;
+
+    @BeforeEach
+    public void setUp() throws Exception {
+        logger.info(getClass().getSimpleName() + " testcase is beginning...");
+        DubboBootstrap.reset();
+        registryCenter = new DefaultSingleRegistryCenter();
+        registryCenter.startup();
+        // initialize service config
+        serviceConfig = new ServiceConfig<>();
+        
serviceConfig.setInterface(SingleRegistryCenterExportProviderService.class);
+        serviceConfig.setRef(new 
SingleRegistryCenterExportProviderServiceImpl());
+        serviceConfig.setAsync(false);
+
+        // initailize bootstrap
+        DubboBootstrap.getInstance()
+            .application(new ApplicationConfig(PROVIDER_APPLICATION_NAME))
+            .registry(registryCenter.getRegistryConfig())
+            .protocol(new ProtocolConfig(PROTOCOL_NAME, PROTOCOL_PORT))
+            .service(serviceConfig);
+    }
+
+    /**
+     * There are some checkpoints need to verify as follow:
+     * <ul>
+     *     <li>ServiceConfig is exported or not</li>
+     *     <li>SingleRegistryCenterExportProviderRegistryProtocolListener is 
null or not</li>
+     *     <li>There is nothing in ServiceListener or not</li>
+     *     <li>There is nothing in ExporterListener or not</li>
+     * </ul>
+     */
+    private void beforeExport() {
+        registryProtocolListener = 
(SingleRegistryCenterExportProviderRegistryProtocolListener) ExtensionLoader
+            .getExtensionLoader(RegistryProtocolListener.class)
+            .getExtension(SPI_NAME);
+        exporterListener = 
(SingleRegistryCenterExportProviderExporterListener) ExtensionLoader
+            .getExtensionLoader(ExporterListener.class)
+            .getExtension(SPI_NAME);
+        filter = (SingleRegistryCenterExportProviderFilter) ExtensionLoader
+            .getExtensionLoader(Filter.class)
+            .getExtension(SPI_NAME);
+        serviceListener = (SingleRegistryCenterExportProviderServiceListener) 
ExtensionLoader
+            .getExtensionLoader(ServiceListener.class)
+            .getExtension(SPI_NAME);
+        // ---------------checkpoints--------------- //
+        // ServiceConfig isn't exported
+        Assertions.assertFalse(serviceConfig.isExported());
+        // registryProtocolListener is just initialized by SPI
+        // so, all of fields are the default value.
+        Assertions.assertNotNull(registryProtocolListener);
+        Assertions.assertFalse(registryProtocolListener.isExported());
+        // There is nothing in ServiceListener
+        Assertions.assertTrue(serviceListener.getExportedServices().isEmpty());
+        // There is nothing in ExporterListener
+        
Assertions.assertTrue(exporterListener.getExportedExporters().isEmpty());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Test
+    @Override
+    public void integrate() {
+        beforeExport();
+        DubboBootstrap.getInstance().start();
+        afterExport();
+        ReferenceConfig<SingleRegistryCenterExportProviderService> 
referenceConfig = new ReferenceConfig<>();
+        
referenceConfig.setInterface(SingleRegistryCenterExportProviderService.class);
+        referenceConfig.setBootstrap(DubboBootstrap.getInstance());
+        referenceConfig.setScope(SCOPE_LOCAL);
+        referenceConfig.get().hello(PROVIDER_APPLICATION_NAME);
+        afterInvoke();
+    }
+
+    /**
+     * There are some checkpoints need to check after exported as follow:
+     * <ul>
+     *     <li>the exporter is exported or not</li>
+     *     <li>The exported exporter are three</li>
+     *     <li>The exported service is 
SingleRegistryCenterExportProviderService or not</li>
+     *     <li>The SingleRegistryCenterExportProviderService is exported or 
not</li>
+     *     <li>The exported exporter contains 
SingleRegistryCenterExportProviderFilter or not</li>
+     * </ul>
+     */
+    private void afterExport() {
+        // The exporter is exported
+        Assertions.assertTrue(registryProtocolListener.isExported());
+        // The exported service is only one
+        Assertions.assertEquals(serviceListener.getExportedServices().size(), 
1);
+        // The exported service is SingleRegistryCenterExportProviderService
+        
Assertions.assertEquals(serviceListener.getExportedServices().get(0).getInterfaceClass(),
+            SingleRegistryCenterExportProviderService.class);
+        // The SingleRegistryCenterExportProviderService is exported
+        
Assertions.assertTrue(serviceListener.getExportedServices().get(0).isExported());
+        // The exported exporter are three
+        // 1. InjvmExporter
+        // 2. DubboExporter with service-discovery-registry protocol
+        // 3. DubboExporter with registry protocol
+        
Assertions.assertEquals(exporterListener.getExportedExporters().size(), 3);
+        // The exported exporter contains 
SingleRegistryCenterExportProviderFilter
+        Assertions.assertTrue(exporterListener.getFilters().contains(filter));
+    }
+
+    /**
+     * There are some checkpoints need to check after invoked as follow:
+     * <ul>
+     *     <li>The SingleRegistryCenterExportProviderFilter has called or 
not</li>
+     *     <li>The SingleRegistryCenterExportProviderFilter exists error after 
invoked</li>
+     *     <li>The SingleRegistryCenterExportProviderFilter's response is 
right or not</li>
+     * </ul>
+     */
+    private void afterInvoke() {
+        // The SingleRegistryCenterInjvmFilter has called
+        Assertions.assertTrue(filter.hasCalled());
+        // The SingleRegistryCenterInjvmFilter doesn't exist error
+        Assertions.assertFalse(filter.hasError());
+        // Check the SingleRegistryCenterInjvmFilter's response
+        Assertions.assertEquals("Hello " + PROVIDER_APPLICATION_NAME, 
filter.getResponse());
+    }
+
+    @AfterEach
+    public void tearDown() throws IOException {
+        DubboBootstrap.reset();
+        PROVIDER_APPLICATION_NAME = null;
+        serviceConfig = null;
+        // The exported service has been unexported
+        Assertions.assertTrue(serviceListener.getExportedServices().isEmpty());
+        logger.info(getClass().getSimpleName() + " testcase is ending...");
+        registryCenter.shutdown();
+        registryProtocolListener = null;
+        registryCenter = null;
+    }
+}
diff --git 
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderRegistryProtocolListener.java
 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderRegistryProtocolListener.java
new file mode 100644
index 0000000..bf8f3a3
--- /dev/null
+++ 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderRegistryProtocolListener.java
@@ -0,0 +1,69 @@
+/*
+ * 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.integration.single.exportprovider;
+
+import org.apache.dubbo.common.URL;
+import org.apache.dubbo.common.extension.Activate;
+import 
org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol;
+import org.apache.dubbo.registry.integration.RegistryProtocol;
+import org.apache.dubbo.registry.integration.RegistryProtocolListener;
+import org.apache.dubbo.rpc.Exporter;
+import org.apache.dubbo.rpc.cluster.ClusterInvoker;
+
+/**
+ * The {@link RegistryProtocolListener} for {@link 
SingleRegistryCenterExportProviderService}
+ */
+@Activate(order = 100)
+public class SingleRegistryCenterExportProviderRegistryProtocolListener 
implements RegistryProtocolListener {
+
+    private boolean exported = false;
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onExport(RegistryProtocol registryProtocol, Exporter<?> 
exporter) {
+        if (registryProtocol instanceof InterfaceCompatibleRegistryProtocol
+            && exporter != null
+            && exporter.getInvoker() != null
+            && 
exporter.getInvoker().getInterface().equals(SingleRegistryCenterExportProviderService.class))
 {
+            this.exported = true;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onRefer(RegistryProtocol registryProtocol, ClusterInvoker<?> 
invoker, URL url, URL registryURL) {
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void onDestroy() {
+    }
+
+    /**
+     * Returns if this exporter is exported.
+     */
+    public boolean isExported() {
+        return exported;
+    }
+}
diff --git 
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderService.java
 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderService.java
new file mode 100644
index 0000000..4ea9980
--- /dev/null
+++ 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderService.java
@@ -0,0 +1,28 @@
+/*
+ * 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.integration.single.exportprovider;
+
+/**
+ * This interface is used to check if the exported provider works well or not.
+ */
+public interface SingleRegistryCenterExportProviderService {
+
+    /**
+     * The simple method for testing.
+     */
+    String hello(String name);
+}
diff --git 
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderServiceImpl.java
 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderServiceImpl.java
new file mode 100644
index 0000000..01aad07
--- /dev/null
+++ 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderServiceImpl.java
@@ -0,0 +1,30 @@
+/*
+ * 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.integration.single.exportprovider;
+
+/**
+ * The implementation of {@link SingleRegistryCenterExportProviderService}
+ */
+public class SingleRegistryCenterExportProviderServiceImpl implements 
SingleRegistryCenterExportProviderService {
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String hello(String name) {
+        return "Hello " + name;
+    }
+}
diff --git 
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderServiceListener.java
 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderServiceListener.java
new file mode 100644
index 0000000..1eefe4d
--- /dev/null
+++ 
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/single/exportprovider/SingleRegistryCenterExportProviderServiceListener.java
@@ -0,0 +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.dubbo.integration.single.exportprovider;
+
+import org.apache.dubbo.config.ServiceListener;
+import org.apache.dubbo.integration.AbstractRegistryCenterServiceListener;
+
+/**
+ * This implementation of {@link ServiceListener} is to record exported 
services with injvm protocol in single registry center.
+ */
+public class SingleRegistryCenterExportProviderServiceListener extends 
AbstractRegistryCenterServiceListener {
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Class<?> getInterface() {
+        return SingleRegistryCenterExportProviderService.class;
+    }
+}
diff --git 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.config.ServiceListener
 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.config.ServiceListener
index b7e2dab..fadb1c2 100644
--- 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.config.ServiceListener
+++ 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.config.ServiceListener
@@ -2,3 +2,4 @@ mock=org.apache.dubbo.config.mock.MockServiceListener
 
exported=org.apache.dubbo.integration.single.SingleRegistryCenterExportedServiceListener
 
singleConfigCenterInjvm=org.apache.dubbo.integration.single.injvm.SingleRegistryCenterInjvmServiceListener
 
multipleConfigCenterInjvm=org.apache.dubbo.integration.multiple.injvm.MultipleRegistryCenterInjvmServiceListener
+singleConfigCenterExportProvider=org.apache.dubbo.integration.single.exportprovider.SingleRegistryCenterExportProviderServiceListener
diff --git 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.ExporterListener
 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.registry.integration.RegistryProtocolListener
similarity index 72%
copy from 
dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.ExporterListener
copy to 
dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.registry.integration.RegistryProtocolListener
index 51f85f7..244d907 100644
--- 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.ExporterListener
+++ 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.registry.integration.RegistryProtocolListener
@@ -15,6 +15,4 @@
 # limitations under the License.
 #
 
-mockexporterlistener=org.apache.dubbo.config.mock.MockExporterListener
-singleConfigCenterInjvm=org.apache.dubbo.integration.single.injvm.SingleRegistryCenterInjvmExporterListener
-multipleConfigCenterInjvm=org.apache.dubbo.integration.multiple.injvm.MultipleRegistryCenterInjvmExporterListener
+singleConfigCenterExportProvider=org.apache.dubbo.integration.single.exportprovider.SingleRegistryCenterExportProviderRegistryProtocolListener
diff --git 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.ExporterListener
 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.ExporterListener
index 51f85f7..b9231ee 100644
--- 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.ExporterListener
+++ 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.ExporterListener
@@ -18,3 +18,4 @@
 mockexporterlistener=org.apache.dubbo.config.mock.MockExporterListener
 
singleConfigCenterInjvm=org.apache.dubbo.integration.single.injvm.SingleRegistryCenterInjvmExporterListener
 
multipleConfigCenterInjvm=org.apache.dubbo.integration.multiple.injvm.MultipleRegistryCenterInjvmExporterListener
+singleConfigCenterExportProvider=org.apache.dubbo.integration.single.exportprovider.SingleRegistryCenterExportProviderExporterListener
diff --git 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.Filter
 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.Filter
index 9bf8f99..faba059 100644
--- 
a/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.Filter
+++ 
b/dubbo-config/dubbo-config-api/src/test/resources/META-INF/services/org.apache.dubbo.rpc.Filter
@@ -1,3 +1,4 @@
 mockfilter=org.apache.dubbo.config.mock.MockFilter
 
singleConfigCenterInjvm=org.apache.dubbo.integration.single.injvm.SingleRegistryCenterInjvmFilter
 
multipleConfigCenterInjvm=org.apache.dubbo.integration.multiple.injvm.MultipleRegistryCenterInjvmFilter
+singleConfigCenterExportProvider=org.apache.dubbo.integration.single.exportprovider.SingleRegistryCenterExportProviderFilter

Reply via email to