From: <tri...@us...> - 2008-07-24 18:42:41
|
Revision: 635 http://equanda.svn.sourceforge.net/equanda/?rev=635&view=rev Author: triathlon98 Date: 2008-07-24 18:42:38 +0000 (Thu, 24 Jul 2008) Log Message: ----------- EQ-103 various template readability improvements Modified Paths: -------------- trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java Modified: trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm =================================================================== --- trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm 2008-07-24 16:35:37 UTC (rev 634) +++ trunk/equanda-generate/src/main/velocity/import/FieldMap.java.vm 2008-07-24 18:42:38 UTC (rev 635) @@ -75,6 +75,10 @@ { Import${table.Name} obj = (Import${table.Name}) proxyObject; #if( !$field.isLink() ) + ## tests to assure modified is set + #if( $field.isBoolean() ) obj.set${field.Name}( true );#end + #if( $field.isInt() ) obj.set${field.Name}( 1 );#end + #if( $field.isDouble() ) obj.set${field.Name}( 1.0 );#end obj.set${field.Name}( ImportParser.parse${field.FieldTypeName}( fieldValue ) ); #else ## linked field Modified: trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java =================================================================== --- trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java 2008-07-24 16:35:37 UTC (rev 634) +++ trunk/equanda-test/test-test/src/test/java/org/equanda/test/ymport/ImportTest.java 2008-07-24 18:42:38 UTC (rev 635) @@ -557,21 +557,31 @@ ImportUtil.quote( firstName ) + ',' + ImportUtil.quote( lastName ) + ',' + ImportUtil.quote( job ) + ',' + "10.0" + ',' + "true" }; + assertNull( ImportUtil.importStrings( lines, URL, getImportCredentials() ) ); + CocoonManSelectorEJB cocoonManSelector = EquandaGlobal.getCocoonManSelector(); + List<CocoonManEJB> cocoonMans = cocoonManSelector.selectPersonByLastNameEJB( lastName ); + assertEquals( 1, cocoonMans.size() ); + CocoonManEJB cocoonMan = cocoonMans.get( 0 ); + assertNotNull( cocoonMan ); + assertEquals( firstName.toUpperCase(), cocoonMan.getFirstName() ); + assertEquals( cocoonMan.getHeight(), 10.0, 0.0 ); + assertTrue( cocoonMan.getEmployed() ); + assertFalse( cocoonMan.getPreviousJobs().isEmpty() ); + String updateLines[] = { ":table:CocoonMan/PersonByLastName:FirstName,LastName,PreviousJobs,Employed", "null" + ',' + ImportUtil.quote( lastName ) + ',' + "[]" + ',' + "false" }; - - assertNull( ImportUtil.importStrings( lines, URL, getImportCredentials() ) ); assertNull( ImportUtil.importStrings( updateLines, URL, getImportCredentials() ) ); // verify import - CocoonManSelectorEJB cocoonManSelector = EquandaGlobal.getCocoonManSelector(); - CocoonManEJB cocoonMan = cocoonManSelector.selectPersonByLastNameEJB( lastName ).iterator().next(); + cocoonMans = cocoonManSelector.selectPersonByLastNameEJB( lastName ); + assertEquals( 1, cocoonMans.size() ); + cocoonMan = cocoonMans.get( 0 ); assertNotNull( cocoonMan ); assertNull( " update should have set FirstName to null ", cocoonMan.getFirstName() ); - assertEquals( " update should not change the Height value ", cocoonMan.getHeight(), 10.0, 0.0 ); + assertEquals( " update should not change the Height value ", 10.0, cocoonMan.getHeight(), 0.0 ); assertFalse( " update should have set Employed to false ", cocoonMan.getEmployed() ); assertTrue( " update should have emptied PreviouesJobs ", cocoonMan.getPreviousJobs().isEmpty() ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |