2017-07-27 10 views
1

Apache Velocity Engineのソースコードでsmthの改善に取り組んでいますが、ビルド時にテストに問題があります。Apache Velocity Engine 1.7.xテストの失敗

githubにApache/Velocityのソースコードをクローンしました。

その後、エンジンを構築しようとしましたが、このエラーが発生しました。

Failed tests: testVelTools66(org.apache.velocity.test.issues.VelTools66TestCase): Method object does not match! expected:<public abstract java.lang.String org.apache.velocity.test.issues.VelTools66TestCase$TestInterface.getTestValue()> but was:<public java.lang.String org.apache.velocity.test.issues.VelTools66TestCase$TestObject.getTestValue()> 
    testResourceLoaderInstance(org.apache.velocity.test.ResourceLoaderInstanceTestCase): Processed template did not match expected output 

Tests in error: 
    testClasspathResource(org.apache.velocity.test.ClasspathResourceTestCase): Unable to find resource 'template/test1.vm' 
    testContextSafety(org.apache.velocity.test.ContextSafetyTestCase): Unable to find resource 'context_safety.vm' 
    testHighByteChinese2(org.apache.velocity.test.EncodingTestCase): Unable to find resource 'encodingtest3.vm' 
    testChineseEncoding(org.apache.velocity.test.EncodingTestCase): Unable to find resource 'encodingtest.vm' 
    testHighByteChinese(org.apache.velocity.test.EncodingTestCase): Unable to find resource 'encodingtest2.vm' 
    testRussian(org.apache.velocity.test.EncodingTestCase): Unable to find resource 'encodingtest_KOI8-R.vm' 
    testMultiLoader(org.apache.velocity.test.MultiLoaderTestCase): Unable to find resource 'template/test1.vm' 
    testSharedRepo(org.apache.velocity.test.StringResourceLoaderRepositoryTestCase): Unable to find resource 'foo' 
    testAlternateStaticRepo(org.apache.velocity.test.StringResourceLoaderRepositoryTestCase): Unable to find resource 'foo' 
    Arithmetic(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'arithmetic.vm' 
    Array(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'array.vm' 
    Block(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'block.vm' 
    Comment(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'comment.vm' 
    Equality(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'equality.vm' 
    Escape(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'escape.vm' 
    Foreach-array(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'foreach-array.vm' 
    Foreach-method(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'foreach-method.vm' 
    Foreach-variable(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'foreach-variable.vm' 
    Formal(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'formal.vm' 
    If(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'if.vm' 
    Logical(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'logical.vm' 
    Loop(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'loop.vm' 
    Method(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'method.vm' 
    Quotes(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'quotes.vm' 
    Sample(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'sample.vm' 
    Shorthand(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'shorthand.vm' 
    Test(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'test.vm' 
    Diabolical(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'diabolical.vm' 
    Pedantic(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'pedantic.vm' 
    Subclass(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'subclass.vm' 
    Foreach-map(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'foreach-map.vm' 
    Include(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'include.vm' 
    Escape2(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'escape2.vm' 
    Parse(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'parse.vm' 
    Velocimacro(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'velocimacro.vm' 
    Reference(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'reference.vm' 
    Interpolation(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'interpolation.vm' 
    Vm_test1(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'vm_test1.vm' 
    Map(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'map.vm' 
    Literal(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'literal.vm' 
    Ifstatement(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'ifstatement.vm' 
    Math(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'math.vm' 
    Range(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'range.vm' 
    Get(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'get.vm' 
    Velocimacro2(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'velocimacro2.vm' 
    Foreach-type(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'foreach-type.vm' 
    Foreach-introspect(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'foreach-introspect.vm' 
    Settest(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'settest.vm' 
    Newline(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'newline.vm' 
    Logical2(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'logical2.vm' 
    String(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'string.vm' 
    Stop1(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'stop1.vm' 
    Stop2(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'stop2.vm' 
    Foreach-null-list(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'foreach-null-list.vm' 
    Curly-directive(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'curly-directive.vm' 
    Comment-eof(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'comment-eof.vm' 
    Commas(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'commas.vm' 
    Stop3(org.apache.velocity.test.TemplateTestCase): Unable to find resource 'stop3.vm' 

Tests run: 444, Failures: 2, Errors: 58, Skipped: 0 

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project velocity: There are test failures. 

Please refer to C:\apache\velocity-engine\target\surefire-reports for the individual test results. 
-> [Help 1] 

To see the full stack trace of the errors, re-run Maven with the -e switch. 
Re-run Maven using the -X switch to enable full debug logging. 

For more information about the errors and possible solutions, please read the following articles: 
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 

我々は考えているように、一般的に、このメッセージは失敗したテストは、テンプレートリソースを見つけることができなかったことを意味します。

注:これらのエラーは私たちの編集行なしに発生します。以前のバージョンの1.7.xエンジンを複製した場合は、 URLに同じエラーが表示されます。

誰かがこの問題の解決策を願っています。おかげさまで

答えて

0

それが理由TemplateTestBase.java

public static final String TEST_COMPARE_DIR = "@[email protected]"; 
public static final String TEST_RESULT_DIR = "@[email protected]"; 

のアンドbuild.properties

test.dir = $ {velocity.dir} /テスト

build.test = $ {ビルドからであると思われます.dir}/test

したがって、antでテストを実行すると、 TEST_COMPARE_DIRTEST_RESULT_DIRを変更する必要はありません。そうしないと、これらの文字列定数をそれに応じて絶対パスに変更することができます。

+0

はい、私はこの問題が初めからこの問題の周りにあることがわかりましたが、これを中心に多くのことを変えようとしましたが、n番目の問題が発生します –

+0

もっと具体的な解決策があれば、ありがとう。 –

関連する問題