Permalink
Browse files

Don't generate a Velocity log file unless explicitly requested (GitHu…

…b issue #13).

Changed URL of Java.net Maven repository (upload still doesn't work).
  • Loading branch information...
1 parent 9e77829 commit c48516b0bf9f3e36edef1da3b44e953ac71e1eae @dwdyer committed Feb 14, 2011
View
@@ -6,6 +6,9 @@ Changes in version 1.1.3
* Fix for TestNG version dependency in Maven POM (GitHub issue #12).
+* Don't generate a Velocity log file unless explicitly requested by setting a
+ system property (GitHub issue #13).
+
Changes in version 1.1.2
------------------------
View
@@ -1,18 +1,16 @@
-===============================================================================
-ReportNG
- (https://reportng.dev.java.net)
-Copyright 2006-2010 Daniel W. Dyer (http://www.dandyer.co.uk)
-
-Acknowledgements:
------------------
-ReportNG depends on the Apache Velocity templating engine. Velocity is also
-licensed under the terms of the Apache Licence Version 2.0. The NOTICE file
-from the Velocity distribution is reproduced below.
-
-===============================================================================
-Apache Velocity
-
-Copyright (C) 2000-2007 The Apache Software Foundation
-
-This product includes software developed at
+ReportNG (http://reportng.uncommons.org)
+Copyright 2006-2011 Daniel W. Dyer (http://www.dandyer.co.uk)
+
+Acknowledgements:
+-----------------
+ReportNG depends on the Apache Velocity templating engine. Velocity is also
+licensed under the terms of the Apache Licence Version 2.0. The NOTICE file
+from the Velocity distribution is reproduced below.
+
+===============================================================================
+Apache Velocity
+
+Copyright (C) 2000-2007 The Apache Software Foundation
+
+This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
View
@@ -83,4 +83,9 @@ output:
dialect of the XML format. Other tools, such as Ant's junitreport task,
do not have a notion of skipped tests. For these tools the dialect can
be set to "junit" and skipped tests will be marked as failures.
+
+ org.uncommons.reportng.velocity-log
+ Since version 1.1.3, ReportNG will no longer generate a Velocity log file
+ by default. If you want a log file you should set this property to
+ "true".
View
@@ -91,6 +91,7 @@
description="Deploys the software to the Java.net Maven repository.">
<uncommons:maven-deploy module="reportng"
version="${version}"
+ repository="svn:https://svn.java.net/svn/maven2-repository~svn/trunk/repository/"
username="${maven.user}"
password="${maven.password}"/>
</target>
@@ -33,7 +33,7 @@
import org.testng.IReporter;
/**
- * Convenient base class for the ReportNG reporters. Provides commmon functionality.
+ * Convenient base class for the ReportNG reporters. Provides common functionality.
* @author Daniel Dyer
*/
public abstract class AbstractReporter implements IReporter
@@ -62,6 +62,12 @@ protected AbstractReporter(String classpathPrefix)
Velocity.setProperty("resource.loader", "classpath");
Velocity.setProperty("classpath.resource.loader.class",
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+ if (!META.shouldGenerateVelocityLog())
+ {
+ Velocity.setProperty("runtime.log.logsystem.class",
+ "org.apache.velocity.runtime.log.NullLogSystem");
+ }
+
try
{
Velocity.init();
@@ -38,6 +38,7 @@
static final String XML_DIALECT_KEY = PROPERTY_KEY_PREFIX + "xml-dialect";
static final String STYLESHEET_KEY = PROPERTY_KEY_PREFIX + "stylesheet";
static final String LOCALE_KEY = PROPERTY_KEY_PREFIX + "locale";
+ static final String VELOCITY_LOG_KEY = PROPERTY_KEY_PREFIX + "velocity-log";
private static final DateFormat DATE_FORMAT = new SimpleDateFormat("EEEE dd MMMM yyyy");
private static final DateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm z");
@@ -136,6 +137,15 @@ public boolean allowSkippedTestsInXML()
/**
+ * @return True if Velocity should generate a log file, false otherwise.
+ */
+ public boolean shouldGenerateVelocityLog()
+ {
+ return System.getProperty(VELOCITY_LOG_KEY, "false").equalsIgnoreCase("true");
+ }
+
+
+ /**
* @return The user account used to run the tests and the host name of the
* test machine.
* @throws UnknownHostException If there is a problem accessing the machine's host name.

0 comments on commit c48516b

Please sign in to comment.