I want to execute TTCN-3 test case from JAVA but we are getting some issue to execute it. we are use the below ttcn3 test case we had also add one Plugin in eclipse IDE which is "TITAN_Designer_and_Executor_Plugin_6.6.1" after add successfully the plugin we will make the TITAN java Project & also add one TTCN3 module Hello1.ttcn
//TTCN3 Module name : Hello1.ttcn
//====================== Port Types ======================
type port MYPORT message {
inout charstring
} with {extension "internal"}
//====================== Component Types ======================
type component MYCOMP {
port MYPORT myport
}
//====================== Constants ======================
const charstring ws0 := "(\n| )#(0,)"
//====================== Templates ======================
//Strings containing the words "hello" and "world", in all small, or
//all capital letters, or small letters with first letter capital;
//exclamation mark is optional; whitespaces allowed
template charstring t_expected :=
pattern "{ws0}(((h|H)ello {ws0}(w|W)orld)|HELLO {ws0}WORLD){ws0}!#(0,1){ws0}"
//====================== Functions ======================
function f_PTC() runs on MYCOMP {
alt {
[] myport.receive(t_expected){
setverdict(pass,"expected message received: ",t_expected)
}
[] myport.receive {
setverdict(fail,"not the expected message received: ",t_expected)
}
}
}
//====================== Testcases ======================
testcase TC(charstring pl_toSend) runs on MYCOMP {
var MYCOMP vl_PTC := MYCOMP.create;
connect (self:myport, vl_PTC:myport);
vl_PTC.start(f_PTC());
myport.send(pl_toSend);
vl_PTC.done
}
//=========================================================================
// Control Part
//=========================================================================
control {
var charstring vl_inputs [6] :=
{"HELLO WORLD!","hello world","Hello World!","hello WORD!","hELLO wORLD!","helloworld!"}
var integer i, vl_noStrings := sizeof(vl_inputs);
for (i:=0; i< vl_noStrings; i:=i+1){
execute (TC(vl_inputs[i]))
}
} // end of control
// Automatic Generate so many line of Java code from Eclipse IDE file name is Hello1.java
//this class also make the eclipse IdE Java Main Class
package org.eclipse.titan.dummy_test.generated;
import org.eclipse.titan.runtime.core.Module_List;
import org.eclipse.titan.runtime.core.PreGenRecordOf;
import org.eclipse.titan.runtime.core.Runtime_Single_main;
import org.eclipse.titan.runtime.core.TTCN_Logger;
import org.eclipse.titan.runtime.core.TitanLoggerApi;
import org.eclipse.titan.dummy_test.generated.Hello1;
public class Single_main {
public static void main( String[] args ) {
long absoluteStart = System.nanoTime();
Module_List.add_module(new PreGenRecordOf());
Module_List.add_module(new TitanLoggerApi());
Module_List.add_module(new Hello1());
TTCN_Logger.set_executable_name("dummy-test");
int returnValue = Runtime_Single_main.singleMain( args );
System.out.println("Total execution took " + (System.nanoTime() - absoluteStart) * (1e-9) + " seconds to complete");
System.exit(returnValue);
}
}
// when we execute the main class then it will give some error logs in console
Dynamic test case error: Module PreGenRecordOf does not have control part.
Verdict statistics: 0 none, 0 pass, 0 inconc, 0 fail, 0 error.
Number of errors outside test cases: 1
Test execution summary: 0 test case was executed. Overall verdict: error
Total execution took 0.416742785 seconds to complete
*We are trying to execute TTCN3 test case from java but we are not able to execute.
we are able to make the TTCN3 test case with the help of "TITAN_Designer_and_Executor_Plugin" and on the same time corresponding TTCN3 it will make the java executable file automatically.
when java file compile successfully when this class is added in the main class which we have to execute.
We are request you to all please give me some solution to execute the TTCN-3 Test case from JAVA.*