[java-sig-commits] [javapackages] Add initial maven_depmap testcases

Stanislav Ochotnicky sochotni at fedoraproject.org
Thu Sep 19 13:46:09 UTC 2013


commit d3504ffd28c6357ec596255245f72a957c8e03e8
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Thu Sep 19 15:43:42 2013 +0200

    Add initial maven_depmap testcases

 test/maven_depmap_test.py |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/test/maven_depmap_test.py b/test/maven_depmap_test.py
new file mode 100644
index 0000000..d021ffd
--- /dev/null
+++ b/test/maven_depmap_test.py
@@ -0,0 +1,37 @@
+import unittest
+from test_common import *
+import inspect
+
+from lxml import etree
+from formencode import doctest_xml_compare
+
+class TestMavenDepmap(unittest.TestCase):
+
+
+    def xml_compare_reporter(self, report):
+        print report
+
+    def check_result(self, test_name, depmap):
+        dirpath = os.path.dirname(os.path.realpath(__file__))
+        got = etree.fromstring(depmap)
+        want = etree.parse(os.path.join(dirpath,
+                                       'data',
+                                       'maven_depmap',
+                                       test_name+"-want.xml")).getroot()
+        res = doctest_xml_compare.xml_compare(got, want, self.xml_compare_reporter)
+        return got, want, res
+
+    @mvn_depmap('JPP-bndlib.pom', 'usr/share/java/bndlib.jar')
+    def test_basic(self, stdout, stderr, return_value, depmap):
+        self.assertEqual(return_value, 0)
+        got, want, res = self.check_result(inspect.currentframe().f_code.co_name,
+                                           depmap)
+        self.assertEqual(res, True)
+
+    @mvn_depmap('JPP-aqute-bndlib.pom', 'usr/share/java/aqute-bndlib.jar')
+    def test_different_artifactId(self, stdout, stderr, return_value, depmap):
+        print stderr
+        self.assertEqual(return_value, 0)
+
+if __name__ == '__main__':
+    unittest.main()


More information about the java-sig-commits mailing list