类org.junitpioneer.jupiter.TempDirectory.TempDir源码实例Demo

下面列出了怎么用org.junitpioneer.jupiter.TempDirectory.TempDir的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: joinfaces   文件: JoinfacesPluginIT.java
@ParameterizedTest
@ValueSource(strings = {"5.1.1", "5.4.1", "5.6.2"})
public void build(String gradleVersion, @TempDir Path projectDir) throws IOException {
	Files.write(projectDir.resolve("settings.gradle"), Collections.singleton("rootProject.name = 'dummy'"));

	Files.write(projectDir.resolve("build.gradle"), Arrays.asList(
			"plugins {",
			"    id 'java'",
			"    id 'groovy'",
			"    id 'scala'",
			"    id 'org.joinfaces'",
			"}",
			"repositories { mavenCentral() }",
			"dependencies {",
			"    compile 'org.apache.myfaces.core:myfaces-impl:2.3.2'",
			"}"
	));

	BuildResult buildResult = GradleRunner.create()
			.withProjectDir(projectDir.toFile())
			.withPluginClasspath()
			.withArguments("jar", "-s", "--info")
			.withDebug(true)
			.withGradleVersion(gradleVersion)
			.build();

	BuildTask scanClasspath = buildResult.task(":scanJoinfacesClasspath");
	assertThat(scanClasspath).isNotNull();
	assertThat(scanClasspath.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);

	File jarFile = projectDir.resolve("build/libs/dummy.jar").toFile();
	assertThat(jarFile).isFile();

	try (ZipFile zipFile = new ZipFile(jarFile)) {
		assertThat(zipFile.getEntry("META-INF/joinfaces/org.apache.myfaces.ee.MyFacesContainerInitializer.classes")).isNotNull();
		assertThat(zipFile.getEntry("META-INF/joinfaces/org.apache.myfaces.spi.AnnotationProvider.classes")).isNotNull();
	}
}
 
源代码2 项目: jbake   文件: AssetTest.java
@BeforeEach
public void setup(@TempDir Path folder) throws Exception {
    fixtureDir = new File(this.getClass().getResource("/fixture").getFile());
    this.folder = folder;
    config = (DefaultJBakeConfiguration) new ConfigUtil().loadConfig(fixtureDir);
    config.setDestinationFolder(folder.toFile());
    Assertions.assertEquals(".html", config.getOutputExtension());
}
 
源代码3 项目: demo-junit-5   文件: PioneerTest.java
@Test
@ExtendWith(TempDirectory.class)
void testTempDirInjection(@TempDir Path tempDir, TestReporter reporter) {
	assertNotNull(tempDir);
	reporter.publishEntry("Temporary directory", tempDir.toString());
}
 
源代码4 项目: jbake   文件: JBakeConfigurationInspectorTest.java
@BeforeEach
public void setup(@TempDir Path folder) {
    this.folder = folder;
}
 
源代码5 项目: jbake   文件: ConfigUtilTest.java
@BeforeEach
public void setup(@TempDir Path folder) {
    this.sourceFolder = folder;
    this.util = new ConfigUtil();
}
 
 类所在包
 类方法
 同包方法