use of org.xmlpull.v1.XmlPullParser in project android-maps-utils by googlemaps.
the class KmlParserTest method createParser.
public XmlPullParser createParser(int res) throws Exception {
InputStream stream = getInstrumentation().getContext().getResources().openRawResource(res);
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser parser = factory.newPullParser();
parser.setInput(stream, null);
parser.next();
return parser;
}
use of org.xmlpull.v1.XmlPullParser in project android-maps-utils by googlemaps.
the class KmlContainerParserTest method testCDataEntity.
public void testCDataEntity() throws Exception {
XmlPullParser xmlPullParser = createParser(R.raw.amu_cdata);
KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser);
assertEquals(kmlContainer.getProperty("description"), "TELEPORT");
}
use of org.xmlpull.v1.XmlPullParser in project android-maps-utils by googlemaps.
the class KmlContainerParserTest method testCreateContainerPlacemark.
public void testCreateContainerPlacemark() throws Exception {
XmlPullParser xmlPullParser = createParser(R.raw.amu_basic_folder);
KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser);
assertTrue(kmlContainer.hasPlacemarks());
assertEquals(kmlContainer.getPlacemarksHashMap().size(), 1);
xmlPullParser = createParser(R.raw.amu_multiple_placemarks);
kmlContainer = KmlContainerParser.createContainer(xmlPullParser);
assertTrue(kmlContainer.hasPlacemarks());
assertEquals(kmlContainer.getPlacemarksHashMap().size(), 2);
}
use of org.xmlpull.v1.XmlPullParser in project android-maps-utils by googlemaps.
the class KmlContainerParserTest method testCreateContainerProperty.
public void testCreateContainerProperty() throws Exception {
XmlPullParser xmlPullParser = createParser(R.raw.amu_basic_folder);
KmlContainer kmlContainer = KmlContainerParser.createContainer(xmlPullParser);
assertTrue(kmlContainer.hasProperties());
assertEquals(kmlContainer.getProperty("name"), "Basic Folder");
xmlPullParser = createParser(R.raw.amu_unknwown_folder);
kmlContainer = KmlContainerParser.createContainer(xmlPullParser);
assertTrue(kmlContainer.hasProperty("name"));
}
use of org.xmlpull.v1.XmlPullParser in project android-maps-utils by googlemaps.
the class KmlFeatureParserTest method testMultiGeometry.
public void testMultiGeometry() throws Exception {
XmlPullParser xmlPullParser = createParser(R.raw.amu_multigeometry_placemarks);
KmlPlacemark placemark = KmlFeatureParser.createPlacemark(xmlPullParser);
assertNotNull(placemark);
assertEquals(placemark.getGeometry().getGeometryType(), "MultiGeometry");
KmlMultiGeometry multiGeometry = ((KmlMultiGeometry) placemark.getGeometry());
assertEquals(multiGeometry.getGeometryObject().size(), 3);
}
Aggregations