Changes for page Testing-JUnit and TestNG
Last modified by Johann Werner on 2012/08/06 03:19
From version 10.1
edited by Johann Werner
on 2012/07/25 10:14
on 2012/07/25 10:14
Change comment:
There is no comment for this version
To version 11.1
edited by Johann Werner
on 2012/08/06 03:19
on 2012/08/06 03:19
Change comment:
differentiation between normal and bundle-less builds
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -54,9 +54,16 @@ 54 54 55 55 == Minor configuration in eclipse == 56 56 57 -To be able to test your business objects layer in JUnit test cases, you should set the following parameters in your test case/test suite launch configuration : 58 -First in the //"Arguments"// tab, set your working directory to the build product of your project. For example, for a framework project the working directory should be : 57 +To be able to test your business objects layer in JUnit or TestNG test cases, you should set the following parameters in your test case/test suite launch configuration depending on if you are using //normal// or bundle-less builds. 59 59 59 +=== Normal builds === 60 + 61 +A //normal// build means that you have checked the build option //Generate bundles// within the WOLips preferences. 62 + 63 +[[image:bundle_builds.png]] 64 + 65 +First in the //"Arguments"// tab, set your working directory to the build product of your project. For example, for a framework project the working directory should be: 66 + 60 60 {{noformat}} 61 61 62 62 ${workspace_loc:MyEclipseProject/build/MyEclipseProject.framework} ... ... @@ -76,19 +76,30 @@ 76 76 Then, in the classpath tab, select the //"User Entries"// entry and use the //"Advanced..."// button and select the //"Add Folders"// button. 77 77 [[image:RunConfig2.jpg]] 78 78 79 -Select the //"Java"// folder of your build product. 86 +Select the //"Java"// folder of your build product. Use the //"Up/Down"// buttons to move this folder at the first position of your classpath. 87 +[[image:RunConfig3.jpg]] 80 80 81 -{{note}} 89 +{{note title="Be Careful"}} 82 82 83 - {color:#333333}Ifyouare usingbundle-lessbuildsyoudon'thavea buildfolder.Youneed to check the{color} {color:#333333}{_}Generatebundles{_}{color}{color:#333333}optioninthepreferencesWOLips->Build andclean yourprojectto gett generated.{color}91 +If during your tests execution you see error messages such as *cannot cast EOGenericRecord to <your object>* please check that the _"Java"_ folder is at first position in your classpath entries. 84 84 85 85 {{/note}} 86 86 87 - Use the//"Up/Down"// buttonsomovethisfolderatthefirstposition ofyourclasspath.88 -[[image: RunConfig3.jpg]]95 +The last step is to add the parameter //-DNSProjectBundleEnabled=true// to your VM parameters. 96 +[[image:vm_arguments.png]] 89 89 90 - {{notetitle="BeCareful"}}98 +=== Bundle-less builds === 91 91 92 - Ifduring your testsexecutionyou see errormessagessuchs *cannotcast EOGenericRecord to <yourobject>* please check that the_"Java"_ folderisatfirstpositionin your classpath entries.100 +A //bundle-less// build means that you have unchecked the build option //Generate bundles// within the WOLips preferences. 93 93 94 -{{/note}} 102 +[[image:bundleless_builds.png]] 103 + 104 +That means that there will be no //build// folder in your project. In that case you must set the working directoy to the default: 105 + 106 +{{noformat}} 107 + 108 +${workspace_loc:MyEclipseProject} 109 + 110 +{{/noformat}} 111 + 112 +On the classpath tab you don't need to add the //"Java"// folder of your build product so only the default classpath should be listed for the //"User Entries"//. Be sure to add the parameter //-DNSProjectBundleEnabled=true// to your VM parameters as for //normal// builds.