MovieNFOReader { public static boolean readXmlNfo(String nfoText, Movie movie, String nfoFilename) { return convertNfoToDoc(null, nfoText, movie, nfoFilename); } private  MovieNFOReader(); static boolean readNfoFile(File nfoFile, Movie movie); static boolean readXmlNfo(String nfoText, Movie movie, String nfoFilename); static boolean readXmlNfo(File nfoFile, Movie movie); static boolean readTextNfo(String nfo, Movie movie); static void movieDate(Movie movie, final String dateString); static void parseRuntime(Element eCommon, Movie movie); static final String TYPE_MOVIE; static final String TYPE_TVSHOW; static final String TYPE_EPISODE; static final String NFO_PLUGIN_ID; }
@Test public void testParseCrew() { LOG.info("ParseCrew"); StringBuilder nfo = new StringBuilder(); nfo.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); nfo.append("<movie>"); nfo.append("<id>-1</id>"); nfo.append("<id moviedb=\"tmdb\">24021</id>"); nfo.append("<title>The Twilight Saga: Eclipse</title>"); nfo.append("<year>2010</year>"); nfo.append("<credits>"); nfo.append("<writer>Melissa Rosenberg</writer>"); nfo.append("<writer>Stephenie Meyer</writer>"); nfo.append("</credits>"); nfo.append("<credits>Hans Dampf</credits>"); nfo.append("<director>David Slade</director>"); nfo.append("</movie>"); Movie movie = new Movie(); MovieNFOReader.readXmlNfo(nfo.toString(), movie, "test.nfo"); assertEquals(1, movie.getDirectors().size()); assertEquals(3, movie.getWriters().size()); }