test_class.declarator: classLoaderFilter = new ClassLoaderFilter()
test_class.modifier: private
test_class.original_string: private ClassLoaderFilter classLoaderFilter = new ClassLoaderFilter();
test_class.type: ClassLoaderFilter
test_class.var_name: classLoaderFilter
test_class.file: dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/filter/ClassLoaderFilterTest.java
test_class.identifier: ClassLoaderFilterTest
test_case.body: @Test
      public void testInvoke() throws Exception {
          URL url = URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1");
  
          String path = DemoService.class.getResource("/").getPath();
          final URLClassLoader cl = new URLClassLoader(new java.net.URL[]{new java.net.URL("file:" + path)}) {
              @Override
              public Class<?> loadClass(String name) throws ClassNotFoundException {
                  try {
                      return findClass(name);
                  } catch (ClassNotFoundException e) {
                      return super.loadClass(name);
                  }
              }
          };
          final Class<?> clazz = cl.loadClass(DemoService.class.getCanonicalName());
          Invoker invoker = new MyInvoker(url) {
              @Override
              public Class getInterface() {
                  return clazz;
              }
  
              @Override
              public Result invoke(Invocation invocation) throws RpcException {
                  Assertions.assertEquals(cl, Thread.currentThread().getContextClassLoader());
                  return null;
              }
          };
          Invocation invocation = Mockito.mock(Invocation.class);
  
          classLoaderFilter.invoke(invoker, invocation);
      }
test_case.class_method_signature: ClassLoaderFilterTest.testInvoke()
test_case.full_signature: @Test public void testInvoke()
test_case.identifier: testInvoke
test_case.invocations: valueOf getPath getResource findClass loadClass loadClass getCanonicalName assertEquals getContextClassLoader currentThread mock invoke
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvoke()
focal_class.file: dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ClassLoaderFilter.java
focal_class.identifier: ClassLoaderFilter
focal_class.interfaces: implements Filter
focal_class.class_method_signature: ClassLoaderFilter.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_method.body: @Override
      public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
          ClassLoader ocl = Thread.currentThread().getContextClassLoader();
          Thread.currentThread().setContextClassLoader(invoker.getInterface().getClassLoader());
          try {
              return invoker.invoke(invocation);
          } finally {
              Thread.currentThread().setContextClassLoader(ocl);
          }
      }
focal_method.class_method_signature: ClassLoaderFilter.invoke(Invoker<?> invoker, Invocation invocation)
focal_method.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation invocation)
focal_method.identifier: invoke
focal_method.invocations: getContextClassLoader currentThread setContextClassLoader currentThread getClassLoader getInterface invoke setContextClassLoader currentThread
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)