added testcase for product data parser
authorJiri Srain <jsrain@suse.cz>
Mon, 28 Nov 2005 11:25:07 +0000 (11:25 +0000)
committerJiri Srain <jsrain@suse.cz>
Mon, 28 Nov 2005 11:25:07 +0000 (11:25 +0000)
devel/devel.jsrain/yum/YUMParser.test/006-patch-correct.test.xml.ref
devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml [new file with mode: 0644]
devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml.err.ref [new file with mode: 0644]
devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml.ref [new file with mode: 0644]
devel/devel.jsrain/yum/YUMtest.cc

index e58b937..c16daae 100644 (file)
@@ -12,10 +12,9 @@ Patch Data:
   provides: [patch] foo-patch-fitzefatze  -
   conflicts: [package] foo-oldpatch EQ 1-1-2
   obsoletes: 
-  freshen: 
-  requires: [package] foo LE 2-3-4
+  freshen: [package] foo LE 2-3-4
 [package] foo-devel LE 3-4-5
-[patch] blah-234 EQ 4-5-6
+  requires: [patch] blah-234 EQ 4-5-6
   category: security
   reboot needed: 1
   affects package manager: 1
diff --git a/devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml b/devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml
new file mode 100644 (file)
index 0000000..ba64c66
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<product 
+    xmlns="http://novell.com/package/metadata/suse/product"
+    xmlns:product="http://novell.com/package/metadata/suse/product"
+    xmlns:yum="http://linux.duke.edu/metadata/common" 
+    xmlns:rpm="http://linux.duke.edu/metadata/rpm" 
+    xmlns:suse="http://novell.com/package/metadata/suse/common"
+    type="add-on">
+  <vendor>Novell Inc.</vendor>
+  <name>OES</name>
+  <version epoch="0" ver="1" rel="2"/>
+  <displayname lang="en">Open Enterprise Server</displayname>
+  <description lang="en">Opens your server to enterprise</description>
+  <rpm:provides><rpm:entry kind="product" name="OES"/></rpm:provides>
+</product>
+
diff --git a/devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml.err.ref b/devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml.err.ref
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml.ref b/devel/devel.jsrain/yum/YUMParser.test/007-product-correct.test.xml.ref
new file mode 100644 (file)
index 0000000..d08c289
--- /dev/null
@@ -0,0 +1,16 @@
+-------------------------------------------------
+Product Data: 
+  type: add-on
+  vendor: Novell Inc.
+  name: OES
+  display name: [en] Open Enterprise Server
+  description: [en] Opens your server to enterprise
+  epoch: 0
+  version: 1
+  release: 2
+  provides: [product] OES  -
+  conflicts: 
+  obsoletes: 
+  freshen: 
+  requires: 
+Exit Code: 0
index 3b6b477..a5f58ad 100644 (file)
@@ -30,7 +30,7 @@ namespace {
   void usage() {
     cerr << "YUMtest usage: "<< endl
     << "YUMtest TYPE" << endl
-    << "TYPE: repomd|primary|group|filelist|other|patch" << endl;
+    << "TYPE: repomd|primary|group|filelist|other|patch|product" << endl;
   }
 }
 
@@ -105,6 +105,16 @@ int main(int argc, char **argv)
       if (iter.errorStatus())
         throw *iter.errorStatus();
     }
+    else if (!strcmp(argv[1],"product")) {
+      YUMProductParser iter(cin,"");
+      for (;
+           !iter.atEnd();
+           ++iter) {
+             cout << **iter;
+           }
+      if (iter.errorStatus())
+        throw *iter.errorStatus();
+    }
     else {
       usage();
       return 2;