/** Tests that the variables are degribed to csv and that the csv contains the actual values */
  @Test
  public void testDegribVariables() {
    variable.setName(VARIABLE_NAME);
    variable.setMessages(messages);
    variable.setOutputName(OUTPUT_VARIABLE_NAME);
    variables = new ArrayList<DegribVariable>();
    variables.add(variable);
    degrib.setVariables(variables);

    try {
      degrib.degribVariables();
    } catch (IOException e1) {
      System.out.println("Error running degrib executable");
      e1.printStackTrace();
    }
    String[] extensions = {"csv"};
    Collection<File> result = FileUtils.listFiles(outputDirectory, extensions, false);
    int actualCount = result.size();

    assertEquals(messages.size(), actualCount);
    for (Integer m : messages) {
      System.out.println(m);
      String currentFile = outputDirectory.getPath() + "/" + OUTPUT_VARIABLE_NAME + m + ".csv";
      System.out.println(currentFile);
      try {
        assertTrue(
            FileUtils.directoryContains(
                outputDirectory, new File(outputDirectory, OUTPUT_VARIABLE_NAME + m + ".csv")));
      } catch (IOException e) {
        System.out.println("Error accessing directory");
      }
    }
  }
 /**
  * 判断目录是否包含指定文件或目录
  *
  * @param directory
  * @param child
  * @return
  * @throws IOException
  */
 public static boolean contains(final File directory, final File child) throws IOException {
   return FileUtils.directoryContains(directory, child);
 }