Community
Participate
Working Groups
This article will outline how to integrate PDE unit tests into an automated build system, using a simple eclipse plugin as an example, some simple java classes, basic eclipse plugin techniques and some standard ant tasks. This article is intended to be a much simpler article than Markus Barchfeld's existing article at : http://www.eclipse.org/articles/Article-PDE-Automation/automation.html. This article concentrates only on the automation of the PDE unit tests and would provide a very useful lightweight mechanism for integrating automated PDE tests into existing ant based build systems, without having to adopt the full eclipse headless build system. The article would provide a full working example, java code and ant build files showing how PDE unit tests are automated by detailing each of the following steps: Prerequisites: 1. A dedicated PDE test eclipse installation that is only used by the automated build system. 2. An eclipse plugin A that is to be tested. 3. An eclipse plugin fragment A-test, that is a plugin fragment for A and that only contains the PDE unit tests for plugin A. 4. A predefined PDE test port to be used for the PDE test run, this port is used by the PDE test run in the PDE test eclipse installation to output the test results and by the PDE test listener process to listen to the results of the PDE test run. Running the PDE unit tests: 1. Start a PDE test listener process that listens on the PDE test port. 2. Deploy plugin A and plugin fragment A-test into the PDE test eclipse installation . 3. Startup the PDE test eclipse installation, specifying the list of unit test classes to be run. 4. The PDE test eclipse installation starts up and automatically runs the specified tests and outputs the results to the PDE test port where the PDE test listener process captures the results and outputs them in standard ant junit task xml format. 5. Remove the deployed plugin and fragment (A and A-test) from the PDE test eclipse installation. 6. Run the regular ant Junitreport task on the generated test results xml files. 7. That's it - you have a typical Junit html report containing your PDE unit test results. I would hope to have my 1st draft completed by end June 2006 at the latest.
(In reply to comment #0) > > I would hope to have my 1st draft completed by end June 2006 at the latest. > Sounds good. I'll look for it.
I'm hardly one to pass judgment on missed self-imposed deadlines, but.... any progress?
Due to apparent inactivity, I'm marking this as LATER. Feel free to reopen.
Created attachment 67925 [details] 1st draft of article on how to run PDE unit tests using ant 1st draft of article on how to run PDE unit tests using ant. Better late than never
Hi All, So sorry for leaving this so late but I finally managed to get some time for this article. Really interested in any and all feedback. Cheers Brian
Can somebody from PDE build review this article?
I'm going to review the article. I'm not on the PDE build, but I was involved in developing the described system when it was originally developed.
Sorry, I did not notice this before, I'll take a look at it.
Hi Brian, Finally had a bit of time to look at your article. Although its very well written and nicely detailed I have a few concerns... * You say it only relates to Eclipse 3.1. With Eclipse 3.3 released last June I think it is quite outdated. Before you publish I think you should update it to Eclipse 3.3. * In the introduction you say that there is no other technique to automatically run tests. I actually think that the PDE Build today can also do this. For this it uses a file called test.xml. Have a look at this article and see whether you think this statement is still true: http://www.eclipse.org/articles/Article-PDE-Automation/automation.html
Hi David, Thank you for taking the time to review the draft - your feedback is much appreciated. > * You say it only relates to Eclipse 3.1. With Eclipse 3.3 released last June I > think it is quite outdated. Before you publish I think you should update it to > Eclipse 3.3. I have done some work on the Eclipse 3.3 version and I will indeed update the article to cover Eclipse 3.3. > * In the introduction you say that there is no other technique to automatically > run tests. I actually think that the PDE Build today can also do this. For this > it uses a file called test.xml. Have a look at this article and see whether you > think this statement is still true: > http://www.eclipse.org/articles/Article-PDE-Automation/automation.html The PDE Test method described in this article is intended to be a lightweight version of Markus Barchfeld's method (described in the article you mention). I accept your point and I will update the article to include a reference to Markus's article. Thanks again, Brian
(In reply to comment #6) > Can somebody from PDE build review this article? > I just took a quick look at the article. There is nothing particular to pde.build here, and I have no comments on the test aspects of the article, but there are a couple of small things: 1) Running PDE Unit Tests in Ant, Marker 5 : 3.3 no longer has a startup.jar. The class name will be org.eclipse.equinox.launcher.Main, the jar is the plugins/org.eclipse.equinox.launcher_<version>.jar. See http://wiki.eclipse.org/Starting_Eclipse_Commandline_With_Equinox_Launcher for some example ant. 2) There is nothing in the article about connecting the tests to an automated headless build. pde.build does provide opportunity to run custom ant after the build is complete using the customTargets.xml postBuild target. Perhaps a paragraph on automatically extracting build results and running the tests on them would be appropriate.
(In reply to comment #11) Hi Andrew, Many thanks for taking the time to review the draft article - I appreciate your feedback. > (In reply to comment #6) > > Can somebody from PDE build review this article? > > > > I just took a quick look at the article. There is nothing particular to > pde.build here, and I have no comments on the test aspects of the article, but > there are a couple of small things: > 1) Running PDE Unit Tests in Ant, Marker 5 : 3.3 no longer has a startup.jar. > The class name will be org.eclipse.equinox.launcher.Main, the jar is the > plugins/org.eclipse.equinox.launcher_<version>.jar. See > http://wiki.eclipse.org/Starting_Eclipse_Commandline_With_Equinox_Launcher for > some example ant. I will include an Eclipse 3.3 version in the revised draft that will use the Eclipse 3.3 mechanism you refer to for launching the test run. > > 2) There is nothing in the article about connecting the tests to an automated > headless build. pde.build does provide opportunity to run custom ant after the > build is complete using the customTargets.xml postBuild target. Perhaps a > paragraph on automatically extracting build results and running the tests on > them would be appropriate. > My aim in this article is to provide a generic mechanism for running PDE Tests from ant, so that ant users can either integrate with the headless build or any ant build system. I am not an expert on the Eclipse headless build so I don't intend to provide a concrete example of how to integrate it into the headless build, but I will be adding a link to Markus Barchfeld's article (http://www.eclipse.org/articles/Article-PDE-Automation/automation.html) in my article. Andrew, will that suffice to cover this point ? Thanks, Brian
Created attachment 91575 [details] 2nd Draft of article on how to run PDE unit tests using ant Apologies for the delay in updating the article with the review comments. The article and examples are now updated for Eclipse 3.3 (tested using Eclipse 3.3.1.1), and the original Eclipse 3.1 version is also included.
Created attachment 94157 [details] 3rd Draft of article on how to run PDE unit tests using ant This version of the article and examples have been enhanced so that the Eclipse 3.3 examples should work with any Eclipse 3.3 installation (not just Eclipse 3.3.1.1 as in the previous draft). The Eclipse 3.3 examples have been tested using Eclipse 3.3.2 and 3.3.1.1. The original Eclipse 3.1 version of the article and examples are still included. Any and all feedback gratefully received. Regards Brian
Hi Brian. It's starting to look good. I'm nothing close to a PDE Build expert; please keep this in mind as you read over my comments. Your hints and tips section at the end might be better as an appendix. It'd be nice to see some discussion around using fragments for test bundles. The discussion of the example application might also belong in an appendix. I think that a little more discussion about the listener/collector is necessary. These are running in separate JVMs (which you imply in step 4). I think this relationship needs to be discussed. The first note in "Running PDE Unit Tests in Ant" indicates that the example code "should not be expanded into an eclipse installation". Do you mean "workspace"? (I tend to think of the "installation" as the "eclipse" directory with all the bundles and such). The exerpt of the build file seems mis-labeled. Maybe it's enough to indicate that the file *builds* and runs the tests. It needs a conclusion.
(In reply to comment #15) Hi Wayne, Thanks for taking the time to review the article and for the excellent feedback, I will rework the article based on your comments. See more replies to your comments in-line below. > Your hints and tips section at the end might be better as an appendix. I agree, I'll move these to an appendix. > It'd be nice to see some discussion around using fragments for test bundles. That's a good idea I will add a section on why we use fragments for PDE test bundles. > The discussion of the example application might also belong in an appendix. OK, I'll move those sections to an appendix too. > I think that a little more discussion about the listener/collector is > necessary. These are running in separate JVMs (which you imply in step 4). I > think this relationship needs to be discussed. Again I agree, I will put more effort into detailing the interactions between the PDE test listener process and the PDE test eclipse process. > > The first note in "Running PDE Unit Tests in Ant" indicates that the example > code "should not be expanded into an eclipse installation". Do you mean > "workspace"? (I tend to think of the "installation" as the "eclipse" directory > with all the bundles and such). What I mean here is that the example zip is a full project complete with an ant build system, so the advice means unzip the examples into a directory that is separate from your eclipse installation (I agree with your interpretation of eclipse installation). I'll try to clarify that in the article. > > The exerpt of the build file seems mis-labeled. Maybe it's enough to indicate > that the file *builds* and runs the tests. Could you let me know which parts you think are mis-labeled? I know that labels 4. and 5. appear twice (first where the targets are called and also where the targets are defined). I think that this section is needed as this article concerns ant too and the section details the actual ant script that runs the pde tests and collects the results, which is the main purpose of the article. > > It needs a conclusion. > I agree - I'll add one. Many thanks again for the feedback. Regards, Brian
Created attachment 94945 [details] 4th Draft of article on how to run PDE unit tests using ant The article has been updated in response to Wayne Beaton's review comments. > Your hints and tips section at the end might be better as an appendix. Done. > It'd be nice to see some discussion around using fragments for test bundles. Done. > The discussion of the example application might also belong in an appendix. Done. > I think that a little more discussion about the listener/collector is > necessary. These are running in separate JVMs (which you imply in step 4). I > think this relationship needs to be discussed. Done, I've added more detailed sections on each of the processes involved and I've also added an overview diagram to help describe the steps involved. > The first note in "Running PDE Unit Tests in Ant" indicates that the example > code "should not be expanded into an eclipse installation". Do you mean > "workspace"? (I tend to think of the "installation" as the "eclipse" directory > with all the bundles and such). Done, I hope the new wording is clearer. > It needs a conclusion. Done. I have also removed the 3.1 version of the article (but have kept the 3.1 example code). As ever all comments and feedback gratefully received. Regards Brian
Can I either get some comments about this article from the community, or a couple of +1s indicating that it's ready for publishing?
(In reply to comment #18) > Can I either get some comments about this article from the community, or a > couple of +1s indicating that it's ready for publishing? > Anyone?
Nice article!
(In reply to comment #20) > Nice article! > Sorry if this comes across as pedantic, but--per our convention--does this translate into a "+1"?
+1!
I've copied the content into Eclipse CVS. It now appears on the website [1], but has not been added to our database (so it won't show up on /articles or /resources yet). I'll try and take a pass over it this weekend (or early next week). Any new changes should (please) be submitted in the form of a patch to: :pserver:anonymous@dev.eclipse.org:/cvsroot/org.eclipse:/www/articles/Article-PDEJUnitAntAutomation [1]http://www.eclipse.org/articles/article.php?file=Article-PDE-JUnitAntAutomation/index.html
That is looking really good. For what it's worth +1 from me.
(In reply to comment #23) > [1]http://www.eclipse.org/articles/article.php?file=Article-PDE-JUnitAntAutomation/index.html I got the URL wrong. It should be: http://www.eclipse.org/articles/article.php?file=Article-PDEJUnitAntAutomation/index.html
I have committed an update that fixes up some spelling and grammar errors. The article is live and is accessible from the home page, /resources, and /articles. Brian, can you please send me your coordinates (mailing address, phone number) along with your shirt size and I'll see if I can find some nice appreciation swag for you? Send it by personal e-mail (I assume you don't want that information published publically)
Created attachment 104910 [details] mylyn/context/zip
I wonder would it be possible to update the example to use junit4 ?
Could this be updated for Eclipse 3.4? I am able to run the example in 3.3 but wouldn't know what else I need to do. I'd appreciate it if someone could email me assistance.
(In reply to comment #28) > I wonder would it be possible to update the example to use junit4 ? > Hi Conor, I have no plans to support Junit 4 for now as Junit 3 is just fine for the kinds of PDE tests we're writing. But please try it yourself, it should be possible to upgrade to Junit 4 but I'm not sure what possible issues there could be - especially in the PDETestListener. If I do ever upgrade to Junit 4 then I will let you know. Cheers Brian
(In reply to comment #29) > Could this be updated for Eclipse 3.4? I am able to run the example in 3.3 but > wouldn't know what else I need to do. I'd appreciate it if someone could email > me assistance. > Hi Jason, As you can imagine the article itself cannot keep up with every release of Eclipse, and unfortunately I haven't had a chance to update things for Eclipse 3.4 yet. If you want to update to 3.4 then I would advise that you have a look at all the build.xml files (specifically projects\PhoneBookExample-test\build.xml) and update the path definitions e.g. "build.class.path" to point to the relevant Eclipse 3.4 jars, note you may need to add new 3.4 jars here. It should work assuming that the Eclipse Junit api classes (i.e. org.eclipse.jdt.internal.junit.model.ITestRunListener2 and import org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient) haven't changed in 3.4. There may also be issues if the launching mechanism has changed in 3.4. Anyway hope that helps. Good luck. Brian
(In reply to comment #31) > There may also be issues if the launching mechanism has changed in 3.4. > Anyway hope that helps. I believe the problems I'm having is that I cannot launch the test Eclipse to run the junit tests.
This is great article. Thanks! It would be very valuable if it is extended with performance tests and their automation. May be this should be a separate article.
I have difficulties applying that to our project. We have a RCP product to test. So a parameter -product is required. But this is not all. I need to pass the location of the configuration folder with -configuration. Otherwise the product is not started before the tests but a Eclipse runtime workbench. But the configuration folder is very tricky because of the update configuration plugin. As it seems, every product needs to use that bundle. And so there is a file /org.eclipse.update/platform.xml which contains features and plugins. It seems that the entries in this must match exactly the features and plugins which are contained in the features and plugins folders. Since I have added a lot of them because of test environment, the product does not start but a runtime workbench. I am struggeling with this -configuration parameter for a while. I need to use it, otherwise the test starts a runtime workbench and not the product to be tested. Does anyone know how to solve these problems?
Created attachment 109388 [details] printer friendly PDF version (from HTML via OpenOffice) The HTML on http://www.eclipse.org/articles/article.php?file=Article-PDEJUnitAntAutomation/index.html doesn't print well from any browser I tried. I manually reformatted it a bit in OpenOffice and produced this PDF from it (also contains clickable bookmarks for headings)
Created attachment 109389 [details] Reformatted OpenOffice version (from HTML)
(In reply to comment #35) Thank you Jorg for doing this, the PDF version looks really good. Regards Brian
I tracked down the pieces that were breaking this example on Eclipse 3.4. Without much understanding of Equinox, I can't assert that these are 100% correct solutions, but they allowed me to run the example tests against 3.4. #1 - After extracting a clean installation of Eclipse 3.4 for test purposes, declare the plugins and fragment in the <eclipse_home>/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info file. PhoneBookExample,1.0.0,file:plugins/PhoneBookExample_1.0.0.jar,4,true pde.test.utils,3.3,file:plugins/pde.test.utils_3.3.jar,4,true PhoneBookExample_test,1.0.0,file:plugins/PhoneBookExample_test_1.0.0.jar,4,false #2 - Don't wipe out the "configuration" folder every time the tests run. Line 80 in the old PhoneBookExample-test/build.xml needs to be commented out (or at least refined). Otherwise the changes made to the bundles.info file will be lost.
I've got it working on Eclipse 3.4 on Mac OS X 10.5. Here is details on changes I made to the code and test run script. I am running the test listener in a separate instance of Eclipse 3.4. I had to update pde.test.utils MANIFEST.MF with these plugins: Require-Bundle: org.eclipse.core.runtime;bundle-version="3.4.0", org.eclipse.ui;bundle-version="3.4.0", org.eclipse.jdt.junit, org.eclipse.jdt.junit.runtime;bundle-version="3.3.0", org.apache.ant, org.junit That fixed a couple of exceptions that reported missing classes. I run the test run from a command line with this command: cd /Users/mykola/Code/projects/testuirun/eclipse java -classpath ./plugins/org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar \ org.eclipse.equinox.launcher.Main \ -application org.eclipse.pde.junit.runtime.uitestapplication \ -data /Users/mykola/Code/projects/testuirun/ws1 \ -dev bin \ -clean \ -port 1623 \ -testpluginname PhoneBookExample \ -classnames phonebookexample.dialogs.PhoneBookEntryEditorDialogTest \ -vmargs \ -XstartOnFirstThread \ -Xms512m \ -Xmx1024m \ -XX:MaxPermSize=256m \ -Dos=macosx \ -Darch=x86 \ -Dws=carbon \ -Dorg.eclipse.swt.internal.carbon.smallFonts Note, the Mac run requires -XstartOnFirstThread option. The test run fine. I saw Eclipse UI came up, the dialogs displayed, etc. The test results listener printed: Listening on port 1623 for test suite PhoneBookExample results ... PDE Test Run Started - running 6 tests ... Test Tree Entry - Description: 1,phonebookexample.dialogs.PhoneBookEntryEditorDialogTest,true,6 Test Tree Entry - Description: 2,testDialogTitle(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest),false,1 Test Tree Entry - Description: 3,testInitialDialog(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest),false,1 Test Tree Entry - Description: 4,testInvalidNumberDisablesOKButton(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest),false,1 Test Tree Entry - Description: 5,testValidNumberEnablesOKButton(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest),false,1 Test Tree Entry - Description: 6,testChangingNameUpdatesPhoneBookEntryData(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest),false,1 Test Tree Entry - Description: 7,testChangingNumberUpdatesPhoneBookEntryData(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest),false,1 Test Started - 1 - testDialogTitle(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Ended - 1 - testDialogTitle(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Started - 2 - testInitialDialog(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Ended - 2 - testInitialDialog(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Started - 3 - testInvalidNumberDisablesOKButton(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Ended - 3 - testInvalidNumberDisablesOKButton(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Started - 4 - testValidNumberEnablesOKButton(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Ended - 4 - testValidNumberEnablesOKButton(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Started - 5 - testChangingNameUpdatesPhoneBookEntryData(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Ended - 5 - testChangingNameUpdatesPhoneBookEntryData(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Started - 6 - testChangingNumberUpdatesPhoneBookEntryData(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Ended - 6 - testChangingNumberUpdatesPhoneBookEntryData(phonebookexample.dialogs.PhoneBookEntryEditorDialogTest) Test Run Ended - PASSED - Total: 6 (Errors: 0, Failed: 0, Passed: 6), duration 794ms. I hope this information will be helpful.
Hi. I have been trying to run the sample code on Eclipse 3.4.1 and Windows XP and was having an SWT "Widget disposed" type exception which ultimately caused a Java Result 13 error to be produced by ant. I have followed Ben's advice (comment #38) and all now works. I thought I would share for other people that may come across the same error. Thanks Ben, great contribution.
Hi Brian, apparently the link to the PDETestExampleProjects-3.3.zip file in your article is dead meanwhile. Can you post us to the new location since I wasn't able to find it anywhere. Maybe you can attach it to this issue (if it's not too big) Greetings Andi
(In reply to comment #41) > Hi Brian, > apparently the link to the PDETestExampleProjects-3.3.zip file in your article > is dead meanwhile. Can you post us to the new location since I wasn't able to > find it anywhere. > Maybe you can attach it to this issue (if it's not too big) > Greetings Andi > Hi Andi, Just tested the link and it's working fine. Cheers Brian
Shit, sorry, you're right. Aparently I used the wrong link. I used this one: http://www.eclipse.org/articles/Article-PDEJUnitAntAutomation/article.html#PDE_Test_Utilities Sorry for the trouble - by the way, great article, just got the headless tests to run ;-)
Hi, I successfully integrated my J-Unit tests into my PDE headless build thanks to this great article. Many thanks ! Nevertheless I have some little troubles with the generated HTML files. Using the 3 provided PDE Junit utility classes the html report doesn't correctly reflect Packages and Classes used to run the test. In fact in the report I only have one package and one class where the package name and class name comes form the test plugin name given as parameter to the PDEResultsCollector main method. For example if my test plug-in is com.mycompany.test the report will show one package called com.mycompany and one class called test containing all my tests. I noticed that only one XML file containing tests results is generated by the PDETestListener class and it seems junireport needs one xml file for each executed TestCase ... Am I wrong ? Does any body reproduced this problem ? For information As test.list.class variable I am using a single AllTests class (with a suite() method). I also tried with a list of TestCase classes and the result is the same ... I am investigating more on that issue but I can't find the exact format of XML files needed as input of the Ant junitreport task ... ??!!! I will let you know about any news Regards Manu
Hi all, As said here: ttp://manuelselva.wordpress.com/2009/03/02/headless-build-final-step/ I was finally able to have reports correctly generated. If anyone is interested to know how please let me know. Moreover I think it can be nice to have classes like the ones provided in this article directly provided by the PDE. What do you think about that ? May be the place for a contribution ? Regards Manu
The good link is http://manuelselva.wordpress.com/2009/03/02/headless-build-final-step/ Moreover maybe the PDE could provide an option to the application used to run PDE tests in order to say that we want to run test AND generates XML report files. Manu (In reply to comment #45) > Hi all, > > As said here: > http://manuelselva.wordpress.com/2009/03/02/headless-build-final-step/ I was > finally able to have reports correctly generated. > > If anyone is interested to know how please let me know. > > Moreover I think it can be nice to have classes like the ones provided in this > article directly provided by the PDE. > > What do you think about that ? May be the place for a contribution ? > > Regards > > Manu >
Hi Manu, I am interested in your fixes for the reports - can't you just post them here as a patch? It would be awesome to have nice reports from this headless build solution. Best regards and thanks to all for the effort put into this, Christian
Created attachment 140842 [details] Junit Util plugin modified
I added in attachment the modified plugin I am using to generate correct reports. Let me know if you have any questions. Regards Manu (In reply to comment #47) > Hi Manu, > > I am interested in your fixes for the reports - can't you just post them here > as a patch? It would be awesome to have nice reports from this headless build > solution. > > Best regards and thanks to all for the effort put into this, > Christian >
Hi Brian, I like your article. However, It doesn't seem to work. I recently tried downloading it and running each ant build in turn. An error occurred durring run_pde_tests: [java] Java Result: 13. Would you please be able to update the example code for modern eclipse versions.
(In reply to comment #50) > Hi Brian, > > I like your article. However, It doesn't seem to work. I recently tried > downloading it and running each ant build in turn. An error occurred durring > run_pde_tests: [java] Java Result: 13. > > Would you please be able to update the example code for modern eclipse > versions. > Hi Keynan, I'd love to be able to update the example for the latest versions of Eclipse but my family life is demanding all my spare time at the moment and I don't see that changing anytime soon. Have a look at some of the excellent contributions in the earlier comments these might help you to get it working for your version of Eclipse, if and when you do could you update the example ? Regards Brian
Created attachment 143986 [details] PDETestExampleProjects-3.4.zip for Eclipse 3.4 I got the examples working with Eclipse 3.4.2 using some of the comments above then ran 'ant zip_example -Dtarget.eclipse.version=3.4' to create the PDETestExampleProjects-3.4.zip that I am attaching. If I use the updated examples in this zip, modify <eclipse_home>/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info as described in comment #38, and specify -Dtarget.eclipse.version=3.4 on the command line, I am able to build and run the examples with Eclipse 3.4.2. Caveat: I'm not an Ant or Eclipse expert. It worked for me. Your mileage may vary.
I downloaded PDETestExampleProjects-3.4.zip and run it successfully with Eclipse 3.4, but it failed when I tried to run it with Eclipse 3.5. This example runs fine from Eclipse 3.5 IDE, but not from the command line? I知 not sure, but it seems the syntax of the following command in \projects\PhoneBookExample-test\build.xml needs to be modified? <java classname="org.eclipse.equinox.launcher.Main" classpathref="equinox.launcher.class.path" dir="${plugin.dir}" fork="yes"> <arg line="-application org.eclipse.pde.junit.runtime.uitestapplication -data ${test.reports.dir}/output/ws -dev bin -clean -port ${pde.test.port} -testpluginname PhoneBookExample -classnames ${test.classes.list}" /> </java> Unfortunately, I could not find enough information about org.eclipse.pde.junit.runtime.uitestapplication process. So, does anyone know how to fix this problem?
Sorry, but I forgot to specify the error message that gets generated when I tried to run PDETestExampleProjects-3.4.zip for Eclipse 3.4 with Eclipse 3.5: run_pde_tests: [mkdir] Skipping C:\tmp\Eclipse_PDE_Unit_Tests\projects\PhoneBookExample-test\target\reports\test\output\ws because it already exists. [java] Executing 'C:\Program Files\Java\jdk1.6.0_13\jre\bin\java.exe' with arguments: [java] '-classpath' [java] 'C:\tmp\Eclipse_PDE_Unit_Tests\projects\eclipse-3.5\eclipse\plugins\org.eclipse.equinox.launcher_1.0.200.v20090520.jar' [java] 'org.eclipse.equinox.launcher.Main' [java] '-application' [java] 'org.eclipse.pde.junit.runtime.uitestapplication' [java] '-data' [java] 'C:\tmp\Eclipse_PDE_Unit_Tests\projects\PhoneBookExample-test\target\reports\test/output/ws' [java] '-dev' [java] 'bin' [java] '-clean' [java] '-port' [java] '52831' [java] '-testpluginname' [java] 'PhoneBookExample' [java] '-classnames' [java] 'phonebookexample.dialogs.PhoneBookEntryEditorDialogTest' [java] [java] The ' characters around the executable and arguments are [java] not part of the command. [java] Exception in thread "WorkbenchTestable" org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException : No Classloader found for plug-in PhoneBookExample) [java] at org.eclipse.swt.SWT.error(SWT.java:3884) [java] at org.eclipse.swt.SWT.error(SWT.java:3799) [java] at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:195) [java] at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) [java] at org.eclipse.swt.widgets.Display.syncExec(Display.java:4312) [java] at org.eclipse.ui.internal.testing.WorkbenchTestable.runTest(WorkbenchTestable.java:112) [java] at org.eclipse.pde.internal.junit.runtime.UITestApplication.runTests(UITestApplication.java:112) [java] at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71) [java] at java.lang.Thread.run(Thread.java:619) [java] Caused by: java.lang.IllegalArgumentException: No Classloader found for plug-in PhoneBookExample [java] at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getClassLoader(RemotePluginTestRunner.java:77)
Created attachment 156982 [details] PDETestListener / Collector for 3.5 + 3.6 This provides a PDETestListener, PDETestResultsCollector that works with 3.5 and 3.6.
Brian, I would like to use some code from your article in the Eclipse Riena Project - http://eclipse.org/riena However, I found that there is no licensing information in the code. I'm hoping that you can help me clarify the licensing for this code, so that I get it past the Eclipse Foundation's legal team: 1) Can you confirm (via bugzilla reply), that you are the only author for code in https://bugs.eclipse.org/bugs/attachment.cgi?id=94945 (PDETestExampleProjects-*.zip) 2) Do you have the rights to place the code under the Eclipse Public License? 3) If the answer to the above is yes, could you kindly change the copyright headers and re-attach? Templates for the copyright headers can be found here: http://eclipse.org/legal/copyrightandlicensenotice.php If you want to save time it would be enough for me to do it for these three files only: PDETestListener.java, PDETestPortLocator.java, PDETestResultsCollector.java in PDETestExampleProjects-3.3.zip) I am sorry for the inconvenience and hope you can help. Thanks, Elias.
(In reply to comment #56) Hi Elias, Comments below ... > > I would like to use some code from your article in the Eclipse Riena Project - > http://eclipse.org/riena That's nice to hear, thanks. > > However, I found that there is no licensing information in the code. I'm hoping > that you can help me clarify the licensing for this code, so that I get it past > the Eclipse Foundation's legal team: > > 1) Can you confirm (via bugzilla reply), that you are the only author for code > in > https://bugs.eclipse.org/bugs/attachment.cgi?id=94945 > (PDETestExampleProjects-*.zip) Yes, I am the only author. > > 2) Do you have the rights to place the code under the Eclipse Public License? Yes. > > 3) If the answer to the above is yes, could you kindly change the copyright > headers and re-attach? Templates for the copyright headers can be found here: > http://eclipse.org/legal/copyrightandlicensenotice.php > > If you want to save time it would be enough for me to do it for these three > files only: PDETestListener.java, PDETestPortLocator.java, > PDETestResultsCollector.java in PDETestExampleProjects-3.3.zip) You can freely copy the source and add any headers you need to them for your work, but I won't be doing that for you. This article is here to provide code and examples to be freely copied, modified and reused as users see fit. I hope that helps you. Regards Brian
Brian, thanks for the help. I've obtained the IP team's "seal of approval" for the pde.test.utils plugin. :-) Interested Eclipse committers can refer to this CQ: http://dev.eclipse.org/ipzilla/show_bug.cgi?id=3705
Hi, I'm having problems building the PDETestListener/Collector for Eclipse 3.6. Eclipse displays the following warning: Discouraged access: The type ITestRunListener2 is not accessible due to restriction on required library C:\eclipse\plugins\org.eclipse.jdt.junit.core_3.6.1.r361_v20100825-0800.jar
Oh, and here's the build output: Buildfile: C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\build.xml build: [javac] Compiling 3 source files to C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\target\classes [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:13: package org.eclipse.jdt.internal.junit.model does not exist [javac] import org.eclipse.jdt.internal.junit.model.ITestRunListener2; [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:15: cannot find symbol [javac] symbol: class ITestRunListener2 [javac] public class PDETestListener implements ITestRunListener2 { [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestResultsCollector.java:3: package org.eclipse.jdt.internal.junit.model does not exist [javac] import org.eclipse.jdt.internal.junit.model.ITestRunListener2; [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestResultsCollector.java:4: package org.eclipse.jdt.internal.junit.model does not exist [javac] import org.eclipse.jdt.internal.junit.model.RemoteTestRunnerClient; [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:118: cannot find symbol [javac] symbol : variable ITestRunListener2 [javac] location: class pde.test.utils.PDETestListener [javac] if (status == ITestRunListener2.STATUS_OK) { [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:121: cannot find symbol [javac] symbol : variable ITestRunListener2 [javac] location: class pde.test.utils.PDETestListener [javac] } else if (status == ITestRunListener2.STATUS_FAILURE) { [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:125: cannot find symbol [javac] symbol : variable ITestRunListener2 [javac] location: class pde.test.utils.PDETestListener [javac] } else if (status == ITestRunListener2.STATUS_ERROR) { [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:137: cannot find symbol [javac] symbol : variable ITestRunListener2 [javac] location: class pde.test.utils.PDETestListener [javac] if (status == ITestRunListener2.STATUS_OK) { [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:139: cannot find symbol [javac] symbol : variable ITestRunListener2 [javac] location: class pde.test.utils.PDETestListener [javac] } else if (status == ITestRunListener2.STATUS_FAILURE) { [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestListener.java:141: cannot find symbol [javac] symbol : variable ITestRunListener2 [javac] location: class pde.test.utils.PDETestListener [javac] } else if (status == ITestRunListener2.STATUS_ERROR) { [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestResultsCollector.java:17: cannot find symbol [javac] symbol : class ITestRunListener2 [javac] location: class pde.test.utils.PDETestResultsCollector [javac] new RemoteTestRunnerClient().startListening(new ITestRunListener2[] { pdeTestListener }, port); [javac] ^ [javac] C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\src\pde\test\utils\PDETestResultsCollector.java:17: cannot find symbol [javac] symbol : class RemoteTestRunnerClient [javac] location: class pde.test.utils.PDETestResultsCollector [javac] new RemoteTestRunnerClient().startListening(new ITestRunListener2[] { pdeTestListener }, port); [javac] ^ [javac] 12 errors BUILD FAILED C:\Users\minguyen\Desktop\pdetestexample\projects\pde.test.utils\build.xml:34: Compile failed; see the compiler error output for details. Total time: 543 milliseconds
I am Also getting the above error mentioned by minh.nguyen@viasat.com Any resolution for this? quick help appreciated. Thanks, Gopal