Running GWT JUnit on Eclipse

191 views
Skip to first unread message

Pion

unread,
Sep 21, 2009, 11:53:41 AM9/21/09
to Google Web Toolkit
I am following the instructions on http://code.google.com/webtoolkit/tutorials/1.6/JUnit.html.
I can run the junit successfully using command line. My environments
are: Eclipse-Galileo, GWT SDK 1.7 on Windows Vista.

However, I am having problem when trying to run it on Eclipse. Eclipse
gave me the following error message: "The input type of the launch
configuration does not exist".

I tried to follow the instructions on http://code.google.com/eclipse/docs/gwt_junit.html.
My Eclipse "Run" button is disabled -- I can not click it.

Thanks in advance for your help.

Jason Parekh

unread,
Sep 21, 2009, 12:41:04 PM9/21/09
to google-we...@googlegroups.com
Hi Pion,

Did the error you described ("The input type of the launch configuration does not exist") come when you were following the StockWatcher test instructions or the Google Plugin for Eclipse test instructions?

What error did you run into when you tried the Google Plugin for Eclipse test instructions (the second URL you mentioned)?

Thanks
jason

Pion

unread,
Sep 21, 2009, 1:21:32 PM9/21/09
to Google Web Toolkit
I got the error when following the instructions on
http://code.google.com/webtoolkit/tutorials/1.6/JUnit.html.

Following http://code.google.com/eclipse/docs/gwt_junit.html did not
give me any error. I went to Eclipse "Run -> Run Configurations ... "
which display a dialog box. But the "Run" button (on the dialog box)
has been disabled so I cannot run it.

On Sep 21, 9:41 am, Jason Parekh <jasonpar...@gmail.com> wrote:
> Hi Pion,
>
> Did the error you described ("The input type of the launch configuration
> does not exist") come when you were following the StockWatcher test
> instructions or the Google Plugin for Eclipse test instructions?
>
> What error did you run into when you tried the Google Plugin for Eclipse
> test instructions (the second URL you mentioned)?
>
> Thanks
> jason
>

Jason Parekh

unread,
Sep 21, 2009, 1:27:47 PM9/21/09
to google-we...@googlegroups.com
On Mon, Sep 21, 2009 at 1:21 PM, Pion <onle...@gmail.com> wrote:

I got the error when following the instructions on
Following http://code.google.com/eclipse/docs/gwt_junit.html did not
give me any error. I went to Eclipse "Run -> Run Configurations ... "
which display a dialog box. But the "Run" button (on the dialog box)
has been disabled so I cannot run it.

Could you try right-clicking on your test class and choosing Run as -> GWT Test case?

Thanks,
jason

 

Pion

unread,
Sep 21, 2009, 1:51:31 PM9/21/09
to Google Web Toolkit
I right-click on my java test file and select "Run As -> GWT Junit
Test". Then, I got the following error: "The input type of the launch
configuration does not exist".


On Sep 21, 10:27 am, Jason Parekh <jasonpar...@gmail.com> wrote:
> On Mon, Sep 21, 2009 at 1:21 PM, Pion <onlee2...@gmail.com> wrote:
>
> > I got the error when following the instructions on
> >http://code.google.com/webtoolkit/tutorials/1.6/JUnit.html.
>
> > Followinghttp://code.google.com/eclipse/docs/gwt_junit.htmldid not

Jason Parekh

unread,
Sep 21, 2009, 3:11:30 PM9/21/09
to google-we...@googlegroups.com
Strange!  Could you send us the contents of your WORKSPACE/.metadata/.log file?  It might have more detailed information about the error.

Thanks
jason

Pion

unread,
Sep 21, 2009, 5:20:48 PM9/21/09
to Google Web Toolkit
Sorry for the late reply. I just returned to my desk.

Where can I find those info? Can you give me more specific examples? I
can't seem to find them.

On Sep 21, 12:11 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> Strange!  Could you send us the contents of your WORKSPACE/.metadata/.log
> file?  It might have more detailed information about the error.
> Thanks
> jason
>

Jason Parekh

unread,
Sep 21, 2009, 5:29:01 PM9/21/09
to google-we...@googlegroups.com
No problem!

If you open your Eclipse workspace folder, there should be a folder called ".metadata".  Inside that, there should be a file called ".log".

I believe Windows hides these files by default, so you may need to use the command prompt to find this file (either that, or turn on the setting to show hidden files -- see http://windowshelp.microsoft.com/Windows/en-US/help/27e9a81a-fac7-457f-896b-e0017a04a59f1033.mspx )

If neither the file nor folder are present, then there may not be any detailed error logs.

jason

Pion

unread,
Sep 21, 2009, 6:27:49 PM9/21/09
to Google Web Toolkit
Unfortunately, there is no .metadata folder.

There are .settings, .classpath and .project.

On Sep 21, 2:29 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> No problem!
> If you open your Eclipse workspace folder, there should be a folder called
> ".metadata".  Inside that, there should be a file called ".log".
>
> I believe Windows hides these files by default, so you may need to use the
> command prompt to find this file (either that, or turn on the setting to
> show hidden files -- seehttp://windowshelp.microsoft.com/Windows/en-US/help/27e9a81a-fac7-457...)
>
> If neither the file nor folder are present, then there may not be any
> detailed error logs.
>
> jason
>

Jason Parekh

unread,
Sep 22, 2009, 10:43:25 AM9/22/09
to google-we...@googlegroups.com
Hi Pion,

Could you try the steps below?  I performed these locally and found success.

1) Extract GettingStarted.zip somewhere
2) Eclipse's File > Import > General > Existing projects, choose the extracted StockWatcher directory
3) Right-click on the StockWatcher project, and choose Properties.  Click on Google > Web Toolkit (on the side bar), and confirm there is a GWT SDK set for this project
4) Java Build Path, Libraries tab, Add Library button, JUnit from list, Next button, ensure JUnit 3 is being used, and Finish button and then OK button
5) Right-click on StockWatcher project, New > Source Folder named "test"
6) Create a package in there named "com.google.gwt.sample.stockwatcher.client"
7) Finally, paste the contents below into a new class in that package (named StockWatcherTest.java)
8) Right-click on this class, choose Run As > GWT JUnit Test

If I've screwed up anywhere in these directions, please let me know.  Hope this works!

jason

package com.google.gwt.sample.stockwatcher.client;

import com.google.gwt.junit.client.GWTTestCase;

/**
 * GWT JUnit tests must extend GWTTestCase.
 */
public class StockWatcherTest extends GWTTestCase {

/**
* Must refer to a valid module that sources this class.
*/
public String getModuleName() {
return "com.google.gwt.sample.stockwatcher.StockWatcher";
}

/**
* Add as many tests as you like.
*/
public void testSimple() {
assertTrue(true);
}

}

Pion

unread,
Sep 22, 2009, 11:58:01 AM9/22/09
to Google Web Toolkit
Thanks, Jason. I really appreciate your help.

I just followed your step-by-step instructions below. Unfortunately,
It still give me "The input type of the launch
configuration does not exist".

Also, I right-click the StockWatcherTest.java and select "Run As ->
Run Configurations", it shows the dialog box and the "Run" button is
disabled.

I don't know if this info will be helpful to you. This morning, I
created a unit test successfully on Eclipse-Galileo for my Google App
Engine by doing the following:

o I created a package com.foo.server.test under src
o Right-click on the package com.foo.server.test, select "New ->
Other ... -> JUnit Test Case ".
o I can run on Eclipse successfully.
o Also, the "Run" button is enabled when I went to "Run As -> Run
Configurations".

Again, thanks for your help.

On Sep 22, 7:43 am, Jason Parekh <jasonpar...@gmail.com> wrote:
> Hi Pion,

Pion

unread,
Sep 24, 2009, 9:31:02 PM9/24/09
to Google Web Toolkit
Jason,
I think I found what my problem was. Your step " 5) Right-click on
StockWatcher project, New > Source Folder named "test"" is the key.

It has to be "Source Folder" -- Just "Folder" will screw things up.

When I right-click the test java file, "Run As -> Run
Configurations ...", the "Run" button is enabled.
Also, I can run the Junit by right-click the test java file "Run As ->
GWT JUnit Test".

Again, thanks for your help! You are the BEST!

On Sep 22, 8:58 am, Pion <onlee2...@gmail.com> wrote:
> Thanks, Jason. I really appreciate your help.
>
> I just followed your step-by-step instructions below. Unfortunately,
> It still give me "The input type of the launch
> configuration doesnotexist".
>
> Also, I right-click the StockWatcherTest.java and select "RunAs ->RunConfigurations", it shows the dialog box and the "Run" button is
> disabled.
>
> I don't know if this info will be helpful to you. This morning, I
> created a unit test successfully onEclipse-Galileo for my Google App
> Engine by doing the following:
>
> o I created a package com.foo.server.test under src
> o Right-click on the package com.foo.server.test, select "New ->
> Other ... ->JUnitTest Case ".
> o IcanrunonEclipsesuccessfully.
> o Also, the "Run" button is enabled when I went to "RunAs ->Run
> Configurations".
>
> Again, thanks for your help.
>
> On Sep 22, 7:43 am, Jason Parekh <jasonpar...@gmail.com> wrote:
>
> > Hi Pion,
> > Could you try the steps below?  I performed these locally and found success.
>
> > 1) Extract GettingStarted.zip somewhere
> > 2)Eclipse'sFile > Import > General > Existing projects, choose the
> > extracted StockWatcher directory
> > 3) Right-click on the StockWatcher project, and choose Properties.  Click on
> > Google > Web Toolkit (on the side bar), and confirm there is a GWT SDK set
> > for this project
> > 4) Java Build Path, Libraries tab, Add Library button,JUnitfrom list, Next
> > button, ensureJUnit3 is being used, and Finish button and then OK button
> > 5) Right-click on StockWatcher project, New > Source Folder named "test"
> > 6) Create a package in there named
> > "com.google.gwt.sample.stockwatcher.client"
> > 7) Finally, paste the contents below into a new class in that package (named
> > StockWatcherTest.java)
> > 8) Right-click on this class, chooseRunAs > GWTJUnitTest
>
> > If I've screwed up anywhere in these directions, please let me know.  Hope
> > this works!
>
> > jason
>
> > package com.google.gwt.sample.stockwatcher.client;
>
> > import com.google.gwt.junit.client.GWTTestCase;
>
> > /**
> >  * GWTJUnittests must extend GWTTestCase.
> >  */
> > public class StockWatcherTest extends GWTTestCase {
>
> > /**
> >  * Must refer to a valid module that sources this class.
> >  */
> > public String getModuleName() {
> > return "com.google.gwt.sample.stockwatcher.StockWatcher";
> >  }
>
> > /**
> >  * Add as many tests as you like.
> >  */
> > public void testSimple() {
> > assertTrue(true);
> >  }
>
> > }
> > On Mon, Sep 21, 2009 at 6:27 PM, Pion <onlee2...@gmail.com> wrote:
>
> > > Unfortunately, there is no .metadata folder.
>
> > > There are .settings, .classpath and .project.
>
> > > On Sep 21, 2:29 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> > > > No problem!
> > > > If you open yourEclipseworkspace folder, there should be a folder
> > > called
> > > > ".metadata".  Inside that, there should be a file called ".log".
>
> > > > I believe Windows hides these files by default, so you may need to use
> > > the
> > > > command prompt to find this file (either that, or turn on the setting to
> > > > show hidden files -- seehttp://
> > > windowshelp.microsoft.com/Windows/en-US/help/27e9a81a-fac7-457...)
>
> > > > If neither the file nor folder are present, then there maynotbe any
> > > > detailed error logs.
>
> > > > jason
>
> > > > On Mon, Sep 21, 2009 at 5:20 PM, Pion <onlee2...@gmail.com> wrote:
>
> > > > > Sorry for the late reply. I just returned to my desk.
>
> > > > > WherecanI find those info?Canyou give me more specific examples? I
> > > > >can't seem to find them.
>
> > > > > On Sep 21, 12:11 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> > > > > > Strange!  Could you send us the contents of your
> > > WORKSPACE/.metadata/.log
> > > > > > file?  It might have more detailed information about the error.
> > > > > > Thanks
> > > > > > jason
>
> > > > > > On Mon, Sep 21, 2009 at 1:51 PM, Pion <onlee2...@gmail.com> wrote:
>
> > > > > > > I right-click on my java test file and select "RunAs -> GWTJunit
> > > > > > > Test". Then, I got the following error: "The input type of the
> > > launch
> > > > > > > configuration doesnotexist".
>
> > > > > > > On Sep 21, 10:27 am, Jason Parekh <jasonpar...@gmail.com> wrote:
> > > > > > > > On Mon, Sep 21, 2009 at 1:21 PM, Pion <onlee2...@gmail.com>
> > > wrote:
>
> > > > > > > > > I got the error when following the instructions on
> > > > > > > > >http://code.google.com/webtoolkit/tutorials/1.6/JUnit.html.
>
> > > > > > > > > Followinghttp://
> > > code.google.com/eclipse/docs/gwt_junit.htmldidnot
> > > > > > > > > give me any error. I went toEclipse"Run->RunConfigurations
> > > ...
> > > > > "
> > > > > > > > > which display a dialog box. But the "Run" button (on the dialog
> > > > > box)
> > > > > > > > > has been disabled so I cannotrunit.
>
> > > > > > > > Could you try right-clicking on your test class and choosingRun
> > > as
> > > > > ->
> > > > > > > GWT
> > > > > > > > Test case?
>
> > > > > > > > Thanks,
> > > > > > > > jason
>
> > > > > > > > > On Sep 21, 9:41 am, Jason Parekh <jasonpar...@gmail.com>
> > > wrote:
> > > > > > > > > > Hi Pion,
>
> > > > > > > > > > Did the error you described ("The input type of the launch
> > > > > > > configuration
> > > > > > > > > > doesnotexist") come when you were following the
> > > StockWatcher
> > > > > test
> > > > > > > > > > instructions or the Google Plugin forEclipsetest
> > > instructions?
>
> > > > > > > > > > What error did youruninto when you tried the Google Plugin
> > > for
> > > > > > >Eclipse
> > > > > > > > > > test instructions (the second URL you mentioned)?
>
> > > > > > > > > > Thanks
> > > > > > > > > > jason
>
> > > > > > > > > > On Mon, Sep 21, 2009 at 11:53 AM, Pion <onlee2...@gmail.com>
> > > > > wrote:
>
> > > > > > > > > > > I am following the instructions on
> > > > > > > > > > >http://code.google.com/webtoolkit/tutorials/1.6/JUnit.html.
> > > > > > > > > > > Icanrunthejunitsuccessfully using command line. My
> > > > > > > environments
> > > > > > > > > > > are:Eclipse-Galileo, GWT SDK 1.7 on Windows Vista.
>
> > > > > > > > > > > However, I am having problem when trying torunit on
> > >Eclipse.
> > > > > > >Eclipse
> > > > > > > > > > > gave me the following error message: "The input type of the
> > > > > launch
> > > > > > > > > > > configuration doesnotexist".
>
> > > > > > > > > > > I tried to follow the instructions on
> > > > > > > > > > >http://code.google.com/eclipse/docs/gwt_junit.html.
> > > > > > > > > > > MyEclipse"Run" button is disabled -- Icannotclick it.
Reply all
Reply to author
Forward
0 new messages