Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » [SOLVED] Is it possible to use java portion of code in RCPTT test case ?(#exec-process_command #read_xls_file #read_external_file #java #match_table_data)
icon5.gif  [SOLVED] Is it possible to use java portion of code in RCPTT test case ? [message #1711069] Mon, 12 October 2015 16:34 Go to next message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member

Dear all,
I have the following scenario.
It is possible to export data from a table in type format Microsoft Excel 97-2003 Worksheet (.xls)
I'd like to check in automatic way if data exported match with data in Application under test and I think to read the xls using Java.
Is it possible to mix java portion of code and RCPTT test case ?
If not have you got good tip to test it in automatic way using RCPTT ?

Thanks in advance guys.





"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova

[Updated on: Tue, 20 October 2015 10:01]

Report message to a moderator

Re: Is it possible to use java portion of code in RCPTT test case ? [message #1711121 is a reply to message #1711069] Tue, 13 October 2015 08:56 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Angelo,

You can try to use exec-process command for this purpose.

Kind regards,
Ulyana.
Re: Is it possible to use java portion of code in RCPTT test case ? [message #1711344 is a reply to message #1711121] Thu, 15 October 2015 08:07 Go to previous messageGo to next message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member

Hi dear Ulyana
I try to run a simple "Hello world" but probably the syntax it is not correct Rolling Eyes

below the command
exec-process -command "C:\\Prog\\Java\\jdk1.7.0_75\\bin\\java" -args "C:\\Users\\angelo.luciani\\workspace\\testhello\\bin\\testhello"


return
Execution failed, exit code: 1. Embarrassed

Please let me know.
Thanks in advance.


"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova

[Updated on: Thu, 15 October 2015 08:20]

Report message to a moderator

Re: Is it possible to use java portion of code in RCPTT test case ? [message #1711431 is a reply to message #1711344] Fri, 16 October 2015 02:18 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Angelo,

I've just tried on Mac and it works for me (with executable jar file):

exec-process -command "java" -args "-jar" -args "/Users/Ulik_MacAir/Documents/HelloWorld.jar"


Could you please also try to change your path, i.e.:

"\"C:\\Prog\\Java\\jdk1.7.0_75\\bin\\java\""


Kind regards,
Ulyana.
Re: Is it possible to use java portion of code in RCPTT test case ? [message #1711451 is a reply to message #1711431] Fri, 16 October 2015 08:40 Go to previous messageGo to next message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member

After various tentative I am able to run a test case without any errors using a jar file as Ulyana described a post before anyway in the console log regarding the AUT
C:\Users\angelo.luciani\rcpttWorkspace\.metadata\.plugins\org.eclipse.pde.core\xdm.client.rcp.xdm\console.log


I don't see the
system.out.println("Hello Word") 
that the testhello.jar file contains.

Below the command code I'm using Windows 7
exec-process -command "\"C:\\Prog\\Java\\jdk1.7.0_75\\bin\\java\"" -args "-jar" -args "\"C:\\Users\\angelo.luciani\\workspace\\testhello\\bin\\testhello.jar\""


Where I can see the system.out.println("Hello Word") printed ?


"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova

[Updated on: Fri, 16 October 2015 08:41]

Report message to a moderator

Re: Is it possible to use java portion of code in RCPTT test case ? [message #1711457 is a reply to message #1711451] Fri, 16 October 2015 09:35 Go to previous messageGo to next message
Ulyana Skorokhodova is currently offline Ulyana SkorokhodovaFriend
Messages: 280
Registered: July 2014
Senior Member
Hi Angelo,

To send output to Console, please, modify the script like shown below:

{code}

exec-process -command "\"C:\\Prog\\Java\\jdk1.7.0_75\\bin\\java\"" -args "-jar" -args "\"C:\\Users\\angelo.luciani\\workspace\\testhello\\bin\\testhello.jar\""| invoke getStdout | log

{code}

After that output will be shown in RCPTT Console.

Kind regards,
Ulyana.
Re: Is it possible to use java portion of code in RCPTT test case ? [message #1711919 is a reply to message #1711457] Tue, 20 October 2015 10:00 Go to previous message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member

It works ! I can see it in the log ! Thank you Ulyana ! You Rock !

"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova
Previous Topic:#Tool to transform get-item in global variables
Next Topic:Do you know if in RCP TT exists something like javadoc ?
Goto Forum:
  


Current Time: Thu Mar 28 23:19:26 GMT 2024

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

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

Back to the top