use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.
the class PicaOldAccountTest method testParseMediaList.
@Test
public void testParseMediaList() throws OpacApi.OpacErrorException {
String html = readResource("/pica_old/medialist/" + file);
// we may not have all files for all libraries
if (html == null)
return;
List<LentItem> media = new ArrayList<>();
PicaOld.parseMediaList(media, Jsoup.parse(html), new DummyStringProvider(), new ArrayList<String>());
assertTrue(media.size() > 0);
for (LentItem item : media) {
assertNotNull(item.getTitle());
assertNotNull(item.getDeadline());
}
}
use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.
the class SISISSearchTest method testParseDetail.
@Test
public void testParseDetail() throws OpacApi.OpacErrorException, JSONException, IOException {
String html1 = readResource("/sisis/result_detail/" + file.replace(".html", "_1.html"));
String html2 = readResource("/sisis/result_detail/" + file.replace(".html", "_2.html"));
String html3 = readResource("/sisis/result_detail/" + file.replace(".html", "_3.html"));
String coverJs = readResource("/sisis/result_detail/" + file.replace(".html", ".js"));
if (html1 == null || html2 == null || html3 == null) {
// we may not have all files for all libraries
return;
}
DetailedItem result = SISIS.parseDetail(html1, html2, html3, coverJs, new JSONObject(), new DummyStringProvider());
assertTrue(result.getCopies().size() > 0);
for (Copy copy : result.getCopies()) {
assertContainsData(copy.getStatus());
assertNullOrNotEmpty(copy.getBarcode());
assertNullOrNotEmpty(copy.getBranch());
assertNullOrNotEmpty(copy.getDepartment());
assertNullOrNotEmpty(copy.getLocation());
assertNullOrNotEmpty(copy.getReservations());
assertNullOrNotEmpty(copy.getShelfmark());
assertNullOrNotEmpty(copy.getUrl());
if (copy.getStatus().equals("Entliehen"))
assertNotNull(copy.getReturnDate());
}
for (Volume volume : result.getVolumes()) {
assertContainsData(volume.getId());
assertContainsData(volume.getTitle());
}
assertEquals(result.getTitle(), getDetailTitle(file));
if (file.equals("berlin_htw.html")) {
assertTrue(result.getDetails().contains(new Detail("Signatur:", "15/2322")));
assertNotNull(result.getCover());
}
}
use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.
the class ApacheBaseApi method init.
/**
* Initializes HTTP client and String Provider
*/
@Override
public void init(Library library, HttpClientFactory http_client_factory) {
http_client = http_client_factory.getNewApacheHttpClient(library.getData().optBoolean("customssl", false), library.getData().optBoolean("customssl_tls_only", true), library.getData().optBoolean("customssl_all_ciphersuites", false), library.getData().optBoolean("disguise", false));
this.library = library;
stringProvider = new DummyStringProvider();
}
use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.
the class BaseApi method init.
/**
* Initializes HTTP client and String Provider
*/
@Override
public void init(Library library, HttpClientFactory http_client_factory) {
this.library = library;
stringProvider = new DummyStringProvider();
}
use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.
the class OkHttpBaseApi method init.
/**
* Initializes HTTP client and String Provider
*/
@Override
public void init(Library library, HttpClientFactory http_client_factory) {
this.http_client_factory = http_client_factory;
http_client = http_client_factory.getNewOkHttpClient(library.getData().optBoolean("customssl", false), library.getData().optBoolean("customssl_tls_only", true), library.getData().optBoolean("customssl_all_ciphersuites", false));
http_client.dispatcher().setMaxRequestsPerHost(10);
this.library = library;
stringProvider = new DummyStringProvider();
}
Aggregations