English 中文(简体)
• 如何写一些东西,确保与Junnit 4号交火记录
原标题:How to write something to surefire log with JUnit 4

能否在试验中撰写一些内容,以确保消防报告/MyClass.txt? 任何类型的伐木等? 测试小组有一名报告员:

  Reporter.log("Something here");

该信息在报告正采用测试方法。 是否在Junnit有过某种传真

问题回答

我在吉尼特使用原木4j,在Eclipse或Hudson上安装这种装置。 这可能与你正在使用的测试/操作/升级相结合,因为这在我的所有情况下都没有工作。 你们可能需要调整基伍。 你们还必须走硬编码道路。

<plugin>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <forkMode>never</forkMode>
    <systemProperties>
      <property>
        <name>log4j.configuration</name>
        <value>file:src/test/resources/log4j.xml</value>
      </property>
    </systemProperties>
  </configuration>
</plugin>

另一种做法是使用redirect TestOutput ToFile向火力报告档案倾斜。 如果为你工作,就没有这种想法。





相关问题
Derby gets stuck closing?

I ve got unit tests (in maven) that use derby. At the end of the test run, there is a very long pause, with these log messages before the pause. INFO: Closing Hibernate SessionFactory Nov 16, 2009 8:...

Execute goal on parent after children complete

I have a multi-module maven project (several levels of nesting). Normally, when I execute a maven build (like mvn install or whatever), maven will run all the goals for the parent project before ...

Including dependencies in a jar with Maven

Is there a way to force maven(2.0.9) to include all the dependencies in a single jar file? I have a project the builds into a single jar file. I want the classes from dependencies to be copied into ...

Java Equivalent of distcc

Distcc makes it easy to distribute a C or C++ compile job across a number of machines, and is a godsend for working with large, frequently-built codebases. An increasing number of our large projects ...

Maven Assembly Problem

I have a maven multiple-module project, which is giving me headaches in the assembly:assembly phase. I have a module which has an assembly defined in it which works fine when I invoke mvn assembly:...

热门标签