public List<ErasureCodingPolicy> loadPolicy(String policyFilePath) {
    try {
      File policyFile = getPolicyFile(policyFilePath);
      if (!policyFile.exists()) {
        LOG.warn("Not found any EC policy file");
        return Collections.emptyList();
      }
      return loadECPolicies(policyFile);
    } catch (ParserConfigurationException | IOException | SAXException e) {
      throw new RuntimeException("Failed to load EC policy file: "
          + policyFilePath);
    }
  }
@Test
  public void testBadECLayoutVersion() throws Exception {
    PrintWriter out = new PrintWriter(new FileWriter(POLICY_FILE));
    out.println("<?xml version=\"1.0\"?>");
    out.println("<configuration>");
    out.println("<layoutversion>3</layoutversion>");
    out.println("<schemas>");
    out.println("  <schema id=\"RSk12m4\">");
    out.println("    <codec>RS</codec>");
    out.println("    <k>12</k>");
    out.println("    <m>4</m>");
    out.println("  </schema>");
    out.println("  <schema id=\"RS-legacyk12m4\">");
    out.println("    <codec>RS-legacy</codec>");
    out.println("    <k>12</k>");
    out.println("    <m>4</m>");
    out.println("  </schema>");
    out.println("</schemas>");
    out.println("<policies>");
    out.println("  <policy>");
    out.println("    <schema>RSk12m4</schema>");
    out.println("    <cellsize>1024</cellsize>");
    out.println("  </policy>");
    out.println("</policies>");
    out.println("</configuration>");
    out.close();

    ECPolicyLoader ecPolicyLoader = new ECPolicyLoader();

    try {
      ecPolicyLoader.loadPolicy(POLICY_FILE);
      fail("RuntimeException should be thrown for bad layoutversion");
    } catch (RuntimeException e) {
      assertExceptionContains("The parse failed because of "
          + "bad layoutversion value", e);
    }
  }