/****************************************************************************** * Copyright (c) 2000-2016 Ericsson Telecom AB * 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 * * Contributors: * Balasko, Jeno * Lovassy, Arpad * Szabo, Janos Zoltan – initial implementation * ******************************************************************************/ // TTCN-3 version of "Hello, world!" module MyExample { type port PCOType message { inout charstring; } type component MTCType { port PCOType MyPCO; } testcase HelloW() runs on MTCType system MTCType { map(mtc:MyPCO, system:MyPCO); MyPCO.send("Hello, world!"); setverdict(pass); } testcase HelloW2() runs on MTCType system MTCType { timer T := 1.0; map(mtc:MyPCO, system:MyPCO); MyPCO.send("Hello, world!"); T.start; alt { [] MyPCO.receive("Hello, TTCN-3!") { T.stop; setverdict(pass); } [] T.timeout { setverdict(inconc); } [] MyPCO.receive { T.stop; setverdict(fail); } } } control { execute(HelloW()); execute(HelloW2()); //1 pass, 1 inconc expected } }