You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(66) |
Aug
(61) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Pieter v. Z. <pv...@us...> - 2005-08-03 08:47:26
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/util/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5697/src-test/za/org/coefficient/util/common Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/util/common added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-03 08:47:25
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5697/src-test/za/org/coefficient/util Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/util added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-03 08:46:45
|
Update of /cvsroot/coefficient/coefficient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5428 Modified Files: build.xml Log Message: changed the test.jar target in the build.xml file.Added the creation of the server.xml.snippit Index: build.xml =================================================================== RCS file: /cvsroot/coefficient/coefficient/build.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** build.xml 2 Aug 2005 07:46:04 -0000 1.37 --- build.xml 3 Aug 2005 08:46:36 -0000 1.38 *************** *** 504,508 **** <!-- M A K E TEST J A R F I L E --> <!-- =================================================================== --> ! <target name="test-jar" depends="compile-tests" description="Make test jar file" > <delete> <fileset dir="${distribution.dir}"> --- 504,508 ---- <!-- M A K E TEST J A R F I L E --> <!-- =================================================================== --> ! <target name="test-jar" depends="compile-tests, mergeSrc,tomcatServerXmlDoclet" description="Make test jar file" > <delete> <fileset dir="${distribution.dir}"> *************** *** 517,520 **** --- 517,523 ---- <include name="invoker.properties" /> </fileset> + <fileset dir="${gen.misc}"> + <include name="server.xml.snippit" /> + </fileset> <fileset dir="${test.classes.dir}" /> </jar> |
From: Pieter v. Z. <pv...@us...> - 2005-08-03 08:44:35
|
Update of /cvsroot/coefficient/coefficient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5079 Modified Files: changelog.txt Log Message: added XMLJndiUtil and changed the test.jar target in the build.xml file Index: changelog.txt =================================================================== RCS file: /cvsroot/coefficient/coefficient/changelog.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** changelog.txt 2 Aug 2005 11:03:30 -0000 1.32 --- changelog.txt 3 Aug 2005 08:44:10 -0000 1.33 *************** *** 2,5 **** --- 2,11 ---- ===================== + 03/08/2005 + pvz: added XMLJndiUtil to create a (at this stage) mock JNDI table from the server.xml.snippit. + Changed TestModuleInvoker to use XMLJndiUtil. + pvz: added the following dependencies to test-jar target: mergeSrc,tomcatServerXmlDoclet. These 2 are needed to build the + server.xml.snippit, which contains the resources for uploading into JNDI. Added server.xml/snippit to te test jar. + 02/08/2005 *************** *** 11,15 **** (the environment your running in). Changed InvokerFactory to read in the property set in the invoker.properties when the class is loaded. pvz: added jars to lib: hsqldb, j2ee and junit. Hypersonic SQL db version 1.8.0 is used to create a in memory db for testing ! ------------------- --- 17,21 ---- (the environment your running in). Changed InvokerFactory to read in the property set in the invoker.properties when the class is loaded. pvz: added jars to lib: hsqldb, j2ee and junit. Hypersonic SQL db version 1.8.0 is used to create a in memory db for testing ! pvz: added junit 3.8.1 to lib/junit ------------------- |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 12:30:44
|
Update of /cvsroot/coefficient/coefficient/lib/junit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13631/lib/junit Added Files: junit.jar Log Message: to replace junit-3.7 that was also booked into the repository --- NEW FILE: junit.jar --- (This appears to be a binary file; contents omitted.) |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 11:03:41
|
Update of /cvsroot/coefficient/coefficient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5082 Modified Files: changelog.txt Log Message: added the test framework and the building and compiling of the test jars Index: changelog.txt =================================================================== RCS file: /cvsroot/coefficient/coefficient/changelog.txt,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** changelog.txt 2 Aug 2005 08:28:09 -0000 1.31 --- changelog.txt 2 Aug 2005 11:03:30 -0000 1.32 *************** *** 10,13 **** --- 10,14 ---- pvz: Added invoker.properties (Options: RUN_AS_WEBAPP / RUN_AS_TEST / RUN_AS_EJB) to specify the type of invoker (the environment your running in). Changed InvokerFactory to read in the property set in the invoker.properties when the class is loaded. + pvz: added jars to lib: hsqldb, j2ee and junit. Hypersonic SQL db version 1.8.0 is used to create a in memory db for testing |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 10:47:38
|
Update of /cvsroot/coefficient/coefficient/lib/junit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14235/lib/junit Added Files: junit-3.7.jar Log Message: added jars to lib: hsqldb and junit. Hypersonic SQL db is used to create a in memory db for testing. Junit is used to write the test cases --- NEW FILE: junit-3.7.jar --- (This appears to be a binary file; contents omitted.) |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 10:47:38
|
Update of /cvsroot/coefficient/coefficient/lib/hsqldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14235/lib/hsqldb Added Files: hsqldb.jar Log Message: added jars to lib: hsqldb and junit. Hypersonic SQL db is used to create a in memory db for testing. Junit is used to write the test cases --- NEW FILE: hsqldb.jar --- (This appears to be a binary file; contents omitted.) |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:37:02
|
Update of /cvsroot/coefficient/coefficient/lib/junit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12105/lib/junit Log Message: Directory /cvsroot/coefficient/coefficient/lib/junit added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:37:02
|
Update of /cvsroot/coefficient/coefficient/lib/j2ee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12105/lib/j2ee Log Message: Directory /cvsroot/coefficient/coefficient/lib/j2ee added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:36:54
|
Update of /cvsroot/coefficient/coefficient/lib/hsqldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12105/lib/hsqldb Log Message: Directory /cvsroot/coefficient/coefficient/lib/hsqldb added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:28:18
|
Update of /cvsroot/coefficient/coefficient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10520 Modified Files: changelog.txt Log Message: added the test framework and the building and compiling of the test jars Index: changelog.txt =================================================================== RCS file: /cvsroot/coefficient/coefficient/changelog.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** changelog.txt 7 Jul 2005 14:10:44 -0000 1.30 --- changelog.txt 2 Aug 2005 08:28:09 -0000 1.31 *************** *** 2,8 **** ===================== version 0.9.6: ! ----------------- 07/07/2005 pvz: added Install.txt and Readme.txt to all modules. --- 2,18 ---- ===================== + 02/08/2005 + + This is the start of adding in the testing framework + pvz: Added src.test.dir, test.classes.dir, test.jar.file and the build targets: compile-tests and test-jar to compile + and jar all the testing code in ${project.name}-test.jar. This was added to modules-common.ent( for each of the modules) and build.xml + pvz: Added src-test, TestModuleInvoker, CoefficientTestCase,CoefficientTestingContext, TestDBSetup + pvz: Added invoker.properties (Options: RUN_AS_WEBAPP / RUN_AS_TEST / RUN_AS_EJB) to specify the type of invoker + (the environment your running in). Changed InvokerFactory to read in the property set in the invoker.properties when the class is loaded. + + ------------------- version 0.9.6: ! ------------------- 07/07/2005 pvz: added Install.txt and Readme.txt to all modules. |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:24:57
|
Update of /cvsroot/coefficient/coefficient/src/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10047/src/misc Added Files: invoker.properties Log Message: Added invoker.properties (Options: RUN_AS_WEBAPP / RUN_AS_TEST / RUN_AS_EJB) to specify the type of invoker (the environment your running in). Changed InvokerFactory to read in the property set in the invoker.properties when the class is loaded. --- NEW FILE: invoker.properties --- #Options: RUN_AS_WEBAPP / RUN_AS_TEST / RUN_AS_EJB # Use RUN_AS_WEBAPP when running in Tomcat webserver # Use RUN_AS_EJB when runnin in Jboss app server # Use RUN_AS_TEST when running JUnit test cases invoker_to_use = RUN_AS_EJB |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:06:37
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/invokers/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6246/src-test/za/org/coefficient/invokers/test Added Files: TestModuleInvoker.java Log Message: added the classes that will form the basis for the testing framework. The TestModuleInvoker will call methods on modules outside a container passing through a CoefficientTestingContext ( maps with parameters) --- NEW FILE: TestModuleInvoker.java --- /** * */ package za.org.coefficient.invokers.test; import org.apache.commons.beanutils.MethodUtils; import org.apache.commons.beanutils.PropertyUtils; import za.co.csir.icomtek.workflow.interfaces.WorkflowContext; import za.org.coefficient.authentication.Role; import za.org.coefficient.exception.ConfigurationException; import za.org.coefficient.interfaces.CoefficientContext; import za.org.coefficient.interfaces.ModuleLocal; import za.org.coefficient.interfaces.ThemeLocalIf; import za.org.coefficient.invokers.base.BaseInvoker; import za.org.coefficient.util.ejb.SecurityUtil; /** * @author pieter20 Jul 19, 2005 This class returns the object on which a method * is being called, and then exucutes this method on the object. * Reflection is being used to do this. This class is based on the * EJBInvoker and WebAppInvoker. Also look at the InvokerFactory. */ public class TestModuleInvoker extends BaseInvoker { private static final String CREATE = "create"; /** * Jul 19, 2005 * * @author pieter20 */ public TestModuleInvoker() { } /* * (non-Javadoc) * * @see za.org.coefficient.invokers.base.BaseInvoker#getService(java.lang.String) * This method acts as a lookup for the module/class in JNDI. JNDI is * not used but simulated using a if statement to return an instance of * the requested object. This is done for testing so that we don't need * a container. */ public Object getService(String serviceName) throws Exception { // new Object[]{"za.org.coefficient.modules.mailforum.MailForum"} Object module = null; System.out.println("TestModuleInvoker.getService()-> serviceName: " + serviceName); if (serviceName == "UserAdmin") { module = (Object) Class.forName( "za.org.coefficient.modules.user.UserAdmin").newInstance(); } else if (serviceName == "MailForum") { module = (Object) Class.forName( "za.org.coefficient.modules.mailforum.MailForum") .newInstance(); } else if (serviceName == "Configuration") { module = (Object) Class.forName( "za.org.coefficient.modules.configuration.Configuration") .newInstance(); } else if (serviceName == "Role") { // TODO:Pvzyl: we // need to improve // this. Why should // this be called in // an EJB? Move this // method to the // Role class module = (Object) Class.forName( "za.org.coefficient.util.common.Roles").newInstance(); } else if (serviceName == "AttributeDataManagement") { module = (Object) Class .forName( "za.org.coefficient.modules.attribute.AttributeDataManagement") .newInstance(); } else if (serviceName == "MemberAdmin") { module = (Object) Class.forName( "za.org.coefficient.modules.user.MemberAdmin") .newInstance(); } else if (serviceName == "DefaultTheme") { module = (Object) Class.forName( "za.org.coefficient.themes.defaultTheme.DefaultTheme") .newInstance(); } else { return null; } return module; } /* * (non-Javadoc) * * @see za.org.coefficient.invokers.base.BaseInvoker#getTheme(java.lang.String) */ protected ThemeLocalIf getTheme(String theme) throws Exception { ThemeLocalIf themeIf = null; Object themeVal = getService(theme); if (!(themeVal instanceof ThemeLocalIf)) { throw new ConfigurationException("Requested theme, " + theme + " is not a valid theme!"); } else { themeIf = (ThemeLocalIf) themeVal; } return themeIf; } /* * (non-Javadoc) * * @see za.org.coefficient.invokers.base.BaseInvoker#getModule(java.lang.String) */ protected ModuleLocal getModule(String module) throws Exception { ModuleLocal mod = null; Object modVal = getService(module); if (!(modVal instanceof ModuleLocal)) { throw new ConfigurationException("Requested module, " + module + " is not a system module!"); } else { mod = (ModuleLocal) modVal; } return mod; } /* * (non-Javadoc) * * @see za.org.coefficient.interfaces.Invoker#invokeOpOnModule(java.lang.String, * java.lang.String, za.org.coefficient.interfaces.CoefficientContext) * TODO:pvz: I have removed the security checks and the checks related * to the project. I have to add these back */ public Object invokeOpOnModule(String module, String operation, CoefficientContext ctx) throws Exception { Object retVal = null; //is this the best place to put this security? return invokeOpOnModuleWithoutSecurity(module, operation, ctx); } /* * (non-Javadoc) * * @see za.org.coefficient.interfaces.Invoker#invoke(za.org.coefficient.interfaces.CoefficientContext) */ public Object invoke(CoefficientContext ctx) throws Exception { // TODO Auto-generated method stub return super.invoke(ctx); } /* * (non-Javadoc) * * @see za.org.coefficient.interfaces.Invoker#invokeGetterOnModule(java.lang.String, * java.lang.String) */ public Object invokeGetterOnModule(String module, String method) throws Exception { // TODO Auto-generated method stub return super.invokeGetterOnModule(module, method); } /* * (non-Javadoc) * * @see za.org.coefficient.interfaces.Invoker#invokeMethodOnModule(java.lang.String, * java.lang.String, java.lang.Object[]) */ public Object invokeMethodOnModule(String module, String method, Object[] paramVals) throws Exception { // TODO Auto-generated method stub return super.invokeMethodOnModule(module, method, paramVals); } /* * (non-Javadoc) * * @see za.org.coefficient.interfaces.Invoker#invokeMethodOnService(java.lang.String, * java.lang.String, java.lang.Object[]) */ public Object invokeMethodOnService(String serviceName, String method, Object[] paramVals) throws Exception { // TODO Auto-generated method stub return super.invokeMethodOnService(serviceName, method, paramVals); } /* * (non-Javadoc) * * @see za.org.coefficient.interfaces.Invoker#invokeMethodOnTheme(java.lang.String, * java.lang.String, java.lang.Object[]) */ public Object invokeMethodOnTheme(String theme, String method, Object[] paramVals) throws Exception { // TODO Auto-generated method stub return super.invokeMethodOnTheme(theme, method, paramVals); } /* * (non-Javadoc) * * @see za.co.csir.icomtek.workflow.interfaces.WorkflowModuleInvoker#invokeOpOnModule(java.lang.String, * java.lang.String, * za.co.csir.icomtek.workflow.interfaces.WorkflowContext) */ public Object invokeOpOnModule(String module, String operation, WorkflowContext ctx) throws Exception { // TODO Auto-generated method stub return super.invokeOpOnModule(module, operation, ctx); } public Object invokeOpOnModuleWithSecurity(String module, String operation, CoefficientContext ctx) throws Exception { return super.invokeOpOnModule(module, operation, ctx); } public Object invokeOpOnModuleWithoutSecurity(String module, String operation, CoefficientContext ctx) throws Exception { Object retVal = null; // Fire the module ModuleLocal mod = getModule(module); try { if (mod != null) { // invoke the operation on the module retVal = MethodUtils.invokeMethod(mod, operation, ctx); } else { ctx.setError("<b>No such module exists!</b>"); } } catch (NoSuchMethodException nsme) { nsme.printStackTrace(); ctx.setError("<b>No such operation exists on module " + module + "!</b>"); } catch (IllegalAccessException iae) { iae.printStackTrace(); ctx.setError("<b>No such operation exists on module " + module + "!</b>"); } return retVal; } } |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:06:36
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/testing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6246/src-test/za/org/coefficient/testing Added Files: TestDBSetup.java CoefficientTestCase.java ContextInitializer.java CoefficientTestingContext.java Log Message: added the classes that will form the basis for the testing framework. The TestModuleInvoker will call methods on modules outside a container passing through a CoefficientTestingContext ( maps with parameters) --- NEW FILE: ContextInitializer.java --- /** * */ package za.org.coefficient.testing; import java.util.HashMap; import java.util.Map; /** * @author pieter20 * Jul 19, 2005 * */ public class ContextInitializer { private CoefficientTestingContext context = null; private Map session = new HashMap(); private Map requestData = new HashMap(); private Map requestAttributes = new HashMap(); public ContextInitializer() { context = new CoefficientTestingContext(session,requestData,requestAttributes); } public CoefficientTestingContext getContext() { return context; } public void setContext(CoefficientTestingContext context) { this.context = context; } public Map getRequestAttributes() { return requestAttributes; } public void setRequestAttributes(Map requestAttributes) { this.requestAttributes = requestAttributes; } public Map getRequestData() { return requestData; } public void setRequestData(Map requestData) { this.requestData = requestData; } public Map getSession() { return session; } public void setSession(Map session) { this.session = session; } } --- NEW FILE: CoefficientTestCase.java --- /** * */ package za.org.coefficient.testing; import za.org.coefficient.interfaces.CoefficientContext; import za.org.coefficient.interfaces.Invoker; import junit.framework.TestCase; import za.org.coefficient.invokers.test.TestModuleInvoker; /** * @author pvzyl Jul 19, 2005 * */ public class CoefficientTestCase extends TestCase { // add CoefficientTestingContext here /** * Jul 19, 2005 * * @author pvzyl */ public CoefficientTestCase(String arg0) { super(arg0); } public void setContext() { // } /** * @author pieter20 * Jul 31, 2005 * @param ctx, containing: the parameters, the module and the method to invoke * @return an object of type CoefficientContext, which contains a map of the result. * @throws Exception */ public Object invokeOpOnModule(CoefficientContext ctx) throws Exception { Invoker testModuleInvoker = new TestModuleInvoker();// this should also // be a singleton? Object context = testModuleInvoker.invoke(ctx);// calls the // BaseInvoker.invoke(ctx) if (context instanceof CoefficientContext) { return ctx; } else { System.out .println("CoefficientTestCase.invokeOpOnModule()-> Something went wrong. Must be instance of CoefficientContext"); } return null; } } --- NEW FILE: TestDBSetup.java --- /** * */ package za.org.coefficient.testing; import java.util.List; import net.sf.hibernate.Hibernate; import net.sf.hibernate.HibernateException; import net.sf.hibernate.util.HibernateUtil; import za.org.coefficient.authentication.CoefficientUser; import za.org.coefficient.core.Project; import za.org.coefficient.interfaces.CoefficientContext; import za.org.coefficient.util.ejb.DataLoaderUtil; /** * @author pieter20 Jul 20, 2005 This class is based on the following article on * ServerSide:Unit-Testing Hibernate with HSQL DB by Alex Vollmer */ public class TestDBSetup { static { try { Class[] classes = new Class[] { Project.class, CoefficientUser.class }; HibernateUtil.configureHibernateForClasses(classes); } catch (HibernateException ex) { ex.printStackTrace(); } } /** * Jul 31, 2005 * @author pieter20 * This constructor creates and initializes the test db with the basic data that is need for * testing. It uses the DataLoaderUtil to initialize the db. */ public TestDBSetup() { //pvz: make this TestDBSetup a singleton DataLoaderUtil dataLoader = new DataLoaderUtil(); dataLoader.initializeDataIfNeeded(); } /** * @author pieter20 * Jul 31, 2005 * Creates a default test project. * @return */ public Project setupDefaultProject() { Project project = new Project(); project.setShortName("test"); project.setName("Testing Project"); project.setDescription("This project is used to test"); project.setHomePage("none"); project.setIsPublic(true); return project; } /** * @author pieter20 * Jul 31, 2005 * Creates a custom project with parameters passed through the context. * @param ctx * @return */ public Project setupProject(CoefficientContext ctx) { Project prj = new Project(); String shortName = ctx.getParameter("shortName"); List projects = null; try { projects = HibernateUtil.find("select from " + Project.class.getName() + " as prj where" + " prj.shortName = ?", shortName, Hibernate.STRING); } catch (HibernateException e) { System.err.println(e); } if (projects.size() == 0) { prj.setShortName("shortName"); prj.setName(ctx.getParameter("name")); prj.setDescription(ctx.getParameter("description")); prj.setHomePage(ctx.getParameter("homePage")); prj.setIsPublic(!"on".equals(ctx.getParameter("isPrivate"))); } else { System.out.println("Project already Exists!"); } return prj; } } --- NEW FILE: CoefficientTestingContext.java --- /** * */ package za.org.coefficient.testing; import java.util.HashMap; import java.util.Map; import za.org.coefficient.core.BaseCoefficientContext; /** * @author pieter20 Jul 31, 2005 * */ public class CoefficientTestingContext extends BaseCoefficientContext { /** * Jul 31, 2005 * * @author pieter20 This class is based on CoefficientTestingContext in * package za.org.coefficient.util.testing; */ public CoefficientTestingContext() { super(); } /** * constructor that includes fileupload data * * @param session * Map containing session data * @param requestData * Map containing reqest paramter data * @param requestAttributes * Map containing request attribute data */ public CoefficientTestingContext(Map session, Map requestData, Map requestAttributes) { super(); this.session = session; this.requestData = requestData; this.requestAttributes = requestAttributes; } } |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:06:36
|
Update of /cvsroot/coefficient/coefficient/src-test/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6246/src-test/misc Added Files: invoker.properties hibernate_util.properties test.properties hibernate.properties coefficient.properties Log Message: added the classes that will form the basis for the testing framework. The TestModuleInvoker will call methods on modules outside a container passing through a CoefficientTestingContext ( maps with parameters) --- NEW FILE: coefficient.properties --- ## Uncomment out and set the value of any constants you want to change for ## the system ## Defines the name of the site as referenced in the title #CFG_SITENAME = Dgroups ## Defines the footer message displayed on the site #CFG_FOOT1= Footer Message ## The maximum size of a file that can be uploaded to the server in bytes #MAX_FILE_UPLOAD_SIZE_BYTES = 10485760 ## The date format used within the project #SYSTEM_DATE_FORMAT =dd/MM/yyyy ## The datasource name used by this installation #DATA_SOURCE_NAME=java:/CoefficientDS ## The connection factory used in the application server used to deploy #JMS_CONNECTION_FACTORY=java:/ConnectionFactory ## The name of the deployed queue used to keep track of statistics #JMS_STATISTICS_QUEUE=queue/statisticsQueue ## The string used to store the current user of the system in the session #USER_SESSION_STRING=__current_user_obj_ ## The JNDI Context prefix for the system ## NOTE do not change this unless you have changed the deployment info as well #JNDI_CONTEXT=za/org/coefficient/ ## The max number of elements to show on a page with a pager #MAX_ELEMENTS_PER_PAGE=3 ## The default theme to use on startup #DEFAULT_THEME_JNDI_NAME=DgroupsDefaultTheme ## This is the SMTP host that coefficient should use to send mail MAIL_SMTP_HOST=pvzmobile.dhcp.icomtek.csir.co.za ## This is the address that the mail will have as a return MAIL_SENDER_ADDRESS=pv...@cs... ## This is the path that file uploads are saved in... path MUST end with a trailing path seperator eg 'C:\\files\\' #FILEUPLOAD_SAVE_PATH=./ ## This is the module that should serve as the welcome page if you are not logged in #WELCOME_MODULE=Home #INVOKER_TYPE = "RUN_AS_TEST" --- NEW FILE: hibernate.properties --- hibernate.connection.username sa hibernate.connection.password hibernate.show_sql true hibernate.dialect net.sf.hibernate.dialect.HSQLDialect hibernate.connection.driver_class org.hsqldb.jdbcDriver hibernate.connection.url jdbc:hsqldb:mem:test hibernate.connection.pool_size 0 --- NEW FILE: invoker.properties --- #Options: RUN_AS_WEBAPP / RUN_AS_TEST / RUN_AS_EJB # Use RUN_AS_WEBAPP when running in Tomcat webserver # Use RUN_AS_EJB when runnin in Jboss app server # Use RUN_AS_TEST when running JUnit test cases invoker_to_use = RUN_AS_TEST --- NEW FILE: test.properties --- za.org.coefficient.modules.project.Projects --- NEW FILE: hibernate_util.properties --- ## This is a properties file for the HibernateUtil ## Defines the classes that I want to have configured in ## Hibernate at initialization class_1=za.org.coefficient.statistics.data.ModuleStatisticsData class_2=za.org.coefficient.statistics.data.ModuleStatistics class_3=za.org.coefficient.statistics.data.ProjectStatisticsData class_4=za.org.coefficient.statistics.data.ProjectStatistics class_5=za.org.coefficient.core.Project class_6=za.org.coefficient.core.Category class_7=za.org.coefficient.core.ProjectAttribute class_8=za.org.coefficient.core.ProjectAttributeData class_9=za.org.coefficient.core.ProjectComponent class_10=za.org.coefficient.core.ProjectVersion class_11=za.org.coefficient.core.AttributeElement class_12=za.org.coefficient.core.CoefficientConfiguration class_13=za.org.coefficient.authentication.CoefficientUser class_14=za.org.coefficient.authentication.Role class_15=za.org.coefficient.authentication.ProjectMember class_16=za.co.csir.icomtek.workflow.WorkflowData ## Defines the JTA Transaction Managers location by default ## it is java:/TransactionManager #jta_transaction_manager=java:/TransactionManager ## Defines whether the HibernateUtil should create tables ## for configured objects that do not yet have a table ## This requires a patched jar of Hibernate, and defaults ## to true. create_tables=true |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:39
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/invokers/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test/za/org/coefficient/invokers/test Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/invokers/test added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:37
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test/za/org/coefficient Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za/org/coefficient added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:37
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/testing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test/za/org/coefficient/testing Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/testing added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:36
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/invokers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test/za/org/coefficient/invokers Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/invokers added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:36
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test/za/org Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za/org added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:36
|
Update of /cvsroot/coefficient/coefficient/src-test/za In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test/za Log Message: Directory /cvsroot/coefficient/coefficient/src-test/za added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:35
|
Update of /cvsroot/coefficient/coefficient/src-test/misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test/misc Log Message: Directory /cvsroot/coefficient/coefficient/src-test/misc added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:03:35
|
Update of /cvsroot/coefficient/coefficient/src-test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108/src-test Log Message: Directory /cvsroot/coefficient/coefficient/src-test added to the repository |
From: Pieter v. Z. <pv...@us...> - 2005-08-02 08:01:06
|
Update of /cvsroot/coefficient/coefficient/src/za/org/coefficient/util/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5677/src/za/org/coefficient/util/common Modified Files: InvokerFactory.java Log Message: added: (Options: RUN_AS_WEBAPP / RUN_AS_TEST / RUN_AS_EJB) to specify the type of invoker (the environment your running in). Changed InvokerFactory to read in the property set in the invoker.properties when the class is loaded. Index: InvokerFactory.java =================================================================== RCS file: /cvsroot/coefficient/coefficient/src/za/org/coefficient/util/common/InvokerFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InvokerFactory.java 20 Oct 2004 08:17:29 -0000 1.2 --- InvokerFactory.java 2 Aug 2005 08:00:55 -0000 1.3 *************** *** 20,27 **** --- 20,31 ---- package za.org.coefficient.util.common; + import java.io.InputStream; + import java.util.Properties; + import org.apache.commons.beanutils.MethodUtils; import za.org.coefficient.exception.ConfigurationException; import za.org.coefficient.interfaces.Invoker; + import za.org.coefficient.core.BaseConfigurationBackedConstants; import za.org.coefficient.core.Constants; *************** *** 32,36 **** --- 36,43 ---- public class InvokerFactory { + //the default invoker to use: RUN_AS_EJB public static boolean RUN_AS_EJB = true; + public static boolean RUN_AS_TEST = false; + public static boolean RUN_AS_WEBAPP = false; private static String INVOKER_LOCAL_EJB_IMPLEMENTATION = *************** *** 42,45 **** --- 49,55 ---- private static String INVOKER_REMOTE_EJB_JNDI_NAME = "za/org/coefficient/util/EjbInvokerFacade"; + + private static String INVOKER_LOCAL_TEST_IMPLEMENTATION = + "za.org.coefficient.invokers.test.TestModuleInvoker"; private static final String CREATE = "create"; *************** *** 47,50 **** --- 57,61 ---- private static Object remote_mi = null; private static Object lock = new Object(); + private static String propertiesFileName = "invoker.properties"; static { *************** *** 52,55 **** --- 63,74 ---- } + /** + * @author pieter20 + * Aug 1, 2005 + * Select the invoker to use depending on the run type as set in the property file. + * TODO: Which should be the default?:web or ejb + * @return the correct invoker to use in the app. + * @throws Exception + */ public static Invoker getInvoker() throws Exception { Class cls = null; *************** *** 57,61 **** if(RUN_AS_EJB) { cls = Class.forName(INVOKER_LOCAL_EJB_IMPLEMENTATION); ! } else { cls = Class.forName(INVOKER_LOCAL_WEBAPP_IMPLEMENTATION); } --- 76,84 ---- if(RUN_AS_EJB) { cls = Class.forName(INVOKER_LOCAL_EJB_IMPLEMENTATION); ! } else if(RUN_AS_TEST){ ! cls = Class.forName(INVOKER_LOCAL_TEST_IMPLEMENTATION); ! } else if(RUN_AS_WEBAPP){ ! cls = Class.forName(INVOKER_LOCAL_WEBAPP_IMPLEMENTATION); ! }else {//default to web impl. This else is not needed any more as we default in initProperties cls = Class.forName(INVOKER_LOCAL_WEBAPP_IMPLEMENTATION); } *************** *** 120,130 **** } private static void init() { try { ! Class.forName(INVOKER_LOCAL_EJB_IMPLEMENTATION); ! } catch (ClassNotFoundException cnfe) { RUN_AS_EJB = false; } ! } } --- 143,221 ---- } + /** + * @author pieter20 + * Jul 26, 2005 + * Selects the default invoker to use in the app. Rewriten to select the invoker from property file + * insteadof the class not being/or being in the class path + */ private static void init() { + initProperties(); + } + /** + * @author pieter20 + * Jul 31, 2005 + * This method reads in the property, from the property file provided, + * to determine which invoker to use. Defaults to the WEBAPP + */ + private static void initProperties() { + Properties invokerProperties = new Properties(); + //read in the properties from property file: + InputStream propertyFile = null; + System.out.println("InvokerFactory.initProperties()->property file name: "+propertiesFileName); try { ! // See if it is in the classpath ! propertyFile = ! InvokerFactory .class.getResourceAsStream("/WEB-INF/" ! + propertiesFileName); ! // See if it is in the jar ! if (propertyFile== null) { ! System.out.println("InvokerFactory.initProperties()->checking property file name: /"); ! propertyFile = ! InvokerFactory.class ! .getResourceAsStream("/" + propertiesFileName); ! if (propertyFile== null) { ! System.out.println("InvokerFactory.initProperties()->checking property file name: without /"); ! propertyFile = ! InvokerFactory.class ! .getResourceAsStream(propertiesFileName); ! } ! } ! invokerProperties.load(propertyFile); ! } catch (Exception t) { ! System.out.println("InvokerFactory.initProperties()-> The properties could not be loaded from: "+propertiesFileName); ! System.out.println("InvokerFactory.initProperties()-> using default loader: RUN_AS_EJB"); ! t.printStackTrace(); ! ! } // end try-catch ! ! String invokerToUse = invokerProperties.getProperty("invoker_to_use"); ! if (invokerToUse == null) { ! RUN_AS_TEST = false; RUN_AS_EJB = false; + RUN_AS_WEBAPP = true; + System.out.println("InvokerFactory.initProperties()-> invokerToUse is null!!!"); + } else if (invokerToUse.compareTo("RUN_AS_EJB")==0) { + RUN_AS_TEST = false; + RUN_AS_EJB = true; + RUN_AS_WEBAPP = false; + System.out.println("InvokerFactory.initProperties()-> RUN_AS_EJB"); + }else if (invokerToUse.compareTo("RUN_AS_TEST")==0) { + RUN_AS_TEST = true; + RUN_AS_EJB = false; + RUN_AS_WEBAPP = false; + System.out.println("InvokerFactory.initProperties()-> RUN_AS_TEST"); + } else if (invokerToUse.compareTo("RUN_AS_WEBAPP")==0) { + RUN_AS_TEST = false; + RUN_AS_EJB = false; + RUN_AS_WEBAPP = true; + System.out.println("InvokerFactory.initProperties()-> RUN_AS_WEBAPP"); + }else { + RUN_AS_TEST = false; + RUN_AS_EJB = false; + RUN_AS_WEBAPP = true; + System.out.println("InvokerFactory.initProperties()-> This is not a valid value for: invoker_to_use. Using default loader: RUN_AS_WEBAPP"); } ! ! }//end initProperties() } |