Sync with 5.4.2
[deliverable/titan.core.git] / titan_executor_api / TITAN_Executor_API_test / readme.txt
CommitLineData
970ed795 1###############################################################################
3abe9331 2# Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
3# All rights reserved. This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License v1.0
5# which accompanies this distribution, and is available at
6# http://www.eclipse.org/legal/epl-v10.html
7###############################################################################
3abe9331 8
91. GENERATING BUILD.XML
10
970ed795
EL
11build.xml is generated.
12The generated build.xml is modified manually:
13 target TITAN_Executor_API_test is modified to fail in ant level if any testcase fails to make Jenkins show the failures
14 failureproperty="test.failed" added to <junit fork="yes" printsummary="withOutAndErr" HERE>
15 <fail if="test.failed" message="TITAN_Executor_API_test FAILED"/> added after </junit>
16
17Steps to generate build.xml from Eclipse:
18 1. Right click on TITAN_Executor_API -> Export...
19 2. Select General/Ant Buildfiles
20JUnit will be included in build.xml
21
3abe9331 222. RUN JUNIT TESTS
23
24Requirements:
25 Java 1.7
26 for compiling Titan with JNI Java SDK (JDK) 1.7 is needed
27 $TTCN3_DIR is set to Titan install directory
28 ${TTCN3_DIR}/lib/libmctrjninative.so exists and ${TTCN3_DIR}/lib is added to $LD_LIBRARY_PATH
29
30The test project depends on these external jars:
31 junit.jar (JUnit4)
32 Hamcrest core 1.3
33 https://code.google.com/p/hamcrest/downloads/list
34
35Test compiling and running from command line is done with this command:
36(NOTE: this script also compiles its dependecies)
37
38ant \
39-lib <JUnit jar> \
40-lib <Hamcrest core jar> \
41TITAN_Executor_API_test
42
43For example
44ant \
45-lib ${LIB_DIR}/org.junit_4.11.0.v201303080030/junit.jar \
46-lib ${LIB_DIR}/org.hamcrest.core_1.3.0.v201303031735.jar \
47TITAN_Executor_API_test
48
49See build_and_run_test.sh, this script also check the dependencies before test compiling and running.
50
513. TROUBLESHOOTING
52Typical error situations during test running and their solutions
53
543.1
55Error:
56java.lang.UnsatisfiedLinkError: org.eclipse.titan.executor.jni.JNIMiddleWare.init(I)J
57Reason:
3f84031e 58The Titan binaries you use are old (before 2014-12-11 or release before CRL 113 200/5 R1A), and since then the project became open source and that’s why all the java packages were renamed from com.ericsson.titan.* to org.eclipse.titan.*
3abe9331 59Solution:
60So you should use the latest release.
61You can download a new package from
62ttcn.ericsson.se/download/
3f84031e 63Search for "TITAN packages", download the latest version
3abe9331 64You can extract it locally in your home directory, just make sure, that
65TTCN3_DIR is set properly
66PATH contains its bin directory
67LD_LIBRARY_PATH contains its lib directory
68
693.2
70Error:
71.../lib/libmctrjninative.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
72Reason:
73You use a 32-bit JDK on a 64-bit system.
74Solution:
75So you should download and use a new one.
76
77So download this file:
78jdk-7u75-linux-x64.tar.gz
79http://download.oracle.com
80
81Extract it to your home directory, you will get a directory like this:
82jdk-7u75-linux-x64
83create a symlink to it:
84ln -s jdk-7u75-linux-x64 jdk
85
86set the following variables in your .bashrc
87JDKDIR=$HOME/jdk
88export JDKDIR
89PATH=$HOME/jdk/bin:${PATH}
90export PATH
91LD_LIBRARY_PATH=$HOME/jdk/lib:.:${LD_LIBRARY_PATH}
92export LD_LIBRARY_PATH
93
94In case of tcsh
95.cshrc.user
96setenv JDKDIR $HOME/jdk
97setenv JAVA_HOME $HOME/jdk
98setenv LD_LIBRARY_PATH ${JAVA_HOME}/lib:$LD_LIBRARY_PATH
99setenv PATH ${JAVA_HOME}/bin:$PATH
100
101Then start a new terminal and check the result with java -version
102
1033.3
104Error:
105org.eclipse.titan.executorapi.exception.JniExecutorJniLoadException: JNI dynamic library could not be loaded.
106Reason:
107libmctrjninative.so is missing or not found
108Solution:
109TTCN3_DIR must be added to LD_LIBRARY_PATH
110Add this line to .bashrc
111LD_LIBRARY_PATH=${TTCN3_DIR}/lib:${LD_LIBRARY_PATH}
112
113If Titan is built locally, Makefile.personal must contain the following lines:
114JNI := yes
115JDKDIR := $HOME/jdk
This page took 0.028779 seconds and 5 git commands to generate.