use of org.apache.carbondata.core.datastore.filesystem.LocalCarbonFile in project carbondata by apache.
the class CarbonUtilTest method testToDeleteFoldersAndFilesForValidFolder.
@Test
public void testToDeleteFoldersAndFilesForValidFolder() throws InterruptedException, IOException {
String folderPath = "../core/src/test/resources/testDir/carbonDir";
new File(folderPath).mkdirs();
LocalCarbonFile testDir = new LocalCarbonFile(folderPath);
CarbonUtil.deleteFoldersAndFiles(testDir);
assertTrue(!testDir.exists());
}
use of org.apache.carbondata.core.datastore.filesystem.LocalCarbonFile in project carbondata by apache.
the class CarbonUtilTest method testToDeleteFoldersAndFilesWithInterruptedException.
@Test(expected = InterruptedException.class)
public void testToDeleteFoldersAndFilesWithInterruptedException() throws InterruptedException, IOException {
LocalCarbonFile testDir = new LocalCarbonFile("../core/src/test/resources/testDir/carbonDir");
new MockUp<UserGroupInformation>() {
@SuppressWarnings("unused")
@Mock
public UserGroupInformation getLoginUser() throws InterruptedException {
throw new InterruptedException();
}
};
CarbonUtil.deleteFoldersAndFiles(testDir);
}
use of org.apache.carbondata.core.datastore.filesystem.LocalCarbonFile in project carbondata by apache.
the class CarbonUtilTest method testToDeleteFoldersAndFilesWithIOException.
@Test(expected = IOException.class)
public void testToDeleteFoldersAndFilesWithIOException() throws InterruptedException, IOException {
LocalCarbonFile testDir = new LocalCarbonFile("../core/src/test/resources/testDir/carbonDir");
new MockUp<UserGroupInformation>() {
@SuppressWarnings("unused")
@Mock
public UserGroupInformation getLoginUser() throws IOException {
throw new IOException();
}
};
CarbonUtil.deleteFoldersAndFiles(testDir);
}
use of org.apache.carbondata.core.datastore.filesystem.LocalCarbonFile in project carbondata by apache.
the class CarbonUtilTest method testToDeleteFoldersAndFilesSintlyWithIOException.
@Test(expected = IOException.class)
public void testToDeleteFoldersAndFilesSintlyWithIOException() throws IOException, InterruptedException {
new MockUp<UserGroupInformation>() {
@SuppressWarnings("unused")
@Mock
public UserGroupInformation getLoginUser() throws IOException {
throw new IOException();
}
};
LocalCarbonFile testDir = new LocalCarbonFile("../unibi-solutions/system/carbon/badRecords/badLogPath");
CarbonUtil.deleteFoldersAndFilesSilent(testDir);
}
use of org.apache.carbondata.core.datastore.filesystem.LocalCarbonFile in project carbondata by apache.
the class CarbonUtilTest method testToDeleteFoldersAndFilesSintlyWithInterruptedException.
@Test(expected = InterruptedException.class)
public void testToDeleteFoldersAndFilesSintlyWithInterruptedException() throws IOException, InterruptedException {
new MockUp<UserGroupInformation>() {
@SuppressWarnings("unused")
@Mock
public UserGroupInformation getLoginUser() throws InterruptedException {
throw new InterruptedException();
}
};
LocalCarbonFile testDir = new LocalCarbonFile("../unibi-solutions/system/carbon/badRecords/badLogPath");
CarbonUtil.deleteFoldersAndFilesSilent(testDir);
}
Aggregations