Skip to content
QiTASC.com / intaQt Built-ins /
CdrSet Built-ins
/ .. /
CdrSet Built-ins





CdrSet Built-ins

CdrSet Built-ins create CDRs for Online Verification. Additionally, they are available for XML Ticket Creation.

A CDR Set is a group of tickets containing details about events from executed test cases. The tickets will later be verified against existing Verification rules. Files created by the CdrSet Built-ins can replace the real, selected CDR tickets: For example, if CDRs need to be created manually or are received in an unsupported format.

These Built-ins can be used with the following steps:

Syntax

1
2
3
4
5
run verification with cdrs <registeredCdrSet String> and rules <ruleSetName String>.<testcaseName String>
run verification for testcase <registeredTestcase String> with cdrs
    <registeredCdrSet String> and rules <ruleSetName String>
run verification for current testcase with cdrs <registeredCdrSet String>
    and rules <ruleSetName String>.<testcaseName String>
Parameters

  • registeredCdrSet - The CDR's set name

  • rulesSetName - The rule-set's name

  • testcaseName - The test case's name

  • registeredTestcase - The assigned name and test case object

Example

1
And run verification with cdrs "cdrSetName" and rules "telephony".moc

Create Tickets From Map

Creates tickets for the CdrSet from a map.

Important! This function is not the same as below, which creates tickets from a file.

Syntax

1
2
<ticket Ticket> := Cdr.createTicket(<type String>,
     <recordId Number>, <properties Map<String, Any>>)

Returns

The ticket.

Parameters

  • type - The ticket type

    • For example, moc or sms
  • recordID - The CDR's numerical record ID

  • properties - A map of the CDR's properties

    • For example, its calling parties, and their phone numbers

Example

1
ticket := Cdr.createTicket("moc", 1, cdrProperties)

Create Tickets From File

Creates tickets for a CdrSet from a file.

Important! This function is not the same as above, which creates tickets from a map.

Syntax

1
<ticket Ticket> := Cdr.createTickets(<type String>, <file File>, <converters Map<String, String>>: <tickets <Ticket>>)

Returns

The ticket.

Parameters

  • type - The ticket format

  • file - The ticket file object

  • converters - The map of property names to Converter names, for example, NUMBER, DATE

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tickets := Cdr.createTickets("MyTicket", ticket_file, {"propertyName" : "DATE"})
testcase := Cdr.createTestcase().setName("09.P091.0001").build()

Cdr.registerTestcase(testcase.name, testcase)

variableTickets := {}
variableTickets.put("MyTicket", tickets)

cdrSet := Cdr.createCdrSet([], variableTickets, testcase)
Cdr.registerCdrSet(cdrSetName, cdrSet)

Create CdrSet

Creates a CdrSet using the tickets, test cases and properties defined in the Stepdef.

Syntax

1
2
<cdrSet CdrSet> := Cdr.createCdrSet(<files List<File>>,
    <variableTickets  Map<String, Ticket>>, <testcase Testcase>)

Returns

The CdrSet.

Parameters

  • files - The CDR files that comprise the CdrSet

  • variableTickets - A map of the variables assigned to the ticket

  • testcase (Optional) - The test case's name

Example

1
cdrSet := Cdr.createCdrSet([], variableTickets, testcase)

Register CdrSet

Creates a name and test case object for the CdrSet so that it can be called in a Feature File.

Syntax

1
Cdr.registerCdrSet(<name String>, <cdrSet CdrSet>)

Parameters

  • name - An assigned name for the CdrSet

  • cdrSet - An object of type cdrSet

Example

1
Cdr.registerCdrSet(cdrSetName, cdrSet)

Get Current Test Case

Returns the current running test case.

Syntax

1
Cdr.getCurrentTestcase(<name String>)

Parameter

  • name - The running test case's name

Example

1
Cdr.getCurrentTestcase("myTest")

Create Test Case Party

Creates a test case party, for example, the A-party.

