use of de.geeksfactory.opacclient.objects.Account in project opacclient by opacapp.
the class DrawerAccountsAdapter method setCurrentAccount.
public void setCurrentAccount(Account currentAccount) {
if (this.currentAccount == null || currentAccount == this.currentAccount)
return;
this.currentAccount = currentAccount;
accountsWithoutCurrent.clear();
for (Account account : accounts) {
if (account.getId() != this.currentAccount.getId()) {
accountsWithoutCurrent.add(account);
}
}
notifyDataSetChanged();
}
use of de.geeksfactory.opacclient.objects.Account in project opacclient by opacapp.
the class BiBer1992AccountTest method testParseResList.
@Test
public void testParseResList() throws OpacApi.OpacErrorException, JSONException {
String html = readResource("/biber1992/reslist/" + file);
// we may not have all files for all libraries
if (html == null)
return;
List<ReservedItem> media = BiBer1992.parseResList(new Account(), Jsoup.parse(html), new JSONObject(), reportHandler, new JSONObject(readResource("/biber1992/headers_reservations.json")));
assertTrue(media.size() > 0);
}
use of de.geeksfactory.opacclient.objects.Account in project opacclient by opacapp.
the class BiBer1992AccountTest method testParseMediaList.
@Test
public void testParseMediaList() throws OpacApi.OpacErrorException, JSONException {
String html = readResource("/biber1992/medialist/" + file);
// we may not have all files for all libraries
if (html == null)
return;
List<LentItem> media = BiBer1992.parseMediaList(new AccountData(0), new Account(), Jsoup.parse(html), new JSONObject(), reportHandler, new JSONObject(readResource("/biber1992/headers_lent.json")));
assertTrue(media.size() > 0);
for (LentItem item : media) {
assertNotNull(item.getDeadline());
// sensible dates
assertTrue(item.getDeadline().isAfter(new LocalDate(2010, 1, 1)));
assertNotNull(item.getId());
}
}
use of de.geeksfactory.opacclient.objects.Account in project opacclient by opacapp.
the class BibliothecaAccountTest method testParseReservationList.
@Test
public void testParseReservationList() throws OpacApi.OpacErrorException, JSONException, NotReachableException {
String html = readResource("/bibliotheca/account/" + file);
// we may not have all files for all libraries
if (html == null)
return;
if (file.equals("gladbeck.html") || file.equals("halle.html") || file.equals("albstadt.html") || file.equals("bernau.html"))
return;
AccountData data = Bibliotheca.parse_account(new Account(), Jsoup.parse(html), new JSONObject(), reportHandler, new JSONObject(readResource("/bibliotheca/headers_lent.json")), new JSONObject(readResource("/bibliotheca/headers_reservations.json")));
assertTrue(data.getReservations().size() > 0);
for (ReservedItem item : data.getReservations()) {
assertContainsData(item.getTitle());
assertNullOrNotEmpty(item.getAuthor());
}
}
use of de.geeksfactory.opacclient.objects.Account in project opacclient by opacapp.
the class BibliothecaAccountTest method testParseMediaList.
@Test
public void testParseMediaList() throws OpacApi.OpacErrorException, JSONException, NotReachableException {
String html = readResource("/bibliotheca/account/" + file);
// we may not have all files for all libraries
if (html == null)
return;
AccountData data = Bibliotheca.parse_account(new Account(), Jsoup.parse(html), new JSONObject(), reportHandler, new JSONObject(readResource("/bibliotheca/headers_lent.json")), new JSONObject(readResource("/bibliotheca/headers_reservations.json")));
assertTrue(data.getLent().size() > 0);
for (LentItem item : data.getLent()) {
assertContainsData(item.getTitle());
assertNullOrNotEmpty(item.getAuthor());
assertNotNull(item.getProlongData());
assertNotNull(item.getDeadline());
}
}
Aggregations