From 17042f3c63e35ac73686caa2434e79ce0e2bcbee Mon Sep 17 00:00:00 2001 From: balaskoa <Jeno.Balasko@ericsson.com> Date: Tue, 13 Aug 2019 14:41:47 +0200 Subject: [PATCH] refined matching message + renaming to support java based usage Signed-off-by: balaskoa <Jeno.Balasko@ericsson.com> --- .../ConnectMapOperNegTest.ttcn | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn b/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn index 702b87277..078983b4f 100644 --- a/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn +++ b/regression_test/connectMapOperTest/ConnectMapOperNegTest.ttcn @@ -20,20 +20,21 @@ module ConnectMapOperNegTest { port loopbackPort p2; } - type component System { + type component System_ { port loopbackPort p1; port loopbackPort p2; } - testcase tc_neg_connect_after_map() runs on GeneralComp system System { + testcase tc_neg_connect_after_map() runs on GeneralComp system System_ { map(self:p1, system:p1); + template charstring t_expected := pattern "*Dynamic test case error: Connect operation cannot be performed on a mapped port \(p1\).*" @try { connect(self:p1, self:p2); setverdict(fail, "Connect operation succeeded. Expected error."); } @catch (msg) { - if (match(msg, "Dynamic test case error: Connect operation cannot be performed on a mapped port (p1).")) { + if (match(msg, t_expected)) { setverdict(pass); } else { @@ -43,15 +44,16 @@ module ConnectMapOperNegTest { setverdict(pass); } - testcase tc_neg_connect_after_map2() runs on GeneralComp system System { + testcase tc_neg_connect_after_map2() runs on GeneralComp system System_ { var GeneralComp v_comp := GeneralComp.create; + template charstring t_expected := pattern "*Dynamic test case error: Connect operation cannot be performed on a mapped port \(p1\).*" map(self:p1, system:p1); @try { connect(self:p1, v_comp:p2); setverdict(fail, "Connect operation succeeded. Expected error."); } @catch (msg) { - if (match(msg, "Dynamic test case error: Connect operation cannot be performed on a mapped port (p1).")) { + if (match(msg, t_expected)) { setverdict(pass); } else { @@ -61,15 +63,16 @@ module ConnectMapOperNegTest { setverdict(pass); } - testcase tc_neg_map_after_connect() runs on GeneralComp system System { + testcase tc_neg_map_after_connect() runs on GeneralComp system System_ { var GeneralComp v_comp := GeneralComp.create; + template charstring t_expected := pattern "*Dynamic test case error: Map operation is not allowed on a connected port \(p1\)." connect(self:p1, v_comp:p2); @try { map(self:p1, system:p1); setverdict(fail, "Connect operation succeeded. Expected error."); } @catch (msg) { - if (match(msg, "Dynamic test case error: Map operation is not allowed on a connected port (p1).")) { + if (match(msg, t_expected)) { setverdict(pass); } else { @@ -82,7 +85,6 @@ module ConnectMapOperNegTest { control{ execute(tc_neg_connect_after_map()); execute(tc_neg_connect_after_map2()); - execute(tc_neg_map_after_connect()); } } \ No newline at end of file -- GitLab