mirror of https://github.com/sbt/sbt.git
Merge pull request #1512 from sbt/wip/fix-1506
Fix unknown host exception in junit xml listener.
This commit is contained in:
commit
52fb91844f
|
|
@ -1,7 +1,7 @@
|
|||
package sbt
|
||||
|
||||
import java.io.{ StringWriter, PrintWriter, File }
|
||||
import java.net.InetAddress
|
||||
import java.io.{IOException, StringWriter, PrintWriter, File}
|
||||
import java.net.{InetAddress}
|
||||
|
||||
import scala.collection.mutable.ListBuffer
|
||||
import scala.util.DynamicVariable
|
||||
|
|
@ -15,7 +15,11 @@ import testing.{ Event => TEvent, Status => TStatus, OptionalThrowable, TestSele
|
|||
*/
|
||||
class JUnitXmlTestsListener(val outputDir: String) extends TestsListener {
|
||||
/**Current hostname so we know which machine executed the tests*/
|
||||
val hostname = InetAddress.getLocalHost.getHostName
|
||||
val hostname =
|
||||
try InetAddress.getLocalHost.getHostName
|
||||
catch {
|
||||
case x: IOException => "localhost"
|
||||
}
|
||||
/**The dir in which we put all result files. Is equal to the given dir + "/test-reports"*/
|
||||
val targetDir = new File(outputDir + "/test-reports/")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue