Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to run JUnit plugin tests from command line?
How to run JUnit plugin tests from command line? [message #268510] Thu, 12 February 2009 09:17 Go to next message
ankit baphna is currently offline ankit baphnaFriend
Messages: 13
Registered: July 2009
Junior Member
Hi all,

I have been using "Run .. -->JUnit Plugin Test" for testing my Eclipse
plugin. It has been since now all manual testing. But I want to automatize
this by writing an Ant task to run my Junit Plugin tests. What shall I do?
Do I need anything extra like a plugin for this?

Thanks.
Re: How to run JUnit plugin tests from command line? [message #268940 is a reply to message #268510] Mon, 02 March 2009 04:29 Go to previous messageGo to next message
ankit baphna is currently offline ankit baphnaFriend
Messages: 13
Registered: July 2009
Junior Member
replies please...................

ankit baphna wrote:

> by the way I am using junit 3.8 and Eclipse SDK Version: 3.4.0

> ankit baphna wrote:

>> Hi all,

>> I have been using "Run .. -->JUnit Plugin Test" for testing my Eclipse
>> plugin. It has been since now all manual testing. But I want to automatize
>> this by writing an Ant task to run my Junit Plugin tests. What shall I do?
>> Do I need anything extra like a plugin for this?

>> Thanks.
Re: How to run JUnit plugin tests from command line? [message #269388 is a reply to message #268940] Mon, 16 March 2009 10:38 Go to previous messageGo to next message
ankit baphna is currently offline ankit baphnaFriend
Messages: 13
Registered: July 2009
Junior Member
I found out a solution for this problem. You need to follow the following
approach:

1) Make a new class that implements IStartup interface. Add a method in it
as shown below:

@Override
public void earlyStartup() {
TestResult result = new TestResult();
AllTests.suite().run(result);
}

There should be nothing like AllTests.suite().run(result) in your AllTests
class.

2)Add an extension to your project "org.eclipse.ui.startup" (in the
manifest editor). Double click on this after adding and then associate the
class that you created in step 1 with this.

3) From eclipse run your plug-in/fragment as Eclipse Application. That
will open a runtime eclipse and runs your tests on top of it as required.

4) Now go to the debug mode, right click on the main thread and see
properties. Copy the command line argument from there and then run it from
anywhere you want :)

Note: Delete the runtime-EclipseApplication folder from your workspace
every time you run the command from the command line and don't delete the
metadata from your workspace. If you delete workspace then you again have
to repeat the whole procedure rather than just using the command next time.

Hope this will help.

-- Ankit Baphna

ankit baphna wrote:


> by the way I am using junit 3.8 and Eclipse SDK Version: 3.4.0

> ankit baphna wrote:

>> Hi all,

>> I have been using "Run .. -->JUnit Plugin Test" for testing my Eclipse
>> plugin. It has been since now all manual testing. But I want to automatize
>> this by writing an Ant task to run my Junit Plugin tests. What shall I do?
>> Do I need anything extra like a plugin for this?

>> Thanks.
Re: How to run JUnit plugin tests from command line? [message #1864585 is a reply to message #269388] Wed, 27 March 2024 05:05 Go to previous messageGo to next message
Sachin Goyal is currently offline Sachin GoyalFriend
Messages: 19
Registered: February 2024
Junior Member
Hi
I want to know how to create Junit Plugin test. As while creating i am seeing only two options
1. create junit test
2. create junit test suite

I am some plugins and I made jars from it and put those jars in my eclipse plugins.
Now, I want junit plugin testing to test those.
I am having trouble to create those.
Can you tell me the step by step procedure for it?
Thanks in advance.
Re: How to run JUnit plugin tests from command line? [message #1864602 is a reply to message #1864585] Wed, 27 March 2024 17:31 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4507
Registered: July 2009
Senior Member

A "Junit Plug-in test" is a JUnit test that expects to be executed within the plug-in runtime, just like your actual plug-in code.

Like your plug-in code, it should be in a plug-in project of some kind so that it can declare the dependencies that the test requires to build and run against. The only other difference is in how it is launched.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:java was started but returned exit code = -1073740771
Next Topic:The operation cannot be completed. See the details
Goto Forum:
  


Current Time: Thu Dec 12 01:36:13 GMT 2024

Powered by FUDForum. Page generated in 0.09160 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top