From: Pieter v. Z. <pv...@us...> - 2005-08-05 13:42:32
|
Update of /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/testing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25497/src-test/za/org/coefficient/testing Modified Files: TestDBSetup.java CoefficientTestCase.java Log Message: added the license and removed CURRENT_PROJECT Index: CoefficientTestCase.java =================================================================== RCS file: /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/testing/CoefficientTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CoefficientTestCase.java 5 Aug 2005 12:48:35 -0000 1.2 --- CoefficientTestCase.java 5 Aug 2005 13:41:53 -0000 1.3 *************** *** 1,4 **** --- 1,21 ---- /** * + * + * Coefficient - facilitates project based collaboration + * Copyright (C) 2005, Meraka Insitute + * PO Box 395 + * Pretoria 0001, RSA + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package za.org.coefficient.testing; *************** *** 10,15 **** /** ! * @author pvzyl Jul 19, 2005 ! * */ public class CoefficientTestCase extends TestCase { --- 27,32 ---- /** ! * @author pvzyl Jul 19, 2005 This forms the base class for testing in ! * Coefficient */ public class CoefficientTestCase extends TestCase { *************** *** 17,22 **** public static String CURRENT_CONTEXT = "CURRENT_CONTEXT"; - public static String CURRENT_PROJECT = "CURRENT_PROJECT"; - /** * Jul 19, 2005 --- 34,37 ---- *************** *** 41,45 **** * @throws Exception */ ! public static Object invokeOpOnModule(CoefficientContext ctx) throws Exception { Invoker testModuleInvoker = new TestModuleInvoker();// this should also // be a singleton? --- 56,61 ---- * @throws Exception */ ! public static Object invokeOpOnModule(CoefficientContext ctx) ! throws Exception { Invoker testModuleInvoker = new TestModuleInvoker();// this should also // be a singleton? Index: TestDBSetup.java =================================================================== RCS file: /cvsroot/coefficient/coefficient/src-test/za/org/coefficient/testing/TestDBSetup.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestDBSetup.java 5 Aug 2005 12:47:38 -0000 1.2 --- TestDBSetup.java 5 Aug 2005 13:41:53 -0000 1.3 *************** *** 1,4 **** --- 1,21 ---- /** * + * + * Coefficient - facilitates project based collaboration + * Copyright (C) 2005, Meraka Insitute + * PO Box 395 + * Pretoria 0001, RSA + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package za.org.coefficient.testing; *************** *** 21,31 **** /** ! * @author pieter20 Jul 20, 2005 This class is based on the following article on ! * ServerSide:Unit-Testing Hibernate with HSQL DB by Alex Vollmer ! * It initializes and creates the defualt db and one: project and user. ! * It then adds the user as a member to the project and logins in the user */ public class TestDBSetup { private static TestDBSetup instance; private HashMap currentSetupMap = null; --- 38,53 ---- /** ! * @author pieter20 Jul 20, 2005 This class is based/inspired on the following ! * article on ServerSide:Unit-Testing Hibernate with HSQL DB by Alex ! * Vollmer It initializes and creates the defualt db and one: project ! * and user. It then adds the user as a member to the project and logins ! * in the user NB: Please note that I am adding values to ONE context ! * over calls to different modules. One can try and clean-up the ! * context? ! * The test db is created in memory. */ public class TestDBSetup { private static TestDBSetup instance; + private HashMap currentSetupMap = null; *************** *** 49,53 **** */ public TestDBSetup() { - // pvz: make this TestDBSetup a singleton DataLoaderUtil dataLoader = new DataLoaderUtil(); dataLoader.initializeDataIfNeeded(); --- 71,74 ---- *************** *** 55,63 **** } - /** ! * @author pieter20 ! * Aug 5, 2005 ! * This method enforces/implements the Singleton Pattern for this class * @return the current instance or a new TestDBSetup instance */ --- 76,82 ---- } /** ! * @author pieter20 Aug 5, 2005 This method enforces/implements the ! * Singleton Pattern for this class * @return the current instance or a new TestDBSetup instance */ *************** *** 75,81 **** /** ! * @author pieter20 ! * Aug 5, 2005 ! * used to set the static instance object * @param instance_ */ --- 94,98 ---- /** ! * @author pieter20 Aug 5, 2005 used to set the static instance object * @param instance_ */ *************** *** 103,108 **** /** ! * @author pieter20 Jul 31, 2005 Creates a default test project. ! * The properties of the project is hardcoded. * @return the newly created project */ --- 120,125 ---- /** ! * @author pieter20 Jul 31, 2005 Creates a default test project. The ! * properties of the project is hardcoded. * @return the newly created project */ *************** *** 281,288 **** /** ! * @author pieter20 ! * Aug 5, 2005 ! * The user needs to be logged in to be able to make calls in the ! * system * @param ctx */ --- 298,303 ---- /** ! * @author pieter20 Aug 5, 2005 The user needs to be logged in to be able to ! * make calls in the system * @param ctx */ *************** *** 318,324 **** /** ! * @author pieter20 ! * Aug 5, 2005 ! * Utility method to list all the projects created. */ private void listAllProjects() { --- 333,338 ---- /** ! * @author pieter20 Aug 5, 2005 Utility method to list all the projects ! * created. */ private void listAllProjects() { *************** *** 342,352 **** /** ! * @author pieter20 ! * Aug 5, 2005 ! * This method initializes and creates the defualt testing project and user. ! * It then adds the user as a member to the project and logins in the user. ! * The stage is then set for testing ! * @return a HashMap containing the CURRENT_PROJECT =projct ! * and the CURRENT_CONTEXT = ctx */ private HashMap setupBasics() { --- 356,364 ---- /** ! * @author pieter20 Aug 5, 2005 This method initializes and creates the ! * defualt testing project and user. It then adds the user as a ! * member to the project and logins in the user. The stage is then ! * set for testing ! * @return a HashMap containing the CURRENT_CONTEXT = ctx */ private HashMap setupBasics() { *************** *** 355,359 **** // creates a default project without going through the project module. Project testProject = createProject(); ! currentSetupMap.put(CoefficientTestCase.CURRENT_PROJECT, testProject); CoefficientTestingContext ctx = new CoefficientTestingContext( new HashMap(), new HashMap(), new HashMap()); --- 367,371 ---- // creates a default project without going through the project module. Project testProject = createProject(); ! CoefficientTestingContext ctx = new CoefficientTestingContext( new HashMap(), new HashMap(), new HashMap()); *************** *** 372,382 **** } - /** ! * @author pieter20 ! * Aug 5, 2005 ! * This methods is the main method of obtaining the current state that has been created for testing. ! * @return a HashMap containing the CURRENT_PROJECT =projct ! * and the CURRENT_CONTEXT = ctx */ public HashMap getCurrentSetupMap() { --- 384,391 ---- } /** ! * @author pieter20 Aug 5, 2005 This methods is the main method of obtaining ! * the current state that has been created for testing. ! * @return a HashMap containing the CURRENT_CONTEXT = ctx */ public HashMap getCurrentSetupMap() { |