Syntax

1
2
<testcaseParty Object> := Cdr.createTestcaseParty()
<testcaseParty Object> := Cdr.createTestcaseParty(<number String>)

Returns

The test case party.

Parameter

  • number - The party's phone number

Example

1
aParty := Cdr.createTestcaseParty("+4369923456789")

Create Connection Type

Defines the type of network connection.

Syntax

1
<connectionType ConnectionType> := Cdr.createConnectionType(<type String>)

Returns

The object that holds the connection type.

Parameter

  • type - The type of connection
    • May be one of CALL, SMS, USSD OR DATA

Example

1
2
3
4
testCallConnection := Cdr.createConnectionType("CALL")
testSmsConnection  := Cdr.createConnectionType("SMS")
testUssdConnection := Cdr.createConnectionType("USSD")
testDataConnection := Cdr.createConnectionType("DATA")

Create Connection Information

Defines information about the connection and its calling party.

Syntax

1
2
3
4
5
6
7
<connectionInfo ConnectionInfo> :=
    Cdr.createConnectionInfo(<connectionType ConnectionType>,
    <partyANumber String>)

<connectionInfo ConnectionInfo> :=
    Cdr.createConnectionInfo(<connectionType ConnectionType>,
    <partyANumber String>, <partyBNumber String>)

Returns

The object that holds the connection information.

Parameters

  • connectionType - The connection type object created using the createConnectionType method

  • partyANumber - The A party

  • partyBNumber - The B party

Example

1
newConnection := Cdr.createConnectionInfo("CALL", "+43123456789")

Create Test Case

Creates a test case, using methods to specify test case criteria. The .build() method must be concatenated at the end of the function. Additional methods used in these examples are detailed below in Availabel Builder Methods.

Syntax

1
<builder TestcaseBuilder> := Cdr.createTestcase()

Returns

The test case builder.

Example

1
2
3
4
5
6
testcase := Cdr.createTestcase()
    .setAParty(Cdr.createTestcaseParty("+4369919100001"))
    .setBParty(Cdr.createTestcaseParty("+4369919100002"))
    .setStartTime(date("now"))
    .setName("moc")
    .build()

Get Files

Gets ticket files.

Syntax

1
<files Files> := <cdrSet CdrSet>.getFiles()

Returns

The ticket files.

Parameter

  • cdrSet - The CDR set object

Example

1
myfiles := tickets.getFiles()

Get Variable Tickets

Returns a map containing the selector and the selector's tickets.

Syntax

1
<variableTickets Map> := <cdrSet CdrSet>.getVariableTickets()

Returns

The map of variable tickets.

Parameter

  • cdrSet - The CDR set object

Example

1
variabletickets := cdrSet.getVariableTickets()

Get All Tickets

Returns a set of all the tickets.

Syntax

1
<tickets Set> := <cdrSet CdrSet>.getAllTickets()

Returns

The set of tickets.

Parameter

  • cdrSet - The CDR set object

Example

1
alltickets := cdrSet.getAllTickets()

Get Test Case

The getTestcase function can be called on an existing CdrSet to get its test case.

Syntax

1
<testcase Testcase> := <cdrSet CdrSet>.getTestcase()

Returns

The test case, if available, or Optional.empty.

Parameter

  • cdrSet - The CDR set object

Example

1
testcase := cdrSet.getTestcase()

Get Properties

The getProperties function returns the ticket's properties.

Syntax

1
<testcase Optional> := <cdrSet CdrSet>.getProperties()

Returns

The ticket's properties.

Parameter

  • cdrSet - The CDR set object

Example

1
2
3
4
5
6
7
tickets := getExecutionContextObject(cdrSet)
        ticketSet := tickets.getAllTickets().toArray()
        for ticket in ticketSet
            for e in ticket.getProperties()
                ticketContent.put(e.getName(),e.getValue())
            end
        end

Available Test Case Builder Methods

The following test case builder methods are used to set the test case's properties.

