-#Sat Dec 15 15:02:13 CET 2007\r
+#Sun Dec 16 00:03:13 CET 2007\r
DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;\r
-USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;\r
-USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;\r
-USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationtrueversion1.1.102.v200709122200\r
+USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;\r
+USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsp.core.internal.validation.JSPContentValidator;org.eclipse.jst.jsp.core.internal.validation.JSPBatchValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.jst.jsf.validation.internal.JSPSemanticsValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator;\r
+USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.1.102.v200709122200\r
eclipse.preferences.version=1\r
/** All mode: everything is executed regardless of the active paths. */\r
public static String ALL = "ALL";\r
/** Active mode: only the active paths are executed. */\r
- public static String ACTIVE = "ACTIVE";\r
+ public static String ACTIVE = "STATUS_ACTIVE";\r
\r
/** Adds an element to the registry. */\r
public void register(StructurePath path, StructureElement element);\r
* \r
* @see #READ\r
* @see #ALL\r
- * @see #ACTIVE\r
+ * @see #STATUS_ACTIVE\r
*/\r
public void setMode(String mode);\r
\r
* \r
* @see #READ\r
* @see #ALL\r
- * @see #ACTIVE\r
+ * @see #STATUS_ACTIVE\r
*/\r
public String getMode();\r
\r
/**\r
* Gets the list of active paths, which will be run if executed in\r
- * <code>ACTIVE</code> mode.\r
+ * <code>STATUS_ACTIVE</code> mode.\r
*/\r
public List<StructurePath> getActivePaths();\r
\r
/**\r
* Sets the list of active path, which will be run if executed in\r
- * <code>ACTIVE</code> mode.\r
+ * <code>STATUS_ACTIVE</code> mode.\r
*/\r
public void setActivePaths(List<StructurePath> activePaths);\r
}\r
return getAsUniqueString().compareTo(o.getAsUniqueString());\r
}\r
\r
- Long getTid() {\r
+ public Long getTid() {\r
return tid;\r
}\r
\r
\r
/** Tree based implementation of a structure registry. */\r
public class TreeSRegistry implements StructureRegistry {\r
+ public final static String STATUS_ACTIVE = "STATUS_ACTIVE";\r
+ \r
/** For ORM */\r
private Long tid;\r
- private TreeSPath root;\r
+ private String status;\r
private Map<TreeSPath, SimpleSElement> elements = new TreeMap<TreeSPath, SimpleSElement>();\r
\r
private String mode = StructureRegistry.ALL;\r
this.activePaths = activePaths;\r
}\r
\r
- /** Gets the related root path. */\r
- public TreeSPath getRoot() {\r
- return root;\r
+\r
+ public String getStatus() {\r
+ return status;\r
}\r
\r
- /** Sets the related root path. */\r
- public void setRoot(TreeSPath root) {\r
- this.root = root;\r
+ public void setStatus(String status) {\r
+ this.status = status;\r
}\r
\r
/** Gets the elements. */\r
import java.util.Vector;\r
\r
import org.argeo.slc.core.test.TestResultPart;\r
+import org.argeo.slc.core.test.TestStatus;\r
\r
/**\r
* List of <code>TestResultPart</code>. It can be used to build complex\r
this.tid = tid;\r
}\r
\r
+ public Boolean getIsPassed(){\r
+ for(TestResultPart part: parts){\r
+ if(part.getStatus()!=TestStatus.PASSED){\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ }\r
}\r
}\r
\r
private TreeSRegistry getOrCreateTreeSRegistry(TreeSPath path) {\r
- TreeSRegistry registry = treeSRegistryDao.getTreeSRegistry(path);\r
+ TreeSRegistry registry = treeSRegistryDao.getActiveTreeSRegistry();\r
if (registry == null) {\r
registry = new TreeSRegistry();\r
TreeSPath root = treeSPathDao.getOrCreate(path.getRoot());\r
- registry.setRoot(root);\r
+ registry.setStatus(TreeSRegistry.STATUS_ACTIVE);\r
treeSRegistryDao.create(registry);\r
- return treeSRegistryDao.getTreeSRegistry(path);\r
+ return treeSRegistryDao.getActiveTreeSRegistry();\r
} else {\r
return registry;\r
}\r
StructureRegistry registry = null;\r
if (treeSRegistryDao != null) {\r
TreeSPath path = result.getResultParts().firstKey();\r
- registry = treeSRegistryDao.getTreeSRegistry(path);\r
+ registry = treeSRegistryDao.getActiveTreeSRegistry();\r
}\r
if (registry == null) {\r
registry = localRegistry;\r
*/\r
public interface TreeSRegistryDao {\r
/** Gets the TreeSRegistry which has the same root path as the provided path. */\r
- public TreeSRegistry getTreeSRegistry(TreeSPath treeSPath);\r
+ public TreeSRegistry getActiveTreeSRegistry();\r
\r
/** Creates a new registry. */\r
public void create(TreeSRegistry registry);\r
--- /dev/null
+package org.argeo.slc.dao.test.tree;\r
+\r
+import java.util.List;\r
+\r
+import org.argeo.slc.core.structure.tree.TreeSPath;\r
+import org.argeo.slc.core.test.tree.TreeTestResult;\r
+import org.argeo.slc.dao.test.TestResultDao;\r
+\r
+public interface TreeTestResultDao extends TestResultDao {\r
+ /** Lists results containing this path*/\r
+ public List<TreeTestResult> listResults(TreeSPath path);\r
+}\r
getHibernateTemplate().update(registry);\r
}\r
\r
- public TreeSRegistry getTreeSRegistry(TreeSPath treeSPath) {\r
+ public TreeSRegistry getActiveTreeSRegistry() {\r
List<?> list = getHibernateTemplate().find(\r
- "from TreeSRegistry where root.asUniqueString=?",\r
- treeSPath.getRoot().getAsUniqueString());\r
+ "from TreeSRegistry where status=?", TreeSRegistry.STATUS_ACTIVE);\r
if (list.size() == 0) {\r
return null;\r
} else {\r
\r
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;\r
\r
+import org.argeo.slc.core.structure.tree.TreeSPath;\r
import org.argeo.slc.core.test.NumericTRId;\r
import org.argeo.slc.core.test.TestResult;\r
import org.argeo.slc.core.test.TestResultId;\r
-import org.argeo.slc.dao.test.TestResultDao;\r
+import org.argeo.slc.core.test.tree.TreeTestResult;\r
+import org.argeo.slc.dao.test.tree.TreeTestResultDao;\r
\r
/**\r
* The Hibernate implementation for tree-based result of the test result dao.\r
* @see TreeTestResult\r
*/\r
public class TestResultDaoHibernate extends HibernateDaoSupport implements\r
- TestResultDao {\r
+ TreeTestResultDao {\r
\r
public void create(TestResult testResult) {\r
getHibernateTemplate().save(testResult);\r
"from TreeTestResult");\r
}\r
\r
+ public List<TreeTestResult> listResults(TreeSPath path) {\r
+ List<TreeTestResult> list = getHibernateTemplate().find(\r
+ "from TreeTestResult res where ? in indices(res.resultParts)",\r
+ path);\r
+ return list;\r
+ }\r
+\r
}\r
<generator class="native" />\r
</id>\r
\r
- <many-to-one name="root" column="ROOT_PATH_ID" unique="true"\r
- not-null="true" />\r
+ <property name="status" column="STATUS" not-null="true"/>\r
\r
<map name="elements" table="REGISTRY_ELEMENTS" cascade="all"\r
lazy="false" sort="natural">\r
treeSPathDao.create(path);\r
\r
TreeSRegistry registry = new TreeSRegistry();\r
- registry.setRoot(root);\r
+ registry.setStatus(TreeSRegistry.STATUS_ACTIVE);\r
String desc = "desc";\r
registry.register(path, new SimpleSElement(desc));\r
\r
treeSRegistryDao.create(registry);\r
\r
- TreeSRegistry registry2 = treeSRegistryDao.getTreeSRegistry(path);\r
+ TreeSRegistry registry2 = treeSRegistryDao.getActiveTreeSRegistry();\r
SimpleSElement element = registry2.getElements().get(path);\r
assertEquals(desc, element.getLabel());\r
}\r
package org.argeo.slc.hibernate.test.tree;\r
\r
import java.util.Date;\r
+import java.util.List;\r
\r
import org.argeo.slc.core.structure.tree.TreeSPath;\r
import org.argeo.slc.core.test.NumericTRId;\r
import org.argeo.slc.core.test.tree.TreeTestResult;\r
import org.argeo.slc.dao.structure.tree.TreeSPathDao;\r
import org.argeo.slc.dao.test.TestResultDao;\r
+import org.argeo.slc.dao.test.tree.TreeTestResultDao;\r
import org.argeo.slc.unit.SpringBasedTestCase;\r
\r
public class TreeTestResultDaoHibernateTest extends SpringBasedTestCase {\r
TreeSPathDao treeSPathDao = (TreeSPathDao) getContext().getBean(\r
"treeSPathDao");\r
\r
- TestResultDao testResultDao = (TestResultDao) getContext().getBean(\r
+ TreeTestResultDao testResultDao = (TreeTestResultDao) getContext().getBean(\r
"testResultDao");\r
\r
String pathParentStr = "/root/testParent";\r
assertEquals(msgFailed, part1.getMessage());\r
\r
assertEquals(closeDate, treeTestResult2.getCloseDate());\r
+ \r
+ List<TreeTestResult> results = testResultDao.listResults(path);\r
+ assertEquals(1, results.size());\r
+ assertEquals(trId, results.get(0).getTestResultId());\r
+ \r
}\r
\r
@Override\r