@Test public void testSingleParsing() { try { RpmSpecParser parser = RpmSpecParser.createParser("src/test/resources/specs/p4bugzilla.spec"); assertNotNull(parser); checkP4BugzillaResults(toProperties(parser.parse())); } catch (FileNotFoundException e) { fail(e.toString()); } }
@Test public void testExampleCode() { try { RpmSpecParser parser = RpmSpecParser.createParser("src/test/resources/specs/p4bugzilla.spec"); Multimap<String, String> properties = parser.parse(); System.out.printf("RPM name: %s %n", properties.get("name")); System.out.printf( "RPM version: %s-%s %n", properties.get("version"), properties.get("release")); } catch (FileNotFoundException e) { // ... } }