Improve comments
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 17 Nov 2007 23:23:54 +0000 (23:23 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 17 Nov 2007 23:23:54 +0000 (23:23 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@714 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

24 files changed:
org.argeo.slc/src/main/java/org/argeo/slc/ant/SlcAntConfig.java
org.argeo.slc/src/main/java/org/argeo/slc/ant/SlcAntException.java
org.argeo.slc/src/main/java/org/argeo/slc/ant/deploy/SlcDeployTask.java
org.argeo.slc/src/main/java/org/argeo/slc/ant/spring/OverrideArg.java
org.argeo.slc/src/main/java/org/argeo/slc/ant/test/SlcTestTask.java
org.argeo.slc/src/main/java/org/argeo/slc/core/SlcException.java
org.argeo.slc/src/main/java/org/argeo/slc/core/UnsupportedException.java
org.argeo.slc/src/main/java/org/argeo/slc/core/structure/SimpleSElement.java
org.argeo.slc/src/main/java/org/argeo/slc/core/structure/tree/TreeSPath.java
org.argeo.slc/src/main/java/org/argeo/slc/core/structure/tree/TreeSRegistry.java
org.argeo.slc/src/main/java/org/argeo/slc/core/test/tree/AsynchronousTreeTestResultListener.java
org.argeo.slc/src/main/java/org/argeo/slc/core/test/tree/FullHtmlTreeReport.java
org.argeo.slc/src/main/java/org/argeo/slc/core/test/tree/PartSubList.java
org.argeo.slc/src/main/java/org/argeo/slc/core/test/tree/TreeTestResult.java
org.argeo.slc/src/main/java/org/argeo/slc/core/test/tree/TreeTestResultPersister.java
org.argeo.slc/src/main/java/org/argeo/slc/dao/structure/tree/TreeSRegistryDao.java
org.argeo.slc/src/main/java/org/argeo/slc/diff/DiffIssue.java
org.argeo.slc/src/main/java/org/argeo/slc/hibernate/structure/tree/TreeSPathDaoHibernate.java
org.argeo.slc/src/main/java/org/argeo/slc/hibernate/structure/tree/TreeSRegistryDaoHibernate.java
org.argeo.slc/src/main/java/org/argeo/slc/unit/DbModel.java
org.argeo.slc/src/test/java/org/argeo/slc/example/ExampleDeployedSystem.java
org.argeo.slc/src/test/java/org/argeo/slc/example/ExampleTask.java
org.argeo.slc/src/test/java/org/argeo/slc/example/appli/ExampleAppli.java
org.argeo.slc/src/test/java/org/argeo/slc/example/junit/TestAntBuild.java

index 80e6acb031d222efba67971b37e76486a7688e5a..6085c663531082223c70947cc2c11852170e44e1 100644 (file)
@@ -106,9 +106,13 @@ import org.argeo.slc.core.test.WritableTestRun;
  */\r
 public class SlcAntConfig {\r
        // SLC ROOT PROPERTIES\r
+       /** Property for the root file (SLC root property file). */\r
        public final static String ROOT_FILE_PROPERTY = "slc.rootFile";\r
+       /** Property for the root dir (SLC root property file). */\r
        public final static String ROOT_DIR_PROPERTY = "slc.rootDir";\r
+       /** Property for the conf dir (SLC root property file). */\r
        public final static String CONF_DIR_PROPERTY = "slc.confDir";\r
+       /** Property for the work dir (SLC root property file). */\r
        public final static String WORK_DIR_PROPERTY = "slc.workDir";\r
        /**\r
         * Comma-separated list of property file names to load from the conf dir and\r
@@ -123,6 +127,7 @@ public class SlcAntConfig {
        public static String DEFAULT_TEST_RUN_PROPERTY = "slc.defaultTestRun";\r
 \r
        // SLC LOCAL PROPERTIES\r
+       /** Property for the dir description (SLC local property file). */\r
        public static String DIR_DESCRIPTION_PROPERTY = "slc.dirDescription";\r
 \r
        private String slcRootFileName = "slcRoot.properties";\r
@@ -145,7 +150,7 @@ public class SlcAntConfig {
                if (slcRootFile == null) {\r
                        return false;\r
                }\r
-               \r
+\r
                // pass the project properties through the System properties\r
                System.getProperties().putAll((Map<?, ?>) project.getUserProperties());\r
                Properties all = prepareAllProperties(slcRootFile);\r
index dc7ebfda8a7001af97011a74a9808cb46c5724bf..854df33cff7af494c89d0a0195d86717c57c72c0 100644 (file)
@@ -6,10 +6,12 @@ import org.argeo.slc.core.SlcException;
 public class SlcAntException extends SlcException {\r
        static final long serialVersionUID = 1l;\r
 \r
+       /** Constructor. */\r
        public SlcAntException(String message) {\r
                super(message);\r
        }\r
 \r
+       /** Constructor. */\r
        public SlcAntException(String message, Throwable cause) {\r
                super(message, cause);\r
        }\r
index 9dba5dcf6838ee380467b4ac78f15f1ed50fa62b..70c0ff7f67a034d9bd57f3b04ff7477328dcb537 100644 (file)
@@ -48,11 +48,13 @@ public class SlcDeployTask extends SAwareTask {
                this.deploymentBean = deploymentBean;\r
        }\r
 \r
+       /** Creates deployment data sub tag.*/\r
        public DeploymentDataArg createDeploymentData() {\r
                deploymentDataArg = new DeploymentDataArg();\r
                return deploymentDataArg;\r
        }\r
 \r
+       /** Creates target data sub tag.*/\r
        public TargetDataArg createTargetData() {\r
                targetDataArg = new TargetDataArg();\r
                return targetDataArg;\r
@@ -60,14 +62,14 @@ public class SlcDeployTask extends SAwareTask {
 }\r
 \r
 class DeploymentDataArg extends AbstractSpringArg {\r
-       public DeploymentData getDeploymentData() {\r
+       DeploymentData getDeploymentData() {\r
                return (DeploymentData) getBeanInstance();\r
        }\r
 \r
 }\r
 \r
 class TargetDataArg extends AbstractSpringArg {\r
-       public TargetData getTargetData() {\r
+       TargetData getTargetData() {\r
                return (TargetData) getBeanInstance();\r
        }\r
 \r
index 14464ff20e00af16bc0646ed51ae5a575cbe4c5e..20508a6e8b90416c75007a3ad3ba58e7089775fa 100644 (file)
@@ -16,6 +16,7 @@ public class OverrideArg extends AbstractSpringArg {
                return name;\r
        }\r
 \r
+       /** Sets the name. */\r
        public void setName(String name) {\r
                this.name = name;\r
        }\r
@@ -36,6 +37,7 @@ public class OverrideArg extends AbstractSpringArg {
                super.setBean(bean);\r
        }\r
 \r
+       /** Creates override list sub tag. */\r
        public OverrideList createList() {\r
                if (value != null || getBean() != null) {\r
                        throw new BuildException("Value already set.");\r
@@ -68,12 +70,14 @@ public class OverrideArg extends AbstractSpringArg {
        protected class OverrideList {\r
                private List<OverrideArg> list = new Vector<OverrideArg>();\r
 \r
+               /** Creates override sub tag. */\r
                public OverrideArg createOverride() {\r
                        OverrideArg overrideArg = new OverrideArg();\r
                        list.add(overrideArg);\r
                        return overrideArg;\r
                }\r
 \r
+               /** Gets as list of objects. */\r
                public List<Object> getAsObjectList() {\r
                        List<Object> objectList = new Vector<Object>();\r
                        for (OverrideArg arg : list) {\r
index 1d9132003faec620c03ff87988cef98da3257062..96b5176e9b70a8dfad1005212e73dd9b1867dd0b 100644 (file)
@@ -66,7 +66,7 @@ public class SlcTestTask extends SAwareTask {
                                        getPath());\r
                }\r
 \r
-               ((ExecutableTestRun)testRun).execute();\r
+               ((ExecutableTestRun) testRun).execute();\r
        }\r
 \r
        /**\r
@@ -78,6 +78,7 @@ public class SlcTestTask extends SAwareTask {
                this.testRunBean = testRunBean;\r
        }\r
 \r
+       /** Creates sub tag. */\r
        public TestDefinitionArg createTestDefinition() {\r
                testDefinitionArg = new TestDefinitionArg();\r
                // only test definitions can add to path\r
@@ -85,16 +86,19 @@ public class SlcTestTask extends SAwareTask {
                return testDefinitionArg;\r
        }\r
 \r
+       /** Creates sub tag. */\r
        public TestDataArg createTestData() {\r
                testDataArg = new TestDataArg();\r
                return testDataArg;\r
        }\r
 \r
+       /** Creates sub tag. */\r
        public DeployedSystemArg createDeployedSystem() {\r
                deployedSystemArg = new DeployedSystemArg();\r
                return deployedSystemArg;\r
        }\r
 \r
+       /** Creates sub tag. */\r
        public TestResultArg createTestResult() {\r
                testResultArg = new TestResultArg();\r
                return testResultArg;\r
@@ -103,27 +107,27 @@ public class SlcTestTask extends SAwareTask {
 }\r
 \r
 class TestDefinitionArg extends AbstractSpringArg {\r
-       public TestDefinition getTestDefinition() {\r
+       TestDefinition getTestDefinition() {\r
                return (TestDefinition) getBeanInstance();\r
        }\r
 }\r
 \r
 class TestDataArg extends AbstractSpringArg {\r
-       public TestData getTestData() {\r
+       TestData getTestData() {\r
                return (TestData) getBeanInstance();\r
        }\r
 \r
 }\r
 \r
 class DeployedSystemArg extends AbstractSpringArg {\r
-       public DeployedSystem getDeployedSystem() {\r
+       DeployedSystem getDeployedSystem() {\r
                return (DeployedSystem) getBeanInstance();\r
        }\r
 \r
 }\r
 \r
 class TestResultArg extends AbstractSpringArg {\r
-       public TestResult getTestResult() {\r
+       TestResult getTestResult() {\r
                return (TestResult) getBeanInstance();\r
        }\r
 \r
index 2cb303d7fd3694d5e91230cd9f3d56de5de89880..7daffaf87126eac742213a71236e17db4f949d98 100644 (file)
@@ -4,10 +4,12 @@ package org.argeo.slc.core;
 public class SlcException extends RuntimeException {\r
        static final long serialVersionUID = 1l;\r
 \r
+       /** Constructor. */\r
        public SlcException(String message) {\r
                super(message);\r
        }\r
 \r
+       /** Constructor. */\r
        public SlcException(String message, Throwable cause) {\r
                super(message, cause);\r
        }\r
index 2399a298932dc24bfa493171adfd8c3279f4e26b..76f6565d2870306a96dcd9b5e317d6fc036a290a 100644 (file)
@@ -1,20 +1,39 @@
 package org.argeo.slc.core;\r
 \r
+/** Exception for unsupported features or actions. */\r
 public class UnsupportedException extends SlcException {\r
        static final long serialVersionUID = 1l;\r
 \r
+       /** Action not supported. */\r
        public UnsupportedException() {\r
                this("Action not supported");\r
        }\r
 \r
+       /** Constructor with a message. */\r
        public UnsupportedException(String message) {\r
                super(message);\r
        }\r
 \r
+       /**\r
+        * Constructor generating a message.\r
+        * \r
+        * @param nature\r
+        *            the nature of the unsupported object\r
+        * @param obj\r
+        *            the object itself (its class name will be used in message)\r
+        */\r
        public UnsupportedException(String nature, Object obj) {\r
                super("Unsupported " + nature + ": " + obj.getClass());\r
        }\r
 \r
+       /**\r
+        * Constructor generating a message.\r
+        * \r
+        * @param nature\r
+        *            the nature of the unsupported object\r
+        * @param value\r
+        *            the problematic value itself\r
+        */\r
        public UnsupportedException(String nature, String value) {\r
                super("Unsupported " + nature + ": " + value);\r
        }\r
index 54bdccf9841c9c4c70fa313e351fd99dc5e6a965..aa6b0da52e43208f25d15ecc8d33a9430dc065ca 100644 (file)
@@ -16,10 +16,12 @@ public class SimpleSElement implements StructureElement {
        public SimpleSElement() {\r
        }\r
 \r
+       /** Constructor */\r
        public SimpleSElement(String description) {\r
                this.description = description;\r
        }\r
 \r
+       /** Constructor */\r
        public SimpleSElement(String description, String defaultDescription) {\r
                this(description != null ? description : defaultDescription);\r
        }\r
@@ -28,6 +30,7 @@ public class SimpleSElement implements StructureElement {
                return description;\r
        }\r
 \r
+       /** Sets the description. */\r
        public void setDescription(String description) {\r
                this.description = description;\r
        }\r
index b00d1cf9443bd6351258f36b6d88de01db3077ca..014e12c0b52967acedbedc82e501f90b9f89f1c8 100644 (file)
@@ -27,6 +27,7 @@ public class TreeSPath implements StructurePath, Comparable<StructurePath> {
                return parentStr + separator + name;\r
        }\r
 \r
+       /** Sets all the required data from a string. */\r
        public void setAsUniqueString(String str) {\r
                TreeSPath twin = parseToCreatePath(str, getSeparator());\r
                name = twin.name;\r
@@ -84,10 +85,12 @@ public class TreeSPath implements StructurePath, Comparable<StructurePath> {
                return currPath;\r
        }\r
 \r
+       /** Lists the children from a registry. */\r
        public List<TreeSPath> listChildren(StructureRegistry registry) {\r
                return listChildrenPaths(registry, this);\r
        }\r
 \r
+       /** Lists the children from a given path from a registry. */\r
        public static List<TreeSPath> listChildrenPaths(StructureRegistry registry,\r
                        TreeSPath path) {\r
                List<TreeSPath> paths = new Vector<TreeSPath>();\r
@@ -101,14 +104,15 @@ public class TreeSPath implements StructurePath, Comparable<StructurePath> {
                return paths;\r
        }\r
 \r
-       public TreeSPath getRoot(){\r
+       /** Gets the root tree path of this path. */\r
+       public TreeSPath getRoot() {\r
                TreeSPath root = this;\r
-               while(root.getParent()!=null){\r
+               while (root.getParent() != null) {\r
                        root = root.getParent();\r
                }\r
                return root;\r
        }\r
-       \r
+\r
        @Override\r
        public String toString() {\r
                return getAsUniqueString();\r
@@ -135,14 +139,17 @@ public class TreeSPath implements StructurePath, Comparable<StructurePath> {
                this.tid = tid;\r
        }\r
 \r
+       /** Sets the separator character to use. */\r
        public void setSeparator(Character separator) {\r
                this.separator = separator;\r
        }\r
 \r
+       /** Sets the parent (for ORM). */\r
        protected void setParent(TreeSPath parent) {\r
                this.parent = parent;\r
        }\r
 \r
+       /** Sets the name (for ORM). */\r
        protected void setName(String name) {\r
                this.name = name;\r
        }\r
index c7945cebf61ebf0edd274064f2aded990f418fb7..e67284375380d7c4b64a5519e4c997927b5fe70c 100644 (file)
@@ -11,6 +11,7 @@ import org.argeo.slc.core.structure.StructureElement;
 import org.argeo.slc.core.structure.StructurePath;\r
 import org.argeo.slc.core.structure.StructureRegistry;\r
 \r
+/** Tree based implementation of a structure registry. */\r
 public class TreeSRegistry implements StructureRegistry {\r
        /** For ORM */\r
        private Long tid;\r
@@ -35,12 +36,12 @@ public class TreeSRegistry implements StructureRegistry {
 \r
        public void register(StructurePath path, StructureElement element) {\r
                final SimpleSElement simpleSElement;\r
-               if (element instanceof SimpleSElement){\r
-                       simpleSElement = (SimpleSElement)element;\r
-               }else{\r
+               if (element instanceof SimpleSElement) {\r
+                       simpleSElement = (SimpleSElement) element;\r
+               } else {\r
                        simpleSElement = new SimpleSElement(element.getDescription());\r
                }\r
-               \r
+\r
                if (!(path instanceof TreeSPath))\r
                        throw new UnsupportedException("path", path);\r
 \r
@@ -64,18 +65,22 @@ public class TreeSRegistry implements StructureRegistry {
                this.activePaths = activePaths;\r
        }\r
 \r
+       /** Gets the related root path. */\r
        public TreeSPath getRoot() {\r
                return root;\r
        }\r
 \r
+       /** Sets the related root path. */\r
        public void setRoot(TreeSPath root) {\r
                this.root = root;\r
        }\r
 \r
+       /** Gets the elements. */\r
        public Map<TreeSPath, SimpleSElement> getElements() {\r
                return elements;\r
        }\r
 \r
+       /** Sets the elements (for ORM). */\r
        public void setElements(Map<TreeSPath, SimpleSElement> elements) {\r
                this.elements = elements;\r
        }\r
index 76a8bb05a08071e93b9f7bb3a41c84d1557530e6..3ac38de5dd44953c602efb9a06bbcecd9a13b4a4 100644 (file)
@@ -19,6 +19,7 @@ public abstract class AsynchronousTreeTestResultListener implements
        private Vector<PartStruct> partStructs = new Vector<PartStruct>();\r
        private Thread thread;\r
 \r
+       /** Starts the underlying thread. */\r
        public void init() {\r
                thread = new Thread(this);\r
                thread.start();\r
@@ -85,6 +86,7 @@ public abstract class AsynchronousTreeTestResultListener implements
                /** The tree test result itself. */\r
                public final TreeTestResult result;\r
 \r
+               /** Constructor */\r
                public PartStruct(TreeSPath path, NumericTRId resultId,\r
                                TestResultPart part, TreeTestResult result) {\r
                        super();\r
index eac9fce9be1d75595fc7f646083970755a084bca..dd418477d9d661f8b0140044d4040561b7078568 100644 (file)
@@ -11,10 +11,7 @@ import org.argeo.slc.core.structure.StructureElement;
 import org.argeo.slc.core.structure.StructurePath;\r
 import org.argeo.slc.core.structure.StructureRegistry;\r
 import org.argeo.slc.core.structure.tree.TreeSPath;\r
-import org.argeo.slc.core.structure.tree.TreeSRegistry;\r
 import org.argeo.slc.core.test.SimpleResultPart;\r
-import org.argeo.slc.core.test.SimpleTestResult;\r
-import org.argeo.slc.core.test.TestStatus;\r
 import org.argeo.slc.core.test.TestReport;\r
 import org.argeo.slc.core.test.TestResult;\r
 import org.argeo.slc.core.test.TestResultPart;\r
@@ -155,11 +152,12 @@ public class FullHtmlTreeReport implements TestReport, StructureAware {
                                + result.getTestResultId() + ".html");\r
        }\r
 \r
-       /** Sets the dao to use to extract all data. */\r
+       /** Sets the DAO to use to extract all data. */\r
        public void setTestResultDao(TestResultDao testResultDao) {\r
                this.testResultDao = testResultDao;\r
        }\r
 \r
+       /** Sets the tree structure registry DAO.*/\r
        public void setTreeSRegistryDao(TreeSRegistryDao treeSRegistryDao) {\r
                this.treeSRegistryDao = treeSRegistryDao;\r
        }\r
@@ -169,7 +167,7 @@ public class FullHtmlTreeReport implements TestReport, StructureAware {
                this.reportDir = reportDir;\r
        }\r
 \r
-       protected void initRegistry(TreeSPath path){\r
+       private void initRegistry(TreeSPath path){\r
                if(treeSRegistryDao != null){\r
                        registry = treeSRegistryDao.getTreeSRegistry(path);\r
                }\r
index d4d366f95521560fdeb921050db1f5ec86e2e9e3..eab01a0482c5bda8b06a61266b92419fa5631a0a 100644 (file)
@@ -20,10 +20,12 @@ public class PartSubList {
 \r
        private List<TestResultPart> parts = new Vector<TestResultPart>();\r
 \r
+       /** Gets the result parts.*/\r
        public List<TestResultPart> getParts() {\r
                return parts;\r
        }\r
 \r
+       /** Sets the result parts.*/\r
        public void setParts(List<TestResultPart> parts) {\r
                this.parts = parts;\r
        }\r
index 5b84115409dc8f602418403cfc3047cdee797627..fb1b0130c951027a29f576381bd38357d47d5476 100644 (file)
@@ -51,10 +51,12 @@ public class TreeTestResult implements TestResult, StructureAware {
                return testResultId;\r
        }\r
 \r
+       /** Sets the test result id as a numeric test result id.*/\r
        public void setNumericResultId(NumericTRId testResultId) {\r
                this.testResultId = testResultId;\r
        }\r
 \r
+       /** Sets the list of listeners.*/\r
        public void setListeners(List<TestResultListener> listeners) {\r
                this.listeners = listeners;\r
        }\r
@@ -83,6 +85,7 @@ public class TreeTestResult implements TestResult, StructureAware {
                this.registry = registry;\r
        }\r
 \r
+       /** Gets the current path.*/\r
        public TreeSPath getCurrentPath() {\r
                return currentPath;\r
        }\r
@@ -121,10 +124,12 @@ public class TreeTestResult implements TestResult, StructureAware {
                this.tid = tid;\r
        }\r
 \r
+       /** Gets the related registry (can be null).*/\r
        public StructureRegistry getRegistry() {\r
                return registry;\r
        }\r
 \r
+       /** Sets the related registry.*/\r
        public void setRegistry(StructureRegistry registry) {\r
                this.registry = registry;\r
        }\r
index 0c32a1a4cfd82caf5a743400e3844c4a66237e24..0621574292f2af41081d1fe1f61d23840c749f00 100644 (file)
@@ -4,7 +4,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;\r
 \r
 import org.argeo.slc.core.structure.SimpleSElement;\r
-import org.argeo.slc.core.structure.StructureElement;\r
 import org.argeo.slc.core.structure.StructureRegistry;\r
 import org.argeo.slc.core.structure.tree.TreeSPath;\r
 import org.argeo.slc.core.structure.tree.TreeSRegistry;\r
@@ -41,6 +40,7 @@ public class TreeTestResultPersister extends AsynchronousTreeTestResultListener
                                } else {\r
                                        registry.register(path, new SimpleSElement(path.getName()));\r
                                }\r
+                               treeSRegistryDao.update(registry);\r
                        }\r
 \r
                        if (persistedResult == null) {\r
@@ -89,15 +89,17 @@ public class TreeTestResultPersister extends AsynchronousTreeTestResultListener
                }\r
        }\r
 \r
-       /** Sets the dao to use in order to persist the results. */\r
+       /** Sets the DAO to use in order to persist the results. */\r
        public void setTestResultDao(TestResultDao testResultDao) {\r
                this.testResultDao = testResultDao;\r
        }\r
 \r
+       /** Sets the tree structure path DAO. */\r
        public void setTreeSPathDao(TreeSPathDao treeSPathDao) {\r
                this.treeSPathDao = treeSPathDao;\r
        }\r
 \r
+       /** Sets the tree structure registry DAO. */\r
        public void setTreeSRegistryDao(TreeSRegistryDao treeSRegistryDao) {\r
                this.treeSRegistryDao = treeSRegistryDao;\r
        }\r
index dc852de239627764752e637c6114455df338d5d2..99e41734122be561e613a963f51c1af435fe0679 100644 (file)
@@ -3,7 +3,18 @@ package org.argeo.slc.dao.structure.tree;
 import org.argeo.slc.core.structure.tree.TreeSPath;\r
 import org.argeo.slc.core.structure.tree.TreeSRegistry;\r
 \r
+/**\r
+ * DAO for tree-base structure registry.\r
+ * \r
+ * @see TreeSRegistry\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
+\r
+       /** Creates a new registry. */\r
        public void create(TreeSRegistry registry);\r
+\r
+       /** Updates an existing registry. */\r
+       public void update(TreeSRegistry registry);\r
 }\r
index 14d3fe02e438916ae8d7f62885088356a123bb97..544fd99400335d4bda3a7fef7d34065304f105ef 100644 (file)
@@ -2,8 +2,10 @@ package org.argeo.slc.diff;
 \r
 /** The root class for issues which happened during a diff. */\r
 public abstract class DiffIssue implements Comparable<DiffIssue> {\r
+       /** The position of this issue.*/\r
        protected final DiffPosition position;\r
 \r
+       /** Constructor*/\r
        public DiffIssue(DiffPosition position) {\r
                super();\r
                this.position = position;\r
index 7eb235806c4976742fb7ba0315c84e751afd60f7..549be3b3b465cc5060d1559a38c13a665f73e346 100644 (file)
@@ -26,7 +26,7 @@ public class TreeSPathDaoHibernate extends HibernateDaoSupport implements
        }\r
 \r
        \r
-       protected void createImpl(TreeSPath path) {\r
+       private void createImpl(TreeSPath path) {\r
                if (path.getParent() != null) {\r
                        TreeSPath parent = getTreeSPath(path.getParent()\r
                                        .getAsUniqueString());\r
index f202c5e36af06ce22247d32a0c6712c0cb757928..b3287a5810d9007615e73d8558eab85c3b6d790e 100644 (file)
@@ -4,19 +4,14 @@ import java.util.List;
 \r
 import org.springframework.orm.hibernate3.support.HibernateDaoSupport;\r
 \r
-import org.apache.commons.logging.Log;\r
-import org.apache.commons.logging.LogFactory;\r
-\r
 import org.argeo.slc.core.structure.tree.TreeSPath;\r
 import org.argeo.slc.core.structure.tree.TreeSRegistry;\r
-import org.argeo.slc.core.test.tree.TreeTestResult;\r
-import org.argeo.slc.dao.structure.tree.TreeSPathDao;\r
 import org.argeo.slc.dao.structure.tree.TreeSRegistryDao;\r
 \r
 /**\r
- * The Hibernate implementation for tree-based result of the test result dao.\r
+ * The Hibernate implementation for tree-based structure registry.\r
  * \r
- * @see TreeTestResult\r
+ * @see TreeSRegistry\r
  */\r
 public class TreeSRegistryDaoHibernate extends HibernateDaoSupport implements\r
                TreeSRegistryDao {\r
@@ -27,6 +22,10 @@ public class TreeSRegistryDaoHibernate extends HibernateDaoSupport implements
                getHibernateTemplate().save(registry);\r
        }\r
 \r
+       public void update(TreeSRegistry registry) {\r
+               getHibernateTemplate().update(registry);\r
+       }\r
+\r
        public TreeSRegistry getTreeSRegistry(TreeSPath treeSPath) {\r
                List<?> list = getHibernateTemplate().find(\r
                                "from TreeSRegistry where root.asUniqueString=?",\r
index dacb80369fcf9a75b760800d19c2ee7d8ce86047..504dffedd1edc4ac0ac802c9e6e5aad45eb1fd8f 100644 (file)
@@ -17,14 +17,20 @@ public class DbModel {
        private String dialect;\r
        private List<String> mappings;\r
 \r
+       /** Sets the Hibernate dialect to use. */\r
        public void setDialect(String dialect) {\r
                this.dialect = dialect;\r
        }\r
 \r
+       /** Sets the list of mappings to consider. */\r
        public void setMappings(List<String> mappings) {\r
                this.mappings = mappings;\r
        }\r
 \r
+       /**\r
+        * Creates an Hibernate schema export tool, in order to create the\r
+        * underlying datamodel.\r
+        */\r
        public SchemaExport createSchemaExport(Connection connection) {\r
                Configuration configuration = new Configuration();\r
                Properties properties = new Properties();\r
index 388d9b40c2a11929832d45f731bb72a7497badca..24ba414b09a5e14813291abc6c04c981d2a15124 100644 (file)
@@ -4,6 +4,7 @@ import org.argeo.slc.core.deploy.DeployedSystem;
 import org.argeo.slc.core.deploy.DeployedSystemId;\r
 import org.argeo.slc.example.appli.ExampleAppli;\r
 \r
+/** Example deployed sytem. */\r
 public class ExampleDeployedSystem implements DeployedSystem {\r
        private DeployedSystemId deployedSystemId;\r
        private int skipFreq = 2;\r
@@ -12,16 +13,19 @@ public class ExampleDeployedSystem implements DeployedSystem {
                return deployedSystemId;\r
        }\r
 \r
+       /** Sets deployed system id. */\r
        public void setDeployedSystemId(DeployedSystemId deployedSystemId) {\r
                this.deployedSystemId = deployedSystemId;\r
        }\r
 \r
+       /** Creates an instance of the example appli. */\r
        public ExampleAppli getExampleAppliInstance() {\r
                ExampleAppli appli = new ExampleAppli();\r
                appli.setSkipFreq(skipFreq);\r
                return appli;\r
        }\r
 \r
+       /** Sets the frequency used to skip lines. */\r
        public void setSkipFreq(int skipFreq) {\r
                this.skipFreq = skipFreq;\r
        }\r
index 4feafac532c37a1e30802fa71ba39d3b77b1f6c6..9da9c8e481f233610993325e56813509f97809ab 100644 (file)
@@ -10,6 +10,7 @@ import org.argeo.slc.core.test.TestDefinition;
 import org.argeo.slc.core.test.TestResult;\r
 import org.argeo.slc.core.test.TestRun;\r
 \r
+/** Example task.*/\r
 public class ExampleTask implements StructureAware, TestDefinition,\r
                StructureElement {\r
        private TreeSPath path;\r
@@ -31,6 +32,7 @@ public class ExampleTask implements StructureAware, TestDefinition,
                return description;\r
        }\r
 \r
+       /** Sets the description.*/\r
        public void setDescription(String description) {\r
                this.description = description;\r
        }\r
index 006369cbd6d1c1a1bc5517e33cf92215fb4dd02e..fd0c6c0f7c55f3123518324cf5e20d4c138bdeeb 100644 (file)
@@ -5,9 +5,11 @@ import java.io.FileReader;
 import java.io.FileWriter;\r
 import java.io.IOException;\r
 \r
+/** Example appli.*/\r
 public class ExampleAppli {\r
        private int skipFreq = 2;\r
 \r
+       /** Filters.*/\r
        public void filter(String[] args) {\r
                if (args.length < 2) {\r
                        throw new RuntimeException(\r
@@ -38,6 +40,7 @@ public class ExampleAppli {
                }\r
        }\r
 \r
+       /** Sets the frequency of the lines to skip.*/\r
        public void setSkipFreq(int skipFreq) {\r
                this.skipFreq = skipFreq;\r
        }\r
index ad88b3b6cd104052e1167b48c4ca1c03320758bd..b4d097483ee2cf79a808ea14db2ef09ce6f7c0cb 100644 (file)
@@ -18,13 +18,16 @@ import org.argeo.slc.core.test.tree.PartSubList;
 import org.argeo.slc.core.test.tree.TreeTestResult;\r
 import org.argeo.slc.dao.test.TestResultDao;\r
 \r
+/** High level tests for SLC Ant. */\r
 public class TestAntBuild extends TestCase {\r
+       /** Tests an end-to-end Ant run. */\r
        public void testAllRunSimple() {\r
-               File[] reportFiles = new File("src/test/slc/work/results/report/").listFiles();\r
-               for(File file: reportFiles){\r
+               File[] reportFiles = new File("src/test/slc/work/results/report/")\r
+                               .listFiles();\r
+               for (File file : reportFiles) {\r
                        file.delete();\r
                }\r
-               \r
+\r
                File slcBaseDir = new File("./src/test/slc").getAbsoluteFile();\r
 \r
                File antFile = new File(slcBaseDir.getPath()\r