Pregunta

Estoy utilizando TestNG + ReportNG por wiki instrucciones en Gradle (me fijo en el libro de cocina como ejemplo por defecto no lo hizo conmigo forma de trabajo).

Me gustaría de alguna manera en la salida de la consola de captura TestNG. ¿Es esto posible?

Gracias Misha

¿Fue útil?

Solución

Está bien que aún no tienen idea de cómo hacerlo formalmente pero me he redirigido la salida estándar y error:

/**
 * Redirect standard output and error to appropriate files
 */
public void redirectStandardOutputAndErrorToFiles(className) {
  def outFile=new   File(System.getProperty("java.io.tmpdir")+File.separator+className+".out.log")
  if (outFile.exists()) {
    outFile.delete()
  }
  def errFile=new File(System.getProperty("java.io.tmpdir")+File.separator+className+".err.log")
  if (errFile.exists()) {
    errFile.delete()
  }
  def out=new PrintStream(new FileOutputStream(outFile))
  def err=new PrintStream(new FileOutputStream(errFile))
  System.setOut(out)
  System.setErr(err)
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top