Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Application error on rcp using headless testing framework
Application error on rcp using headless testing framework [message #487959] Fri, 25 September 2009 04:47 Go to next message
John Reysa is currently offline John Reysa
Messages: 21
Registered: July 2009
Junior Member
I tried the following steps:
1. Created an rcp product and can successfully launch it from product
editor
2. I have all the swtbot and headless testing plugins in the target
platform.
3. I exported the product (for testing) which includes the swtbot and
headless testing (junit 4 only) plugins.
4. I unzipped the rcp product, cd to the eclipse directory and ran the
following:

java -Xms128M -Xmx368M -XX:MaxPermSize=256M -DPLUGIN_PATH= -classpath
C:\tmp\hdwb3\eclipse\plugins\org.eclipse.equinox.launcher_*. jar
org.eclipse.core.launcher.Main -application
org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -clean
-data workspace
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,allTestsJunitSummary.xml
-testPluginName com.ibm.hdwb.support.junit -className
com.ibm.hdwb.support.junit.AllTests -os win32 -ws win32 -arch x86
-consoleLog -debug

The result was:

Starting application: 9937
!SESSION 2009-09-24 23:43:28.406
-----------------------------------------------

eclipse.buildId=unknown
java.fullversion=J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32
vmwi3260sr5-20090519_3
5743 (JIT enabled, AOT enabled)
J9VM - 20090519_035743_lHdSMr
JIT - r9_20090518_2017
GC - 20090417_AA
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: -application
org.eclipse.swtbot.eclipse.junit4.headless.sw
tbottestapplication
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU
nitResultFormatter,allTestsJunitSummary.xml -testPluginName
com.ibm.hdwb.support
..junit -className com.ibm.hdwb.support.junit.AllTests
Command-line arguments: -application
org.eclipse.swtbot.eclipse.junit4.headless
..swtbottestapplication -clean -data workspace
formatter=org.apache.tools.ant.tas
kdefs.optional.junit.XMLJUnitResultFormatter,allTestsJunitSu mmary.xml
-testPlugi
nName com.ibm.hdwb.support.junit -className
com.ibm.hdwb.support.junit.AllTests
-os win32 -ws win32 -arch x86 -consoleLog -debug

!ENTRY org.eclipse.osgi 4 0 2009-09-24 23:43:38.406
!MESSAGE Application error
!STACK 1
junit.framework.AssertionFailedError: null
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at junit.framework.Assert.assertNotNull(Assert.java:214)
at junit.framework.Assert.assertNotNull(Assert.java:207)
at
org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .getAppli
cation(UITestApplication.java:94)
at
org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .run(UITe
stApplication.java:54)
at
org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .start(UI
TestApplication.java:203)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandl
e.java:194)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runAppli
cation(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Ec
lipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.ja
va:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.ja
va:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAcces
sorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
at org.eclipse.core.launcher.Main.main(Main.java:34)

Thanks for any help you can provide.
Re: Application error on rcp using headless testing framework [message #488688 is a reply to message #487959] Tue, 29 September 2009 18:18 Go to previous messageGo to next message
John Reysa is currently offline John Reysa
Messages: 21
Registered: July 2009
Junior Member
John Reysa wrote:
> I tried the following steps:
> 1. Created an rcp product and can successfully launch it from product
> editor
> 2. I have all the swtbot and headless testing plugins in the target
> platform.
> 3. I exported the product (for testing) which includes the swtbot and
> headless testing (junit 4 only) plugins.
> 4. I unzipped the rcp product, cd to the eclipse directory and ran the
> following:
>
> java -Xms128M -Xmx368M -XX:MaxPermSize=256M -DPLUGIN_PATH= -classpath
> C:\tmp\hdwb3\eclipse\plugins\org.eclipse.equinox.launcher_*. jar
> org.eclipse.core.launcher.Main -application
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -clean
> -data workspace
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,allTestsJunitSummary.xml
> -testPluginName com.ibm.hdwb.support.junit -className
> com.ibm.hdwb.support.junit.AllTests -os win32 -ws win32 -arch x86
> -consoleLog -debug
>

Ketan, it looks like it cannot find an extension in UITestApplication.
Do the steps in the previous post look correct for exporting the RCP
project?

IExtension extension =
Platform.getExtensionRegistry().getExtension(
Platform.PI_RUNTIME,
Platform.PT_APPLICATIONS,
getApplicationToRun(args));

// If no 3.0 extension can be found, search the registry
// for the pre-3.0 default workbench application, i.e. org.eclipse
ui.workbench
// Set the deprecated flag to true
if (extension == null) {
extension = Platform.getExtensionRegistry().getExtension(
Platform.PI_RUNTIME,
Platform.PT_APPLICATIONS,
DEFAULT_APP_PRE_3_0);
fInDeprecatedMode = true;
}

Assert.assertNotNull(extension);
Re: Application error on rcp using headless testing framework [message #488689 is a reply to message #488688] Tue, 29 September 2009 18:48 Go to previous messageGo to next message
John Reysa is currently offline John Reysa
Messages: 21
Registered: July 2009
Junior Member
John Reysa wrote:
> John Reysa wrote:
>> I tried the following steps:
>> 1. Created an rcp product and can successfully launch it from product
>> editor
>> 2. I have all the swtbot and headless testing plugins in the target
>> platform.
>> 3. I exported the product (for testing) which includes the swtbot and
>> headless testing (junit 4 only) plugins.
>> 4. I unzipped the rcp product, cd to the eclipse directory and ran
>> the following:
>>
>> java -Xms128M -Xmx368M -XX:MaxPermSize=256M -DPLUGIN_PATH= -classpath
>> C:\tmp\hdwb3\eclipse\plugins\org.eclipse.equinox.launcher_*. jar
>> org.eclipse.core.launcher.Main -application
>> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion
>> -clean -data workspace
>> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,allTestsJunitSummary.xml
>> -testPluginName com.ibm.hdwb.support.junit -className
>> com.ibm.hdwb.support.junit.AllTests -os win32 -ws win32 -arch x86
>> -consoleLog -debug
>>
>
> Ketan, it looks like it cannot find an extension in UITestApplication.
> Do the steps in the previous post look correct for exporting the RCP
> project?
>
> IExtension extension =
> Platform.getExtensionRegistry().getExtension(
> Platform.PI_RUNTIME,
> Platform.PT_APPLICATIONS,
> getApplicationToRun(args));
>
> // If no 3.0 extension can be found, search the registry
> // for the pre-3.0 default workbench application, i.e.
> org.eclipse ui.workbench
> // Set the deprecated flag to true
> if (extension == null) {
> extension = Platform.getExtensionRegistry().getExtension(
> Platform.PI_RUNTIME,
> Platform.PT_APPLICATIONS,
> DEFAULT_APP_PRE_3_0);
> fInDeprecatedMode = true;
> }
>
> Assert.assertNotNull(extension);
>

Looks like the swtbottestapplication takes an argument
-testApplication <rcpApplication>

This makes sense as I was wondering how the test knew to run against the
rcp application.

So the following invocation
java -Xms128M -Xmx368M -XX:MaxPermSize=256M -DPLUGIN_PATH= -classpath
C:\tmp\hdwb3\eclipse\plugins\org.eclipse.equinox.launcher_*. jar
org.eclipse.core.launcher.Main -application
org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -clean
-data workspace -testApplication com.ibm.hdwb.client.ui.HDWB
formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,allTestsJunitSummary.xml
-testPluginName com.ibm.hdwb.support.junit -className
com.ibm.hdwb.support.junit.AllTests -os win32 -ws win32 -arch x86
-consoleLog -debug

Brings up the application ui.
I get another exception. I'll open a separate thread if I can't figure
it out.
Re: Application error on rcp using headless testing framework [message #488734 is a reply to message #487959] Wed, 30 September 2009 02:24 Go to previous message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
Ant execution and command line args are mentioned on the wiki at
http://wiki.eclipse.org/SWTBot/Ant.

You may also look at the ant script for the command line arguments. I'd
recommend using the ant scripts since they do lot more validation about
various execution params.

--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr

On 25/09/09 10:17 AM, John Reysa wrote:
> I tried the following steps:
> 1. Created an rcp product and can successfully launch it from product
> editor
> 2. I have all the swtbot and headless testing plugins in the target
> platform.
> 3. I exported the product (for testing) which includes the swtbot and
> headless testing (junit 4 only) plugins.
> 4. I unzipped the rcp product, cd to the eclipse directory and ran the
> following:
>
> java -Xms128M -Xmx368M -XX:MaxPermSize=256M -DPLUGIN_PATH= -classpath
> C:\tmp\hdwb3\eclipse\plugins\org.eclipse.equinox.launcher_*. jar
> org.eclipse.core.launcher.Main -application
> org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplica tion -clean
> -data workspace
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU nitResultFormatter,allTestsJunitSummary.xml
> -testPluginName com.ibm.hdwb.support.junit -className
> com.ibm.hdwb.support.junit.AllTests -os win32 -ws win32 -arch x86
> -consoleLog -debug
>
> The result was:
>
> Starting application: 9937
> !SESSION 2009-09-24 23:43:28.406
> -----------------------------------------------
>
> eclipse.buildId=unknown
> java.fullversion=J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32
> vmwi3260sr5-20090519_3
> 5743 (JIT enabled, AOT enabled)
> J9VM - 20090519_035743_lHdSMr
> JIT - r9_20090518_2017
> GC - 20090417_AA
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
> Framework arguments: -application
> org.eclipse.swtbot.eclipse.junit4.headless.sw
> tbottestapplication
> formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJU
> nitResultFormatter,allTestsJunitSummary.xml -testPluginName
> com.ibm.hdwb.support
> ..junit -className com.ibm.hdwb.support.junit.AllTests
> Command-line arguments: -application
> org.eclipse.swtbot.eclipse.junit4.headless
> ..swtbottestapplication -clean -data workspace
> formatter=org.apache.tools.ant.tas
> kdefs.optional.junit.XMLJUnitResultFormatter,allTestsJunitSu mmary.xml
> -testPlugi
> nName com.ibm.hdwb.support.junit -className
> com.ibm.hdwb.support.junit.AllTests
> -os win32 -ws win32 -arch x86 -consoleLog -debug
>
> !ENTRY org.eclipse.osgi 4 0 2009-09-24 23:43:38.406
> !MESSAGE Application error
> !STACK 1
> junit.framework.AssertionFailedError: null
> at junit.framework.Assert.fail(Assert.java:47)
> at junit.framework.Assert.assertTrue(Assert.java:20)
> at junit.framework.Assert.assertNotNull(Assert.java:214)
> at junit.framework.Assert.assertNotNull(Assert.java:207)
> at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .getAppli
> cation(UITestApplication.java:94)
> at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .run(UITe
> stApplication.java:54)
> at org.eclipse.swtbot.eclipse.junit4.headless.UITestApplication .start(UI
> TestApplication.java:203)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandl
> e.java:194)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runAppli
> cation(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Ec
> lipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.ja
> va:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.ja
> va:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.
> java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAcces
> sorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:599)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
> at org.eclipse.core.launcher.Main.main(Main.java:34)
>
> Thanks for any help you can provide.
Previous Topic:Returning to a base state after an error...?
Next Topic:Enhancement suggestions for the WithId matcher
Goto Forum:
  


Current Time: Fri Oct 31 12:21:30 GMT 2014

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

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