test_class.file: dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MockInvokerTest.java
test_class.identifier: MockInvokerTest
test_case.body: @Test
      public void testGetMockObject() {
          Assertions.assertEquals("",
                  MockInvoker.getMockObject("java.lang.String", String.class));
  
          Assertions.assertThrows(IllegalStateException.class, () -> MockInvoker
                  .getMockObject("true", String.class));
          Assertions.assertThrows(IllegalStateException.class, () -> MockInvoker
                  .getMockObject("default", String.class));
          Assertions.assertThrows(IllegalStateException.class, () -> MockInvoker
                  .getMockObject("java.lang.String", Integer.class));
          Assertions.assertThrows(IllegalStateException.class, () -> MockInvoker
                  .getMockObject("java.io.Serializable", Serializable.class));
      }
test_case.class_method_signature: MockInvokerTest.testGetMockObject()
test_case.full_signature: @Test public void testGetMockObject()
test_case.identifier: testGetMockObject
test_case.invocations: assertEquals getMockObject assertThrows getMockObject assertThrows getMockObject assertThrows getMockObject assertThrows getMockObject
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetMockObject()
focal_class.declarator: PROXY_FACTORY = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension()
focal_class.modifier: private final static
focal_class.original_string: private final static ProxyFactory PROXY_FACTORY = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
focal_class.type: ProxyFactory
focal_class.var_name: PROXY_FACTORY
focal_class.declarator: MOCK_MAP = new ConcurrentHashMap<String, Invoker<?>>()
focal_class.modifier: private final static
focal_class.original_string: private final static Map<String, Invoker<?>> MOCK_MAP = new ConcurrentHashMap<String, Invoker<?>>();
focal_class.type: Map<String, Invoker<?>>
focal_class.var_name: MOCK_MAP
focal_class.declarator: THROWABLE_MAP = new ConcurrentHashMap<String, Throwable>()
focal_class.modifier: private final static
focal_class.original_string: private final static Map<String, Throwable> THROWABLE_MAP = new ConcurrentHashMap<String, Throwable>();
focal_class.type: Map<String, Throwable>
focal_class.var_name: THROWABLE_MAP
focal_class.declarator: url
focal_class.modifier: private final
focal_class.original_string: private final URL url;
focal_class.type: URL
focal_class.var_name: url
focal_class.declarator: type
focal_class.modifier: private final
focal_class.original_string: private final Class<T> type;
focal_class.type: Class<T>
focal_class.var_name: type
focal_class.file: dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java
focal_class.identifier: MockInvoker
focal_class.interfaces: implements Invoker<T>
focal_class.class_method_signature: MockInvoker.MockInvoker(URL url, Class<T> type)
focal_class.full_signature: public  MockInvoker(URL url, Class<T> type)
focal_class.identifier: MockInvoker
focal_class.modifiers: public
focal_class.parameters: (URL url, Class<T> type)
focal_class.signature:  MockInvoker(URL url, Class<T> type)
focal_class.class_method_signature: MockInvoker.parseMockValue(String mock)
focal_class.full_signature: public static Object parseMockValue(String mock)
focal_class.identifier: parseMockValue
focal_class.modifiers: public static
focal_class.parameters: (String mock)
focal_class.return: Object
focal_class.signature: Object parseMockValue(String mock)
focal_class.class_method_signature: MockInvoker.parseMockValue(String mock, Type[] returnTypes)
focal_class.full_signature: public static Object parseMockValue(String mock, Type[] returnTypes)
focal_class.identifier: parseMockValue
focal_class.modifiers: public static
focal_class.parameters: (String mock, Type[] returnTypes)
focal_class.return: Object
focal_class.signature: Object parseMockValue(String mock, Type[] returnTypes)
focal_class.class_method_signature: MockInvoker.invoke(Invocation invocation)
focal_class.full_signature: @Override public Result invoke(Invocation invocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (Invocation invocation)
focal_class.return: Result
focal_class.signature: Result invoke(Invocation invocation)
focal_class.class_method_signature: MockInvoker.getThrowable(String throwstr)
focal_class.full_signature: public static Throwable getThrowable(String throwstr)
focal_class.identifier: getThrowable
focal_class.modifiers: public static
focal_class.parameters: (String throwstr)
focal_class.return: Throwable
focal_class.signature: Throwable getThrowable(String throwstr)
focal_class.class_method_signature: MockInvoker.getInvoker(String mockService)
focal_class.full_signature: @SuppressWarnings("unchecked") private Invoker<T> getInvoker(String mockService)
focal_class.identifier: getInvoker
focal_class.modifiers: @SuppressWarnings("unchecked") private
focal_class.parameters: (String mockService)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> getInvoker(String mockService)
focal_class.class_method_signature: MockInvoker.getMockObject(String mockService, Class serviceType)
focal_class.full_signature: @SuppressWarnings("unchecked") public static Object getMockObject(String mockService, Class serviceType)
focal_class.identifier: getMockObject
focal_class.modifiers: @SuppressWarnings("unchecked") public static
focal_class.parameters: (String mockService, Class serviceType)
focal_class.return: Object
focal_class.signature: Object getMockObject(String mockService, Class serviceType)
focal_class.class_method_signature: MockInvoker.normalizeMock(String mock)
focal_class.full_signature: public static String normalizeMock(String mock)
focal_class.identifier: normalizeMock
focal_class.modifiers: public static
focal_class.parameters: (String mock)
focal_class.return: String
focal_class.signature: String normalizeMock(String mock)
focal_class.class_method_signature: MockInvoker.getUrl()
focal_class.full_signature: @Override public URL getUrl()
focal_class.identifier: getUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getUrl()
focal_class.class_method_signature: MockInvoker.isAvailable()
focal_class.full_signature: @Override public boolean isAvailable()
focal_class.identifier: isAvailable
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isAvailable()
focal_class.class_method_signature: MockInvoker.destroy()
focal_class.full_signature: @Override public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: MockInvoker.getInterface()
focal_class.full_signature: @Override public Class<T> getInterface()
focal_class.identifier: getInterface
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<T>
focal_class.signature: Class<T> getInterface()
focal_method.body: @SuppressWarnings("unchecked")
      public static Object getMockObject(String mockService, Class serviceType) {
          boolean isDefault = ConfigUtils.isDefault(mockService);
          if (isDefault) {
              mockService = serviceType.getName() + "Mock";
          }
  
          Class<?> mockClass;
          try {
              mockClass = ReflectUtils.forName(mockService);
          } catch (Exception e) {
              if (!isDefault) {// does not check Spring bean if it is default config.
                  ExtensionFactory extensionFactory =
                          ExtensionLoader.getExtensionLoader(ExtensionFactory.class).getAdaptiveExtension();
                  Object obj = extensionFactory.getExtension(serviceType, mockService);
                  if (obj != null) {
                      return obj;
                  }
              }
              throw new IllegalStateException("Did not find mock class or instance "
                      + mockService
                      + ", please check if there's mock class or instance implementing interface "
                      + serviceType.getName(), e);
          }
          if (mockClass == null || !serviceType.isAssignableFrom(mockClass)) {
              throw new IllegalStateException("The mock class " + mockClass.getName() +
                      " not implement interface " + serviceType.getName());
          }
  
          try {
              return mockClass.newInstance();
          } catch (InstantiationException e) {
              throw new IllegalStateException("No default constructor from mock class " + mockClass.getName(), e);
          } catch (IllegalAccessException e) {
              throw new IllegalStateException(e);
          }
      }
focal_method.class_method_signature: MockInvoker.getMockObject(String mockService, Class serviceType)
focal_method.full_signature: @SuppressWarnings("unchecked") public static Object getMockObject(String mockService, Class serviceType)
focal_method.identifier: getMockObject
focal_method.invocations: isDefault getName forName getAdaptiveExtension getExtensionLoader getExtension getName isAssignableFrom getName getName newInstance getName
focal_method.modifiers: @SuppressWarnings("unchecked") public static
focal_method.parameters: (String mockService, Class serviceType)
focal_method.return: Object
focal_method.signature: Object getMockObject(String mockService, Class serviceType)