116 Commits

Author SHA1 Message Date
MohitMali
4751ef1565 Publish snapshot on maven for testing the java-libkiwix
* Introduce publish_snapshot.yml for uploading the snapshot artifact on the mavenCentral.
* We have added the `SNAPSHOT` env variable in publish_snapshot.yml and match it our code if found then it means this workflow triggered to publish the snapshot on maven so on behalf of this we have rectify our code.
2023-07-31 18:42:27 +05:30
Matthieu Gautier
020c9375a9 Fix typo in setDataDirectory.
This is `libkiwix`, not `kiwixlib`.
2023-07-21 10:28:40 +02:00
MohitMali
ebd27b53f1 Fixed libkiwix dependency
* Updated the source of libkiwix and libzim .so files to download.kiwix.org/release instead of using nightly builds.
* Introduced new variables for specifying the versions of libkiwix and libzim, allowing retrieval of .so files from the release repositories.
* Modified the README.md file to get the version and image from maven central for `org.kiwix.libkiwix` artifact.
2023-07-19 11:20:47 +05:30
MohitMali
423000e1a6 Upload java-libkiwix to the new Maven repository with version code 1.0.0 2023-07-18 15:20:03 +05:30
MohitMali
eaa957fcf0 Added .so file while while initlizing JNIKiwix class which we have missed 2023-07-13 17:45:53 +05:30
Matthieu Gautier
ab7bbc1043 Try to trigger gc to call finalize methods. 2023-06-30 11:54:26 +02:00
Matthieu Gautier
33152da9b4 Exception is properly created by jni wrapper.
No need to do the check in java code.
2023-06-30 11:32:55 +02:00
Matthieu Gautier
36ad3c0331 Fix indentation. 2023-06-30 11:32:55 +02:00
Matthieu Gautier
9d6ef87b57 Introduce EntryNotFoundException. 2023-06-30 11:32:55 +02:00
Matthieu Gautier
827ab31c38 Better testing of errors. 2023-06-30 10:37:37 +02:00
Matthieu Gautier
40dd4ea853 Use the message of the exception instead of using our own. 2023-06-30 10:37:26 +02:00
Matthieu Gautier
c36a29abc4 Wrap all cpp code in a try/catch on create corresponding java exception. 2023-06-29 17:11:50 +02:00
Matthieu Gautier
a2e6381a84 Construct the library different ways. 2023-06-28 15:25:54 +02:00
Matthieu Gautier
ddbf5a08c5 Separate how we test Library from how we create it. 2023-06-28 15:25:54 +02:00
Matthieu Gautier
089a7d4ba5 Fix Book.getIllustrations 2023-06-28 15:25:54 +02:00
Matthieu Gautier
73039e4ef4 Add a lot of test on libkiwix. 2023-06-28 15:25:54 +02:00
Matthieu Gautier
09c0e0155e Fix hasEntryByTitle 2023-06-28 15:25:54 +02:00
Matthieu Gautier
df631a4679 Fix Iterators. 2023-06-28 15:25:54 +02:00
Matthieu Gautier
16ee15021a Add a full coverage of libzim part. 2023-06-28 15:25:54 +02:00
Matthieu Gautier
15f42f0757 Make CodeFactor happy. 2023-06-28 15:17:15 +02:00
Matthieu Gautier
eaf9b3aac9 [test] Get the suggestion result from the first result. 2023-06-21 11:39:17 +02:00
Matthieu Gautier
1806febcf4 Fix iterator next.
`next` must return the "next" value.
But here, the next value is the value of the current iterator.
2023-06-21 11:38:47 +02:00
Matthieu Gautier
7315228b06 Fix typos in search/suggestion getResults. 2023-06-21 11:38:00 +02:00
Matthieu Gautier
c7ac3a0878 Update test zim file.
zim files have been created using a recent version of zimwriterfs
(including the fix for openzim/zim-tools#355
2023-06-21 11:36:36 +02:00
Matthieu Gautier
61faa65343 Addapt create_test_zimfiles to last zimwriterfs. 2023-06-21 11:35:08 +02:00
Matthieu Gautier
fb83f1154b Create the test zim file with a xapian FT index. 2023-06-21 11:34:29 +02:00
Matthieu Gautier
f9131e901c Add wrapper for libzim search and suggestion. 2023-06-20 16:47:13 +02:00
Matthieu Gautier
52cc2e48a8 Introduce TestBookmark. 2023-06-14 15:07:38 +02:00
Matthieu Gautier
83a6429565 Introduce TestBook, TestLibrary, TestManager and TestServer. 2023-06-14 14:49:10 +02:00
Matthieu Gautier
f84d951e97 Introduce TestEntryIterator.java 2023-06-14 14:15:46 +02:00
Matthieu Gautier
7c7f56d0de Rename renameFolders to removeDateFromFolderName 2023-06-14 10:12:42 +02:00
Matthieu Gautier
57fb755a02 Latest libzim nigthly is build on bionic. 2023-06-14 10:11:49 +02:00
Matthieu Gautier
ce1f216108 Introduce TestBlob.java 2023-06-13 17:49:02 +02:00
Matthieu Gautier
80f6920201 Introduce TestItem.java 2023-06-13 17:46:21 +02:00
Matthieu Gautier
ff6469a34f Introduce TestEntry.java 2023-06-13 17:38:18 +02:00
Matthieu Gautier
d4f2f82e98 Introduce test package.
Jacoco don't track native methods, so our code coverage don't
include all the native methods, and it is exactly want we want to check.

By introducing a test package wrapping all native methods with a small
java function, we have the coverage of the wrapping methods.
2023-06-13 17:38:03 +02:00
MohitMaliFtechiz
07defa8356 Generating test binding and jacoco reports in build directory 2023-06-09 17:45:11 +02:00
Matthieu Gautier
3577824507 Deactivate testSearcher() to fix.
`small.zim` doesn't seems to contain a xapian database, so searcher
cannot work.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
9dee22fd9d Illustration.height must return the height. 2023-05-20 17:07:25 +02:00
Matthieu Gautier
9312e32435 Fix illustration.
`Book::getIllustration(size)` return a `shared_ptr<Illustration>`.
The current `buildWrapper` was creating a wrapper on a
`shared_ptr<Illustration>` (so a `shared_ptr<shared_ptr<Illustration>>`)
but we was converting to a `shared_ptr<Illustration>` and so we were doing
wrong reads.

By specializing the buildWrapper for `shared_ptr<T>`, we avoid the
"double shared_ptr" and we are good.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
4d73e57c69 Fix Query.
Correctly include `org_kiwix_libwzim_Query.h`.
Property set the return type of setNativeQuery to void.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
915866a5fe Make Blob.getData return a byte[] instead of a String.
Blob IS a `char[]`. C++ allow a char[] to be stored in a string but in
java, a String is associated to a encoding.
Content in a Blob may have no encoding so we cannot convert to a string.

Fix the test part.
2023-05-20 17:07:25 +02:00
Matthieu Gautier
81993af3c1 Correctly construct Book.
Introduce a new set of wrapper (with a nice `2` postfix) with use a
constructor taking a handle as parameter.
It allow Book to have two constructor:
- One creating a default empty (cpp) book.
- One setting the wrapper around a exsiting cpp book.
2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
a0fd51228c Added more test cases for bookmark 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
c38ccd8015 Added test cases for searcher, SuggestionSearcher. Added test cases for getting books from library 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
d6e4479621 Added test cases for checking is archive created with invalid zim file , added remove book from library by id tests 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
bea92d800d Fixed source file path in compileTestFile task 2023-05-20 17:07:25 +02:00
MohitMaliFtechiz
3fd6a01f0f Renamed generateHeader as buildHeader and buildLinuxSoFile as buildLinuxBinding for better naming 2023-05-20 17:07:23 +02:00
MohitMaliFtechiz
84235ee822 Removed javac bash commands to compile and run test cases, now we are using the gradle tasks to compile and run test cases 2023-05-20 17:06:32 +02:00
MohitMaliFtechiz
fb380e208a Removed dependency from date for copying the .so and headers files of (libkiwix, libzim) , Now we are renameing the folders names via renameFolders method 2023-05-20 17:06:31 +02:00