@Test public void testProgramParsing() throws XmlTvParser.XmlTvParseException { String testXmlFile = "xmltv.xml"; String APRIL_FOOLS_SOURCE = "https: "0videos/April%20Fool's%202013/Introducing%20Google%20Fiber%20to%20the%20Pole.mp4"; String ELEPHANTS_DREAM_POSTER_ART = "https: "ple/images_480x270/ElephantsDream.jpg"; InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(testXmlFile); XmlTvParser.TvListing listings = XmlTvParser.parse(inputStream); assertEquals(9, listings.getAllPrograms().size()); assertEquals("Introducing Gmail Blue", listings.getAllPrograms().get(0).getTitle()); assertEquals("Introducing Gmail Blue", listings.getPrograms(listings.getChannels().get(0)).get(0).getTitle()); assertEquals(TvContract.Programs.Genres.TECH_SCIENCE, listings.getAllPrograms().get(1).getCanonicalGenres()[1]); assertEquals(listings.getAllPrograms().get(2).getChannelId(), listings.getChannels().get(0).getOriginalNetworkId()); assertNotNull(listings.getAllPrograms().get(3).getInternalProviderData()); assertEquals(APRIL_FOOLS_SOURCE, listings.getAllPrograms().get(3).getInternalProviderData().getVideoUrl()); assertEquals("Introducing Google Nose", listings.getAllPrograms().get(4).getDescription()); assertEquals(ELEPHANTS_DREAM_POSTER_ART, listings.getAllPrograms().get(5).getPosterArtUri()); InternalProviderData internalProviderData = new InternalProviderData(); internalProviderData.setVideoType(TvContractUtils.SOURCE_TYPE_HTTP_PROGRESSIVE); internalProviderData.setVideoUrl(APRIL_FOOLS_SOURCE); assertEquals(internalProviderData, listings.getAllPrograms().get(3).getInternalProviderData()); }
public static TvListing parse(@NonNull InputStream inputStream) throws XmlTvParseException { return parse(inputStream, Xml.newPullParser()); }
XmlTvParser { public static TvListing parse(@NonNull InputStream inputStream) throws XmlTvParseException { return parse(inputStream, Xml.newPullParser()); } }
XmlTvParser { public static TvListing parse(@NonNull InputStream inputStream) throws XmlTvParseException { return parse(inputStream, Xml.newPullParser()); } private  XmlTvParser(); }
XmlTvParser { public static TvListing parse(@NonNull InputStream inputStream) throws XmlTvParseException { return parse(inputStream, Xml.newPullParser()); } private  XmlTvParser(); static TvListing parse(@NonNull InputStream inputStream); }
XmlTvParser { public static TvListing parse(@NonNull InputStream inputStream) throws XmlTvParseException { return parse(inputStream, Xml.newPullParser()); } private  XmlTvParser(); static TvListing parse(@NonNull InputStream inputStream);  }