本文整理汇总了Java中org.gradle.testkit.runner.TaskOutcome类的典型用法代码示例。如果您正苦于以下问题:Java TaskOutcome类的具体用法?Java TaskOutcome怎么用?Java TaskOutcome使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TaskOutcome类属于org.gradle.testkit.runner包,在下文中一共展示了TaskOutcome类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tasks
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Override
public List<BuildTask> tasks(final TaskOutcome outcome) {
return Collections.unmodifiableList(CollectionUtils.filter(tasks, new Spec<BuildTask>() {
public boolean isSatisfiedBy(BuildTask element) {
return element.getOutcome() == outcome;
}
}));
}
示例2: taskPaths
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Override
public List<String> taskPaths(TaskOutcome outcome) {
return Collections.unmodifiableList(CollectionUtils.collect(tasks(outcome), new Transformer<String, BuildTask>() {
public String transform(BuildTask buildTask) {
return buildTask.getPath();
}
}));
}
示例3: canBeApplied
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void canBeApplied() throws Exception {
String gradle = "" +
"apply plugin: 'com.android.application'\n" +
"apply plugin: 'com.bendb.placeholders'\n" +
"\n" +
"buildscript {\n" +
"repositories {\n" +
" jcenter()\n" +
"}\n" +
"dependencies {\n" +
" classpath 'com.android.tools.build:gradle:3.0.0-alpha4'\n" +
"}\n" +
"}" +
"android {\n" +
"}";
Files.write(buildFile.toPath(), gradle.getBytes("UTF-8"));
BuildResult result = GradleRunner.create()
.withProjectDir(tempFolder.getRoot())
.withArguments("assemble")
.withPluginClasspath(pluginClasspath)
.build();
assertThat(result.task(":processDebugResourcePlaceholders").getOutcome(), is(TaskOutcome.SUCCESS));
}
示例4: installLocalWithDefaultValuesTest
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
public void installLocalWithDefaultValuesTest() throws Exception {
setUpDefaultProject();
BuildResult result = GradleRunner.create().withProjectDir(testProjectDir.getRoot()).withPluginClasspath()
.withArguments("installSdk", "installLocal", "--info").forwardOutput().build();
//System.out.println(result.getOutput());
assertThat(result.task(":" + "installLocal").getOutcome(), equalTo(TaskOutcome.SUCCESS));
File serverLocation = new File(testProjectDir.getRoot().getPath().concat(File.separator).concat(".sdk").concat(File.separator).concat("server"));
assertThat("server was installed in default location",serverLocation.exists(), equalTo(true));
}
示例5: installLocalWithCustomServerLocation
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
public void installLocalWithCustomServerLocation() throws Exception {
setUpCustomProjectServerlocation();
BuildResult result = GradleRunner.create().withProjectDir(testProjectDir.getRoot()).withPluginClasspath()
.withArguments("installSdk", "installLocal", "--info").build();
//System.out.println(result.getOutput());
assertThat(result.task(":" + "installLocal").getOutcome(), equalTo(TaskOutcome.SUCCESS));
File serverLocation = new File(testProjectDir.getRoot().getPath().concat(File.separator).concat("test"));
assertThat("server was installed in default location",serverLocation.exists(), equalTo(true));
}
示例6: test
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void test() throws Exception {
setUpBuildFile();
BuildResult result = GradleRunner.create().withProjectDir(testProjectDir.getRoot()).withPluginClasspath()
.withArguments("installSdk", "deploy", "--info").forwardOutput().build();
assertThat(result.task(":" + "deploy").getOutcome(), equalTo(TaskOutcome.SUCCESS));
}
示例7: testPositiveCustomLocation
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
public void testPositiveCustomLocation() throws Exception {
setUpPositiveCustomLocation();
BuildResult result = GradleRunner.create().withProjectDir(testProjectDir.getRoot()).withPluginClasspath()
.withArguments("installSdk", "--info").build();
// System.out.println(result.getOutput());
assertThat(result.task(":" + "installSdk").getOutcome(), equalTo(TaskOutcome.SUCCESS));
File sdkLocation = new File(testProjectDir.getRoot().getPath().concat(File.separator).concat("test"));
assertThat("Sdk was downloaded and extracted to custom location", sdkLocation.exists(), equalTo(true));
}
示例8: testNegativeCustomLocation
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
public void testNegativeCustomLocation() throws Exception {
setUpNegativeCustomLocation();
try {
BuildResult result = GradleRunner.create().withProjectDir(testProjectDir.getRoot()).withPluginClasspath()
.withArguments("installSdk", "--info").build();
System.out.println(result.getOutput());
assertThat(result.task(":" + "installSdk").getOutcome(), equalTo(TaskOutcome.FAILED));
} catch (Exception e) {
}
}
示例9: testPositiveCustomLocation
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void testPositiveCustomLocation() throws Exception {
setup();
BuildResult result = GradleRunner.create().withProjectDir(testProjectDir.getRoot()).withPluginClasspath()
.withArguments("info", "--info").forwardOutput().withDebug(true).build();
// System.out.println(result.getOutput());
assertThat(result.task(":" + "info").getOutcome(), equalTo(TaskOutcome.SUCCESS));
}
示例10: apply
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void apply() throws Exception {
loadBuildFileFromClasspath("maven-jars.gradle");
BuildResult buildResult = GradleRunner.create()
.withProjectDir(testProjectDir.getRoot())
.withArguments("assemble", "--stacktrace")
.withPluginClasspath()
.withDebug(true)
.build();
assertEquals(TaskOutcome.SUCCESS, buildResult.task(":sourcesJar").getOutcome());
}
示例11: checkBuiltFiles
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void checkBuiltFiles() {
BuildResult result = GradleRunner.create()
.withProjectDir(testProjectDir.getRoot())
.withArguments("mainSass")
.withPluginClasspath()
.build();
assertEquals("check that ':mainSass' task succeeded", result.task(":mainSass").getOutcome(),TaskOutcome.SUCCESS);
Path mainSassBuildRoot = Paths.get(testProjectDir.getRoot().getPath(), "build", "sass", "main");
assertTrue(mainSassBuildRoot.resolve(Paths.get("main.css")).toFile().exists());
assertTrue(mainSassBuildRoot.resolve(Paths.get("relPath","foo.css")).toFile().exists());
}
示例12: testFooDeletion
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void testFooDeletion() {
BuildResult result = GradleRunner.create()
.withProjectDir(testProjectDir.getRoot())
.withArguments("mainSass")
.withPluginClasspath()
.build();
assertEquals("check that ':mainSass' task succeeded", result.task(":mainSass").getOutcome(), TaskOutcome.SUCCESS);
Path mainSassBuildRoot = Paths.get(testProjectDir.getRoot().getPath(), "build", "sass", "main");
assertTrue(mainSassBuildRoot.resolve(Paths.get("main.css")).toFile().exists());
assertTrue(mainSassBuildRoot.resolve(Paths.get("foo.css")).toFile().exists());
fooScss.delete();
BuildResult result2 = GradleRunner.create()
.withProjectDir(testProjectDir.getRoot())
.withArguments("mainSass")
.withPluginClasspath()
.build();
assertEquals("check that ':mainSass' task succeeded", result2.task(":mainSass").getOutcome(), TaskOutcome.SUCCESS);
assertTrue(mainSassBuildRoot.resolve(Paths.get("main.css")).toFile().exists());
assertFalse(mainSassBuildRoot.resolve(Paths.get("foo.css")).toFile().exists());
}
示例13: testDeleteStack
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void testDeleteStack() {
runBuild(MINIMAL_PROJECT_DIR, //
"clean", "deploy");
assertEquals(buildResult.task(":deploy").getOutcome(), TaskOutcome.SUCCESS);
runBuild(MINIMAL_PROJECT_DIR, //
"deleteStack");
assertEquals(buildResult.task(":deleteStack").getOutcome(), TaskOutcome.SUCCESS);
}
示例14: testDeploySwaggerApp
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void testDeploySwaggerApp() throws ClientProtocolException, IOException {
runBuild(SWAGGER_PROJECT_DIR, //
"clean", "deploy");
assertEquals(buildResult.task(":deploy").getOutcome(), TaskOutcome.SUCCESS);
assertApiGatewayDeployed();
}
示例15: testDeployInlineSwaggerApp
import org.gradle.testkit.runner.TaskOutcome; //导入依赖的package包/类
@Test
public void testDeployInlineSwaggerApp() throws ClientProtocolException, IOException {
runBuild(INLINE_SWAGGER_PROJECT_DIR, //
"clean", "deploy");
assertEquals(buildResult.task(":deploy").getOutcome(), TaskOutcome.SUCCESS);
assertApiGatewayDeployed();
}