Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Why procedure doesn't return the same result ?
Why procedure doesn't return the same result ? [message #1728883] Fri, 08 April 2016 09:03 Go to next message
kkt8 Mising name is currently offline kkt8 Mising nameFriend
Messages: 22
Registered: September 2014
Junior Member
Hi,

I try to get an environment variable with a procedure using a java class.
Under RCPTT I've :
proc "get_env_var" {
	invoke-static 	-pluginId "myPlugin"
					-className "myPlugin.myClass"
					-methodName "myMethod"
					-args "monArg"
}

get_env_var | log


My java class :
public static String myMethod(String var) {
    	CUIPlugin.getDefault().logError("var : " + var);
    	CUIPlugin.getDefault().logError(" value : " + System.getenv(var));
    	return System.getenv(var) == null ? "" : System.getenv(var) ;
    }


I tried this java class and it's ok, I get the value of the variable !

I test this under RCPTT and it is not ok, the value is null !

Sad

Something I do wrong ?
thank you for your help ...
Re: Why procedure doesn't return the same result ? [message #1729126 is a reply to message #1728883] Mon, 11 April 2016 11:12 Go to previous messageGo to next message
Angelo Luciani is currently offline Angelo LucianiFriend
Messages: 129
Registered: September 2015
Location: Milan
Senior Member


// To run a java program
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


// Results in the log
// The log is located in C:\Users\...\rcpttWorkspace\.metadata\.plugins\org.eclipse.pde.core\xdm.client.rcp.xdm\console.log



"Ce sont les petits désirs qui rendent un jeune homme hardi."
Giovanni Giacomo Casanova
Re: Why procedure doesn't return the same result ? [message #1729788 is a reply to message #1728883] Tue, 19 April 2016 06:37 Go to previous messageGo to next message
kkt8 Mising name is currently offline kkt8 Mising nameFriend
Messages: 22
Registered: September 2014
Junior Member
Hi Angelo !

I don't understand your answer, I want to call a java method using invoke like this :
https://www.eclipse.org/rcptt/documentation/userguide/ecl/new-command-guide/

In your example, how can I pass the arguments ?

Thank you
Chris
Re: Why procedure doesn't return the same result ? [message #1729824 is a reply to message #1729788] Tue, 19 April 2016 11:30 Go to previous messageGo to next message
kkt8 Mising name is currently offline kkt8 Mising nameFriend
Messages: 22
Registered: September 2014
Junior Member
So, I tried to do with your example.
for information my jar works on a command prompt.

but under RCPTT I've an error : Execution failed, exit code: 1. at exec-process

My command :
exec-process -command "\"C:\\Program Files (x86)\\Java\\jre1.8.0_66\\bin\\java.exe\"" -args "-jar" -args "\"C:\\Users\\moi\\rcpttWorkspaceSystemWorkbench\\SystemWorkbenchTests\\utils\\Utils.jar\"" -args "arg passed to my jar" | invoke getStdout | log

Do you see anything wrong ?
Thank you Smile

[Updated on: Tue, 19 April 2016 12:03]

Report message to a moderator

Re: Why procedure doesn't return the same result ? [message #1730070 is a reply to message #1729824] Thu, 21 April 2016 09:10 Go to previous message
Andrey Sobolev is currently offline Andrey SobolevFriend
Messages: 75
Registered: February 2015
Member
Hi,

I think answer is here: https://www.eclipse.org/forums/index.php/t/1076733/

Best regards,
Andrey.
Previous Topic:Unable to use assertion mode to verify the items inside a tooltip
Next Topic:Unable to launch the application from RCPTT IDE
Goto Forum:
  


Current Time: Fri Mar 29 09:25:57 GMT 2024

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

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

Back to the top