Commit 7d1af68d authored by balaskoa's avatar balaskoa
Browse files

New testcases have been mapped from titan.core 5


Signed-off-by: default avatarbalaskoa <Jeno.Balasko@ericsson.com>
parent 44f26da1
......@@ -33,6 +33,12 @@
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
<FileResource>
<FilePath>src/commProcedure/AdvancedRedirects.ttcn</FilePath>
<FileProperties>
<ExcludeFromBuild>true</ExcludeFromBuild>
</FileProperties>
</FileResource>
</FileProperties>
<FolderProperties>
<FolderResource>
......
......@@ -12,6 +12,15 @@
testerlanc # exec time: 40sec
#any_from:
any_from #only in parallel
#checkstate:
PortCheckstate.control #only in parallel
#commMessage:
TcommMessage.control #ok, only in parallel
HS41022.control #ok, only in parallel
#commProcedure:
#AdvancedRedirects.control #TODO: contains java sem errors in the generated code !
#test ports required!
ProcPort.control #only in parallel
[ORDERED_INCLUDE]
......
......@@ -23,15 +23,15 @@
#"src/assignmentNotation/TassignmentNotation.cfg" #Verdict Statistics: 0 none (0 %), 7 pass (100 %), 0 inconc (0 %), 0 fail (0 %), 0 error (0 %)
#HACK: escaped double quote added, ass. not. nok Error message:
# Error while setting parameter field 'tsp_editor' to 'vim': Referenced module parameter cannot be found. Module `vim' does not exist, and no parameter with name `vim' exists in any module.
"src/ucharstrOper/config.cfg"
[EXECUTE]
#all_from_with_functions #TODO: JSON enc-dec function handling,
#encdec_OK #TODO: JSON, BER encoder
#TbitstrOper.tc__value_list_bs #fails
cstr_content.tc_unichar_utf8_mp2
#cstr_content.tc_unichar_utf8_mp2
#TcharstrOper.tc_altstep_cs_idx # bring back the uncommented test!
TmultipleRedirects.commMessageDecodedValueRedirect #error JSON encode is missing
[LOGGING]
......
......@@ -65,7 +65,24 @@ TboolOper.control
#ordered_include - excluded, cannot executed in one step
#testport_parameters -excluded, TODO
#
#charOper
TcharOper.control
#charstrOper
TcharstrOper.control
#checkstate:
# PortCheckstate.control #only in parallel
#commMessage:
AddressPortNegTest
#TcommMessage.control #ok, only in parallel
#HS41022.control #ok, only in parallel
TmultipleRedirects.commMessageMultiValueRedirect
#TmultipleRedirects.commMessageDecodedValueRedirect #TODO: error JSON encode is missing
#commProcedure #par
#AdvancedRedirects.control #TODO: contains java sem errors in the generated code !
#test ports required!
#ProcPort.control #only in parallel
#json (There are testcases commented out in it!! In preinit of JsonTypes it stops with exception)
#AttributeTestcases.control
#JsonTestcases.control
......@@ -148,12 +165,10 @@ TbasicStatem.control
TtemplateChar.control
#tryCatch_Functions.control
TtemplateBool.control
TcharOper.control
TcontrolTimer.control
TrecofOper.control
SelectUnion.control
TtemplateEnum.control
TcharstrOper.control
TtemplateRec.control
TassignmentNotation.control
IsTemplateKind.control
......@@ -205,7 +220,9 @@ TsetofOper.control
#"src/cfgFile/ordered_include/oi_after_list1.cfg" #Error while setting parameter field 'tsp_c' to '0': Type mismatch: charstring value was expected instead of null.
#"src/cfgFile/testport_parameters/array_index.cfg" #compiled, not runnining, it shall be excluded anyway!!!
"src/ucharstrOper/config.cfg" # Bugfixed: UTF8Testcases.control stops with error
"src/ucharstrOper/config.cfg"
[LOGGING]
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).
......
......@@ -16,7 +16,7 @@
// char type is no longer a standalone type, it maps to charstring in the standard
module TcharOper
{
type char typedefbasic_mychar;
type char typedefbasic_mychar;
const char TcharOper_const1:="h";
type component charOper_comptype { };
......
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Szabo, Janos Zoltan – initial implementation
#
###############################################################################
[MODULE_PARAMETERS]
[LOGGING]
Logfile := "charOper.log"
FileMask := LOG_ALL
ConsoleMask := TTCN_WARNING | TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS
[EXECUTE]
TcharOper
###############################################################################
# Copyright (c) 2000-2019 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Balasko, Jeno
# Szabo, Janos Zoltan – initial implementation
#
###############################################################################
[MODULE_PARAMETERS]
[LOGGING]
Logfile := "charstrOper.log"
FileMask := LOG_ALL
ConsoleMask := TTCN_WARNING | TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS
[EXECUTE]
TcharstrOper
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Szabo, Bence Janos
*
******************************************************************************/
module PortCheckstate
{
type port MyPort message
{
inout charstring
} with { extension "internal" }
type component MyMTCType
{
port MyPort MyPCO1;
port MyPort MyPCO2;
}
type component MTCType
{
port MyPort MyPCO3;
port MyPort MyPCO4;
}
testcase tc_checkstate() runs on MyMTCType system MTCType
{
var boolean myPortState;
var charstring started := "Started";
myPortState := MyPCO1.checkstate(started) and MyPCO2.checkstate("Started");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := MyPCO1.checkstate("Linked");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
map(mtc:MyPCO2, system:MyPCO4);
myPortState := MyPCO2.checkstate("Linked");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := MyPCO2.checkstate("Mapped");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := MyPCO2.checkstate("Connected");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO2, system:MyPCO4);
var MyMTCType myComp1 := MyMTCType.create;
connect(myComp1:MyPCO2, mtc:MyPCO2);
myPortState := MyPCO2.checkstate("Connected");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
disconnect(myComp1:MyPCO2, mtc:MyPCO2);
myPortState := MyPCO2.checkstate("Connected");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO2, system:MyPCO4);
myPortState := MyPCO2.checkstate("Mapped");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := MyPCO2.checkstate("Linked");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
all port.stop;
if(MyPCO2.checkstate("Stopped")) {
setverdict(pass);
} else {
setverdict(fail);
}
}
testcase tc_any_checkstate() runs on MyMTCType system MTCType
{
var boolean myPortState;
myPortState := any port.checkstate("Started");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := any port.checkstate("Linked");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
map(mtc:MyPCO2, system:MyPCO4);
myPortState := any port.checkstate("Linked");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := any port.checkstate("Mapped");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := any port.checkstate("Connected");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO2, system:MyPCO4);
var MyMTCType myComp1 := MyMTCType.create;
connect(myComp1:MyPCO2, mtc:MyPCO2);
myPortState := any port.checkstate("Connected");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
disconnect(myComp1:MyPCO2, mtc:MyPCO2);
myPortState := any port.checkstate("Connected");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO2, system:MyPCO4);
myPortState := any port.checkstate("Mapped");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := any port.checkstate("Linked");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
all port.stop;
if(any port.checkstate("Stopped")) {
setverdict(pass);
} else {
setverdict(fail);
}
}
testcase tc_all_checkstate() runs on MyMTCType system MTCType
{
var boolean myPortState := all port.checkstate("Started");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := all port.checkstate("Linked");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
map(mtc:MyPCO1, system:MyPCO3);
myPortState := all port.checkstate("Linked");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := all port.checkstate("Mapped");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
map(mtc:MyPCO2, system:MyPCO4);
myPortState := all port.checkstate("Linked");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := all port.checkstate("Mapped");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
myPortState := all port.checkstate("Connected");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO1, system:MyPCO3);
var MyMTCType myComp1 := MyMTCType.create;
connect(myComp1:MyPCO1, mtc:MyPCO1);
myPortState := all port.checkstate("Connected");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO2, system:MyPCO4);
var MyMTCType myComp2 := MyMTCType.create;
connect(myComp2:MyPCO2, mtc:MyPCO2);
myPortState := all port.checkstate("Connected");
if(myPortState == true) {
setverdict(pass);
}else {
setverdict(fail);
}
disconnect(myComp1:MyPCO1, mtc:MyPCO1);
myPortState := all port.checkstate("Connected");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO2, system:MyPCO4);
myPortState := all port.checkstate("Mapped");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
unmap(mtc:MyPCO1, system:MyPCO3);
myPortState := all port.checkstate("Linked");
if(myPortState == false) {
setverdict(pass);
}else {
setverdict(fail);
}
all port.stop;
if(all port.checkstate("Stopped")) {
setverdict(pass);
} else {
setverdict(fail);
}
}
control
{
execute(tc_checkstate());
execute(tc_any_checkstate());
execute(tc_all_checkstate());
}
}
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Szabo, Bence Janos
*
******************************************************************************/
module AddressPortNegTest {
type record SIP_address_type
{
charstring host optional, // hostname, IPv4 or IPv6
integer portField optional, // represented as an integer
boolean tcporudp optional // true if TCP false if UDP
}
type SIP_address_type address;
type port PortType1 message {
inout integer;
} with {extension "address"}
type port PortType2 message {
inout integer;
}
type component TestCaseComp {
port PortType1 p1;
}
type component TestCaseComp2 {
port PortType2 p1;
}
type component SystemComp {
port PortType1 p1;
}
testcase tc_neg_address_port_not_mapped() runs on TestCaseComp system SystemComp {
var address v_addr := {"Host", 4400, false}
@try {
p1.send(5) to v_addr;
setverdict(fail, "Send operation succeeded. Expected error.");
}
@catch (msg) {
if (match(msg, pattern "*Dynamic test case error: Port p1 has neither connections nor mappings. Message cannot be sent on it.")) {
setverdict(pass);
}
else {
setverdict(fail, "Incorrect error message received (receive test): ", msg);
}
}
// After map it is good
map(self:p1, system:p1);
p1.send(5) to v_addr;
setverdict(pass);
}
testcase tc_neg_address_port_not_mapped_system() runs on TestCaseComp system SystemComp {
@try {
p1.send(5) to system;
setverdict(fail, "Send operation succeeded. Expected error.");
}
@catch (msg) {
if (match(msg, pattern "*Dynamic test case error: Port p1 has neither connections nor mappings. Message cannot be sent on it.")) {
setverdict(pass);
}
else {
setverdict(fail, "Incorrect error message received (receive test): ", msg);
}
}
// After map it is good
map(self:p1, system:p1);
p1.send(5) to system;
setverdict(pass);
}
testcase tc_neg_port_not_mapped_system() runs on TestCaseComp2 system SystemComp {
@try {
p1.send(5) to system;
setverdict(fail, "Send operation succeeded. Expected error.");
}
@catch (msg) {
if (match(msg, pattern "*Dynamic test case error: Port p1 has neither connections nor mappings. Message cannot be sent on it.")) {
setverdict(pass);
}
else {
setverdict(fail, "Incorrect error message received (receive test): ", msg);
}
}
// After map it is good
map(self:p1, system:p1);
p1.send(5) to system;
setverdict(pass);
}
control {
execute(tc_neg_address_port_not_mapped());
execute(tc_neg_address_port_not_mapped_system());
execute(tc_neg_port_not_mapped_system());
}
}
/**********************************