There are multiple equal conditions in if, why can’t the latter be recognized?
Please read the Groovy language documentation.
Likewise for the logical
&&
operator: if the left operand is false, it knows that the result will be false in any case, so it won’t evaluate the right operand. The right operand will be evaluated only if the left operand is true.
You can also reduce the number of parentheses you are using in your statement which could also be a concern. At least to declutter.
Something like:
if ((new_overlaylan_interface_type == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
5, index)) &&
(new_overlaylan_interfacerole == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
12, index)) &&
(new_overlaylan_ip == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
14, index)) &&
(new_overlaylan_describe == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
7, index)) &&
(new_overlaylan_vrrp == Boolean.valueOf(findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
15, index)) &&
(new_overlaylan_vrrp1num == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
18, index)) &&
(new_overlaylan_vrrp1ip == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
17, index)) &&
(new_overlaylan_vrrp1morb == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
19, index)) &&
(new_overlaylan_vrrp2morb == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
22, index)) &&
(new_overlaylan_vrrp2ip == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
20, index)) &&
(new_overlaylan_vrrp2num == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
21, index)) &&
(new_overlaylan_groupnum == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
16, index)) &&
(new_overlaylan_neilianip == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
13, index)) &&
(new_overlaylan_vlanid == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
10, index)) &&
(new_overlaylan_subinterface == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
9, index)) &&
(new_overlaylan_intfIdentifier == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
8, index)) &&
(new_overlaylan_intprefix == findTestData('Deploy/OverlayNetwork/Lan_Interface/Add_OverlayLan').getValue(
11, index))) {
'如果成功匹配打印成功'
println('success')
}