@Test
public void writeRoadPolylineRoadPolylineXMLBuilderXMLResources() throws Exception {

	PathBuilder pathBuilder = new SimplePathBuilder();
	XMLResources res = new XMLResources(pathBuilder);
	DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	DocumentBuilder builder = factory.newDocumentBuilder();
	Document doc = builder.newDocument();
	XMLBuilder xmlBuilder = new XMLBuilder() {
		@Override
		public Document getDocument() throws DOMException {
			return doc;
		}
	};
	RoadPolyline road = new RoadPolyline();
	road.addGroup(1, 2);
	road.addPoint(3, 4);
	road.addPoint(5, 6);
	road.addGroup(-1, 2);
	road.addPoint(-3, 4);
	road.addPoint(-5, -6);
	road.setName("myroad"); //$NON-NLS-1$
	road.setColor(0xFFFF0011);
	road.setAttribute("myattr", "thevalue"); //$NON-NLS-1$ //$NON-NLS-2$
	Element element = XMLRoadUtil.writeRoadPolyline(road, xmlBuilder, res);
	doc.appendChild(element);
	String actual;
	try (StringWriter sw = new StringWriter()) {
		XMLUtil.writeXML(doc, sw);
		sw.close();
		actual = sw.toString();
	}
	assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>" //$NON-NLS-1$
			+ "<road geoId=\"0ee8691041f80b41e4957e89239b4ff7#-5;-6;5;6\" id=\"" //$NON-NLS-1$
			+ road.getUUID().toString() + "\" name=\"myroad\" wide=\"true\" width=\"6.6\">" //$NON-NLS-1$
			+ "<points><point x=\"1.0\" y=\"2.0\"/><point x=\"3.0\" y=\"4.0\"/>" //$NON-NLS-1$
			+ "<point x=\"5.0\" y=\"6.0\"/><point x=\"-1.0\" y=\"2.0\"/>" //$NON-NLS-1$
			+ "<point x=\"-3.0\" y=\"4.0\"/><point x=\"-5.0\" y=\"-6.0\"/>" //$NON-NLS-1$
			+ "</points><groups><group firstPointIndex=\"0\" lastPointIndex=\"2\"/>" //$NON-NLS-1$
			+ "<group firstPointIndex=\"3\" lastPointIndex=\"5\"/></groups>" //$NON-NLS-1$
			+ "<attributes><attribute name=\"myattr\" type=\"STRING\" value=\"thevalue\"/>" //$NON-NLS-1$
			+ "<attribute name=\"nom_rue_d\" type=\"STRING\" value=\"myroad\"/></attributes></road>", actual); //$NON-NLS-1$
}