当前位置: 首页>>代码示例>>Java>>正文


Java TaskOutcome类代码示例

本文整理汇总了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;
        }
    }));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultBuildResult.java

示例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();
        }
    }));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultBuildResult.java

示例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));
}
 
开发者ID:benjamin-bader,项目名称:placeholders-plugin,代码行数:28,代码来源:PlaceholdersPluginTest.java

示例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));
}
 
开发者ID:TTS-TMC,项目名称:neo-java-web-gradle-plugin,代码行数:10,代码来源:InstallLocalTest.java

示例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));
}
 
开发者ID:TTS-TMC,项目名称:neo-java-web-gradle-plugin,代码行数:10,代码来源:InstallLocalTest.java

示例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));
}
 
开发者ID:TTS-TMC,项目名称:neo-java-web-gradle-plugin,代码行数:8,代码来源:DeployTest.java

示例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));

	}
 
开发者ID:TTS-TMC,项目名称:neo-java-web-gradle-plugin,代码行数:13,代码来源:InstallSdkTest.java

示例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) {
	}


}
 
开发者ID:TTS-TMC,项目名称:neo-java-web-gradle-plugin,代码行数:14,代码来源:InstallSdkTest.java

示例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));

}
 
开发者ID:TTS-TMC,项目名称:neo-java-web-gradle-plugin,代码行数:11,代码来源:TestTaskTest.java

示例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());
}
 
开发者ID:freefair,项目名称:gradle-plugins,代码行数:14,代码来源:MavenJarsPluginTest.java

示例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());
}
 
开发者ID:kravemir,项目名称:GradleSassPlugin,代码行数:15,代码来源:HelloSassExampleTest.java

示例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());
}
 
开发者ID:kravemir,项目名称:GradleSassPlugin,代码行数:28,代码来源:IncrementalTasksTest.java

示例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);
}
 
开发者ID:kaklakariada,项目名称:aws-sam-gradle,代码行数:10,代码来源:PluginTest.java

示例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();
}
 
开发者ID:kaklakariada,项目名称:aws-sam-gradle,代码行数:8,代码来源:PluginTest.java

示例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();
}
 
开发者ID:kaklakariada,项目名称:aws-sam-gradle,代码行数:8,代码来源:PluginTest.java


注:本文中的org.gradle.testkit.runner.TaskOutcome类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。