Commit | Line | Data |
---|---|---|
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 | |
9 | 1. GENERATING BUILD.XML | |
10 | ||
970ed795 EL |
11 | build.xml is generated. |
12 | The 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 | ||
17 | Steps to generate build.xml from Eclipse: | |
18 | 1. Right click on TITAN_Executor_API -> Export... | |
19 | 2. Select General/Ant Buildfiles | |
20 | JUnit will be included in build.xml | |
21 | ||
3abe9331 | 22 | 2. RUN JUNIT TESTS |
23 | ||
24 | Requirements: | |
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 | ||
30 | The 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 | ||
35 | Test compiling and running from command line is done with this command: | |
36 | (NOTE: this script also compiles its dependecies) | |
37 | ||
38 | ant \ | |
39 | -lib <JUnit jar> \ | |
40 | -lib <Hamcrest core jar> \ | |
41 | TITAN_Executor_API_test | |
42 | ||
43 | For example | |
44 | ant \ | |
45 | -lib ${LIB_DIR}/org.junit_4.11.0.v201303080030/junit.jar \ | |
46 | -lib ${LIB_DIR}/org.hamcrest.core_1.3.0.v201303031735.jar \ | |
47 | TITAN_Executor_API_test | |
48 | ||
49 | See build_and_run_test.sh, this script also check the dependencies before test compiling and running. | |
50 | ||
51 | 3. TROUBLESHOOTING | |
52 | Typical error situations during test running and their solutions | |
53 | ||
54 | 3.1 | |
55 | Error: | |
56 | java.lang.UnsatisfiedLinkError: org.eclipse.titan.executor.jni.JNIMiddleWare.init(I)J | |
57 | Reason: | |
3f84031e | 58 | The 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 | 59 | Solution: |
60 | So you should use the latest release. | |
61 | You can download a new package from | |
62 | ttcn.ericsson.se/download/ | |
3f84031e | 63 | Search for "TITAN packages", download the latest version |
3abe9331 | 64 | You can extract it locally in your home directory, just make sure, that |
65 | TTCN3_DIR is set properly | |
66 | PATH contains its bin directory | |
67 | LD_LIBRARY_PATH contains its lib directory | |
68 | ||
69 | 3.2 | |
70 | Error: | |
71 | .../lib/libmctrjninative.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch) | |
72 | Reason: | |
73 | You use a 32-bit JDK on a 64-bit system. | |
74 | Solution: | |
75 | So you should download and use a new one. | |
76 | ||
77 | So download this file: | |
78 | jdk-7u75-linux-x64.tar.gz | |
79 | http://download.oracle.com | |
80 | ||
81 | Extract it to your home directory, you will get a directory like this: | |
82 | jdk-7u75-linux-x64 | |
83 | create a symlink to it: | |
84 | ln -s jdk-7u75-linux-x64 jdk | |
85 | ||
86 | set the following variables in your .bashrc | |
87 | JDKDIR=$HOME/jdk | |
88 | export JDKDIR | |
89 | PATH=$HOME/jdk/bin:${PATH} | |
90 | export PATH | |
91 | LD_LIBRARY_PATH=$HOME/jdk/lib:.:${LD_LIBRARY_PATH} | |
92 | export LD_LIBRARY_PATH | |
93 | ||
94 | In case of tcsh | |
95 | .cshrc.user | |
96 | setenv JDKDIR $HOME/jdk | |
97 | setenv JAVA_HOME $HOME/jdk | |
98 | setenv LD_LIBRARY_PATH ${JAVA_HOME}/lib:$LD_LIBRARY_PATH | |
99 | setenv PATH ${JAVA_HOME}/bin:$PATH | |
100 | ||
101 | Then start a new terminal and check the result with java -version | |
102 | ||
103 | 3.3 | |
104 | Error: | |
105 | org.eclipse.titan.executorapi.exception.JniExecutorJniLoadException: JNI dynamic library could not be loaded. | |
106 | Reason: | |
107 | libmctrjninative.so is missing or not found | |
108 | Solution: | |
109 | TTCN3_DIR must be added to LD_LIBRARY_PATH | |
110 | Add this line to .bashrc | |
111 | LD_LIBRARY_PATH=${TTCN3_DIR}/lib:${LD_LIBRARY_PATH} | |
112 | ||
113 | If Titan is built locally, Makefile.personal must contain the following lines: | |
114 | JNI := yes | |
115 | JDKDIR := $HOME/jdk |