Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Talend tAssert component issue

Hi there,

 

I am currently developping my Unit Test to check my developments.

 

I have an issue with a tAssert component, when I compare 2 integer which came from a tSetGlobalVar component.

 

I have this in my tAssert Expression field :

((Integer)globalMap.get("countRows"))==((Integer)globalMap.get("NbMunicipalityExtract"))

 

This assertion results always by a "Test logically failed" status.

 

I am 100% sure that I have exactly the same value in the 2 variables, because I have set this in the Description field of my tAssert :

"Check current count :  " + ((Integer)globalMap.get("countRows")) + " == " + ((Integer)globalMap.get("NbMunicipalityExtract"))

 

And I can see that in the results :

Check current count :  382 == 382

 

How can I fix that ?

If I do this in the Expression field :

((Integer)globalMap.get("countRows"))==382 

or
382==((Integer)globalMap.get("NbMunicipalityExtract")),

then the result of the assertion is OK.

 

Is that an issue with the component ?

 

I use Talend ESB 7.0.1.

 

Thanks for your help !

 

 

 

 

 

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

Hi,

 

there are many similar topics there, the answer is - for compare Integer you can not use ==

 

you could use equals() - https://stackoverflow.com/questions/1514910/how-to-properly-compare-two-integers-in-java

View solution in original post

2 Replies
vapukov
Master II
Master II

Hi,

 

there are many similar topics there, the answer is - for compare Integer you can not use ==

 

you could use equals() - https://stackoverflow.com/questions/1514910/how-to-properly-compare-two-integers-in-java

Anonymous
Not applicable
Author

Thanks Vapukov for your help !