Comparable<TreeTestResult>, AttachmentsEnabled, Serializable {\r
private static final long serialVersionUID = 1L;\r
\r
- private Log log = LogFactory.getLog(TreeTestResult.class);\r
+ private final static Log log = LogFactory.getLog(TreeTestResult.class);\r
\r
private List<TestResultListener<TreeTestResult>> listeners = new Vector<TestResultListener<TreeTestResult>>();\r
\r
\r
private Map<String, String> attributes = new TreeMap<String, String>();\r
\r
+ private Boolean strictChecks = false;\r
+\r
/** Sets the list of listeners. */\r
public void setListeners(List<TestResultListener<TreeTestResult>> listeners) {\r
this.listeners = listeners;\r
\r
public void addResultPart(TestResultPart part) {\r
if (isClosed)\r
- throw new SlcException("Cannot result parts to a closed result");\r
-\r
+ notifyIssue(\r
+ "Trying to add result parts to an already closed result,"\r
+ + " consider changing the scope of this test result:"\r
+ + " you are referencing the same stored data with each new call.",\r
+ null);\r
+ \r
if (currentPath == null)\r
throw new SlcException("No current path set.");\r
\r
}\r
}\r
\r
+ protected void notifyIssue(String msg, Exception e) {\r
+ if (strictChecks)\r
+ throw new SlcException(msg, e);\r
+ else\r
+ log.error(msg, e);\r
+ }\r
+\r
public void notifyCurrentPath(StructureRegistry<TreeSPath> registry,\r
TreeSPath path) {\r
if (registry != null) {\r
}\r
}\r
\r
+ public void setStrictChecks(Boolean strictChecks) {\r
+ this.strictChecks = strictChecks;\r
+ }\r
+\r
}\r