You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/09/08 06:07:32 UTC

[dubbo] branch 3.0 updated: [3.0] Enhance ExtensionLoaderTest (#8646)

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 2182fae  [3.0] Enhance ExtensionLoaderTest (#8646)
2182fae is described below

commit 2182fae846c67f02a2fcebab80887832c0866653
Author: Wang Chengming <63...@qq.com>
AuthorDate: Wed Sep 8 14:07:19 2021 +0800

    [3.0] Enhance ExtensionLoaderTest (#8646)
    
    * 1.enhance ExtensionLoaderTest
    2.remove unused code and clean code
    
    * remove unused code
---
 .../dubbo/common/extension/ExtensionLoader.java    |  11 --
 .../common/extension/ExtensionLoaderTest.java      | 192 ++++++++++++++++-----
 .../extension/ext11_no_adaptive/NoAdaptiveExt.java |  28 +++
 .../ext11_no_adaptive/NoAdaptiveExtImpl.java       |  24 +++
 ...ommon.extension.ext11_no_adaptive.NoAdaptiveExt |   1 +
 5 files changed, 201 insertions(+), 55 deletions(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java
index 76a3c43..41349da 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java
@@ -462,17 +462,6 @@ public class ExtensionLoader<T> {
         return cachedAdaptiveInstance.get();
     }
 
-//    public T getPrioritizedExtensionInstance() {
-//        Set<String> supported = getSupportedExtensions();
-//
-//        Set<T> instances = new HashSet<>();
-//        Set<T> prioritized = new HashSet<>();
-//        for (String s : supported) {
-//
-//        }
-//
-//    }
-
     /**
      * Find the extension with the given name. If the specified name is not found, then {@link IllegalStateException}
      * will be thrown.
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java
index 258529a..7a6e18f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java
@@ -38,6 +38,8 @@ import org.apache.dubbo.common.extension.ext1.SimpleExt;
 import org.apache.dubbo.common.extension.ext1.impl.SimpleExtImpl1;
 import org.apache.dubbo.common.extension.ext1.impl.SimpleExtImpl2;
 import org.apache.dubbo.common.extension.ext10_multi_names.Ext10MultiNames;
+import org.apache.dubbo.common.extension.ext11_no_adaptive.NoAdaptiveExt;
+import org.apache.dubbo.common.extension.ext11_no_adaptive.NoAdaptiveExtImpl;
 import org.apache.dubbo.common.extension.ext2.Ext2;
 import org.apache.dubbo.common.extension.ext6_wrap.WrappedExt;
 import org.apache.dubbo.common.extension.ext6_wrap.WrappedExtWrapper;
@@ -94,42 +96,42 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getExtensionLoader_Null() throws Exception {
+    public void test_getExtensionLoader_Null() {
         try {
             getExtensionLoader(null);
             fail();
         } catch (IllegalArgumentException expected) {
             assertThat(expected.getMessage(),
-                    containsString("Extension type == null"));
+                containsString("Extension type == null"));
         }
     }
 
     @Test
-    public void test_getExtensionLoader_NotInterface() throws Exception {
+    public void test_getExtensionLoader_NotInterface() {
         try {
             getExtensionLoader(ExtensionLoaderTest.class);
             fail();
         } catch (IllegalArgumentException expected) {
             assertThat(expected.getMessage(),
-                    containsString("Extension type (class org.apache.dubbo.common.extension.ExtensionLoaderTest) is not an interface"));
+                containsString("Extension type (class org.apache.dubbo.common.extension.ExtensionLoaderTest) is not an interface"));
         }
     }
 
     @Test
-    public void test_getExtensionLoader_NotSpiAnnotation() throws Exception {
+    public void test_getExtensionLoader_NotSpiAnnotation() {
         try {
             getExtensionLoader(NoSpiExt.class);
             fail();
         } catch (IllegalArgumentException expected) {
             assertThat(expected.getMessage(),
-                    allOf(containsString("org.apache.dubbo.common.extension.NoSpiExt"),
-                            containsString("is not an extension"),
-                            containsString("NOT annotated with @SPI")));
+                allOf(containsString("org.apache.dubbo.common.extension.NoSpiExt"),
+                    containsString("is not an extension"),
+                    containsString("NOT annotated with @SPI")));
         }
     }
 
     @Test
-    public void test_getDefaultExtension() throws Exception {
+    public void test_getDefaultExtension() {
         SimpleExt ext = getExtensionLoader(SimpleExt.class).getDefaultExtension();
         assertThat(ext, instanceOf(SimpleExtImpl1.class));
 
@@ -138,7 +140,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getDefaultExtension_NULL() throws Exception {
+    public void test_getDefaultExtension_NULL() {
         Ext2 ext = getExtensionLoader(Ext2.class).getDefaultExtension();
         assertNull(ext);
 
@@ -147,13 +149,13 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getExtension() throws Exception {
+    public void test_getExtension() {
         assertTrue(getExtensionLoader(SimpleExt.class).getExtension("impl1") instanceof SimpleExtImpl1);
         assertTrue(getExtensionLoader(SimpleExt.class).getExtension("impl2") instanceof SimpleExtImpl2);
     }
 
     @Test
-    public void test_getExtension_WithWrapper() throws Exception {
+    public void test_getExtension_WithWrapper() {
         WrappedExt impl1 = getExtensionLoader(WrappedExt.class).getExtension("impl1");
         assertThat(impl1, anyOf(instanceOf(Ext5Wrapper1.class), instanceOf(Ext5Wrapper2.class)));
         assertThat(impl1, instanceOf(WrappedExtWrapper.class));
@@ -184,15 +186,15 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getActivateExtension_WithWrapper() throws Exception {
+    public void test_getActivateExtension_WithWrapper() {
         URL url = URL.valueOf("test://localhost/test");
         List<ActivateExt1> list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, new String[]{}, "order");
+            .getActivateExtension(url, new String[]{}, "order");
         assertEquals(2, list.size());
     }
 
     @Test
-    public void test_getExtension_ExceptionNoExtension() throws Exception {
+    public void test_getExtension_ExceptionNoExtension() {
         try {
             getExtensionLoader(SimpleExt.class).getExtension("XXX");
             fail();
@@ -202,7 +204,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getExtension_ExceptionNoExtension_WrapperNotAffactName() throws Exception {
+    public void test_getExtension_ExceptionNoExtension_WrapperNotAffactName() {
         try {
             getExtensionLoader(WrappedExt.class).getExtension("XXX");
             fail();
@@ -212,7 +214,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getExtension_ExceptionNullArg() throws Exception {
+    public void test_getExtension_ExceptionNullArg() {
         try {
             getExtensionLoader(SimpleExt.class).getExtension(null);
             fail();
@@ -222,7 +224,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_hasExtension() throws Exception {
+    public void test_hasExtension() {
         assertTrue(getExtensionLoader(SimpleExt.class).hasExtension("impl1"));
         assertFalse(getExtensionLoader(SimpleExt.class).hasExtension("impl1,impl2"));
         assertFalse(getExtensionLoader(SimpleExt.class).hasExtension("xxx"));
@@ -236,7 +238,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_hasExtension_wrapperIsNotExt() throws Exception {
+    public void test_hasExtension_wrapperIsNotExt() {
         assertTrue(getExtensionLoader(WrappedExt.class).hasExtension("impl1"));
         assertFalse(getExtensionLoader(WrappedExt.class).hasExtension("impl1,impl2"));
         assertFalse(getExtensionLoader(WrappedExt.class).hasExtension("xxx"));
@@ -252,7 +254,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getSupportedExtensions() throws Exception {
+    public void test_getSupportedExtensions() {
         Set<String> exts = getExtensionLoader(SimpleExt.class).getSupportedExtensions();
 
         Set<String> expected = new HashSet<String>();
@@ -264,7 +266,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_getSupportedExtensions_wrapperIsNotExt() throws Exception {
+    public void test_getSupportedExtensions_wrapperIsNotExt() {
         Set<String> exts = getExtensionLoader(WrappedExt.class).getSupportedExtensions();
 
         Set<String> expected = new HashSet<String>();
@@ -275,7 +277,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_AddExtension() throws Exception {
+    public void test_AddExtension() {
         try {
             getExtensionLoader(AddExt1.class).getExtension("Manual1");
             fail();
@@ -291,8 +293,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_AddExtension_NoExtend() throws Exception {
-//        ExtensionLoader.getExtensionLoader(Ext9Empty.class).getSupportedExtensions();
+    public void test_AddExtension_NoExtend() {
         getExtensionLoader(Ext9Empty.class).addExtension("ext9", Ext9EmptyImpl.class);
         Ext9Empty ext = getExtensionLoader(Ext9Empty.class).getExtension("ext9");
 
@@ -301,7 +302,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_AddExtension_ExceptionWhenExistedExtension() throws Exception {
+    public void test_AddExtension_ExceptionWhenExistedExtension() {
         SimpleExt ext = getExtensionLoader(SimpleExt.class).getExtension("impl1");
 
         try {
@@ -313,7 +314,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_AddExtension_Adaptive() throws Exception {
+    public void test_AddExtension_Adaptive() {
         ExtensionLoader<AddExt2> loader = getExtensionLoader(AddExt2.class);
         loader.addExtension(null, AddExt2_ManualAdaptive.class);
 
@@ -322,7 +323,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_AddExtension_Adaptive_ExceptionWhenExistedAdaptive() throws Exception {
+    public void test_AddExtension_Adaptive_ExceptionWhenExistedAdaptive() {
         ExtensionLoader<AddExt1> loader = getExtensionLoader(AddExt1.class);
 
         loader.getAdaptiveExtension();
@@ -336,7 +337,110 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_replaceExtension() throws Exception {
+    public void test_addExtension_with_error_class() {
+        try {
+            getExtensionLoader(SimpleExt.class).addExtension("impl1", ExtensionLoaderTest.class);
+        } catch (IllegalStateException expected) {
+            assertThat(expected.getMessage(),
+                containsString("Input type class org.apache.dubbo.common.extension.ExtensionLoaderTest " +
+                    "doesn't implement the Extension interface org.apache.dubbo.common.extension.ext1.SimpleExt"));
+        }
+    }
+
+    @Test
+    public void test_addExtension_with_interface() {
+        try {
+            getExtensionLoader(SimpleExt.class).addExtension("impl1", SimpleExt.class);
+        } catch (IllegalStateException expected) {
+            assertThat(expected.getMessage(),
+                containsString("Input type interface org.apache.dubbo.common.extension.ext1.SimpleExt " +
+                    "can't be interface!"));
+        }
+    }
+
+    @Test
+    public void test_addExtension_without_adaptive_annotation() {
+        try {
+            getExtensionLoader(NoAdaptiveExt.class).addExtension(null, NoAdaptiveExtImpl.class);
+        } catch (IllegalStateException expected) {
+            assertThat(expected.getMessage(),
+                containsString("Extension name is blank " +
+                    "(Extension interface org.apache.dubbo.common.extension.ext11_no_adaptive.NoAdaptiveExt)!"));
+        }
+    }
+
+    @Test
+    public void test_getLoadedExtension_name_with_null() {
+        try {
+            getExtensionLoader(SimpleExt.class).getLoadedExtension(null);
+        } catch (IllegalArgumentException expected) {
+            assertThat(expected.getMessage(), containsString("Extension name == null"));
+        }
+    }
+
+    @Test
+    public void test_getLoadedExtension_null() {
+        SimpleExt impl1 = getExtensionLoader(SimpleExt.class).getLoadedExtension("XXX");
+        assertNull(impl1);
+    }
+
+    @Test
+    public void test_getLoadedExtension() {
+        SimpleExt simpleExt = getExtensionLoader(SimpleExt.class).getExtension("impl1");
+        assertThat(simpleExt, instanceOf(SimpleExtImpl1.class));
+
+        SimpleExt simpleExt1 = getExtensionLoader(SimpleExt.class).getLoadedExtension("impl1");
+        assertThat(simpleExt1, instanceOf(SimpleExtImpl1.class));
+    }
+
+    @Test
+    public void test_getLoadedExtensions() {
+        SimpleExt simpleExt1 = getExtensionLoader(SimpleExt.class).getExtension("impl1");
+        assertThat(simpleExt1, instanceOf(SimpleExtImpl1.class));
+
+        SimpleExt simpleExt2 = getExtensionLoader(SimpleExt.class).getExtension("impl2");
+        assertThat(simpleExt2, instanceOf(SimpleExtImpl2.class));
+
+        Set<String> loadedExtensions = getExtensionLoader(SimpleExt.class).getLoadedExtensions();
+        Assertions.assertNotNull(loadedExtensions);
+    }
+
+    @Test
+    public void test_getLoadedExtensionInstances() {
+        SimpleExt simpleExt1 = getExtensionLoader(SimpleExt.class).getExtension("impl1");
+        assertThat(simpleExt1, instanceOf(SimpleExtImpl1.class));
+
+        SimpleExt simpleExt2 = getExtensionLoader(SimpleExt.class).getExtension("impl2");
+        assertThat(simpleExt2, instanceOf(SimpleExtImpl2.class));
+
+        List<SimpleExt> loadedExtensionInstances = getExtensionLoader(SimpleExt.class).getLoadedExtensionInstances();
+        Assertions.assertNotNull(loadedExtensionInstances);
+    }
+
+    @Test
+    public void test_replaceExtension_with_error_class() {
+        try {
+            getExtensionLoader(SimpleExt.class).replaceExtension("impl1", ExtensionLoaderTest.class);
+        } catch (IllegalStateException expected) {
+            assertThat(expected.getMessage(),
+                containsString("Input type class org.apache.dubbo.common.extension.ExtensionLoaderTest " +
+                    "doesn't implement Extension interface org.apache.dubbo.common.extension.ext1.SimpleExt"));
+        }
+    }
+
+    @Test
+    public void test_replaceExtension_with_interface() {
+        try {
+            getExtensionLoader(SimpleExt.class).replaceExtension("impl1", SimpleExt.class);
+        } catch (IllegalStateException expected) {
+            assertThat(expected.getMessage(),
+                containsString("Input type interface org.apache.dubbo.common.extension.ext1.SimpleExt " +
+                    "can't be interface!"));
+        }
+    }
+
+    @Test
+    public void test_replaceExtension() {
         try {
             getExtensionLoader(AddExt1.class).getExtension("Manual2");
             fail();
@@ -360,7 +464,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_replaceExtension_Adaptive() throws Exception {
+    public void test_replaceExtension_Adaptive() {
         ExtensionLoader<AddExt3> loader = getExtensionLoader(AddExt3.class);
 
         AddExt3 adaptive = loader.getAdaptiveExtension();
@@ -373,7 +477,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_replaceExtension_ExceptionWhenNotExistedExtension() throws Exception {
+    public void test_replaceExtension_ExceptionWhenNotExistedExtension() {
         AddExt1 ext = getExtensionLoader(AddExt1.class).getExtension("impl1");
 
         try {
@@ -385,7 +489,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_replaceExtension_Adaptive_ExceptionWhenNotExistedExtension() throws Exception {
+    public void test_replaceExtension_Adaptive_ExceptionWhenNotExistedExtension() {
         ExtensionLoader<AddExt4> loader = getExtensionLoader(AddExt4.class);
 
         try {
@@ -397,7 +501,7 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void test_InitError() throws Exception {
+    public void test_InitError() {
         ExtensionLoader<InitErrorExt> loader = getExtensionLoader(InitErrorExt.class);
 
         loader.getExtension("ok");
@@ -412,35 +516,35 @@ public class ExtensionLoaderTest {
     }
 
     @Test
-    public void testLoadActivateExtension() throws Exception {
+    public void testLoadActivateExtension() {
         // test default
         URL url = URL.valueOf("test://localhost/test");
         List<ActivateExt1> list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, new String[]{}, "default_group");
+            .getActivateExtension(url, new String[]{}, "default_group");
         Assertions.assertEquals(1, list.size());
         assertSame(list.get(0).getClass(), ActivateExt1Impl1.class);
 
         // test group
         url = url.addParameter(GROUP_KEY, "group1");
         list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, new String[]{}, "group1");
+            .getActivateExtension(url, new String[]{}, "group1");
         Assertions.assertEquals(1, list.size());
         assertSame(list.get(0).getClass(), GroupActivateExtImpl.class);
 
         // test old @Activate group
         url = url.addParameter(GROUP_KEY, "old_group");
         list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, new String[]{}, "old_group");
+            .getActivateExtension(url, new String[]{}, "old_group");
         Assertions.assertEquals(2, list.size());
         Assertions.assertTrue(list.get(0).getClass() == OldActivateExt1Impl2.class
-                || list.get(0).getClass() == OldActivateExt1Impl3.class);
+            || list.get(0).getClass() == OldActivateExt1Impl3.class);
 
         // test value
         url = url.removeParameter(GROUP_KEY);
         url = url.addParameter(GROUP_KEY, "value");
         url = url.addParameter("value", "value");
         list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, new String[]{}, "value");
+            .getActivateExtension(url, new String[]{}, "value");
         Assertions.assertEquals(1, list.size());
         assertSame(list.get(0).getClass(), ValueActivateExtImpl.class);
 
@@ -448,25 +552,25 @@ public class ExtensionLoaderTest {
         url = URL.valueOf("test://localhost/test");
         url = url.addParameter(GROUP_KEY, "order");
         list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, new String[]{}, "order");
+            .getActivateExtension(url, new String[]{}, "order");
         Assertions.assertEquals(2, list.size());
         assertSame(list.get(0).getClass(), OrderActivateExtImpl1.class);
         assertSame(list.get(1).getClass(), OrderActivateExtImpl2.class);
     }
 
     @Test
-    public void testLoadDefaultActivateExtension() throws Exception {
+    public void testLoadDefaultActivateExtension() {
         // test default
         URL url = URL.valueOf("test://localhost/test?ext=order1,default");
         List<ActivateExt1> list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, "ext", "default_group");
+            .getActivateExtension(url, "ext", "default_group");
         Assertions.assertEquals(2, list.size());
         assertSame(list.get(0).getClass(), OrderActivateExtImpl1.class);
         assertSame(list.get(1).getClass(), ActivateExt1Impl1.class);
 
         url = URL.valueOf("test://localhost/test?ext=default,order1");
         list = getExtensionLoader(ActivateExt1.class)
-                .getActivateExtension(url, "ext", "default_group");
+            .getActivateExtension(url, "ext", "default_group");
         Assertions.assertEquals(2, list.size());
         assertSame(list.get(0).getClass(), ActivateExt1Impl1.class);
         assertSame(list.get(1).getClass(), OrderActivateExtImpl1.class);
@@ -500,8 +604,8 @@ public class ExtensionLoaderTest {
         ext10MultiNames = getExtensionLoader(Ext10MultiNames.class).getExtension("implMultiName");
         Assertions.assertNotNull(ext10MultiNames);
         Assertions.assertThrows(
-                IllegalStateException.class,
-                () -> getExtensionLoader(Ext10MultiNames.class).getExtension("impl,implMultiName")
+            IllegalStateException.class,
+            () -> getExtensionLoader(Ext10MultiNames.class).getExtension("impl,implMultiName")
         );
     }
 
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ext11_no_adaptive/NoAdaptiveExt.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ext11_no_adaptive/NoAdaptiveExt.java
new file mode 100644
index 0000000..fdcb80b
--- /dev/null
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ext11_no_adaptive/NoAdaptiveExt.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.common.extension.ext11_no_adaptive;
+
+import org.apache.dubbo.common.extension.SPI;
+
+/**
+ * Has no Adaptive annotation
+ */
+@SPI
+public interface NoAdaptiveExt {
+
+    String echo(String s);
+}
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ext11_no_adaptive/NoAdaptiveExtImpl.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ext11_no_adaptive/NoAdaptiveExtImpl.java
new file mode 100644
index 0000000..4084202
--- /dev/null
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ext11_no_adaptive/NoAdaptiveExtImpl.java
@@ -0,0 +1,24 @@
+/*
+ * 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.common.extension.ext11_no_adaptive;
+
+public class NoAdaptiveExtImpl implements NoAdaptiveExt {
+
+    public String echo(String s) {
+        return "NoAdaptiveExtImpl-echo";
+    }
+}
diff --git a/dubbo-common/src/test/resources/META-INF/dubbo/internal/org.apache.dubbo.common.extension.ext11_no_adaptive.NoAdaptiveExt b/dubbo-common/src/test/resources/META-INF/dubbo/internal/org.apache.dubbo.common.extension.ext11_no_adaptive.NoAdaptiveExt
new file mode 100644
index 0000000..424046b
--- /dev/null
+++ b/dubbo-common/src/test/resources/META-INF/dubbo/internal/org.apache.dubbo.common.extension.ext11_no_adaptive.NoAdaptiveExt
@@ -0,0 +1 @@
+noAdaptive=org.apache.dubbo.common.extension.ext11_no_adaptive.NoAdaptiveExtImpl