@BeforeClass public static void setUpBeforeClass() throws Exception { irodsFileSystem = IRODSFileSystem.instance(); org.irods.jargon.testutils.TestingPropertiesHelper testingPropertiesLoader = new TestingPropertiesHelper(); testingProperties = testingPropertiesLoader.getTestProperties(); irodsTestSetupUtilities = new org.irods.jargon.testutils.IRODSTestSetupUtilities(); irodsTestSetupUtilities.initializeIrodsScratchDirectory(); irodsTestSetupUtilities.initializeDirectoryForTest(IRODS_TEST_SUBDIR_PATH); SettableJargonProperties settableJargonProperties = new SettableJargonProperties(irodsFileSystem.getJargonProperties()); jargonOriginalProperties = settableJargonProperties; }
@Test public void testHandleNoObjStatUnderRootOrHomeByLookingForPublicAndHome() throws Exception { IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); SettableJargonProperties props = new SettableJargonProperties(irodsFileSystem.getJargonProperties()); props.setDefaultToPublicIfNothingUnderRootWhenListing(true); irodsFileSystem.getIrodsSession().setJargonProperties(props); CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsFileSystem .getIRODSAccessObjectFactory() .getCollectionAndDataObjectListAndSearchAO(irodsAccount); CollectionListingUtils listingUtils = new CollectionListingUtils(collectionAndDataObjectListAndSearchAO); String path = "/"; ObjStat objStat = listingUtils.handleNoObjStatUnderRootOrHomeByLookingForPublicAndHome(path); Assert.assertNotNull(objStat); Assert.assertTrue(objStat.isStandInGeneratedObjStat()); Assert.assertEquals(path, objStat.getAbsolutePath()); }