use of org.junit.rules.TemporaryFolder in project druid by druid-io.
the class ProcCgroupDiscovererTest method testFallBack.
@Test
public void testFallBack() throws Exception {
TemporaryFolder temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
File cgroupDir = temporaryFolder.newFolder();
File procDir = temporaryFolder.newFolder();
TestUtils.setUpCgroups(procDir, cgroupDir);
// Swap out the cgroup path with a default path
FileUtils.deleteDirectory(new File(cgroupDir, "cpu,cpuacct/"));
Assert.assertTrue(new File(cgroupDir, "cpu,cpuacct/").mkdir());
Assert.assertEquals(new File(cgroupDir, "cpu,cpuacct").toPath(), new ProcCgroupDiscoverer(procDir.toPath()).discover("cpu"));
}
use of org.junit.rules.TemporaryFolder in project batfish by batfish.
the class NodJobChunkingTest method setupDataPlane.
private void setupDataPlane() throws IOException {
TemporaryFolder tmp = new TemporaryFolder();
tmp.create();
Batfish batfish = BatfishTestUtils.getBatfish(_configs, tmp);
BdpDataPlanePlugin bdpDataPlanePlugin = new BdpDataPlanePlugin();
bdpDataPlanePlugin.initialize(batfish);
batfish.registerDataPlanePlugin(bdpDataPlanePlugin, "bdp");
batfish.computeDataPlane(false);
_dataPlane = batfish.loadDataPlane();
}
use of org.junit.rules.TemporaryFolder in project batfish by batfish.
the class BatfishCompressionTest method compressNetwork.
private SortedMap<String, Configuration> compressNetwork(Map<String, Configuration> configs, HeaderSpace headerSpace) throws IOException {
TemporaryFolder tmp = new TemporaryFolder();
tmp.create();
IBatfish batfish = BatfishTestUtils.getBatfish(new TreeMap<>(configs), tmp);
return new TreeMap<>(new BatfishCompressor(batfish, configs).compress(headerSpace));
}
use of org.junit.rules.TemporaryFolder in project junit4 by junit-team.
the class TempFolderRuleTest method recursiveDeleteFolderWithZeroElements.
@Test
public void recursiveDeleteFolderWithZeroElements() throws IOException {
TemporaryFolder folder = new TemporaryFolder();
folder.create();
folder.delete();
assertFalse(folder.getRoot().exists());
}
use of org.junit.rules.TemporaryFolder in project buck by facebook.
the class RuleKeyLoggerListenerTest method setUp.
@Before
public void setUp() throws IOException {
tempDirectory = new TemporaryFolder();
tempDirectory.create();
projectFilesystem = new ProjectFilesystem(tempDirectory.getRoot().toPath());
outputExecutor = MostExecutors.newSingleThreadExecutor(new CommandThreadFactory(getClass().getName()));
info = InvocationInfo.of(new BuildId(), false, false, "topspin", tempDirectory.getRoot().toPath());
durationTracker = new BuildRuleDurationTracker();
}
Aggregations