Index: lams_tool_deploy/build.xml =================================================================== diff -u -ra174a94fcb9db22380a89926f460afbef0216c91 -r5a1e4424a7fee54a37abf1504b699077bd9f41fa --- lams_tool_deploy/build.xml (.../build.xml) (revision a174a94fcb9db22380a89926f460afbef0216c91) +++ lams_tool_deploy/build.xml (.../build.xml) (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -31,8 +31,27 @@ + + + + + + + + + + + + + + + + + + + @@ -58,40 +77,25 @@ - - - - - - - - - - - - - - - + + - + - - - - - + + + Index: lams_tool_deploy/lib/jakarta-commmons/commons-collections-3.1.jar =================================================================== diff -u Binary files differ Index: lams_tool_deploy/lib/jakarta-commmons/commons-configuration-1.1.jar =================================================================== diff -u Binary files differ Index: lams_tool_deploy/lib/jakarta-commmons/commons-io-1.0.jar =================================================================== diff -u Binary files differ Index: lams_tool_deploy/lib/jakarta-commmons/commons-lang-2.0.jar =================================================================== diff -u Binary files differ Index: lams_tool_deploy/lib/jakarta-commmons/commons-logging.jar =================================================================== diff -u Binary files differ Index: lams_tool_deploy/nbproject/project.xml =================================================================== diff -u -ra174a94fcb9db22380a89926f460afbef0216c91 -r5a1e4424a7fee54a37abf1504b699077bd9f41fa --- lams_tool_deploy/nbproject/project.xml (.../project.xml) (revision a174a94fcb9db22380a89926f460afbef0216c91) +++ lams_tool_deploy/nbproject/project.xml (.../project.xml) (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -28,6 +28,9 @@ clean + + junit + @@ -47,19 +50,20 @@ + src/java - lib/ant/ant.jar:lib/jakarta-commmons/commons-dbutils-1.0.jar:lib/mysql/mysql-connector-java-3.1.7-bin.jar + lib/ant/ant.jar:lib/jakarta-commmons/commons-dbutils-1.0.jar:lib/mysql/mysql-connector-java-3.1.7-bin.jar:lib/jakarta-commmons/commons-configuration-1.1.jar:lib/jakarta-commmons/commons-lang-2.0.jar:lib/jakarta-commmons/commons-collections-3.1.jar:lib/jakarta-commmons/commons-logging.jar:lib/jakarta-commmons/commons-io-1.0.jar 1.4 test/java - src/java:lib/ant/ant.jar:lib/jakarta-commmons/commons-dbutils-1.0.jar:lib/mysql/mysql-connector-java-3.1.7-bin.jar:lib/junit/junit.jar + src/java:lib/ant/ant.jar:lib/jakarta-commmons/commons-dbutils-1.0.jar:lib/mysql/mysql-connector-java-3.1.7-bin.jar:lib/junit/junit.jar:lib/jakarta-commmons/commons-configuration-1.1.jar:lib/jakarta-commmons/commons-lang-2.0.jar:lib/jakarta-commmons/commons-collections-3.1.jar:lib/jakarta-commmons/commons-logging.jar:lib/jakarta-commmons/commons-io-1.0.jar 1.4 Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java =================================================================== diff -u --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java (revision 0) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/Deploy.java (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -0,0 +1,30 @@ +/* + * Deploy.java + * + * Created on 04 April 2005, 10:36 + */ + +package org.lamsfoundation.lams.tool.deploy; + +/** + * Tool Deployer + * @author chris + */ +public class Deploy +{ + + /** Creates a new instance of Deploy */ + public Deploy() + { + } + + /** + * @param args the command line arguments + */ + public static void main(String[] args) throws Exception + { + + DeployConfig config = new DeployConfig(args[1]); + } + +} Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployConfig.java =================================================================== diff -u --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployConfig.java (revision 0) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployConfig.java (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -0,0 +1,281 @@ +/* + * DeployConfig.java + * + * Created on 04 April 2005 + */ + +package org.lamsfoundation.lams.tool.deploy; + +import java.util.List; +import java.util.ArrayList; +import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.configuration.ConfigurationException; + +/** + * Encapsulates configuration data for the Deployer. + * @author chris + */ +public class DeployConfig +{ + //public static final String PROPERTIES_FILE_NAME = "/home/chris/workspace/lams_tool_deploy/test/file/deploy.properties"; + public static final String TOOL_WEB_URI_KEY = "toolWebUri"; + public static final String TOOL_CONTEXT_KEY = "toolContext"; + public static final String LAMS_EAR_PATH_KEY = "lamsEarPath"; + public static final String TOOL_INSERT_SCRIPT_NAME_KEY = "toolInsertScriptName"; + public static final String TOOL_LIBRARY_INSERT_SCRIPT_NAME_KEY = "toolLibraryInsertScriptName"; + public static final String TOOL_ACTIVITY_INSERT_SCRIPT_NAME_KEY = "toolActivityInsertScriptName"; + public static final String TOOL_TABLES_SCRIPT_NAME_KEY = "toolTablesScriptName"; + public static final String DB_USERNAME_KEY = "dbUsername"; + public static final String DB_PASSWORD_KEY = "dbPassword"; + public static final String DB_DRIVER_CLASS_KEY = "dbDriverClass"; + public static final String DB_DRIVER_URL_KEY = "dbDriverUrl"; + public static final String DEPLOY_FILES_KEY = "deployFiles"; + + private PropertiesConfiguration props = null; + /** + * Holds value of property toolWebUri. + */ + private String toolWebUri; + + /** + * Holds value of property toolContextRoot. + */ + private String toolContextRoot; + + /** + * Holds value of property lamsEarPath. + */ + private String lamsEarPath; + + /** + * Holds value of property toolInsertScriptName. + */ + private String toolInsertScriptName; + + /** + * Holds value of property toolLibraryInsertScriptName. + */ + private String toolLibraryInsertScriptName; + + /** + * Holds value of property toolActivityInsertScriptName. + */ + private String toolActivityInsertScriptName; + + /** + * Holds value of property toolTablesScriptName. + */ + private String toolTablesScriptName; + + /** + * Holds value of property deployFiles. + */ + private List deployFiles; + + /** + * Holds value of property dbUsername. + */ + private String dbUsername; + + /** + * Holds value of property dbPassword. + */ + private String dbPassword; + + /** + * Holds value of property dbDriverClass. + */ + private String dbDriverClass; + + /** + * Holds value of property dbDriverUrl. + */ + private String dbDriverUrl; + + /** Creates a new instance of DeployConfig */ + public DeployConfig(final String deployPropertiesFilePath) throws DeployException + { + try + { + props = new PropertiesConfiguration(deployPropertiesFilePath); + toolWebUri = getProperty(TOOL_WEB_URI_KEY); + toolContextRoot = getProperty(TOOL_CONTEXT_KEY); + lamsEarPath = getProperty(LAMS_EAR_PATH_KEY); + toolInsertScriptName = getProperty(TOOL_INSERT_SCRIPT_NAME_KEY); + toolLibraryInsertScriptName = getProperty(TOOL_LIBRARY_INSERT_SCRIPT_NAME_KEY); + toolActivityInsertScriptName = getProperty(TOOL_ACTIVITY_INSERT_SCRIPT_NAME_KEY); + toolTablesScriptName = getProperty(TOOL_TABLES_SCRIPT_NAME_KEY); + dbUsername = getProperty(DB_USERNAME_KEY); + dbPassword = getProperty(DB_PASSWORD_KEY); + dbDriverClass = getProperty(DB_DRIVER_CLASS_KEY); + dbDriverUrl = getProperty(DB_DRIVER_URL_KEY); + deployFiles = getPropertyList(DEPLOY_FILES_KEY); + + } + catch (ConfigurationException confex) + { + throw new DeployException("Failed to load configuration", confex); + } + } + + /** + * Getter for property toolWebAppName. + * @return Value of property toolWebAppName. + */ + public String getToolWebUri() + + + { + + return this.toolWebUri; + } + + /** + * Getter for property toolContextRoot. + * @return Value of property toolContextRoot. + */ + public String getToolContextRoot() + { + + return this.toolContextRoot; + } + + /** + * Getter for property lamsEarPath. + * @return Value of property lamsEarPath. + */ + public String getLamsEarPath() + { + + return this.lamsEarPath; + } + + /** + * Getter for property toolIinsertScriptPath. + * @return Value of property toolIinsertScriptPath. + */ + public String getToolInsertScriptName() + + + { + + return this.toolInsertScriptName; + } + + /** + * Getter for property libraryInsertScriptPath. + * @return Value of property libraryInsertScriptPath. + */ + public String getToolLibraryInsertScriptName() + + + { + + return this.toolLibraryInsertScriptName; + } + + /** + * Getter for property toolActivityInsertScriptPath. + * @return Value of property toolActivityInsertScriptPath. + */ + public String getToolActivityInsertScriptName() + + { + + return this.toolActivityInsertScriptName; + } + + /** + * Getter for property toolTablesScriptPath. + * @return Value of property toolTablesScriptPath. + */ + public String getToolTablesScriptName() + + { + + return this.toolTablesScriptName; + } + + /** + * Getter for property deployFiles. + * @return Value of property deployFiles. + */ + public List getDeployFiles() + { + + return this.deployFiles; + } + + /** + * Getter for property dbUsername. + * @return Value of property dbUsername. + */ + public String getDbUsername() + { + + return this.dbUsername; + } + + /** + * Getter for property dbPassword. + * @return Value of property dbPassword. + */ + public String getDbPassword() + { + + return this.dbPassword; + } + + /** + * Getter for property dbDriverClass. + * @return Value of property dbDriverClass. + */ + public String getDbDriverClass() + { + + return this.dbDriverClass; + } + + /** + * Getter for property dbDriverURL. + * @return Value of property dbDriverURL. + */ + public String getDbDriverUrl() + + { + + return this.dbDriverUrl; + } + + /** + * Tries to load the property for the given key. + * @param key the key to the desired property. + * @return String the property value + * @throws DeployException if the property cannot be found. + */ + protected String getProperty(final String key) throws DeployException + { + String property = props.getString(key); + if ((property == null) || (property.length() < 1)) + { + throw new DeployException("Property "+key+" is missing or has no value"); + } + return property; + } + + /** + * Returns a list of property strings for the given key. + * @param key identifies the property to locate + * @return List of (String) properties + * @throws DeployException if there are no matches + */ + protected List getPropertyList(final String key) throws DeployException + { + List propsList = props.getList(key); + if ((propsList == null) || (propsList.isEmpty())) + { + throw new DeployException("Property List "+key+" is missing or empty"); + } + return propsList; + } +} Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployFilesTask.java =================================================================== diff -u --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployFilesTask.java (revision 0) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployFilesTask.java (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -0,0 +1,96 @@ +/* + * DeployWarTask.java + * + * Created on 29 March 2005, 16:57 + */ + +package org.lamsfoundation.lams.tool.deploy; +import java.util.List; +import java.io.File; +import java.io.IOException; +import org.apache.commons.io.FileUtils; + +/** + * Copies the required file to the lams ear directory. + * @author chris + */ +public class DeployFilesTask implements Task +{ + + /** + * Holds value of property lamsEarPath. + */ + private String lamsEarPath; + + /** + * Holds value of property deployFiles. + */ + private List deployFiles; + + /** Creates a new instance of DeployWarTask */ + public DeployFilesTask() + { + } + + /** + * Setter for property lamsEarPath. + * @param lamsEarPath New value of property lamsEarPath. + */ + public void setLamsEarPath(String lamsEarPath) + { + + this.lamsEarPath = lamsEarPath; + } + + /** + * Setter for property deployFiles. + * @param deployFiles New value of property deployFiles. + */ + public void setDeployFiles(List deployFiles) + { + + this.deployFiles = deployFiles; + } + + /** + *Executes the task + */ + public void execute() throws DeployException + { + File lamsEar = new File(lamsEarPath); + if (!lamsEar.exists()) + { + throw new DeployException("Could not find "+lamsEarPath); + } + else if (!lamsEar.isDirectory()) + { + throw new DeployException(lamsEarPath+" is not a directory"); + } + else if (!lamsEar.canWrite()) + { + throw new DeployException(lamsEarPath+" is not writable"); + } + + for (int i = 0, size = deployFiles.size(); i < size; i++) + { + copyFile((String) deployFiles.get(i), lamsEar); + } + } + + /** + * + */ + protected void copyFile(String fileName, File directory) throws DeployException + { + try + { + File original = new File(fileName); + FileUtils.copyFileToDirectory(original, directory); + } + catch (IOException ioex) + { + throw new DeployException("Could not copy file "+fileName+" to "+lamsEarPath, ioex); + } + + } +} Fisheye: Tag 5a1e4424a7fee54a37abf1504b699077bd9f41fa refers to a dead (removed) revision in file `lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/DeployWarTask.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBActivateTask.java =================================================================== diff -u -ra174a94fcb9db22380a89926f460afbef0216c91 -r5a1e4424a7fee54a37abf1504b699077bd9f41fa --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBActivateTask.java (.../ToolDBActivateTask.java) (revision a174a94fcb9db22380a89926f460afbef0216c91) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBActivateTask.java (.../ToolDBActivateTask.java) (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -35,6 +35,7 @@ public void execute() throws BuildException { + //TODO //run tool create db script //-->transaction Index: lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBDeployTask.java =================================================================== diff -u -ra174a94fcb9db22380a89926f460afbef0216c91 -r5a1e4424a7fee54a37abf1504b699077bd9f41fa --- lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBDeployTask.java (.../ToolDBDeployTask.java) (revision a174a94fcb9db22380a89926f460afbef0216c91) +++ lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/ToolDBDeployTask.java (.../ToolDBDeployTask.java) (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -34,356 +34,127 @@ * * @author chris */ -public class ToolDBDeployTask //extends DBTask +public class ToolDBDeployTask extends DBTask { /** - * Holds value of property toolLibraryScript. + * Holds value of property toolInsertScript. */ - private File toolLibraryScript; + private File toolInsertScript; /** - * Holds value of property toolId. + * Holds value of property toolLibraryInsertScript. */ - private long toolId; + private File toolLibraryInsertScript; /** - * Holds value of property defaultContentId. + * Holds value of property toolTablesCreatScript. */ - private long defaultContentId; + private File toolTablesCreatScript; /** - * Holds value of property toolSignature. + * Holds value of property toolId. */ - private String toolSignature; + private long toolId; /** - * Holds value of property serviceName. + * Holds value of property learningLibraryId. */ - private String serviceName; + private long learningLibraryId; /** - * Holds value of property displayName. + * Holds value of property toolActivityInsertScript. */ - private String displayName; + private File toolActivityInsertScript; - /** - * Holds value of property learningLibraryid. - */ - private long learningLibraryid; - - /** - * Holds value of property groupingSupportTypeId. - */ - private int groupingSupportTypeId; - - /** - * Holds value of property supportsDefineLater. - */ - private boolean supportsDefineLater; - - /** - * Holds value of property supportsRunOffline. - */ - private boolean supportsRunOffline; - - /** - * Holds value of property supportsModeration. - */ - private boolean supportsModeration; - - /** - * Holds value of property supportsContribution. - */ - private boolean supportsContribution; - - /** - * Holds value of property learnerUrl. - */ - private String learnerUrl; - - /** - * Holds value of property auythorUrl. - */ - private String auythorUrl; - - /** - * Holds value of property defineLaterUrl. - */ - private String defineLaterUrl; - - /** - * Holds value of property exportPortfolioUrl. - */ - private String exportPortfolioUrl; - - /** - * Holds value of property monitorUrl. - */ - private String monitorUrl; - - /** - * Holds value of property contributeUrl. - */ - private String contributeUrl; - - /** - * Holds value of property moderationUrl. - */ - private String moderationUrl; - - /** - * Holds value of property toolDBCreateScript. - */ - private File toolDBCreateScript; - - /** - * Holds value of property toolDBInsertScript. - */ - private File toolDBInsertScript; - - /** - * Holds value of property toolActivityScript. - */ - private File toolActivityScript; /** Creates a new instance of ToolDBActivateTask */ public ToolDBDeployTask() { } /** - * Setter for property toolLibraryScript. - * @param toolLibraryScript New value of property toolLibraryScript. + * Setter for property toolInsertFile. + * @param toolInsertFile New value of property toolInsertFile. */ - public void setToolLibraryScript(File toolLibraryScript) + public void setToolInsertScript(java.io.File toolInsertScript) + { - this.toolLibraryScript = toolLibraryScript; + this.toolInsertScript = toolInsertScript; } /** - * Getter for property toolId. - * @return Value of property toolId. + * Setter for property toolLibraryInsertFile. + * @param toolLibraryInsertFile New value of property toolLibraryInsertFile. */ - public long getToolId() + public void setToolLibraryInsertScript(java.io.File toolLibraryInsertScript) + { - return this.toolId; + this.toolLibraryInsertScript = toolLibraryInsertScript; } /** - * Getter for property defaultContentId. - * @return Value of property defaultContentId. + * Setter for property toolTablesCreatScript. + * @param toolTablesCreatScript New value of property toolTablesCreatScript. */ - public long getDefaultContentId() + public void setToolTablesCreatScript(File toolTablesCreatScript) { - return this.defaultContentId; + this.toolTablesCreatScript = toolTablesCreatScript; } - /** - * Setter for property toolSignature. - * @param toolSignature New value of property toolSignature. - */ - public void setToolSignature(String toolSignature) + public void execute() throws DeployException { - - this.toolSignature = toolSignature; + //get a tool content id + + //put the tool content id into the tool insert file + + //run tool insert and get tool id back + + //put the tool id into the tool library script + + //run tool library script and get the library id back + + //put the library id into the activity insert script + + //run the activity insert script + + //put the tool id and and defualt content id into + //the tool tables script + + //run the tool table script } /** - * Setter for property serviceName. - * @param serviceName New value of property serviceName. + * Getter for property toolId. + * @return Value of property toolId. */ - public void setServiceName(String serviceName) + public long getToolId() { - this.serviceName = serviceName; + return this.toolId; } /** - * Setter for property displayName. - * @param displayName New value of property displayName. + * Getter for property learningLibraryId. + * @return Value of property learningLibraryId. */ - public void setDisplayName(String displayName) + public long getLearningLibraryId() { - this.displayName = displayName; + return this.learningLibraryId; } -// -// /** -// * Getter for property description. -// * @return Value of property description. -// */ -// public String getDescription() -// { -// } /** - * Setter for property description. - * @param description New value of property description. + * Setter for property toolActivityInsertScript. + * @param toolActivityInsertScript New value of property toolActivityInsertScript. */ - public void setDescription(String description) + public void setToolActivityInsertScript(File toolActivityInsertScript) { - } - /** - * Setter for property groupingSupportTypeId. - * @param groupingSupportTypeId New value of property groupingSupportTypeId. - */ - public void setGroupingSupportTypeId(int groupingSupportTypeId) - { - - this.groupingSupportTypeId = groupingSupportTypeId; + this.toolActivityInsertScript = toolActivityInsertScript; } - - /** - * Setter for property supportsDefineLater. - * @param supportsDefineLater New value of property supportsDefineLater. - */ - public void setSupportsDefineLater(boolean supportsDefineLater) - { - - this.supportsDefineLater = supportsDefineLater; - } - - /** - * Setter for property supportsRunOffline. - * @param supportsRunOffline New value of property supportsRunOffline. - */ - public void setSupportsRunOffline(boolean supportsRunOffline) - { - - this.supportsRunOffline = supportsRunOffline; - } - - /** - * Setter for property supportsModeration. - * @param supportsModeration New value of property supportsModeration. - */ - public void setSupportsModeration(boolean supportsModeration) - { - - this.supportsModeration = supportsModeration; - } - - /** - * Setter for property supportsContribution. - * @param supportsContribution New value of property supportsContribution. - */ - public void setSupportsContribution(boolean supportsContribution) - { - - this.supportsContribution = supportsContribution; - } - - /** - * Setter for property learnerUrl. - * @param learnerUrl New value of property learnerUrl. - */ - public void setLearnerUrl(String learnerUrl) - { - - this.learnerUrl = learnerUrl; - } - - /** - * Setter for property auythorUrl. - * @param auythorUrl New value of property auythorUrl. - */ - public void setAuythorUrl(String auythorUrl) - { - - this.auythorUrl = auythorUrl; - } - - /** - * Setter for property defineLaterUrl. - * @param defineLaterUrl New value of property defineLaterUrl. - */ - public void setDefineLaterUrl(String defineLaterUrl) - { - - this.defineLaterUrl = defineLaterUrl; - } - - /** - * Setter for property exportPortfolioUrl. - * @param exportPortfolioUrl New value of property exportPortfolioUrl. - */ - public void setExportPortfolioUrl(String exportPortfolioUrl) - { - - this.exportPortfolioUrl = exportPortfolioUrl; - } - - /** - * Setter for property monitorUrl. - * @param monitorUrl New value of property monitorUrl. - */ - public void setMonitorUrl(String monitorUrl) - { - - this.monitorUrl = monitorUrl; - } - - /** - * Setter for property contributeUrl. - * @param contributeUrl New value of property contributeUrl. - */ - public void setContributeUrl(String contributeUrl) - { - - this.contributeUrl = contributeUrl; - } - - /** - * Setter for property moderationUrl. - * @param moderationUrl New value of property moderationUrl. - */ - public void setModerationUrl(String moderationUrl) - { - - this.moderationUrl = moderationUrl; - } - - /** - * Getter for property learningLibraryid. - * @return Value of property learningLibraryid. -// */ -// public long getLearningLibraryid() -// { -// } - - /** - * Setter for property toolDBCreateScript. - * @param toolDBCreateScript New value of property toolDBCreateScript. - */ - public void setToolDBCreateScript(File toolDBCreateScript) - { - - this.toolDBCreateScript = toolDBCreateScript; - } - - /** - * Setter for property toolDBInsertScript. - * @param toolDBInsertScript New value of property toolDBInsertScript. - */ - public void setToolDBInsertScript(File toolDBInsertScript) - { - - this.toolDBInsertScript = toolDBInsertScript; - } - - /** - * Setter for property toolActivityScript. - * @param toolActivityScript New value of property toolActivityScript. - */ - public void setToolActivityScript(File toolActivityScript) - { - - this.toolActivityScript = toolActivityScript; - } } Fisheye: Tag 5a1e4424a7fee54a37abf1504b699077bd9f41fa refers to a dead (removed) revision in file `lams_tool_deploy/test/file/application.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_deploy/test/file/deploy.properties =================================================================== diff -u --- lams_tool_deploy/test/file/deploy.properties (revision 0) +++ lams_tool_deploy/test/file/deploy.properties (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -0,0 +1,39 @@ +# Properties for the Deploy APp + + + +#Password for Install DB +dbPassword=lamsdemo + +#user for install db +dbUsername=lams + +#Driver Connection URL +dbDriverUrl=jdbc:mysql://localhost:3306/lams + +#Classname of JDBC driver +dbDriverClass=com.mysql.jdbc.Driver + +#List of files to move to the deploy directory +deployFiles=lams_tool_imscp.war,lams_tool_imscp.jar + +#nameof SQL script file to create and populate the tool tables +toolTablesScriptName=create_imscp_db.sql + +#Name of SQL script file to create the tool library activity +toolActivityInsertScriptName=insert_imscp_activity.sql + +#Name of SQL script to insert the library record +toolLibraryInsertScriptName=insert_imscp_library.sql + +#name of SQL script that inserts the lams_tool record +toolInsertScriptName=insert_imscp_tool.sql + +#path to lams ear dir +lamsEarPath=/var/jboss/server/default/deploy/lams.ear + +#Context path to deploy the tool under +toolContext=/lams/tool/imscp + +#URI of tool web app location +toolWebUri=lams_tool_imscp.war Index: lams_tool_deploy/test/file/lams.ear/application.xml =================================================================== diff -u --- lams_tool_deploy/test/file/lams.ear/application.xml (revision 0) +++ lams_tool_deploy/test/file/lams.ear/application.xml (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -0,0 +1,43 @@ + + + + LAMS + + Learning Activty Management System + + + + lasm_central.war + /lams + lams_admin.war + /lams/admin + lams_authoring.war + /lams/authoring + lams_learning.war + /lams/learning + lams_monitoring.war + /lams/monitoring + + + \ No newline at end of file Index: lams_tool_deploy/test/file/test-dummy.jar =================================================================== diff -u Binary files differ Index: lams_tool_deploy/test/file/test-dummy.war =================================================================== diff -u Binary files differ Index: lams_tool_deploy/test/java/org/lamsfoundation/lams/tool/deploy/DeployConfigTest.java =================================================================== diff -u --- lams_tool_deploy/test/java/org/lamsfoundation/lams/tool/deploy/DeployConfigTest.java (revision 0) +++ lams_tool_deploy/test/java/org/lamsfoundation/lams/tool/deploy/DeployConfigTest.java (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -0,0 +1,124 @@ +/* + * DeployConfigTest.java + * JUnit based test + * + * Created on 05 April 2005, 11:33 + */ + +package org.lamsfoundation.lams.tool.deploy; + +import junit.framework.*; +import java.util.List; +import java.util.ArrayList; +import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.configuration.ConfigurationException; + +/** + * + * @author chris + */ +public class DeployConfigTest extends TestCase +{ + private DeployConfig config = null; + + public DeployConfigTest(String testName) + { + super(testName); + } + + protected void setUp() throws java.lang.Exception + { + config = new DeployConfig("test/file/deploy.properties"); + } + + protected void tearDown() throws java.lang.Exception + { + } + + public static junit.framework.Test suite() + { + junit.framework.TestSuite suite = new junit.framework.TestSuite(DeployConfigTest.class); + + return suite; + } + + // TODO add test methods here. The name must begin with 'test'. For example: + // public void testHello() {} + + public void testGetDbUsername() + { + assertEquals(config.getDbUsername(), "lams"); + } + + public void testGetDbPassword() + { + assertEquals(config.getDbPassword(), "lamsdemo"); + } + + public void testGetDbDriverUrl() + { + assertEquals(config.getDbDriverUrl(), "jdbc:mysql://localhost:3306/lams"); + } + + public void testGetDbDriverClass() + { + assertEquals(config.getDbDriverClass(), "com.mysql.jdbc.Driver"); + } + + // #List of files to move to the deploy directory + //deployFiles=lams_tool_imscp.war,lams_tool_imscp.jar + + public void testDeployFiles() + { + List deployFiles = config.getDeployFiles(); + assertNotNull(deployFiles); + assertEquals(deployFiles.size(),2); + assertEquals(deployFiles.get(0), "lams_tool_imscp.war"); + assertEquals(deployFiles.get(1), "lams_tool_imscp.jar"); + + } + //#nameof SQL script file to create and populate the tool tables + //toolTablesScriptName=create_imscp_db.sql + + public void testGetToolTablesScriptName() + { + assertEquals(config.getToolTablesScriptName(), "create_imscp_db.sql"); + } + //#Name of SQL script file to create the tool library activity + //toolActivityInsertScriptName=insert_imscp_activity.sql + public void testGetToolActivityInsertScriptName() + { + assertEquals(config.getToolActivityInsertScriptName(), "insert_imscp_activity.sql"); + } + + //#Name of SQL script to insert the library record + //toolLibraryInsertScriptName=insert_imscp_library.sql + public void testGetToolLibraryInsertScriptName() + { + assertEquals(config.getToolLibraryInsertScriptName(), "insert_imscp_library.sql"); + } + //#name of SQL script that inserts the lams_tool record + //toolInsertScriptName=insert_imscp_tool.sql + public void testGetToolInsertScriptName() + { + assertEquals(config.getToolInsertScriptName(), "insert_imscp_tool.sql"); + } + //#path to lams ear dir + //lamsEarPath=/var/jboss/server/default/deploy/lams.ear + public void testGetLamsEarPath() + { + assertEquals(config.getLamsEarPath(), "/var/jboss/server/default/deploy/lams.ear"); + } + //#Context path to deploy the tool under + //toolContext=/lams/tool/imscp + public void testGetToolContextRoot() + { + assertEquals(config.getToolContextRoot(), "/lams/tool/imscp"); + } + //#URI of tool web app location + //toolWebUri=lams_tool_imscp.war + public void testGetToolWebUri() + { + assertEquals(config.getToolWebUri(), "lams_tool_imscp.war"); + } +} Index: lams_tool_deploy/test/java/org/lamsfoundation/lams/tool/deploy/DeployFilesTaskTest.java =================================================================== diff -u --- lams_tool_deploy/test/java/org/lamsfoundation/lams/tool/deploy/DeployFilesTaskTest.java (revision 0) +++ lams_tool_deploy/test/java/org/lamsfoundation/lams/tool/deploy/DeployFilesTaskTest.java (revision 5a1e4424a7fee54a37abf1504b699077bd9f41fa) @@ -0,0 +1,72 @@ +/* + * DeployFilesTaskTest.java + * JUnit based test + * + * Created on 05 April 2005, 15:21 + */ + +package org.lamsfoundation.lams.tool.deploy; + +import junit.framework.*; +import java.util.List; +import java.util.ArrayList; +import java.io.File; +import java.io.IOException; +import org.apache.commons.io.FileUtils; + +/** + * + * @author chris + */ +public class DeployFilesTaskTest extends TestCase +{ + public static final String TEST_WAR_PATH = "test/file/test-dummy.war"; + public static final String TEST_JAR_PATH = "test/file/test-dummy.jar"; + public static final String TEST_TARGET_PATH = "test/file/lams.ear"; + public static final String COPIED_TEST_WAR_PATH = TEST_TARGET_PATH+"/test-dummy.war"; + public static final String COPIED_TEST_JAR_PATH = TEST_TARGET_PATH+"/test-dummy.jar"; + + public static final List testDeployFiles = new ArrayList(); + static + { + testDeployFiles.add(TEST_WAR_PATH); + testDeployFiles.add(TEST_JAR_PATH); + } + + private DeployFilesTask deployer = null; + + public DeployFilesTaskTest(String testName) + { + super(testName); + } + + protected void setUp() throws java.lang.Exception + { + deployer = new DeployFilesTask(); + } + + protected void tearDown() throws java.lang.Exception + { + FileUtils.forceDelete(new File(COPIED_TEST_WAR_PATH)); + FileUtils.forceDelete(new File(COPIED_TEST_JAR_PATH)); + } + + public static junit.framework.Test suite() + { + junit.framework.TestSuite suite = new junit.framework.TestSuite(DeployFilesTaskTest.class); + + return suite; + } + + public void testExecute() throws Exception + { + deployer.setLamsEarPath(TEST_TARGET_PATH); + deployer.setDeployFiles(testDeployFiles); + deployer.execute(); + assertTrue((new File(COPIED_TEST_WAR_PATH)).exists()); + assertTrue((new File(COPIED_TEST_JAR_PATH)).exists()); + } + + + +} Fisheye: Tag 5a1e4424a7fee54a37abf1504b699077bd9f41fa refers to a dead (removed) revision in file `lams_tool_deploy/test/results/FileTokenReplacer.txt'. Fisheye: No comparison available. Pass `N' to diff?