Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / java / README
1 libcephfs Java wrappers
2 =======================
3
4 - native/: C++
5 - java/: Java
6 - test/: JUnit tests
7 - lib/: JUnit library
8 - build.xml: Test runner
9
10 Building
11 --------
12
13 Autotools handles the build using the configure flag --enable-cephfs-java
14
15 Testing
16 -------
17
18 These tests assume a live cluster, and depend on JUnit4 and Ant.
19
20 To run the tests make sure that the JUnit4 JAR is installed. 
21 Install it via a package manager or like this:
22
23   $ mkdir lib
24   $ cd lib
25   $ wget https://github.com/downloads/KentBeck/junit/junit-4.8.2.jar
26
27 And then add the jar to the CLASSPATH.
28 *NOTE* for now, configure is only looking for this jar in the 
29 /usr/share/java directory as junit4.jar. So create a softlink
30 to that location from wherever the junit jar is installed. 
31
32 Ant is used to run the unit test (apt-get install ant). For example:
33
34   $ cd src/
35   $ ./vstart -d -n --localhost
36   $ cd java
37   $ CEPHFS_CONF=../ceph.conf CLASSPATH=/usr/share/java/junit4.jar ant test
38
39 1. The tests depend on the compiled wrappers. If the wrappers are installed as
40 part of a package (e.g. Debian package) then this should 'just work'. Ant will
41 also look in the current directory for 'libcephfs.jar' and 'libcephfs-test.jar';
42 and in ../.libs for the
43 JNI library.  If all else fails, set the environment variables CEPHFS_JAR, and
44 CEPHFS_JNI_LIB accordingly.
45
46 2. Set CEPHFS_CONF environment variable to point to a ceph.conf. This can be
47 omitted if the desired configuration file can be found in a default location.
48
49 Documentation
50 -------------
51
52 Ant is used to build the Javadocs:
53
54   $ ant docs