本文整理汇总了Java中io.takari.maven.testing.executor.MavenExecutionResult类的典型用法代码示例。如果您正苦于以下问题:Java MavenExecutionResult类的具体用法?Java MavenExecutionResult怎么用?Java MavenExecutionResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MavenExecutionResult类属于io.takari.maven.testing.executor包,在下文中一共展示了MavenExecutionResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: basicItClearcaseScmTest
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void basicItClearcaseScmTest()
throws Exception
{
File projDir = resources.getBasedir( "basic-it-clearcase-scm" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "verify" );
File testDir = result.getBasedir();
result.assertLogText( "Storing buildNumber: foo" );
result.assertLogText( "Storing buildScmBranch: UNKNOWN_BRANCH" );
File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-clearcase-scm-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Attributes manifest = jarFile.getManifest().getMainAttributes();
jarFile.close();
String scmRev = manifest.getValue( "SCM-Revision" );
Assert.assertEquals( "foo", scmRev );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:20,代码来源:BuildNumberMojoTest.java
示例2: createTimestampItTest
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void createTimestampItTest()
throws Exception
{
File projDir = resources.getBasedir( "create-timestamp-it" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "verify" );
File testDir = result.getBasedir();
File artifact = new File( testDir, "target/buildnumber-maven-plugin-create-timestamp-it-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Attributes manifest = jarFile.getManifest().getMainAttributes();
jarFile.close();
String timestamp = manifest.getValue( "Build-Time" );
SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss" );
Date theDate = format.parse( timestamp );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:19,代码来源:BuildNumberMojoTest.java
示例3: failLocalChangeItTest
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
@Ignore
// svn local db corrupted
public void failLocalChangeItTest()
throws Exception
{
File projDir = resources.getBasedir( "failed-local-change" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean" );
result.assertErrorFreeLog();
File basedir = result.getBasedir();
File foo = new File( basedir, "foo.txt" );
FileUtils.fileWrite( foo, "hello" );
FileUtils.copyDirectory( new File( basedir, "DotSvnDir" ), new File( basedir, ".svn" ) );
result = mavenExec.execute( "verify" );
// this fail local dotSvnDir corrupted, not b/c we change local file
result.assertLogText( "BUILD FAILURE" );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:20,代码来源:BuildNumberMojoTest.java
示例4: gitBasicItMBUILDNUM66Test
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
@Ignore
// git local database corrected
public void gitBasicItMBUILDNUM66Test()
throws Exception
{
File projDir = resources.getBasedir( "git-basic-it-MBUILDNUM-66" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean" );
result.assertErrorFreeLog();
File basedir = result.getBasedir();
File foo = new File( basedir, "foo.txt" );
FileUtils.fileWrite( foo, "hello" );
FileUtils.copyDirectory( new File( basedir, "dotGitDir" ), new File( basedir, ".git" ) );
result = mavenExec.execute( "verify" );
// this fail local dotSvnDir corrupted, not b/c we change local file
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:20,代码来源:BuildNumberMojoTest.java
示例5: mBuildNum83Test
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void mBuildNum83Test()
throws Exception
{
File projDir = resources.getBasedir( "MBUILDNUM-83" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "verify" );
result.assertErrorFreeLog();
File testDir = result.getBasedir();
File artifact = new File( testDir, "target/buildnumber-maven-plugin-basic-it-svnjava-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Attributes manifest = jarFile.getManifest().getMainAttributes();
jarFile.close();
String scmRev = manifest.getValue( "SCM-Revision" );
Assert.assertEquals( "booom", scmRev ); // ??? biim?
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:19,代码来源:BuildNumberMojoTest.java
示例6: Mojo1668Test
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void Mojo1668Test()
throws Exception
{
if ( !isSvn18() )
{
System.out.println( "Not Subversion 1.8 compatible. Skip test" );
return;
}
File projDir = resources.getBasedir( "MOJO-1668" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean" );
result.assertErrorFreeLog();
File testDir = result.getBasedir();
FileUtils.copyDirectory( new File( testDir, "DotSvnDir" ), new File( testDir, ".svn" ) );
result = mavenExec.execute( "clean", "verify" );
File artifact = new File( testDir, "target/buildnumber-maven-plugin-MOJO-1668-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Attributes manifest = jarFile.getManifest().getMainAttributes();
jarFile.close();
String buildDate = manifest.getValue( "Build-Date" );
Assert.assertTrue( buildDate.length() > 0 );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:27,代码来源:BuildNumberMojoTest.java
示例7: noRevisionItTest
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void noRevisionItTest()
throws Exception
{
File projDir = resources.getBasedir( "norevision-it" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "verify" );
result.assertErrorFreeLog();
File testDir = result.getBasedir();
File artifact = new File( testDir, "target/buildnumber-maven-plugin-norevision-it-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Attributes manifest = jarFile.getManifest().getMainAttributes();
jarFile.close();
String scmRev = manifest.getValue( "SCM-Revision" );
Assert.assertTrue( StringUtils.isBlank( scmRev ) );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:19,代码来源:BuildNumberMojoTest.java
示例8: skipItTest
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void skipItTest()
throws Exception
{
File projDir = resources.getBasedir( "skip-it" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "verify" );
result.assertErrorFreeLog();
File testDir = result.getBasedir();
File artifact = new File( testDir, "target/buildnumber-maven-plugin-skip-it-1.0-SNAPSHOT.jar" );
JarFile jarFile = new JarFile( artifact );
Attributes manifest = jarFile.getManifest().getMainAttributes();
jarFile.close();
String buildDate = manifest.getValue( "Build-Date" );
Assert.assertTrue( StringUtils.isBlank( buildDate ) );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:19,代码来源:BuildNumberMojoTest.java
示例9: testBasicConfiguration
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void testBasicConfiguration()
throws Exception
{
File projDir = resources.getBasedir( "create-metadata-it" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "test" );
result.assertErrorFreeLog();
File testDir = result.getBasedir();
Assert.assertTrue( new File( testDir, "target/file1.properties" ).exists() );
Assert.assertTrue( new File( testDir, "target/xxx/file1.properties" ).exists() );
Assert.assertTrue( new File( testDir, "target/generated/build-metadata/build.properties" ).exists() );
Assert.assertTrue( new File( testDir, "target/classes/build.properties" ).exists() );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:18,代码来源:CreateMetadataMojoTest.java
示例10: testBasicJsonConfiguration
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void testBasicJsonConfiguration()
throws Exception
{
File projDir = resources.getBasedir( "create-metadata-json-it" );
MavenExecution mavenExec = maven.forProject( projDir );
MavenExecutionResult result = mavenExec.execute( "clean", "test" );
result.assertErrorFreeLog();
File testDir = result.getBasedir();
Assert.assertTrue( new File( testDir, "target/file1.json" ).exists() );
Assert.assertTrue( new File( testDir, "target/xxx/file1.json" ).exists() );
Assert.assertTrue( new File( testDir, "target/generated/build-metadata/build.properties" ).exists() );
Assert.assertTrue( new File( testDir, "target/classes/build.properties" ).exists() );
}
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:18,代码来源:CreateMetadataMojoTest.java
示例11: testAggregatorPlugin
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void testAggregatorPlugin() throws Exception {
verifier.forProject(resources.getBasedir("aggregator-plugin")) //
.execute("clean", "install") //
.assertErrorFreeLog();
File basedir = resources.getBasedir("basic-it");
MavenExecutionResult result = verifier.forProject(basedir) //
.withCliOptions("--builder", "smart") //
.withCliOptions("-e", "-T2") //
.execute("clean", "package", "io.takari.maven.smartbuilder.tests:aggregator-plugin:0.1-SNAPSHOT:aggregate");
result.assertErrorFreeLog();
assertFilesPresent(basedir, "target/aggregator.txt");
assertFilesNotPresent(basedir, //
"basic-it-module-a/target/aggregator.txt", //
"basic-it-module-b/target/aggregator.txt", //
"basic-it-module-c/target/aggregator.txt");
}
开发者ID:takari,项目名称:takari-smart-builder,代码行数:22,代码来源:SmartBuilderIntegrationTest.java
示例12: graphInDot
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void graphInDot() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.execute("clean", "package", "depgraph:graph");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.dot",
"module-2/target/dependency-graph.dot",
"sub-parent/module-3/target/dependency-graph.dot",
"target/dependency-graph.dot",
"sub-parent/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/graph_parent.dot", "target/dependency-graph.dot");
assertFileContents(basedir, "expectations/graph_module-1.dot", "module-1/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/graph_module-2.dot", "module-2/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/graph_sub-parent.dot", "sub-parent/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/graph_module-3.dot", "sub-parent/module-3/target/dependency-graph.dot");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:23,代码来源:GraphIntegrationTest.java
示例13: byGroupIdInDot
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void byGroupIdInDot() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.execute("clean", "package", "depgraph:by-groupid");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.dot",
"module-2/target/dependency-graph.dot",
"sub-parent/module-3/target/dependency-graph.dot",
"target/dependency-graph.dot",
"sub-parent/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/by-groupid_parent.dot", "target/dependency-graph.dot");
assertFileContents(basedir, "expectations/by-groupid_module-1.dot", "module-1/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/by-groupid_module-2.dot", "module-2/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/by-groupid_sub-parent.dot", "sub-parent/target/dependency-graph.dot");
assertFileContents(basedir, "expectations/by-groupid_module-3.dot", "sub-parent/module-3/target/dependency-graph.dot");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:23,代码来源:GraphIntegrationTest.java
示例14: targetIncludes
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void targetIncludes() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.withCliOption("-DgraphFormat=gml")
.withCliOption("-DtargetIncludes=*:guava")
.withCliOption("-DshowDuplicates")
.withCliOption("-DshowConflicts")
.execute("clean", "package", "depgraph:graph");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.gml",
"module-2/target/dependency-graph.gml",
"sub-parent/module-3/target/dependency-graph.gml",
"target/dependency-graph.gml",
"sub-parent/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_target-includes_parent.gml", "target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_target-includes_module-1.gml", "module-1/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_target-includes_module-2.gml", "module-2/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_target-includes_sub-parent.gml", "sub-parent/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_target-includes_module-3.gml", "sub-parent/module-3/target/dependency-graph.gml");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:27,代码来源:GraphIntegrationTest.java
示例15: transitiveIncludes
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void transitiveIncludes() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.withCliOption("-DgraphFormat=text")
.withCliOption("-DtransitiveIncludes=com.mysema.*:*")
.execute("clean", "package", "depgraph:graph");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.txt",
"module-2/target/dependency-graph.txt",
"sub-parent/module-3/target/dependency-graph.txt",
"target/dependency-graph.txt",
"sub-parent/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_transitive-includes_parent.txt", "target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_transitive-includes_module-1.txt", "module-1/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_transitive-includes_module-2.txt", "module-2/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_transitive-includes_sub-parent.txt", "sub-parent/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_transitive-includes_module-3.txt", "sub-parent/module-3/target/dependency-graph.txt");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:25,代码来源:GraphIntegrationTest.java
示例16: transitiveAndTargetFiltering
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void transitiveAndTargetFiltering() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.withCliOption("-DgraphFormat=text")
.withCliOption("-DshowGroupIds")
.withCliOption("-DtargetIncludes=com.mysema.*:*")
.withCliOption("-DtransitiveExcludes=com.mysema.*:*")
.execute("clean", "package", "depgraph:aggregate");
result.assertErrorFreeLog();
assertFilesPresent(basedir, "target/dependency-graph.txt");
assertFileContents(basedir, "expectations/aggregate_transitive-and-target-filtering.txt", "target/dependency-graph.txt");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:17,代码来源:GraphIntegrationTest.java
示例17: graphInGml
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void graphInGml() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.withCliOption("-DgraphFormat=gml")
.withCliOption("-DshowGroupIds")
.withCliOption("-DshowVersions")
.execute("clean", "package", "depgraph:graph");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.gml",
"module-2/target/dependency-graph.gml",
"sub-parent/module-3/target/dependency-graph.gml",
"target/dependency-graph.gml",
"sub-parent/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_parent.gml", "target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_module-1.gml", "module-1/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_module-2.gml", "module-2/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_sub-parent.gml", "sub-parent/target/dependency-graph.gml");
assertFileContents(basedir, "expectations/graph_module-3.gml", "sub-parent/module-3/target/dependency-graph.gml");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:26,代码来源:GraphIntegrationTest.java
示例18: graphInJson
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void graphInJson() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.withCliOption("-DgraphFormat=json")
.withCliOption("-DshowDuplicates")
.withCliOption("-DshowConflicts")
.execute("clean", "package", "depgraph:graph");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.json",
"module-2/target/dependency-graph.json",
"sub-parent/module-3/target/dependency-graph.json",
"target/dependency-graph.json",
"sub-parent/target/dependency-graph.json");
assertFileContents(basedir, "expectations/graph_parent.json", "target/dependency-graph.json");
assertFileContents(basedir, "expectations/graph_module-1.json", "module-1/target/dependency-graph.json");
assertFileContents(basedir, "expectations/graph_module-2.json", "module-2/target/dependency-graph.json");
assertFileContents(basedir, "expectations/graph_sub-parent.json", "sub-parent/target/dependency-graph.json");
assertFileContents(basedir, "expectations/graph_module-3.json", "sub-parent/module-3/target/dependency-graph.json");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:26,代码来源:GraphIntegrationTest.java
示例19: graphInText
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void graphInText() throws Exception {
File basedir = this.resources.getBasedir("depgraph-maven-plugin-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.withCliOption("-DgraphFormat=text")
.withCliOption("-DshowVersions")
.execute("clean", "package", "depgraph:graph");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.txt",
"module-2/target/dependency-graph.txt",
"sub-parent/module-3/target/dependency-graph.txt",
"target/dependency-graph.txt",
"sub-parent/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_parent.txt", "target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_module-1.txt", "module-1/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_module-2.txt", "module-2/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_sub-parent.txt", "sub-parent/target/dependency-graph.txt");
assertFileContents(basedir, "expectations/graph_module-3.txt", "sub-parent/module-3/target/dependency-graph.txt");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:25,代码来源:GraphIntegrationTest.java
示例20: graphNoMerge
import io.takari.maven.testing.executor.MavenExecutionResult; //导入依赖的package包/类
@Test
public void graphNoMerge() throws Exception {
File basedir = this.resources.getBasedir("merge-test");
MavenExecutionResult result = this.mavenRuntime
.forProject(basedir)
.execute("clean", "package", "depgraph:graph");
result.assertErrorFreeLog();
assertFilesPresent(
basedir,
"module-1/target/dependency-graph.dot",
"module-2/target/dependency-graph.dot",
"target/dependency-graph.dot");
assertFileContents(basedir, "expectations/graph_module-1_no-merge.dot", "module-1/target/dependency-graph.dot");
}
开发者ID:ferstl,项目名称:depgraph-maven-plugin,代码行数:17,代码来源:MergeOptionsIntegrationTest.java
注:本文中的io.takari.maven.testing.executor.MavenExecutionResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论