Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » nested context procs do not work(when an inline proc is moved to a context, exection fails)
nested context procs do not work [message #1774537] Mon, 16 October 2017 21:39 Go to next message
Eclipse UserFriend
OK I gve up...

this simple set of procs and test work fine if the procs are inline but fails with

Cannot match given parameters to declared parameters
at val (/testing/testing.test:59)
at test_it (/testing/testing.test:64)

if they are moved to context

here the are


// global [val designerProjectName "Application"]
// global [val projectCountFile [concat [substitute-variables "${system_property:java.io.tmpdir}"] "projectcount.txt"]]
/*
proc set_projectcount2 [val resetflag "NORESET" ]
[val debugflag "NODEBUG" ] {
exec-with-options {

let [val countfile [concat [substitute-variables "${system_property:java.io.tmpdir}"] "projectcount.txt"]] {

if [$debugflag | eq "DEBUG"] {
show-alert [concat "projectcount file:\n\n" $countfile]
}

if [get-file [uri-from-path $countfile] | get exists] {
log "set_projectcount: count file exists"
} -else {
str 1 | write-lines $countfile
}
let [val oldcount [read-lines [uri-from-path $countfile]]] {

if [$debugflag | eq "DEBUG"] {
show-alert [concat "oldcount: " $oldcount]
}

let [val nextcount [$oldcount | plus 1]] {

if [$debugflag | eq "DEBUG"] {
show-alert [concat "nextcount: " $nextcount]
}

if [$resetflag | not-eq "NORESET"] {
str 1 | write-lines $countfile
} -else {
$nextcount | str | write-lines $countfile
}

if [$debugflag | eq "DEBUG"] {
show-alert [concat "Result:\n\n"
+"file: " $countfile "\n\n"
+"oldcount: " $oldcount "\n\n"
+"newcount: " [read-lines [uri-from-path $countfile]]]
}

}
}
}

} -allowStatusDialog
}

proc get_projectlabel2 [val projectname $designerProjectName] {
set_projectcount2
let [val projectcount [read-lines [uri-from-path $projectCountFile]]] {
emit [concat $projectname $projectcount]
}
}
*/
proc test_it {
let [val label [get_projectlabel fred]] {
show-alert $label
}
}

test_it

late-breaking-news

I can run the set_projectcount proc from context but not the get_projectlabel proc

[Updated on: Mon, 16 October 2017 21:51] by Moderator

Report message to a moderator

Re: nested context procs do not work [message #1774569 is a reply to message #1774537] Tue, 17 October 2017 12:17 Go to previous messageGo to next message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Hi Walt,

At the time when RCPTT tries to read procedures from the context, there is no declared 'designerProjectName' variable.
Put this value into parameter context and add it to the test before 'ecl script' context.
Re: nested context procs do not work [message #1774677 is a reply to message #1774569] Wed, 18 October 2017 14:31 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your response. I see what you are saying, but I have an ecl context before it that sets the variable as a global. By-the-way when applying some ecl contexts that have one of the declared global variables as the default for a parameter I get and error that the variable is not defined, but at run time the script works fine. Strangely in this case the apply works fine but the run-time fails.

this is the context for the testing script:
global_variables
set_projectcount_proc
get_projectlabel_proc

this is the declare in global_variables

global [val designerProjectName "Application"]

[Updated on: Wed, 18 October 2017 14:32] by Moderator

Report message to a moderator

Re: nested context procs do not work [message #1775443 is a reply to message #1774677] Mon, 30 October 2017 09:14 Go to previous message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
I still cannot reproduce your issue: everything works as expected
What version of RCPTT do you use? Maybe there was a bug in the oldest versions that have been fixed. The latest release is 2.2.0, it is available here: https://eclipse.org/rcptt/download/

Also, it will be helpful if you attach full RCPTT project and RCPTT report with error
Previous Topic:RCPTT with Selenium
Next Topic:Random failures when loading eclipse projects lead to invalid configuration
Goto Forum:
  


Current Time: Thu Apr 25 14:48:49 GMT 2024

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

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

Back to the top