@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE", justification = "Test code") @Test @Category(UnitTest.class) public void testListImages() throws Exception { File dir = new File(Defs.INPUT); File[] files = dir.listFiles(); List<String> base = new ArrayList<String>(); for (File file : files) { if (file.isDirectory()) { File metadataFile = new File(file, "metadata"); if (metadataFile.exists()) { base.add(file.getName()); } } } Collections.sort(base); String[] images = factory.listImages(conf, providerProperties); Arrays.sort(images); Assert.assertEquals("Wrong number of images!", base.size(), images.length); for (int i = 0; i < base.size(); i++) { Assert.assertEquals("Bad image", base.get(i), images[i]); } }
@Override public String[] listImages(Configuration conf, ProviderProperties providerProperties) throws IOException { Path usePath = getBasePath(conf); return listImages(conf, usePath, "", new String[0], providerProperties); }
HdfsMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public String[] listImages(Configuration conf, ProviderProperties providerProperties) throws IOException { Path usePath = getBasePath(conf); return listImages(conf, usePath, "", new String[0], providerProperties); } }
HdfsMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public String[] listImages(Configuration conf, ProviderProperties providerProperties) throws IOException { Path usePath = getBasePath(conf); return listImages(conf, usePath, "", new String[0], providerProperties); }  }
HdfsMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public String[] listImages(Configuration conf, ProviderProperties providerProperties) throws IOException { Path usePath = getBasePath(conf); return listImages(conf, usePath, "", new String[0], providerProperties); }  @Override boolean isValid(); @Override @SuppressWarnings("squid:S2696") // need to keep the conf static, but want to only set it with the object. yuck! void initialize(Configuration config); @Override String getPrefix(); @Override Map<String, String> getConfiguration(); @Override void setConfiguration(Map<String, String> properties); @Override MrsImageDataProvider createMrsImageDataProvider(String input,
    Configuration conf,
    ProviderProperties providerProperties); @Override MrsImageDataProvider createTempMrsImageDataProvider(Configuration conf, ProviderProperties providerProperties); @Override boolean canOpen(String input,
                       Configuration conf,
                       ProviderProperties providerProperties); @Override boolean canWrite(String input,
                        Configuration conf,
                        ProviderProperties providerProperties); @Override String[] listImages(Configuration conf,
                           ProviderProperties providerProperties); @Override boolean exists(String input,
                      Configuration conf,
                      ProviderProperties providerProperties); @Override void delete(String name,
                   Configuration conf,
                   ProviderProperties providerProperties); }
HdfsMrsImageDataProviderFactory implements MrsImageDataProviderFactory { @Override public String[] listImages(Configuration conf, ProviderProperties providerProperties) throws IOException { Path usePath = getBasePath(conf); return listImages(conf, usePath, "", new String[0], providerProperties); }  @Override boolean isValid(); @Override @SuppressWarnings("squid:S2696") // need to keep the conf static, but want to only set it with the object. yuck! void initialize(Configuration config); @Override String getPrefix(); @Override Map<String, String> getConfiguration(); @Override void setConfiguration(Map<String, String> properties); @Override MrsImageDataProvider createMrsImageDataProvider(String input,
    Configuration conf,
    ProviderProperties providerProperties); @Override MrsImageDataProvider createTempMrsImageDataProvider(Configuration conf, ProviderProperties providerProperties); @Override boolean canOpen(String input,
                       Configuration conf,
                       ProviderProperties providerProperties); @Override boolean canWrite(String input,
                        Configuration conf,
                        ProviderProperties providerProperties); @Override String[] listImages(Configuration conf,
                           ProviderProperties providerProperties); @Override boolean exists(String input,
                      Configuration conf,
                      ProviderProperties providerProperties); @Override void delete(String name,
                   Configuration conf,
                   ProviderProperties providerProperties);  }