コード例 #1
0
 @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());
   }
 }
コード例 #2
0
 @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) {
     // ...
   }
 }