@@ -0,0 +1,1836 @@
+/*%0A * Copyright (c) 1998-2020 John Caron and University Corporation for Atmospheric Research/Unidata%0A *  See LICENSE for license information.%0A */%0A%0Apackage ucar.nc2;%0A%0Aimport java.io.IOException;%0Aimport java.lang.invoke.MethodHandles;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport ucar.nc2.dataset.NetcdfDatasets;%0Aimport ucar.unidata.util.test.TestDir;%0Aimport ucar.unidata.util.test.category.NeedsCdmUnitTest;%0A%0A/** Just open all the files in the selected directory. */%0A@Category(NeedsCdmUnitTest.class)%0Apublic class TestReadFormats %7B%0A  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());%0A%0A  private static int countGood = 0;%0A  private static int countFail = 0;%0A%0A  private List%3CString%3E failFiles = new ArrayList%3C%3E();%0A%0A  @Test%0A  public void testReadFormats() throws IOException %7B%0A    TestDir.actOnAll(TestDir.cdmUnitTestDir + %22/formats/gini%22, null, this::doRead);%0A    TestDir.actOnAll(TestDir.cdmUnitTestDir + %22/formats/fysat%22, null, this::doRead);%0A    System.out.printf(%22Good=%25d Fail=%25d%25n%22, countGood, countFail);%0A    if (countFail %3E 0) %7B%0A      System.out.printf(%22Failed Files%25n%22);%0A      for (String f : failFiles) %7B%0A        System.out.printf(%22  %25s%25n%22, f);%0A      %7D%0A    %7D%0A    assert countFail == 0 : %22Failed = %22 + countFail;%0A  %7D%0A%0A  private int doRead(String name) %7B%0A    try (NetcdfFile ncfile = NetcdfDatasets.openFile(name, null)) %7B%0A      System.out.printf(%22  GOOD on %25s == %25s%25n%22, name, ncfile.getFileTypeId());%0A      countGood++;%0A      return 1;%0A    %7D catch (Throwable t) %7B%0A      System.out.printf(%22  FAIL on %25s == %25s%25n%22, name, t.getMessage());%0A      failFiles.add(name);%0A      t.printStackTrace();%0A      countFail++;%0A      return 0;%0A    %7D%0A  %7D%0A%0A%7D%0A

Split TestReadFormats out of cdm-test.