@Test
  public void testCustomTestClassOptions() throws IOException {
    Queue<String> opts = new LinkedList<>();
    // create custom properties that can be used for a custom test class
    Properties commandProps = new Properties();
    commandProps.put("prop1", "val1");
    String cmdPropsFilePath =
      this.getClass().getClassLoader().getResource("").getPath() + "cmd_properties.txt";
    FileWriter writer = new FileWriter(new File(cmdPropsFilePath));
    commandProps.store(writer, null);
    // create opts for the custom test class - commandPropertiesFile, testClassName
    opts.offer("--commandPropertiesFile=" + "cmd_properties.txt");
    String testClassName = "org.apache.hadoop.hbase.TestPerformanceEvaluation$PESampleTestImpl";
    opts.offer(testClassName);
    opts.offer("1");
    PerformanceEvaluation.TestOptions options = PerformanceEvaluation.parseOpts(opts);
    assertNotNull(options);
    assertNotNull(options.getCmdName());
    assertEquals(testClassName, options.getCmdName());
    assertNotNull(options.getCommandProperties());
    assertEquals("val1", options.getCommandProperties().get("prop1"));
  }
Exercise the mr spec writing. Simple assertions to make sure it is basically working.
hbase-diagnostics/src/test/java/org/apache/hadoop/hbase/TestPerformanceEvaluation.java