/******************************************************************************
 * Copyright (c) 2000-2021 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
 *   Beres, Szabolcs
 *
 ******************************************************************************/
// TTCN-3 version of "Hello, world!"
module MyExample
{
type port PCOType message
{
  inout charstring;
}

type component MTCType
{
  port PCOType MyPCO_PT;
}

testcase tc_HelloW() runs on MTCType system MTCType
{
  map(mtc:MyPCO_PT, system:MyPCO_PT);
  MyPCO_PT.send("Hello, world!");
  setverdict(pass);
}

testcase tc_HelloW2() runs on MTCType system MTCType
{
  timer TL_T := 15.0;
  map(mtc:MyPCO_PT, system:MyPCO_PT);
  MyPCO_PT.send("Hello, world!");
  TL_T.start;
  alt {
    [] MyPCO_PT.receive("Hello, TTCN-3!") { TL_T.stop; setverdict(pass); }
    [] TL_T.timeout { setverdict(inconc); }
    [] MyPCO_PT.receive { TL_T.stop; setverdict(fail); }
  }
}

control
{
  execute(tc_HelloW());
  execute(tc_HelloW2());
}
}