Set Name

Sets the test case's name.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setName(<name String>)
Parameters

  • testCaseBuilder - The test case builder object

  • name - The name assigned to the test case

Example

1
testcase.setName("moc")

Set Description

Sets a description of the test case.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setDescription(<description String>)

Parameters

  • testCaseBuilder - The test case builder object

  • description - The test case's description

Example

1
testcase.setDescription("telephony test cases")

Set Start Time

Sets the test case's start time.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setStartTime(<startTime Date>)

Parameters

  • testCaseBuilder - The test case builder object

  • startTime - The test case's start time

Example

1
testcase.setStartTime(date("now"))

Set Finish Time

Sets the test case's finish time.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setFinishTime(<finishTime Date>)

Parameters

  • testCaseBuilder - The test case builder object

  • startTime - The test case's finish time

Example

1
testcase.setFinishTime(date("tomorrow"))

Set Party Number

Sets a party's number. Up to 6 parties may be defined (setAParty through setFParty).

Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<testCaseBuilder TestCaseBuilder>
    .setAParty(Cdr.createTestcaseParty(<number String>))
<testCaseBuilder TestCaseBuilder>
    .setBParty(Cdr.createTestcaseParty(<number String>))
<testCaseBuilder TestCaseBuilder>
    .setCParty(Cdr.createTestcaseParty(<number String>))
<testCaseBuilder TestCaseBuilder>
    .setDParty(Cdr.createTestcaseParty(<number String>))
<testCaseBuilder TestCaseBuilder>
    .setEParty(Cdr.createTestcaseParty(<number String>))
<testCaseBuilder TestCaseBuilder>
    .setFParty(Cdr.createTestcaseParty(<number String>))

Parameters

  • testCaseBuilder - The test case builder object

  • number - The party's phone number

Example

1
2
3
4
5
6
testcase.setAParty(Cdr.createTestcaseParty("+4369919100001"))
testcase.setBParty(Cdr.createTestcaseParty("+4369919100002"))
testcase.setCParty(Cdr.createTestcaseParty("+4369919100003"))
testcase.setDParty(Cdr.createTestcaseParty("+4369919100004"))
testcase.setEParty(Cdr.createTestcaseParty("+4369919100005"))
testcase.setFParty(Cdr.createTestcaseParty("+4369919100006"))

Set IP

Sets the IP address.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setIp(<ip String>)

Parameters

  • testCaseBuilder - The test case builder object

  • ip - The IP address

Example

1
testcase.setIp("192.168.1.1")

Set Charging ID

Sets the charging/tariff ID.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setChargingId(<chargingId String>)

Parameters

  • testCaseBuilder - The test case builder object

  • chargingId - The name assigned to the charge/tariff

Example

1
testcase.setChargingId("longdistance")

Set APN

Sets the APN.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setApn(<apn String>)

Parameters

  • testCaseBuilder - The test case builder object

  • apn - The APN

Example

1
testcase.setApn("testnetwork.com")

Set Test Case Duration

Sets the test case's duration.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setDuration(<duration Number>)

Parameters

  • testCaseBuilder - The test case builder object

  • duration - The length of the test case in milliseconds

Example

1
testcase.setDuration(2000)

Set Tolerance

Sets the tolerance value, which checks for CDRs a certain amount of time before or after a test case's start or end.

Syntax

1
<testCaseBuilder TestCaseBuilder>.setTolerance(<tolerance Number>)

Parameters

  • testCaseBuilder - The test case builder object

  • tolerance - The value assigned to the tolerance in milliseconds

Example

1
testcase.setTolerance(2000)

Set Network Element

Sets the network element, which is the location where the CDR is written, or saved and waiting to be picked up.

Syntax

1
<testCaseBuilder Builder>.setNetworkElement(<networkElement String>)

Parameters

  • testCaseBuilder - The test case builder object

  • networkElement - The network element

Example

1
testcase.setNetworkElement("remotehost")

Set Comments

