use of org.junit.rules.TemporaryFolder in project indy by Commonjava.
the class TestProvider method setup.
@PostConstruct
public void setup() {
storeDataManager = new MemoryStoreDataManager(true);
nfc = new MemoryNotFoundCache();
objectMapper = new IndyObjectMapper(false);
fileEventManager = new NoOpFileEventManager();
transferDecorator = new NoOpTransferDecorator();
transportManagerConfig = new TransportManagerConfig();
weftConfig = new DefaultWeftConfig();
globalHttpConfiguration = new GlobalHttpConfiguration();
userLifecycleManager = new AlternativeUserLifecycleManager();
temp = new TemporaryFolder();
try {
temp.create();
cacheProvider = new FileCacheProvider(temp.newFolder("storage"), indyPathGenerator, fileEventManager, new TransferDecoratorManager(transferDecorator));
} catch (IOException e) {
fail("Cannot initialize temporary directory structure");
temp.delete();
}
}
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 ddf by codice.
the class SystemPropertiesAdminTest method setUp.
@Before
public void setUp() throws IOException {
TemporaryFolder temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
etcFolder = temporaryFolder.newFolder("etc");
System.setProperty("karaf.etc", etcFolder.getAbsolutePath());
systemPropsFile = new File(etcFolder, "custom.system.properties");
userPropsFile = new File(etcFolder, "users.properties");
userAttrsFile = new File(etcFolder, "users.attributes");
try (InputStream is = SystemPropertiesAdminTest.class.getResourceAsStream("/custom.system.properties")) {
FileUtils.copyToFile(is, systemPropsFile);
}
}
Aggregations