Search in sources :

Example 1 with DummyStringProvider

use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.

the class PicaLBSAccountTest method testParseMediaList.

@Test
public void testParseMediaList() throws OpacApi.OpacErrorException {
    String html = readResource("/pica_lbs/medialist/" + file);
    // we may not have all files for all libraries
    if (html == null)
        return;
    List<LentItem> media = PicaLBS.parseMediaList(Jsoup.parse(html), new DummyStringProvider());
    assertTrue(media.size() > 0);
    for (LentItem item : media) {
        assertNotNull(item.getTitle());
        assertNotNull(item.getDeadline());
    }
}
Also used : DummyStringProvider(de.geeksfactory.opacclient.i18n.DummyStringProvider) LentItem(de.geeksfactory.opacclient.objects.LentItem) Test(org.junit.Test)

Example 2 with DummyStringProvider

use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.

the class PicaOldAccountTest method testParseResList.

@Test
public void testParseResList() throws OpacApi.OpacErrorException {
    String html = readResource("/pica_old/reslist/" + file);
    // we may not have all files for all libraries
    if (html == null)
        return;
    List<ReservedItem> media = new ArrayList<>();
    PicaOld.parseResList(media, Jsoup.parse(html), new DummyStringProvider());
    assertTrue(media.size() > 0);
}
Also used : DummyStringProvider(de.geeksfactory.opacclient.i18n.DummyStringProvider) ArrayList(java.util.ArrayList) ReservedItem(de.geeksfactory.opacclient.objects.ReservedItem) Test(org.junit.Test)

Example 3 with DummyStringProvider

use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.

the class WinBiapAccountTest method testParseResList.

@Test
public void testParseResList() throws OpacApi.OpacErrorException {
    String html = readResource("/winbiap/reslist/" + file);
    // we may not have all files for all libraries
    if (html == null)
        return;
    List<ReservedItem> media = WinBiap.parseResList(Jsoup.parse(html), new DummyStringProvider(), new JSONObject());
    for (ReservedItem item : media) {
        assertNotNull(item.getMediaType());
        assertContainsData(item.getCover());
    }
    assertTrue(media.size() > 0);
}
Also used : DummyStringProvider(de.geeksfactory.opacclient.i18n.DummyStringProvider) JSONObject(org.json.JSONObject) ReservedItem(de.geeksfactory.opacclient.objects.ReservedItem) Test(org.junit.Test)

Example 4 with DummyStringProvider

use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.

the class PicaLBSAccountTest method testParseResList.

@Test
public void testParseResList() throws OpacApi.OpacErrorException {
    String html = readResource("/pica_lbs/reslist/" + file);
    // we may not have all files for all libraries
    if (html == null)
        return;
    List<ReservedItem> media = PicaLBS.parseResList(Jsoup.parse(html), new DummyStringProvider());
    assertTrue(media.size() > 0);
}
Also used : DummyStringProvider(de.geeksfactory.opacclient.i18n.DummyStringProvider) ReservedItem(de.geeksfactory.opacclient.objects.ReservedItem) Test(org.junit.Test)

Example 5 with DummyStringProvider

use of de.geeksfactory.opacclient.i18n.DummyStringProvider in project opacclient by opacapp.

the class AdisAccountTest method testParseReservationList.

@Test
public void testParseReservationList() throws OpacApi.OpacErrorException, JSONException {
    String html = readResource("/adis/reslist/" + file);
    // we may not have all files for all libraries
    if (html == null)
        return;
    List<ReservedItem> res = new ArrayList<>();
    DateTimeFormatter fmt = DateTimeFormat.forPattern("dd.MM.yyyy").withLocale(Locale.GERMAN);
    String[] rlink = new String[] { "Vormerkungen zeigen oder löschen", "https://opac.sbs.stuttgart.de/aDISWeb/app;" + "jsessionid=98AAE50B33FC5A0C191319D406D1564E?service=direct/1/POOLM02Q" + "@@@@@@@@_4B032E00_349DAD80/Tabelle_Z1LW01.cellInternalLink" + ".directlink&sp=SRGLINK_3&sp=SZM&requestCount=2" };
    Adis.parseReservationList(Jsoup.parse(html), rlink, true, res, fmt, new DummyStringProvider());
    assertTrue(res.size() > 0);
    for (ReservedItem item : res) {
        assertNotNull(item.getTitle());
    }
}
Also used : DummyStringProvider(de.geeksfactory.opacclient.i18n.DummyStringProvider) ArrayList(java.util.ArrayList) ReservedItem(de.geeksfactory.opacclient.objects.ReservedItem) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) Test(org.junit.Test)

Aggregations

DummyStringProvider (de.geeksfactory.opacclient.i18n.DummyStringProvider)10 Test (org.junit.Test)7 ReservedItem (de.geeksfactory.opacclient.objects.ReservedItem)4 ArrayList (java.util.ArrayList)3 LentItem (de.geeksfactory.opacclient.objects.LentItem)2 JSONObject (org.json.JSONObject)2 Copy (de.geeksfactory.opacclient.objects.Copy)1 Detail (de.geeksfactory.opacclient.objects.Detail)1 DetailedItem (de.geeksfactory.opacclient.objects.DetailedItem)1 Volume (de.geeksfactory.opacclient.objects.Volume)1 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)1