### Question:
IRODSFileReader extends Reader { @Override public void close() throws IOException { log.info("closing irodsFileReader"); irodsFileInputStream.close(); } IRODSFileReader(final IRODSFile irodsFile, final IRODSFileFactory irodsFileFactory); @Override void close(); @Override int read(final char[] cbuf, final int off, final int len); static Logger log; }### Answer:
@Test public void testIRODSFileReaderFile() throws Exception { String testFileName = "testCanRead.txt"; String targetIrodsFile = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + '/' + testFileName); String absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH); String fileNameOrig = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 2); String targetIrodsCollection = testingPropertiesHelper .buildIRODSCollectionAbsolutePathFromTestProperties(testingProperties, IRODS_TEST_SUBDIR_PATH); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); IRODSAccessObjectFactory accessObjectFactory = irodsFileSystem.getIRODSAccessObjectFactory(); DataTransferOperations dto = accessObjectFactory.getDataTransferOperations(irodsAccount); dto.putOperation( fileNameOrig, targetIrodsCollection, testingProperties.getProperty(TestingPropertiesHelper.IRODS_RESOURCE_KEY), null, null); IRODSFileFactory irodsFileFactory = accessObjectFactory.getIRODSFileFactory(irodsAccount); IRODSFileReader reader = irodsFileFactory.instanceIRODSFileReader(targetIrodsFile); reader.close(); Assert.assertNotNull("reader was not returned from factory", reader); }