Author: kmalhi
Date: Thu Jul 15 02:13:48 2010
New Revision: 964281
URL: http://svn.apache.org/viewvc?rev=964281&view=rev
Log:
Added a warning confluence message stating that this page is autogenerated and
manual changes will be overwritten.
Wrapped the audit report summary in a confluence info section
Converted the untested keys table from one to four columns
Changed the title of the untested keys table to heading level 2 (h2)
Modified:
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
Modified:
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java?rev=964281&r1=964280&r2=964281&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/ValidationKeysAuditorTest.java
Thu Jul 15 02:13:48 2010
@@ -70,9 +70,11 @@ public class ValidationKeysAuditorTest {
e.printStackTrace();
}
}
+
/**
- * This method will write to confluence only if you supply the system
properties confluenceUsername and confluencePassword
- * example usage mvn test -Dtest=ValidationKeysAuditorTest
-DconfluenceUsername=<<your username>> -DconfluencePassword=<<your password>>
+ * This method will write to confluence only if you supply the system
properties confluenceUsername and confluencePassword example usage mvn test
+ * -Dtest=ValidationKeysAuditorTest -DconfluenceUsername=<<your username>>
-DconfluencePassword=<<your password>>
+ *
* @param confluenceOutput
*/
private void writeToConfluence(String confluenceOutput) {
@@ -88,7 +90,7 @@ public class ValidationKeysAuditorTest {
confluence.storePage(page);
confluence.logout();
} catch (Exception e) {
- e.printStackTrace();
+ e.printStackTrace();
}
}
}
@@ -164,10 +166,21 @@ public class ValidationKeysAuditorTest {
}
private void prepareConfluenceUntestedKeyList(Set<String> untestedKeys,
StringBuilder output, String newLine) {
- output.append("|| List of untested keys \\\\ ||").append(newLine);
+ output.append("|| h2.List of untested keys \\\\ ||").append(newLine);
+ int count = 0;
for (String key : untestedKeys) {
- output.append("| ").append(key).append(" |").append(newLine);
+ if (count == 0) {
+ output.append("| ");
+ }
+ if (count >= 0 && count < 4) {
+ output.append(key).append(" | ");
+ ++count;
+ continue;
+ }
+ output.append(newLine);
+ count = 0;
}
+ output.append(newLine);
}
private void prepareConfluenceSummary(Set<String> untestedKeys,
StringBuilder output, String newLine) {
@@ -175,7 +188,10 @@ public class ValidationKeysAuditorTest {
int untested = untestedKeys.size();
int tested = total - untested;
double coverage = (((tested + 0.0) / (total + 0.0)) * 100);
- output.append("h2.Out of a total of " + total + " keys, " + tested + "
have been tested. Test coverage for keys is " + coverage + "
%.").append(newLine);
+ output.append("{warning:title=Warning}This page is auto-generated. Any
manual changes would be over-written the next time this page is
regenerated{warning}").append(
+ newLine);
+ output.append("{info:title=Audit Result}h2.Out of a total of " + total
+ " keys, " + tested + " have been tested. Test coverage for keys is " +
coverage + " %.{info}")
+ .append(newLine);
}
private void generateReport(File file, KeysAnnotationVisitor visitor)
throws IOException {