use of org.junit.rules.TemporaryFolder in project app-maven-plugin by GoogleCloudPlatform.
the class AbstractDevServerTest method setUpAppEngineWebXml.
protected void setUpAppEngineWebXml() throws IOException {
TemporaryFolder tempFolder = new TemporaryFolder();
tempFolder.create();
File webInf = tempFolder.newFolder("build", "artifact", "WEB-INF");
new File(webInf, "appengine-web.xml").createNewFile();
when(mavenProjectMock.getBuild()).thenReturn(mock(Build.class));
when(mavenProjectMock.getBuild().getDirectory()).thenReturn(webInf.getParentFile().getParentFile().getAbsolutePath());
when(mavenProjectMock.getBuild().getFinalName()).thenReturn("artifact");
}
use of org.junit.rules.TemporaryFolder in project xodus by JetBrains.
the class JMH_MVStoreTokyoCabinetBenchmarkBase method createEnvironment.
private void createEnvironment() throws IOException {
closeStore();
temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
store = new MVStore.Builder().fileName(temporaryFolder.newFile("data").getAbsolutePath()).autoCommitDisabled().open();
}
use of org.junit.rules.TemporaryFolder in project flink by apache.
the class FlinkEmbeddedHiveRunner method classRules.
@Override
protected List<TestRule> classRules() {
// need to load hive runner config before the context is inited
loadAnnotatesHiveRunnerConfig(getTestClass().getJavaClass());
final TemporaryFolder temporaryFolder = new TemporaryFolder();
context = new FlinkEmbeddedHiveServerContext(temporaryFolder, config);
List<TestRule> rules = super.classRules();
ExternalResource hiveShell = new ExternalResource() {
@Override
protected void before() throws Throwable {
container = createHiveServerContainer(getTestClass().getJavaClass(), context);
}
@Override
protected void after() {
tearDown();
}
};
rules.add(hiveShell);
rules.add(temporaryFolder);
return rules;
}
use of org.junit.rules.TemporaryFolder in project flink by apache.
the class RestClusterClientTest method testJobSubmissionWithUserArtifact.
@Test(timeout = 120_000)
public void testJobSubmissionWithUserArtifact() throws Exception {
try (final TestRestServerEndpoint restServerEndpoint = createRestServerEndpoint(new TestJobSubmitHandler())) {
try (RestClusterClient<?> restClusterClient = createRestClusterClient(restServerEndpoint.getServerAddress().getPort())) {
TemporaryFolder temporaryFolder = new TemporaryFolder();
temporaryFolder.create();
File file = temporaryFolder.newFile();
Files.write(file.toPath(), "hello world".getBytes(ConfigConstants.DEFAULT_CHARSET));
// Add file path with scheme
jobGraph.addUserArtifact("file", new DistributedCache.DistributedCacheEntry(file.toURI().toString(), false));
// Add file path without scheme
jobGraph.addUserArtifact("file2", new DistributedCache.DistributedCacheEntry(file.toURI().getPath(), false));
restClusterClient.submitJob(jobGraph).get();
}
}
}
use of org.junit.rules.TemporaryFolder in project flink by apache.
the class LolCacheFactory method create.
@Override
public DownloadCache create() throws IOException {
final TemporaryFolder folder = new TemporaryFolder();
folder.create();
return new LolCache(folder);
}
Aggregations