test_class.declarator: executeLimitFilter = new ExecuteLimitFilter()
test_class.modifier: private
test_class.original_string: private ExecuteLimitFilter executeLimitFilter = new ExecuteLimitFilter();
test_class.type: ExecuteLimitFilter
test_class.var_name: executeLimitFilter
test_class.file: dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/ExecuteLimitFilterTest.java
test_class.identifier: ExecuteLimitFilterTest
test_case.body: @Test
      public void testExecuteLimitInvoke() throws Exception {
          Invoker invoker = Mockito.mock(Invoker.class);
          when(invoker.invoke(any(Invocation.class))).thenReturn(new AppResponse("result"));
          when(invoker.getUrl()).thenReturn(URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1&executes=10"));
  
          Invocation invocation = Mockito.mock(Invocation.class);
          when(invocation.getMethodName()).thenReturn("testExecuteLimitInvoke");
  
          Result result = executeLimitFilter.invoke(invoker, invocation);
          Assertions.assertEquals("result", result.getValue());
      }
test_case.class_method_signature: ExecuteLimitFilterTest.testExecuteLimitInvoke()
test_case.full_signature: @Test public void testExecuteLimitInvoke()
test_case.identifier: testExecuteLimitInvoke
test_case.invocations: mock thenReturn when invoke any thenReturn when getUrl valueOf mock thenReturn when getMethodName invoke assertEquals getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteLimitInvoke()
focal_class.declarator: EXECUTE_LIMIT_FILTER_START_TIME = "execute_limit_filter_start_time"
focal_class.modifier: private static final
focal_class.original_string: private static final String EXECUTE_LIMIT_FILTER_START_TIME = "execute_limit_filter_start_time";
focal_class.type: String
focal_class.var_name: EXECUTE_LIMIT_FILTER_START_TIME
focal_class.file: dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ExecuteLimitFilter.java
focal_class.identifier: ExecuteLimitFilter
focal_class.interfaces: implements Filter, Filter.Listener
focal_class.class_method_signature: ExecuteLimitFilter.invoke(Invoker<?> invoker, Invocation invocation)
focal_class.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation invocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (Invoker<?> invoker, Invocation invocation)
focal_class.return: Result
focal_class.signature: Result invoke(Invoker<?> invoker, Invocation invocation)
focal_class.class_method_signature: ExecuteLimitFilter.onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
focal_class.full_signature: @Override public void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
focal_class.identifier: onResponse
focal_class.modifiers: @Override public
focal_class.parameters: (Result appResponse, Invoker<?> invoker, Invocation invocation)
focal_class.return: void
focal_class.signature: void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
focal_class.class_method_signature: ExecuteLimitFilter.onError(Throwable t, Invoker<?> invoker, Invocation invocation)
focal_class.full_signature: @Override public void onError(Throwable t, Invoker<?> invoker, Invocation invocation)
focal_class.identifier: onError
focal_class.modifiers: @Override public
focal_class.parameters: (Throwable t, Invoker<?> invoker, Invocation invocation)
focal_class.return: void
focal_class.signature: void onError(Throwable t, Invoker<?> invoker, Invocation invocation)
focal_class.class_method_signature: ExecuteLimitFilter.getElapsed(Invocation invocation)
focal_class.full_signature: private long getElapsed(Invocation invocation)
focal_class.identifier: getElapsed
focal_class.modifiers: private
focal_class.parameters: (Invocation invocation)
focal_class.return: long
focal_class.signature: long getElapsed(Invocation invocation)
focal_method.body: @Override
      public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
          URL url = invoker.getUrl();
          String methodName = invocation.getMethodName();
          int max = url.getMethodParameter(methodName, EXECUTES_KEY, 0);
          if (!RpcStatus.beginCount(url, methodName, max)) {
              throw new RpcException(RpcException.LIMIT_EXCEEDED_EXCEPTION,
                      "Failed to invoke method " + invocation.getMethodName() + " in provider " +
                              url + ", cause: The service using threads greater than <dubbo:service executes=\"" + max +
                              "\" /> limited.");
          }
  
          invocation.put(EXECUTE_LIMIT_FILTER_START_TIME, System.currentTimeMillis());
          try {
              return invoker.invoke(invocation);
          } catch (Throwable t) {
              if (t instanceof RuntimeException) {
                  throw (RuntimeException) t;
              } else {
                  throw new RpcException("unexpected exception when ExecuteLimitFilter", t);
              }
          }
      }
focal_method.class_method_signature: ExecuteLimitFilter.invoke(Invoker<?> invoker, Invocation invocation)
focal_method.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation invocation)
focal_method.identifier: invoke
focal_method.invocations: getUrl getMethodName getMethodParameter beginCount getMethodName put currentTimeMillis invoke
focal_method.modifiers: @Override public
focal_method.parameters: (Invoker<?> invoker, Invocation invocation)
focal_method.return: Result
focal_method.signature: Result invoke(Invoker<?> invoker, Invocation invocation)