use of me.vertretungsplan.objects.SubstitutionScheduleData in project substitution-schedule-parser by vertretungsplanme.
the class ColorProviderTest method testPreconfigured.
@Test
public void testPreconfigured() {
final SubstitutionScheduleData scheduleData = new SubstitutionScheduleData();
scheduleData.setData(new JSONObject());
final ColorProvider provider = new ColorProvider(scheduleData);
assertEquals("#2196F3", provider.getColor("Vertretung"));
}
use of me.vertretungsplan.objects.SubstitutionScheduleData in project substitution-schedule-parser by vertretungsplanme.
the class DaVinciDemoTest method setUp.
@Before
public void setUp() throws JSONException {
htmlSingle = readResource("/davinci/single.html");
htmlSingleDaVinci5 = readResource("/davinci/single_5.html");
htmlDayIndex = readResource("/davinci/dayIndex.html");
htmlMonth = readResource("/davinci/month.html");
htmlClasses = readResource("/davinci/classes.html");
SubstitutionScheduleData scheduleData = new SubstitutionScheduleData();
scheduleData.setData(new JSONObject());
parser = new DaVinciParser(scheduleData, null);
}
use of me.vertretungsplan.objects.SubstitutionScheduleData in project substitution-schedule-parser by vertretungsplanme.
the class ESchoolDemoTest method setUp.
@Before
public void setUp() throws JSONException {
html = readResource("/eschool/eschool.html");
SubstitutionScheduleData scheduleData = new SubstitutionScheduleData();
scheduleData.setData(new JSONObject());
parser = new ESchoolParser(scheduleData, null);
}
use of me.vertretungsplan.objects.SubstitutionScheduleData in project substitution-schedule-parser by vertretungsplanme.
the class IndiwareDemoTest method testHTMLEmbeddedContentSelector.
@Test
public void testHTMLEmbeddedContentSelector() throws JSONException, IOException {
String html = readResource("/indiware/indiware_embedded.html");
SubstitutionScheduleData scheduleData = new SubstitutionScheduleData();
final JSONObject data = new JSONObject();
data.put("embeddedContentSelector", ".items-leading .dd-article > table > tbody > tr > td");
scheduleData.setData(data);
IndiwareParser parser = new IndiwareParser(scheduleData, null);
SubstitutionSchedule schedule = new SubstitutionSchedule();
parser.parseIndiwarePage(schedule, html);
assertEquals(2, schedule.getDays().size());
assertEquals(new LocalDate(2017, 3, 10), schedule.getDays().get(0).getDate());
assertEquals(new LocalDate(2017, 3, 13), schedule.getDays().get(1).getDate());
}
use of me.vertretungsplan.objects.SubstitutionScheduleData in project substitution-schedule-parser by vertretungsplanme.
the class IndiwareMobileDemoTest method demoTest.
@Test
public void demoTest() throws IOException, JSONException {
Document doc = Jsoup.parse(readResource("/indiware-mobile/indiware-mobile.xml"), "", Parser.xmlParser());
SubstitutionScheduleData scheduleData = new SubstitutionScheduleData();
scheduleData.setType(SubstitutionSchedule.Type.STUDENT);
SubstitutionScheduleDay day = IndiwareMobileParser.parseDay(doc, new ColorProvider(), scheduleData);
assertEquals(new LocalDate(2017, 6, 21), day.getDate());
assertEquals(new LocalDateTime(2017, 6, 20, 10, 28), day.getLastChange());
assertEquals(192, day.getSubstitutions().size());
}
Aggregations