| Summary: | EUnit test framework can NOT run in javascript preview pane or deployed mode | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Jing Qian <jqian> | ||||||
| Component: | EDT | Assignee: | Scott Greer <greer> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | carrollk, greer, hjiyong, mayunf, wxwu | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Jing Qian
Ji Yong, Could you try Jing's scenario and see what you think? Just step thru the instructions on the green threads wiki, starting with "0. Run EUnit test framework "..... I've just tried it for myself and reviewed the generated JavaScript for the library created in Step 1; it looks ok to me (although I didn't execute it). I also reviewed the generated JS in Step 3 and it also looks ok. I was unable to go to the Preview pane -- I get the document.write error, but I may not be running all the latest IDE code..... I suspect this is a deployment issue, but please confirm whether you agree; if you think it's in JS, just re-assign it back to me....thanks! Created attachment 203330 [details]
Change to eunit javascript testdriver project creation; Add eunit runtime to HTML gen
The changes are: 1. The javascript testdriver project did not add javascript dev generator, add it. 2. Add the eunit runtime to html file. There are still several problems: JS Gen problem 1.writeResultLib.egl generation error: in js file line 310 or so eze$Temp11 = egl.egl.lang.ETimestamp.fromETimestamp(myTime"yyyyMMddHHmmssffffff"); should be eze$Temp11 = egl.egl.lang.ETimestamp.fromETimestamp(myTime,"yyyyMMddHHmmssffffff"); 2.mylib.egl generation error? at corresponding js file line 9 new egl.a.mylib(); // Is this expected? Html Gen problem 1. library dependency is wrong: createResultFile.js is not included Scott, could you please look at the JS Gen problem at your working day? JiYong, Your fix made the javascript testdriver project ONLY has the development mode generator. I checked another fix, tested it, now the javascript testdriver project have BOTH development and deployment mode generator Created attachment 203411 [details] HTML Gen update The problems still exists JSGen 1. writeResultLib.egl generation error still exists. in js file getTimeStamp function eze$Temp11 = egl.egl.lang.ETimestamp.ezeCast({eze$$value : myTime, eze$$signature : "J'null';"}"yyyyMMddHHmmssffffff"); // This is wrong. 2.TestExecutionLib.egl, the generated js is wrong. "eze$$setEmpty": function() { this.resultRootSum = new egl.org.eclipse.edt.eunit.runtime.ResultSummaryRoot(); this.STEXTS = []; } this.STEXTS should not be empty. JS Runtime Error 1. egl.createInvalidIndexException does not exist which is invoked in several place. --------------------------- The mylib.js problem in comment 3 is not an issue. It happens because the project does not configure javascript dev generator. Scott, I will transfer this to you because I can only find gen problems now. Please return to me if there is deployment problem. *** Bug 356464 has been marked as a duplicate of this bug. *** Quick update.....after working with Ji Yong tonight / today, I was able to get EUnit working with these caveats: 1. Late Friday there were some MOF changes that broke JS Gen; I eventually figured out that running with an earlier version of TypeUtils at least restores JS gen to where I can gen & run the FVT testcases again. I'll work with Paul (and possibly Jeff) tomorrow to figure out how to resolve this. 2. The EUnit scenario on the green threads wiki calls for the creation of a basic EGL project; as a result, the dev mode generator won't be used (as required by VE). So I re-ran the scenario, but with a Web Client project.... This may be a bug. 3. There appear to be issues with the service -- I did get errors when I generated the Java portion of the testcase so perhaps that is the root problem. So I commented out all the service-related work in CreateResultFile.egl. Ji Yong and I will continue to look into getting the service to work. Finally, I'd like to mention that these results were obtained with the committed version of JS gen and the JS runtime (i.e., without uncommitted changes). (In reply to comment #7) > Quick update.....after working with Ji Yong tonight / today, I was able to get > EUnit working with these caveats: > > 1. Late Friday there were some MOF changes that broke JS Gen; I eventually > figured out that running with an earlier version of TypeUtils at least restores > JS gen to where I can gen & run the FVT testcases again. I'll work with Paul > (and possibly Jeff) tomorrow to figure out how to resolve this. > > 2. The EUnit scenario on the green threads wiki calls for the creation of a > basic EGL project; as a result, the dev mode generator won't be used (as > required by VE). So I re-ran the scenario, but with a Web Client project.... > This may be a bug. > > 3. There appear to be issues with the service -- I did get errors when I > generated the Java portion of the testcase so perhaps that is the root problem. > So I commented out all the service-related work in CreateResultFile.egl. Ji > Yong and I will continue to look into getting the service to work. > > Finally, I'd like to mention that these results were obtained with the > committed version of JS gen and the JS runtime (i.e., without uncommitted > changes). Hi Scott, The service problem may be caused by the generation error of CreateResultFile. The generated constructor is "constructor": function() { this.jsrt$SysVar = new egl.egl.core.SysVar(); var trService = new egl.eglx.http.HttpRest(); this.trService.restType = egl.eglx.rest.ServiceType.EglDedicated; this.trService.request.uri = "org.eclipse.edt.eunit.runtime.TestResultService"; ; this.eze$$setInitial(); } In which, var trService is declared but this.trService is undefined. (In reply to comment #8) Ji Yong, Thanks so much for triaging CreateResultFile; I've just committed a fix for this and as a result, I can now run the EUnit smoke-test end-to-end. Jing, there are still two caveats (unrelated to JS gen): 1) I had to create my test project (myProj) as a Web Client with Services Project; otherwise, my Java test driver for the project would be marked by Eclipse with a red exclamation mark. I don't know why I had to do this, and possibly I could've done something different, but this does work for me. 2) I had to modify EUnit to work around the SysLib issue; as you know, this is outside of the scope of JS gen. I simply hardcoded the directory and file separator. Not sure whether Brian's workaround works, or if there's something to dig into here. > Hi Scott, > The service problem may be caused by the generation error of CreateResultFile. > The generated constructor is > "constructor": function() { > this.jsrt$SysVar = new egl.egl.core.SysVar(); > var trService = new egl.eglx.http.HttpRest(); > this.trService.restType = egl.eglx.rest.ServiceType.EglDedicated; > this.trService.request.uri = > "org.eclipse.edt.eunit.runtime.TestResultService"; > ; > this.eze$$setInitial(); > } > In which, var trService is declared but this.trService is undefined. Jing and I were both seeing the resulting XML .trs file contained invalid XML tags which were improperly prefixed with "null". Joe identified the bug in XML.js, and I've just verified that it works with EUnit; am committing the fix now. Jing and I are both seeing invalid counts coming of the summary results, so I'll look at that next. Discovered that the test results weren't being accurately tallied because ConstantsLib.js had been generated prior to some fixes, so all the various constants were incorrectly initialized to zero. Committing the fix for that now. Next up is to look into JS gen's exception handling, since that has some bearing on EUnit's results (there are separate bugs that may document these already). (Reply to comment #9) caveats #1, the basic EGL project should have all 3 generators by default (java, javascript dev, javascript), but sometimes javascript dev generator isn't created, bug 358304 has been opened against IDE Also, we found the record => XML conversion has issues in javascript, [[bug 358304]] has been opened (In reply to comment #12) > (Reply to comment #9) > > caveats #1, the basic EGL project should have all 3 generators by default > (java, javascript dev, javascript), but sometimes javascript dev generator > isn't created, bug 358304 has been opened against IDE > > Also, we found the record => XML conversion has issues in javascript, [[bug > 358304]] has been opened At this point, I believe that all JS gen issues have been addressed. Jing, if you agree, please close or re-route this bug.....thanks! > Committing the fix for that now. Next up is to look into JS gen's exception > handling, since that has some bearing on EUnit's results (there are separate > bugs that may document these already). After further review, I don't think the exception issues are affecting the tallies. lower the severity to normal, waiting for bug 358321 (XML issue in javascript) to be fixed Jing agreed with marking this one resolved; will re-open if necessary. verified on 20111009's build verified & closed |