@Test
  public void testLoadSystemCoprocessorWithPath() throws Exception {
    Configuration conf = TEST_UTIL.getConfiguration();
    final String key = "KEY";
    final String testClassName = "TestSystemCoprocessor";
    final String testClassNameWithPriorityAndPath = testClassName + "PriorityAndPath";

    File jarFile = buildCoprocessorJar(testClassName);
    File jarFileWithPriorityAndPath = buildCoprocessorJar(testClassNameWithPriorityAndPath);

    try {
      CoprocessorHost<RegionCoprocessor, CoprocessorEnvironment<RegionCoprocessor>> host;
      host = new CoprocessorHostForTest<>(conf);

      // make a string of coprocessor with only priority
      int overridePriority = Integer.MAX_VALUE - 1;
      final String coprocessorWithPriority =
        SimpleRegionObserverV3.class.getName() + "|" + overridePriority;
      // make a string of coprocessor with path but no priority
      final String coprocessorWithPath =
        String.format("%s|%s|%s", testClassName, "", jarFile.getAbsolutePath());
      // make a string of coprocessor with priority and path
      final String coprocessorWithPriorityAndPath =
        String.format("%s|%s|%s", testClassNameWithPriorityAndPath, (overridePriority - 1),
          jarFileWithPriorityAndPath.getAbsolutePath());

      // Try and load a system coprocessors
      conf.setStrings(key, SimpleRegionObserverV2.class.getName(), coprocessorWithPriority,
        coprocessorWithPath, coprocessorWithPriorityAndPath);
      host.loadSystemCoprocessors(conf, key);

      // first loaded system coprocessor with default priority
      CoprocessorEnvironment<?> simpleEnv =
        host.findCoprocessorEnvironment(SimpleRegionObserverV2.class.getName());
      assertNotNull(simpleEnv);
      assertEquals(Coprocessor.PRIORITY_SYSTEM, simpleEnv.getPriority());

      // external system coprocessor with default priority
      CoprocessorEnvironment<?> coprocessorEnvironmentWithPath =
        host.findCoprocessorEnvironment(testClassName);
      assertNotNull(coprocessorEnvironmentWithPath);
      assertEquals(Coprocessor.PRIORITY_SYSTEM + 1, coprocessorEnvironmentWithPath.getPriority());

      // system coprocessor with configured priority
      CoprocessorEnvironment<?> coprocessorEnvironmentWithPriority =
        host.findCoprocessorEnvironment(SimpleRegionObserverV3.class.getName());
      assertNotNull(coprocessorEnvironmentWithPriority);
      assertEquals(overridePriority, coprocessorEnvironmentWithPriority.getPriority());

      // external system coprocessor with override priority
      CoprocessorEnvironment<?> coprocessorEnvironmentWithPriorityAndPath =
        host.findCoprocessorEnvironment(testClassNameWithPriorityAndPath);
      assertNotNull(coprocessorEnvironmentWithPriorityAndPath);
      assertEquals(overridePriority - 1, coprocessorEnvironmentWithPriorityAndPath.getPriority());
    } finally {
      if (jarFile.exists()) {
        jarFile.delete();
      }
      if (jarFileWithPriorityAndPath.exists()) {
        jarFileWithPriorityAndPath.delete();
      }
    }
  }
An {@link Abortable} implementation for tests.
hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorHost.java