[hibernate-commits] Hibernate SVN: r15959 - validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Wed Feb 11 23:40:22 EST 2009
Author: shane.bryzak at jboss.com
Date: 2009-02-11 23:40:22 -0500 (Wed, 11 Feb 2009)
New Revision: 15959
Modified:
validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/AuditParser.java
validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageProcessor.java
validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/SpecReference.java
Log:
fix report
Modified: validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/AuditParser.java
===================================================================
--- validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/AuditParser.java 2009-02-12 03:48:51 UTC (rev 15958)
+++ validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/AuditParser.java 2009-02-12 04:40:22 UTC (rev 15959)
@@ -115,8 +115,11 @@
* @return
*/
public boolean hasAssertion(String sectionId, String assertionId)
- {
- if (!assertions.containsKey(sectionId)) return false;
+ {
+ if (!assertions.containsKey(sectionId))
+ {
+ return false;
+ }
for (AuditAssertion assertion : assertions.get(sectionId))
{
@@ -151,8 +154,10 @@
private void processSectionNode(Element node)
{
String sectionId = node.getAttribute("id");
- titles.put(sectionId, node.getAttribute("title"));
+ titles.put(sectionId, node.getAttribute("title"));
+ assertions.put(sectionId, new ArrayList<AuditAssertion>());
+
NodeList assertionNodes = node.getChildNodes();
for (int i = 0; i < assertionNodes.getLength(); i++)
@@ -166,13 +171,8 @@
}
private void processAssertionNode(String sectionId, Element node)
- {
+ {
List<AuditAssertion> value = assertions.get(sectionId);
- if (value == null)
- {
- value = new ArrayList<AuditAssertion>();
- assertions.put(sectionId, value);
- }
String text = null;
String note = null;
@@ -194,7 +194,7 @@
}
}
- value.add(new AuditAssertion(node.getAttribute("section"),
- node.getAttribute("id"), text, note));
+ value.add(new AuditAssertion(sectionId,
+ node.getAttribute("id"), text, note));
}
}
Modified: validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageProcessor.java
===================================================================
--- validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageProcessor.java 2009-02-12 03:48:51 UTC (rev 15958)
+++ validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/CoverageProcessor.java 2009-02-12 04:40:22 UTC (rev 15959)
@@ -32,7 +32,8 @@
* @author Hardy Ferentschik
*/
@SupportedAnnotationTypes({
- "org.hibernate.tck.annotations.SpecAssertion", "org.hibernate.tck.annotations.SpecAssertions"
+ "org.hibernate.tck.annotations.SpecAssertion",
+ "org.hibernate.tck.annotations.SpecAssertions"
})
@SupportedSourceVersion(RELEASE_6)
public class CoverageProcessor extends AbstractProcessor {
@@ -53,7 +54,7 @@
public void init(ProcessingEnvironment env) {
super.init(env);
-
+
createOutputDir();
InputStream in = getAuditFileInputStream();
@@ -73,6 +74,7 @@
private InputStream getAuditFileInputStream() {
InputStream in;
String auditFileName = processingEnv.getOptions().get(AUDITFILE_OPTION_KEY);
+
if (auditFileName == null || auditFileName.length() == 0) {
auditFileName = getCurrentWorkingDirectory() + DEFAULT_AUDIT_FILE_NAME;
System.out.println(
@@ -128,7 +130,7 @@
}
for (TypeElement type : annotations) {
- processAnnoatedMethods(roundEnvironment, type);
+ processAnnotatedMethods(roundEnvironment, type);
}
if (roundEnvironment.processingOver()) {
@@ -137,7 +139,7 @@
return true;
}
- private void processAnnoatedMethods(RoundEnvironment env, TypeElement annotation) {
+ private void processAnnotatedMethods(RoundEnvironment env, TypeElement annotation) {
Set<Element> elements = (Set<Element>) env.getElementsAnnotatedWith(annotation);
for (Element element : elements) {
processMethod(element);
@@ -162,17 +164,19 @@
}
}
- private void createSpecReference(ExecutableElement methodElement, Map<? extends ExecutableElement, ? extends AnnotationValue> annotationParameters) {
+ private void createSpecReference(ExecutableElement methodElement,
+ Map<? extends ExecutableElement, ? extends AnnotationValue> annotationParameters) {
+
SpecReference ref = new SpecReference();
ref.setClassName(methodElement.getClass().getName());
ref.setMethodName(methodElement.getSimpleName().toString());
for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : annotationParameters.entrySet()) {
final String elementKey = entry.getKey().toString();
- // TODO - is there no better way of doing this?
+
if (elementKey.equals("section()")) {
- ref.setSection(entry.getValue().toString());
+ ref.setSection((String) entry.getValue().getValue());
} else if (elementKey.equals("id()")) {
- ref.setAssertion(entry.getValue().toString());
+ ref.setAssertion((String) entry.getValue().getValue());
}
}
references.add(ref);
Modified: validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/SpecReference.java
===================================================================
--- validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/SpecReference.java 2009-02-12 03:48:51 UTC (rev 15958)
+++ validator/trunk/tck-utils/impl/src/main/java/org/hibernate/tck/report/SpecReference.java 2009-02-12 04:40:22 UTC (rev 15959)
@@ -42,4 +42,11 @@
public String getMethodName() {
return methodName;
}
+
+ @Override
+ public String toString()
+ {
+ return "SpecReference[section=" + section + ";assertion=" + assertion +
+ ";class=" + className + ";method=" + methodName + "]";
+ }
}
More information about the hibernate-commits
mailing list