Sets comments about the test case.

Example

1
<testCaseBuilder Builder>.setComments(<comments String>)

Parameters

  • testCaseBuilder - The test case builder object

  • comments - The comments

Example

1
testcase.setComments("group 6")

Set Parent

Sets the parent test case. For example, if the the test case being run is a subset of a larger CdrSet.

Syntax

1
<testCaseBuilder Builder>.setParent(<parent Testcase>)

Parameters

  • testCaseBuilder - The test case builder object

  • parent - The parent test case objet

Example

1
testcase.setParent(testcase)

Add CALL, SMS, USSD or DATA

Adds a call type using a connectionInfo object.

Syntax

1
2
3
4
<testCaseBuilder TestCaseBuilder>.addCall(<callInfo ConnectionInfo>)
<testCaseBuilder TestCaseBuilder>.addSms(<callInfo ConnectionInfo>)
<testCaseBuilder TestCaseBuilder>.addUssd(<callInfo ConnectionInfo>)
<testCaseBuilder TestCaseBuilder>.addData(<callInfo ConnectionInfo>)

Parameters

  • testCaseBuilder - The test case builder object

  • callInfo - The connectionInfo object type created by the createConnectionInfo method

Example

1
2
3
4
testcase.addCall(testCallConnection)
testcase.addSms(testSmsConnection)
testcase.addUssd(testUssdConnection)
testcase.addData(testDataConnection)

Test Case Example

​The following example demonstrates how to create a CdrSet in memory without any CDR files. The ticket properties are represented by a map of key-value pairs. The values can be of types strings, number, date, boolean, map or list.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
stepdef "create cdr set as {}" / cdrSetName /
    cdrProperties := {
        "A" : "A_VALUE",
        "B" : 23,
        "C" : {
            "D" : ["D1_VALUE", "D2_VALUE"]
        },
        "A_PARTY" : "+4369919100001",
        "B_PARTY" : "+4369919100002"
    }

    ticket := Cdr.createTicket("TicketType", 1, cdrProperties)

    variableTickets := {
        "MOC" : [ticket]
    }

    testcase := Cdr.createTestcase()
        .setAParty(Cdr.createTestcaseParty("+4369919100001"))
        .setBParty(Cdr.createTestcaseParty("+4369919100002"))
        .setStartTime(date("now"))
        .setName("moc")
        .build()

    cdrSet := Cdr.createCdrSet([], variableTickets, testcase)
    Cdr.registerCdrSet(cdrSetName, cdrSet)
end

XML Ticket Creation

The createXMLTickets function creates a list of tickets from a specified XML file and a list of XPaths. These can be used when defining selectors. Additionally, the XML node's name can be specified for working with relatively large XML files.

Syntax

1
2
3
4
5
<tickets List<Ticket>> := createXMLTickets(<xmlFile File>, <xpaths List<String>>
    ,<schema File>)
<tickets List<Ticket>> := createXMLTickets(<xmlFile File>, <xpaths List<String>>
    ,<schemaURI String>)
<tickets List<Ticket>> := createXMLTickets(<xmlFile File>, <xpaths List<String>)

Returns

The list of tickets composed using the XML file and XPaths.

Parameters

  • xmlFile - The XML file containing the information to be verified

  • xpaths - The XPaths corresponding to the tickets

  • elementName - The name of the XML node corresponding to the ticket

  • schema (Optional) - The file that will be used as XSD schema for the specified XML file

  • schemaURI (Optional) - The URI of the file that will be used as XSD schema for the specified XML file

Example

1
2
3
4
5
    tickets := Cdr.createXMLTickets(File.fromProject("/verification/tickets.xml"),
        "ticketNode", ["/root/ticketNode"],
        "http://www.w3.org/2001/XMLSchema-instance/shiporder.xsd")
    cdrSet := Cdr.createCdrSet([], { "XML" : tickets })
    Cdr.registerCdrSet("XMLSet", cdrSet)