本文整理汇总了Java中io.takari.maven.testing.executor.MavenExecutionResult.assertErrorFreeLog方法的典型用法代码示例。如果您正苦于以下问题:Java MavenExecutionResult.assertErrorFreeLog方法的具体用法?Java MavenExecutionResult.assertErrorFreeLog怎么用?Java MavenExecutionResult.assertErrorFreeLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.takari.maven.testing.executor.MavenExecutionResult
的用法示例。
在下文中一共展示了MavenExecutionResult.assertErrorFreeLog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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" );
}
示例2: 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
}
示例3: 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?
}
示例4: 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 );
}
示例5: 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 ) );
}
示例6: 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 ) );
}
示例7: 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() );
}
示例8: 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() );
}
示例9: 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");
}
示例10: 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");
}
示例11: 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");
}
示例12: 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");
}
示例13: 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");
}
示例14: 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");
}
示例15: 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");
}