Changes for page Testing-JUnit and TestNG
Last modified by Yana Oksner on 2026/01/08 12:10
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 12.1
edited by Johann Werner
on 2012/08/06 03:19
on 2012/08/06 03:19
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -48,15 +48,22 @@ 48 48 * example.com.app.Application myApp = new example.com.app.Application( ) ; 49 49 * ERXApplication.primeApplication(NSBundle.mainBundle().bundlePath(), null, "example.com.app.Application"); ~/~/(Wonder) or 50 50 * WOApplication.primeApplication(NSBundle.mainBundle().bundlePath(), null, "example.com.app.Application"); ~/~/(No Wonder) 51 -* er.extensions.ERXExtensions.initApp(example.com.app.Application.class, new StringWO:0) ; 51 +* er.extensions.ERXExtensions.initApp(example.com.app.Application.class, new String[WO:0]) ; 52 52 53 53 One of them may work best in your situation. It may be important for your application to find its main bundle properly, and all the goodies bound up in that main bundle. 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:attach: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} ... ... @@ -63,7 +63,7 @@ 63 63 64 64 {{/noformat}} 65 65 66 -For an application it should be (using the handy wolips //dir//loc variable)73 +For an application it should be (using the handy wolips_dir_loc variable) 67 67 68 68 {{noformat}} 69 69 ... ... @@ -71,24 +71,33 @@ 71 71 72 72 {{/noformat}} 73 73 74 -[[image:RunConfig1.jpg]] 81 +[[image:attach:RunConfig1.jpg]] 75 75 76 76 Then, in the classpath tab, select the //"User Entries"// entry and use the //"Advanced..."// button and select the //"Add Folders"// button. 77 -[[image:RunConfig2.jpg]] 84 +[[image:attach: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:attach:RunConfig3.jpg]] 80 80 81 -{{note}} 89 +{{note title="Be Careful"}} 90 +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. 91 +{{/note}} 82 82 83 -{color:#333333}If you are using bundle-less builds you don't have a build folder. You need to check the{color} {color:#333333}{_}Generate bundles{_}{color} {color:#333333}option in the preferences WOLips->Build and clean your project to get it generated.{color} 93 +The last step is to add the parameter //-DNSProjectBundleEnabled=true// to your VM parameters. 94 +[[image:attach:vm_arguments.png]] 84 84 85 - {{/note}}96 +=== Bundle-less builds === 86 86 87 -Use the //"Up/Down"// buttons to move this folder at the first position of your classpath. 88 -[[image:RunConfig3.jpg]] 98 +A //bundle-less// build means that you have unchecked the build option //Generate bundles// within the WOLips preferences. 89 89 90 - {{notetitle="BeCareful"}}100 +[[image:attach:bundleless_builds.png]] 91 91 92 - Ifduringyourtestsexecution yousee error messages suchas*cannot cast EOGenericRecordto <yourobject>*pleasecheckthatthe_"Java"_ folderisat firstpositionin your classpath entries.102 +That means that there will be no //build// folder in your project. In that case you must set the working directoy to the default: 93 93 94 -{{/note}} 104 +{{noformat}} 105 + 106 +${workspace_loc:MyEclipseProject} 107 + 108 +{{/noformat}} 109 + 110 +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.