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 testNormalizeMock() {
          Assertions.assertNull(MockInvoker.normalizeMock(null));
  
          Assertions.assertEquals("", MockInvoker.normalizeMock(""));
          Assertions.assertEquals("", MockInvoker.normalizeMock("fail:"));
          Assertions.assertEquals("", MockInvoker.normalizeMock("force:"));
          Assertions.assertEquals("throw", MockInvoker.normalizeMock("throw"));
          Assertions.assertEquals("default", MockInvoker.normalizeMock("fail"));
          Assertions.assertEquals("default", MockInvoker.normalizeMock("force"));
          Assertions.assertEquals("default", MockInvoker.normalizeMock("true"));
          Assertions.assertEquals("default",
                  MockInvoker.normalizeMock("default"));
          Assertions.assertEquals("return null",
                  MockInvoker.normalizeMock("return"));
          Assertions.assertEquals("return null",
                  MockInvoker.normalizeMock("return null"));
      }
test_case.class_method_signature: MockInvokerTest.testNormalizeMock()
test_case.full_signature: @Test public void testNormalizeMock()
test_case.identifier: testNormalizeMock
test_case.invocations: assertNull normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock assertEquals normalizeMock
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNormalizeMock()
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: public static String normalizeMock(String mock) {
          if (mock == null) {
              return mock;
          }
  
          mock = mock.trim();
  
          if (mock.length() == 0) {
              return mock;
          }
  
          if (RETURN_KEY.equalsIgnoreCase(mock)) {
              return RETURN_PREFIX + "null";
          }
  
          if (ConfigUtils.isDefault(mock) || "fail".equalsIgnoreCase(mock) || "force".equalsIgnoreCase(mock)) {
              return "default";
          }
  
          if (mock.startsWith(FAIL_PREFIX)) {
              mock = mock.substring(FAIL_PREFIX.length()).trim();
          }
  
          if (mock.startsWith(FORCE_PREFIX)) {
              mock = mock.substring(FORCE_PREFIX.length()).trim();
          }
  
          if (mock.startsWith(RETURN_PREFIX) || mock.startsWith(THROW_PREFIX)) {
              mock = mock.replace('`', '"');
          }
  
          return mock;
      }
focal_method.class_method_signature: MockInvoker.normalizeMock(String mock)
focal_method.full_signature: public static String normalizeMock(String mock)
focal_method.identifier: normalizeMock
focal_method.invocations: trim length equalsIgnoreCase isDefault equalsIgnoreCase equalsIgnoreCase startsWith trim substring length startsWith trim substring length startsWith startsWith replace
focal_method.modifiers: public static
focal_method.parameters: (String mock)
focal_method.return: String
focal_method.signature: String normalizeMock(String mock)