@XmlElement(name = "STARTDATE") public LocalDate getStartDate() { return date.getDate(); }
@XmlElement(name = "ENDDATE") public LocalDate getEndDate() { ZonedDateTime end = date.getEnd(); return end == null ? null : end.toLocalDate(); }
@XmlAttribute public String getHashid() { return date.getId(); }
assertTrue("The node should be of type DateData", object instanceof DateData); DateData node = (DateData)object; assertEquals(data.localDate2, node.getDate()); assertEquals(data.sold_out, node.getNodeState()); assertNull(node.getType()); assertEquals(data.start2, node.getStart()); assertEquals(data.end2, node.getEnd()); assertNotNull(node.getLocation()); PlaceData place = node.getLocation(); compareVenue(place); assertNull(node.getSubunit()); assertNotNull(node.getFeatures()); assertEquals(0, node.getFeatures().size()); assertNotNull(node.getFields()); assertEquals(0, node.getFields().size()); assertNotNull(node.getNodes()); assertEquals(0, node.getNodes().size()); assertNotNull(node.getContributors()); assertEquals(0, node.getContributors().size()); assertNotNull(node.getMedia()); assertEquals(0, node.getMedia().size()); assertNotNull(node.getPrices()); assertEquals(0, node.getPrices().size()); assertEquals(data.start1, node.getCreated()); assertEquals(data.end1, node.getModified()); assertEquals(new Integer(2), node.getVersion()); assertEquals(data.event, node.getEvent());
dateWithPlace.setId("17"); dateWithPlace.setSource(source); dateWithPlace.setLocale(locale); dateWithPlace.setDate(localDate1); dateWithPlace.setType(around); dateWithPlace.setStart(start1); dateWithPlace.setEnd(end1); dateWithPlace.setLocation(place); dateWithPlace.setCreated(start1); dateWithPlace.setModified(end1); dateWithPlace.setVersion(2); dateWithPlace.setEvent(event); dateWithVenue.setId("18"); dateWithVenue.setSource(source); dateWithVenue.setLocale(locale); dateWithVenue.setDate(localDate2); dateWithVenue.setNodeState(sold_out); dateWithVenue.setStart(start2); dateWithVenue.setEnd(end2); dateWithVenue.setLocation(venue); dateWithVenue.setCreated(start1); dateWithVenue.setModified(end1); dateWithVenue.setVersion(2); dateWithVenue.setEvent(event); dateWithLocation.setId("20"); dateWithLocation.setSource(source); dateWithLocation.setLocale(locale);
date = (DateData)inline.get("http://import-test/DATE/EINDEUTIGE_DATE_ID/"); assertNotNull(date); assertEquals(source, date.getUri().getSource()); assertEquals(LocalDate.parse("2015-03-12"), date.getDate()); assertNull(date.getType()); assertEquals(ZonedDateTime.parse("2015-03-12T20:00:00+01:00[Europe/Berlin]"), date.getStart()); assertEquals(ZonedDateTime.parse("2015-03-12T22:00:00+01:00[Europe/Berlin]"), date.getEnd()); assertEquals(eindeutig, date.getLocation()); assertEquals(LocalDate.parse("2015-03-12"), date.getDate()); assertEquals(ZonedDateTime.parse("2015-03-12T20:00:00+01:00[Europe/Berlin]"), date.getStart()); assertEquals(ZonedDateTime.parse("2015-03-12T22:00:00+01:00[Europe/Berlin]"), date.getEnd()); date = (DateData)inline.get("http://import-test/DATE/20150312/"); assertNotNull(date); assertEquals(source, date.getUri().getSource()); assertEquals(LocalDate.parse("2015-03-12"), date.getDate()); assertNull(date.getType()); assertEquals(ZonedDateTime.parse("2015-03-12T20:00:00+01:00[Europe/Berlin]"), date.getStart()); assertNull(date.getEnd()); assertEquals(jovel, date.getLocation());
public void checkDate(NodeData node) { assertNotNull("The node presented as DATE was null", node); DateData date = (DateData)node; assertNull(date.getDate()); checkEvent(date.getEvent()); checkLocation(date.getLocation()); }
DateData date = (DateData)inline.get("http://TEST/DATE/20151112/"); assertNotNull(date); assertEquals( LocalDate.parse("2015-11-12"), date.getDate()); assertNotNull(date.getLocation()); assertEquals("Y", date.getLocation().getId()); assertTrue(date.getLocation() instanceof LocationData); LocationData location = (LocationData)date.getLocation(); assertNotNull(location.getAddress());
@XmlElement(name = "STATUSTEXT") public String getStatusText() { NodeStateInfo state = date.getNodeState(); return state == null ? null : state.getText(); }
assertEquals(DATE, node.getNodeType()); date = (DateData) node; assertEquals(handled.get(event_3), date.getEvent()); assertEquals(handled.get(location_4), date.getLocation()); assertEquals(DATE, node.getNodeType()); date = (DateData) node; assertEquals(handled.get(event_3), date.getEvent()); assertEquals(handled.get(location_5), date.getLocation()); assertEquals(DATE, node.getNodeType()); date = (DateData) node; assertEquals(handled.get(event_3), date.getEvent()); assertEquals(handled.get(location_6), date.getLocation()); assertEquals(DATE, node.getNodeType()); date = (DateData) node; assertEquals(handled.get(event_3), date.getEvent()); assertEquals(handled.get(location_7), date.getLocation());
assertEquals(DATE, node.getNodeType()); date = (DateData) node; assertEquals(handled.get(event_2), date.getEvent()); state = date.getNodeState(); assertNotNull(state); assertEquals(handled.get(date_14), state.getNode()); assertEquals(DATE, node.getNodeType()); date = (DateData) node; assertEquals(handled.get(event_3), date.getEvent()); state = date.getNodeState(); assertNotNull(state); assertEquals(handled.get(date_12), state.getNode());
@XmlElementWrapper(name = "ADDRESSLIST", required = true) @XmlElement(name = "ADDRESS") public List<Address> getAddressList() { if (dates == null || dates.isEmpty()) return Collections.EMPTY_LIST; List<Address> addresses = new LinkedList<>(); PlaceData location = dates.get(0).getLocation(); if (location == null) return Collections.EMPTY_LIST; addresses.add(new Address(model, location)); return addresses; }
public void setHashid(String hashid) { date.setId(hashid); }
public void setStartDate(LocalDate startDate) { date.setDate(startDate); }
@XmlElement(name = "STARTTIME") public LocalTime getStartTime() { ZonedDateTime start = date.getStart(); return start == null ? null : start.toLocalTime(); }
@XmlElement(name = "EXTRA1") public String getExtra1() { return date.getAfter(); }
@Test public void testStoreAndGetDateWithType() throws Exception { LOG.debug("<-- start of new test-case"); config.createType("START|END"); DetachedDate detached = (DetachedDate)parse("/xml/nodes/date.xml"); notifier.clear(); nodeRepository.store(detached.getNodeData()); flush(); assertEquals(1, notifier.created.size()); assertEquals(detached.getUri(), notifier.created.iterator().next()); assertEquals(0, notifier.updated.size()); assertEquals(0, notifier.removed.size()); assertTrue(nodeRepository.exists(detached.getUri())); NodeData node = nodeRepository.get(detached.getUri()); assertNotNull(node); assertEquals(DATE, node.getNodeType()); assertEquals("114095325941506", node.getId()); DateData date = (DateData)node; assertEquals(detached.getType(), date.getType()); }
assertTrue("The node should be of type DateData", object instanceof DateData); DateData node = (DateData)object; assertEquals(data.localDate1, node.getDate()); assertNull(node.getNodeState()); assertEquals(data.around, node.getType()); assertEquals(data.start1, node.getStart()); assertEquals(data.end1, node.getEnd()); assertNotNull(node.getLocation()); PlaceData place = node.getLocation(); comparePlace(place); assertNull(node.getSubunit()); assertNotNull(node.getFeatures()); assertEquals(0, node.getFeatures().size()); assertNotNull(node.getFields()); assertEquals(0, node.getFields().size()); assertNotNull(node.getNodes()); assertEquals(0, node.getNodes().size()); assertNotNull(node.getContributors()); assertEquals(0, node.getContributors().size()); assertNotNull(node.getMedia()); assertEquals(0, node.getMedia().size()); assertNotNull(node.getPrices()); assertEquals(0, node.getPrices().size()); assertEquals(data.start1, node.getCreated()); assertEquals(data.end1, node.getModified()); assertEquals(new Integer(2), node.getVersion()); assertEquals(data.event, node.getEvent());
assertEquals(source, date.getUri().getSource()); assertEquals(LocalDate.parse("2015-03-12"), date.getDate()); assertEquals(around, date.getType()); assertEquals(ZonedDateTime.parse("2015-03-12T20:00:00+01:00[Europe/Berlin]"), date.getStart()); assertNull(date.getEnd()); assertNotNull(date.getLocation()); PlaceData place = date.getLocation(); assertEquals(source, place.getUri().getSource()); assertTrue("expected a LocationData", place instanceof LocationData);
assertNotNull(uri_date_1 + " should still be stored", node); DateData date = (DateData)node; assertNotNull(date.getDate()); assertEquals(LocalDate.parse("2017-06-08"), date.getDate()); checkEvent(date.getEvent()); assertEquals(location, date.getLocation()); node = nodeRepository.get(uri_date_2); assertNotNull(uri_date_2 + " should still be stored", node); date = (DateData)node; assertNotNull(date.getDate()); assertEquals(LocalDate.parse("2017-06-09"), date.getDate()); checkEvent(date.getEvent()); assertEquals(location, date.getLocation()); node = nodeRepository.get(uri_date_3); assertNotNull(uri_date_3 + " should still be stored", node); date = (DateData)node; assertNotNull(date.getDate()); assertEquals(LocalDate.parse("2017-06-10"), date.getDate()); checkEvent(date.getEvent()); assertEquals(location, date.getLocation()); assertEquals("wrong number of missing references", 1 , result.missing.size()); assertTrue(uri_country + " should be missing", result.missing.iterator().next().matches(uri_country));