Test and Validation [message #1732183] |
Fri, 13 May 2016 06:17  |
Eclipse User |
|
|
|
Hello I try to adapt a test and validation which was made on workbench on the compiler Titan? Think you that there is a compatibility with both compilers workbench and Titan?
|
|
|
|
|
|
Re: Test and Validation [message #1732280 is a reply to message #1732273] |
Sat, 14 May 2016 09:44   |
Eclipse User |
|
|
|
Hi Alexandre,
as far as I know, .ttcn3view files are TTCN-3 files representing the explicit conversion of an XSD or ASN.1 file.
(BTW Titan imports ASN.1 implicitly, without generating intermediate artifacts as the .ttcn3view files, and imports XSDs explicitly ,
converting the XML schemas into TTCN-3 files, which are in a way equivalent to the .ttcn3view files).
As such , these .ttcn3view files should be compileable directly with Titan.
However, this should be avoided.
in the light of the above,
1)instead of .ttcn3view files for ASN.1 it is preferred to import the ASN.1 files directly
2) instead of .ttcn3 view files for XSDs it is preferred to generate the intermediate
.ttcn files with xsd2ttcn
(see https://www.eclipse.org/forums/index.php/t/1077272/ for XML conversion and codecs)
The main reason for this is that the xsd2ttcn converter will also generate the encoding instructions needed for Titan to automatically generate the codec functions.
For instance , the following file, oma_xml_xdm_common_policy.ttcn3view
(downloaded from http://forge.etsi.org/websvn/filedetails.php?repname=LIBS.LibSip&path=%2FLibSip%2Ftrunk%2Fxsd%2Foma_xml_xdm_common_policy.ttcn3view&peg=426)
module oma_xml_xdm_common_policy {
import from XSDAUX language "TTCN-3:2009" all;
type record EmptyType {
}
type record AnchorType {
XSDAUX.anyURI anc optional,
record of record {
charstring name,
anytype value_
} anyAttributes optional
}
type record External_list {
record of AnchorType entry optional
}
}
with {
encode "SupplementaryServices";
}
was generated from oma-common-policy.xsd ( you can google it up if interested in details)
The same XSD file converted with xsd2ttcn will result in:
/*******************************************************************************
* Copyright (c) 2000-2016 Ericsson Telecom AB
*
* XSD to TTCN-3 Translator version: CRL 113 200/5 R5A
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
//
// File: urn_oma_xml_xdm_common_policy.ttcn
// Description:
// References:
// Rev:
// Prodnr:
// Updated: Sat May 14 15:25:53 2016
// Contact: http://ttcn.ericsson.se
//
////////////////////////////////////////////////////////////////////////////////
// Generated from file(s):
// - oma-common-policy.xsd
// /* xml version = "1.0" encoding = "UTF-8" */
// /* targetnamespace = "urn:oma:xml:xdm:common-policy" */
////////////////////////////////////////////////////////////////////////////////
// Modification header(s):
//-----------------------------------------------------------------------------
// Modified by:
// Modification date:
// Description:
// Modification contact:
//------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
module urn_oma_xml_xdm_common_policy {
import from XSD all;
/* OMA specific "conditions" child elements */
type EmptyType Other_identity
with {
variant "name as 'other-identity'";
variant "element";
};
type record External_list
{
record of AnchorType entry_list
}
with {
variant "name as 'external-list'";
variant "element";
variant (entry_list) "untagged";
variant (entry_list[-]) "name as 'entry'";
};
type EmptyType Anonymous_request
with {
variant "name as 'anonymous-request'";
variant "element";
};
type record AnchorType
{
XSD.AnyURI anc optional,
record of XSD.String attr optional
}
with {
variant "name as uncapitalized";
variant (anc) "attribute";
variant (attr) "anyAttributes";
};
type record EmptyType
{
}
with {
variant "name as uncapitalized";
};
In the first case, the codec is hidden behind the
with {
encode "SupplementaryServices";
}
expression, which will invoke the codec code;
in the second case, encoding appears explicitly in form of encoding variants which will be used by Titan to generate the codec code.
Similarly, Titan will generate BER codec for ASN.1 , but not for the equivalent .ttcn3view.
In conclusion , the answer to your question is that it is possible, but you should avoid it. .ttcn3view files are intermediate artifacts specific to the way of working of TT Workbench and have little meaning for Titan.
I hope it makes sense
Best regards
Elemer
[Updated on: Sat, 14 May 2016 13:55] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: Test and Validation [message #1732983 is a reply to message #1732978] |
Mon, 23 May 2016 10:31  |
Eclipse User |
|
|
|
Hi Boubacar,
to build it , please read through the original post; all information should be there.
In the use case described there, TTCN-3 invokes a Java function which returns a result, so communication is more or less unidirectional.
As I mentioned, this is only a proof of concept, we don't have extensive experience with TTCN-3/Java hybrids, so we cannot offer a lot more help.
As these hybrids are rather complex, one should really consider whether they are really worth the effort.
Best regards
Elemer
|
|
|
Powered by
FUDForum. Page generated in 0.28621 seconds