From 26a17ef401f684ee0413bd4f73277e6fb9861fe1 Mon Sep 17 00:00:00 2001 From: rkv Date: Tue, 16 Oct 2012 06:59:40 +0000 Subject: [PATCH] *** empty log message *** --- Workspace/DaoGenerator/bin/config.properties | 4 - .../org/siman/generator/DaoGenerator.class | Bin 9252 -> 0 bytes .../DaoGenerator/bin/templates/DAO.java.vm | 21 - .../bin/templates/DAOImpl.java.vm | 32 -- .../templates/TestKnowledgeElementDAO.java.vm | 395 ------------------ .../bin/templates/daoContext.xml.vm | 14 - 6 files changed, 466 deletions(-) delete mode 100644 Workspace/DaoGenerator/bin/config.properties delete mode 100644 Workspace/DaoGenerator/bin/org/siman/generator/DaoGenerator.class delete mode 100644 Workspace/DaoGenerator/bin/templates/DAO.java.vm delete mode 100644 Workspace/DaoGenerator/bin/templates/DAOImpl.java.vm delete mode 100644 Workspace/DaoGenerator/bin/templates/TestKnowledgeElementDAO.java.vm delete mode 100644 Workspace/DaoGenerator/bin/templates/daoContext.xml.vm diff --git a/Workspace/DaoGenerator/bin/config.properties b/Workspace/DaoGenerator/bin/config.properties deleted file mode 100644 index 9793835..0000000 --- a/Workspace/DaoGenerator/bin/config.properties +++ /dev/null @@ -1,4 +0,0 @@ -datasource.context=../Siman-Common/src/spring/datasourceContext.xml -source.path=../Siman-Common/src/ -output.path=../Siman-Common/src/ -factory.id=simanSessionFactory diff --git a/Workspace/DaoGenerator/bin/org/siman/generator/DaoGenerator.class b/Workspace/DaoGenerator/bin/org/siman/generator/DaoGenerator.class deleted file mode 100644 index a056268780680dbd9224fa7d8abc45ff222df8c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9252 zcmbta33y!9b^ecLr1vy>mhBk{JjMor!I33P12#1rGgKD!+Toc1PIPb7P<1w~&3Aad&LoZT9*? zn_AoYdbaoP?QAy@7KDcEL5e=voJ??NdutCTwry#>uERtvd)ctf9z0+VJA&$t?!L~x z{^*>q;AH#kffN@D zcV!0c)DAnFRCT{G=#C^Q!9`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=Hs@aZ2C7a|>Hn8q!}B;ttfC*dH7dxBm7phocBea*q+f`Xhx(gZuqPfk)W@nh*VHj z(eeTf-X1mby1RSsIv>UBg|Tr{DLl%B`7bmjmZ$oNEb+u5F@=LsZy&#+UsN07x%O1QW!+cLaNRCzU{;&t3JZR;Rh9E&Jhh!b0NYJuPK{dd? zr>Er#@?8+ic?G+YY*@}epzqggSb+<99lVO;44&s(WV{Np@KfBig{4Za|0s1*feB&;~h&IfmIxl9=0eZI>HdFjfx|_QCA=# zH?S?pUD{+jgKs&N#2dD+q`PSNa?Tu)?#2_+*L@5d;z}FTf!xFt>=-UB)OYK8U7@~D z*B2G)gRGyDq5jp!Wh5SKYEWw=)vwGkgyKO}%09>4XgkW#ufIzPSygWkTYuw{V8XMT ziOCwDr#CV@gAStDF~pEy;d@w0XIaKK)&_>=)l5<1_%YVwC!G0HrbItu>hp81@C&9h zzhwIIrqq%5fE4tBu*!W(jF!UG8n4=MCnYiX(W9B(bp1 diff --git a/Workspace/DaoGenerator/bin/templates/DAO.java.vm b/Workspace/DaoGenerator/bin/templates/DAO.java.vm deleted file mode 100644 index 59e05a8..0000000 --- a/Workspace/DaoGenerator/bin/templates/DAO.java.vm +++ /dev/null @@ -1,21 +0,0 @@ -/***************************************************************************** - * Company EURIWARE - * Application SIMAN - * File $Id$ - * Creation date 06.10.2012 - * @author $Author$ - * @version $Revision$ - *****************************************************************************/ - -package ${DAOPackage}; - -import ${EntityPackage}.${EntityClass}; -import org.splat.dal.dao.kernel.GenericDAO; - -/** - * ${EntityClass} DAO class implementation. - * @author Roman Kozlov (RKV) - * - */ -public interface ${EntityClass}DAO extends GenericDAO<${EntityClass}, Long> { -} diff --git a/Workspace/DaoGenerator/bin/templates/DAOImpl.java.vm b/Workspace/DaoGenerator/bin/templates/DAOImpl.java.vm deleted file mode 100644 index 42d44a8..0000000 --- a/Workspace/DaoGenerator/bin/templates/DAOImpl.java.vm +++ /dev/null @@ -1,32 +0,0 @@ -/***************************************************************************** - * Company EURIWARE - * Application SIMAN - * File $Id$ - * Creation date 06.10.2012 - * @author $Author$ - * @version $Revision$ - *****************************************************************************/ - -package ${DAOPackage}; - -import ${EntityPackage}.${EntityClass}; -import org.splat.dal.dao.kernel.GenericDAOImpl; - -/** - * ${EntityClass} DAO. - * @author RKV - * - */ -public class ${EntityClass}DAOImpl extends - GenericDAOImpl<${EntityClass}, Long> implements ${EntityClass}DAO { - - /** - * {@inheritDoc} - * @see org.splat.dal.dao.kernel.GenericDAOImpl#getType() - */ - @Override - protected Class<${EntityClass}> getType() { - return ${EntityClass}.class; - } - -} \ No newline at end of file diff --git a/Workspace/DaoGenerator/bin/templates/TestKnowledgeElementDAO.java.vm b/Workspace/DaoGenerator/bin/templates/TestKnowledgeElementDAO.java.vm deleted file mode 100644 index d90ec94..0000000 --- a/Workspace/DaoGenerator/bin/templates/TestKnowledgeElementDAO.java.vm +++ /dev/null @@ -1,395 +0,0 @@ -/***************************************************************************** - * Company EURIWARE - * Application SIMAN - * File $Id$ - * Creation date 12 Oct 2012 - * @author $Author$ - * @version $Revision$ - *****************************************************************************/ -package test.splat.dao; - -import java.util.Date; - -import org.splat.dal.bo.kernel.User; -import org.splat.dal.bo.som.${EntityClass}; -import org.splat.dal.dao.som.${EntityClass}DAO; -import org.splat.kernel.InvalidPropertyException; -import org.splat.kernel.MissedPropertyException; -import org.splat.kernel.MultiplyDefinedException; -import org.splat.log.AppLogger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.orm.hibernate3.HibernateTemplate; -import org.testng.Assert; -import org.testng.annotations.Test; - -import test.splat.common.BaseTest; - -/** - * Test class for ${EntityClass}DAO. - * - * @author Roman Kozlov (RKV) - * - */ -public class Test${EntityClass}DAO extends BaseTest { - - /** - * Logger for the class. - */ - private static final AppLogger LOG = AppLogger - .getLogger(Test${EntityClass}DAO.class); - - /** - * The tested ${EntityClass}DAO. Later injected by Spring. - */ - @Autowired - @Qualifier("${DAOBean}") - private transient ${EntityClass}DAO _${DAOBean}; - - /** - * Test creation of an object.
- * Description :
- * Create an object.
- * Action :
- * 1. call DAO's create method for a good transient object.
- * 2. call DAO's create method for an object with non-zero id.
- * Test data :
- * no input parameters
- * no input parameters
- * - * Outcome results:
- * - *
    - *
  • Object is created in the database successfully
    - *
  • - *
  • Exception is thrown
    - *
  • - *
- *
- * - * @throws InvalidPropertyException - * if an invalid property is used when creating objects - * @throws MultiplyDefinedException - * when trying to create an object with already existing id - * @throws MissedPropertyException - * if a mandatory property is not defined for an object to be created - * - */ - @Test - public void testCreate() throws InvalidPropertyException, - MissedPropertyException, MultiplyDefinedException { - LOG.debug(">>>>> BEGIN testCreate()"); - - ${EntityClass} anObject = get${EntityClass}(); - // Call DAO's create method for a good transient object. - Long id = _${DAOBean}.create(anObject); - Assert.assertNotNull(id, - "Create method returns null instead of a new id."); - Assert.assertTrue(id > 0, "The new id is not a positive number."); - ${EntityClass} anObjectFound = getHibernateTemplate().get( - ${EntityClass}.class, id); - compareObjects(anObjectFound, anObject); - - // Call DAO's create method for an object with non-zero id. - // TODO: Fill the object's properties - ${EntityClass} aBadObj = new ${EntityClass}( - (new ${EntityClass}.Properties())); - aBadObj.setIndex(anObjectFound.getIndex()); - try { - _${DAOBean}.create(aBadObj); - getHibernateTemplate().flush(); - Assert.fail("Creation with existing id must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - LOG.debug(">>>>> END testCreate()"); - } - - /** - * Test of getting an object.
- * Description :
- * Create an object and try to get it from the database.
- * Action :
- * 1. call DAO's read method for an existing id.
- * 2. call DAO's read method for a not existing id.
- * Test data :
- * no input parameters
- * no input parameters
- * - * Outcome results:
- * - *
    - *
  • Object is found in the database successfully
    - *
  • - *
  • Exception is thrown
    - *
  • - *
- *
- * - * @throws InvalidPropertyException - * if an invalid property is used when creating objects - * @throws MultiplyDefinedException - * when trying to create an object with already existing id - * @throws MissedPropertyException - * if a mandatory property is not defined for an object to be created - * - */ - @Test - public void testGet() throws InvalidPropertyException, - MissedPropertyException, MultiplyDefinedException { - LOG.debug(">>>>> BEGIN testGet()"); - ${EntityClass} anObject = get${EntityClass}(); - // Call DAO's create method for a good transient object. - Long id = _${DAOBean}.create(anObject); - Assert.assertNotNull(id, - "Create method returns null instead of a new id."); - Assert.assertTrue(id > 0, "The new id is not a positive number."); - - // Call DAO's get method for an existing id. - ${EntityClass} anObjectFound = _${DAOBean}.get(id); - - compareObjects(anObjectFound, anObject); - - // Call DAO's get method for a not existing id. - try { - anObjectFound = _${DAOBean}.get(-1L); - getHibernateTemplate().flush(); - Assert - .fail("Getting an object with not existing id must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - try { - anObjectFound = _${DAOBean}.get(0L); - getHibernateTemplate().flush(); - Assert - .fail("Getting an object with not existing id must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - try { - anObjectFound = _${DAOBean}.get(id + 1); - getHibernateTemplate().flush(); - Assert - .fail("Getting an object with not existing id must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - LOG.debug(">>>>> END testGet()"); - } - - /** - * Test of updating an object.
- * Description :
- * Create an object and try to update it with another data.
- * Action :
- * 1. call DAO's update method for an existing id.
- * 2. call DAO's update method for a not existing id.
- * 3. call DAO's update method for wrong data.
- * Test data :
- * no input parameters
- * no input parameters
- * no input parameters
- * - * Outcome results:
- * - *
    - *
  • Object is update in the database successfully
    - *
  • - *
  • Exception is thrown
    - *
  • - *
  • Exception is thrown
    - *
  • - *
- *
- * - * @throws InvalidPropertyException - * if an invalid property is used when creating objects - * @throws MultiplyDefinedException - * when trying to create an object with already existing id - * @throws MissedPropertyException - * if a mandatory property is not defined for an object to be created - * - */ - @Test - public void testUpdate() throws InvalidPropertyException, - MissedPropertyException, MultiplyDefinedException { - LOG.debug(">>>>> BEGIN testUpdate()"); - ${EntityClass} anObject = get${EntityClass}(); - // Call DAO's create method for a good transient object. - Long id = _${DAOBean}.create(anObject); - Assert.assertNotNull(id, - "Create method returns null instead of a new id."); - Assert.assertTrue(id > 0, "The new id is not a positive number."); - - // Call DAO's update method for an existing id. - // TODO: Modify some object's properties to update it later -/* Assert - .assertTrue(anObject.getProgressState() != ProgressState.APPROVED, - "The initial state of the object should not be APPROVED."); - anObject.setProgressState(ProgressState.APPROVED); - anObject.setTitle(anObject.getTitle() + " updated");*/ - - _${DAOBean}.update(anObject); - - // Check that the object has been updated. - ${EntityClass} anObjectFound = _${DAOBean}.get(id); - - compareObjects(anObjectFound, anObject); - - // Call DAO's create method for an object with non-zero id. - // TODO: Fill the object's properties - ${EntityClass} aBadObj = new ${EntityClass}( - (new ${EntityClass}.Properties())); - // aBadObj.setIndex(anObjectFound.getIndex()); - try { - _${DAOBean}.update(aBadObj); - getHibernateTemplate().flush(); - Assert.fail("Update with not existing id must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - // Call update with bad data (null title). - aBadObj.setIndex(anObjectFound.getIndex()); - aBadObj.setTitle(null); - try { - _${DAOBean}.update(aBadObj); - getHibernateTemplate().flush(); - Assert.fail("Update with null title must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - // Call update with bad data (null state). - aBadObj.setTitle(anObjectFound.getTitle()); - aBadObj.setProgressState(null); - try { - _${DAOBean}.update(aBadObj); - getHibernateTemplate().flush(); - Assert.fail("Update with null state must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - LOG.debug(">>>>> END testUpdate()"); - } - - /** - * Test of deleting an object.
- * Description :
- * Create an object and try to delete it.
- * Action :
- * 1. call DAO's delete method for an existing id.
- * 2. call DAO's delete method for a not existing id.
- * Test data :
- * no input parameters
- * no input parameters
- * - * Outcome results:
- * - *
    - *
  • Object is found in the database successfully
    - *
  • - *
  • Exception is thrown
    - *
  • - *
- *
- * - * @throws InvalidPropertyException - * if an invalid property is used when creating objects - * @throws MultiplyDefinedException - * when trying to create an object with already existing id - * @throws MissedPropertyException - * if a mandatory property is not defined for an object to be created - * - */ - @Test - public void testDelete() throws InvalidPropertyException, - MissedPropertyException, MultiplyDefinedException { - LOG.debug(">>>>> BEGIN testDelete()"); - ${EntityClass} anObject = get${EntityClass}(); - // Call DAO's create method for a good transient object. - Long id = _${DAOBean}.create(anObject); - Assert.assertNotNull(id, - "Create method returns null instead of a new id."); - Assert.assertTrue(id > 0, "The new id is not a positive number."); - - // Call DAO's delete method for an existing id. - _${DAOBean}.delete(anObject); - - // Check that the object has been deleted. - ${EntityClass} anObjectFound = _${DAOBean}.get(id); - - Assert.assertNull(anObjectFound, "Deleted object must not be found."); - // Call DAO's delete method for a not existing id. - try { - _${DAOBean}.delete(anObject); - getHibernateTemplate().flush(); - Assert.fail("Delete with with not existing id must be failed."); - } catch (Exception e) { - LOG.debug("Expected exception is thrown: " - + e.getClass().getSimpleName() + ": " + e.getMessage()); - } - LOG.debug(">>>>> END testDelete()"); - } - - /** - * Create a transient ${EntityClass} for tests. - * - * @return a transient ${EntityClass} - * @throws InvalidPropertyException - * if an invalid property is used when creating objects - * @throws MultiplyDefinedException - * when trying to create an object with already existing id - * @throws MissedPropertyException - * if a mandatory property is not defined for an object to be created - */ - private ${EntityClass} get${EntityClass}() - throws InvalidPropertyException, MissedPropertyException, - MultiplyDefinedException { - // Create a test knowledge type - HibernateTemplate ht = getHibernateTemplate(); - - ${EntityClass}.Properties kprops = new ${EntityClass}.Properties(); - // Prepare a transient object - - return new ${EntityClass}(kprops); - } - - /** - * Check that given objects are equal. - * - * @param anActual - * the object to check - * @param anExpected - * the expected object - */ - private void compareObjects(${EntityClass} anActual, - ${EntityClass} anExpected) { - Assert.assertNotNull(anActual, - "Created object is not found in the database."); - Assert.assertEquals(anActual.getAuthor(), anExpected.getAuthor(), - "object author is not saved."); - Assert.assertEquals(anActual.getDate(), anExpected.getDate(), - "object date is not saved."); - Assert - .assertEquals(anActual.getOwnerScenario(), anExpected - .getOwnerScenario(), - "object scenario is not saved."); - Assert.assertEquals(anActual.getProgressState(), anExpected - .getProgressState(), "object state is not saved."); - Assert.assertEquals(anActual.getTitle(), anExpected.getTitle(), - "object title is not saved."); - Assert.assertEquals(anActual.getType(), anExpected.getType(), - "object type is not saved."); - Assert.assertEquals(anActual.getValue(), anExpected.getValue(), - "object value is not saved."); - Assert.assertEquals(anActual.getIndex(), anExpected.getIndex(), - "object index is not saved."); - } -} diff --git a/Workspace/DaoGenerator/bin/templates/daoContext.xml.vm b/Workspace/DaoGenerator/bin/templates/daoContext.xml.vm deleted file mode 100644 index d748ec4..0000000 --- a/Workspace/DaoGenerator/bin/templates/daoContext.xml.vm +++ /dev/null @@ -1,14 +0,0 @@ - - - -#foreach( $dao in $daos ) - - - -#end - \ No newline at end of file -- 2.39.2