Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » check values from table column
check values from table column [message #1780210] Thu, 18 January 2018 15:51 Go to next message
Fabian Bo is currently offline Fabian BoFriend
Messages: 10
Registered: January 2018
Junior Member
Hey guys,

i have to check the response time values of the table column if they are between 0.141 and 0.741
Can someone please tell me how to get the right output type for the "between" command or why my code is not working?

read-csv-file "workspace:/InfrastructureComponent_Example/Usage_Scenario_defaultUsageScenario_Response_Time_Tuple.csv" | select-columns "Response Time[s]" | to-list | foreach {between -left 0.141 -right 0.741 | verify-true}

Many thanks
Fabian


PS: the table looks like this:

Point in Time[s],Response Time[s]
0.611,0.611
6.252,0.641
11.823,0.5709999999999997
Re: check values from table column [message #1780382 is a reply to message #1780210] Mon, 22 January 2018 04:30 Go to previous messageGo to next message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Hi Fabian,

Try to use 'gt "0.141" | and [lt "0.741"]'
https://hudson.eclipse.org/rcptt/job/rcptt-all/ws/releng/doc/target/doc/ecl/index.html#gt
https://hudson.eclipse.org/rcptt/job/rcptt-all/ws/releng/doc/target/doc/ecl/index.html#lt
Re: check values from table column [message #1780411 is a reply to message #1780382] Mon, 22 January 2018 09:29 Go to previous messageGo to next message
Fabian Bo is currently offline Fabian BoFriend
Messages: 10
Registered: January 2018
Junior Member
thanks for your help. it seems that the input object isnt formatted as a number. i get the following error:

Cannot convert argument to number: 'org.eclipse.rcptt.ecl.core.impl.EclListImpl@51d4826c'
at gt (/ Infrastructure Component Test.test:40)



Re: check values from table column [message #1780414 is a reply to message #1780411] Mon, 22 January 2018 09:53 Go to previous messageGo to next message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Hi Fabian,

'select-columns' produces 'Table' object. No need to use 'to-list' command.

Example of work with Table object:
let [val table [read-csv-file "file.csv"]] {
	$table | list [get rows] | each [val row] {
		$row | list [get values] | each [val value] {
			log $value
		}
	}
}


Please, check the documentation:
https://hudson.eclipse.org/rcptt/job/rcptt-all/ws/releng/doc/target/doc/ecl/index.html#select-columns
https://hudson.eclipse.org/rcptt/job/rcptt-all/ws/releng/doc/target/doc/ecl/index.html#each
https://hudson.eclipse.org/rcptt/job/rcptt-all/ws/releng/doc/target/doc/ecl/index.html#read-csv-file
https://hudson.eclipse.org/rcptt/job/rcptt-all/ws/releng/doc/target/doc/ecl/index.html#read-excel-file

[Updated on: Mon, 22 January 2018 09:54]

Report message to a moderator

Re: check values from table column [message #1780466 is a reply to message #1780414] Mon, 22 January 2018 21:01 Go to previous messageGo to next message
Fabian Bo is currently offline Fabian BoFriend
Messages: 10
Registered: January 2018
Junior Member
Hey Viktoria,

thanks for your quick help!
i read the documentation before, but unfortunately the examples have not been so helpful. I suspected that it is related to the table object. that's why Im asking :D
Thank you for your code suggestion, I have taken this and still get the following convert error:

Quote:
Cannot convert value '0.631' from String to Long
at gt (Infrastructure Component Test.test:42)


probably "abs" should help to convert the string into long, but i didnt understand the right syntax :(

read-csv-file "workspace:/InfrastructureComponent_Example/Usage_Scenario_defaultUsageScenario_Response_Time_Tuple.csv" | select-columns "Response Time[s]" | list [get rows] | each [val row] {
	$row | list [get values] | each [val value] {
		$value | gt "0.141" | and [lt "0.741"] | verify-true
	}
}


Re: check values from table column [message #1780476 is a reply to message #1780466] Tue, 23 January 2018 05:11 Go to previous messageGo to next message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Try to use 'float' command:
and [float $value | gt [float "0.141"]] [float $value | lt [float "0.741"]] | verify-true
Re: check values from table column [message #1780485 is a reply to message #1780476] Tue, 23 January 2018 08:54 Go to previous message
Fabian Bo is currently offline Fabian BoFriend
Messages: 10
Registered: January 2018
Junior Member
thanks! that works fine :)
Previous Topic: Get item text based on the index no. from a table
Next Topic:Does not support Eclipse RAP 3.4?
Goto Forum:
  


Current Time: Thu Apr 25 22:17:23 GMT 2024

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

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

Back to the top