def test_unsupported(self):
     return_value, stderr, report = exec_pom_macro_simple(\
             "%pom_remove_parent",
             "simple_ivy.xml", filename='ivy.xml')
     assertIn(self, 'Operation not supported', stderr)
     self.assertNotEqual(0, return_value)
     self.assertEqual('', report)
 def test_require_skipped(self, stdout, stderr, return_value):
     self.assertNotEqual(return_value, 0)
     self.assertNotEqual(stderr, "")
     lines = stderr.split("\n")
     self.assertEqual(True, len(lines) > 1)
     self.assertEqual("g:skipped:UNKNOWN required by g:a1", lines[-5])
     assertIn(self, "%mvn_package", lines[-3])
 def test_no_match(self):
     return_value, stderr, _ = exec_pom_macro(
         '''%pom_xpath_disable "/pom:project/pom:groupId='not-there'" submodule''',
         {'submodule': 'minimal_pom.xml'})
     assertIn(self, "Error", stderr)
     assertIn(self, "didn't match", stderr)
     self.assertNotEqual(0, return_value)
示例#4
0
 def test_unsupported(self):
     return_value, stderr, report = exec_pom_macro_simple(\
             "%pom_remove_parent",
             "simple_ivy.xml", filename='ivy.xml')
     assertIn(self, 'Operation not supported', stderr)
     self.assertNotEqual(0, return_value)
     self.assertEqual('', report)
示例#5
0
 def test_recursive_missing(self):
     poms_tree = dict(example_tree)
     del poms_tree['intermediate/schemas']
     return_value, stderr, _ = exec_pom_macro('%pom_remove_dep -r :commons-io',
             poms_tree=poms_tree)
     assertIn(self, "Couldn't locate", stderr)
     self.assertNotEqual(0, return_value)
示例#6
0
 def test_require_skipped(self, stdout, stderr, return_value):
     self.assertNotEqual(return_value, 0)
     self.assertNotEqual(stderr, '')
     lines = stderr.split('\n')
     self.assertEqual(True, len(lines) > 1)
     self.assertEqual("g:skipped:UNKNOWN required by g:a1", lines[-5])
     assertIn(self, "%mvn_package", lines[-3])
示例#7
0
    def test_no_pom_explicit(self):
        package = Package("nonexistent_pom_explicit")
        package.append_to_prep('%pom_remove_parent nonexistent_pom.xml')
        _, stderr, returncode = package.run_prep()

        self.assertEqual(returncode, 1, stderr)
        assertIn(self, "Couldn't locate ", stderr)
示例#8
0
    def test_no_pom_explicit(self):
        package = Package("nonexistent_pom_explicit")
        package.append_to_prep('%pom_remove_parent nonexistent_pom.xml')
        _, stderr, returncode = package.run_prep()

        self.assertEqual(returncode, 1, stderr)
        assertIn(self, "Couldn't locate ", stderr)
 def test_no_match(self):
     return_value, stderr, _ = exec_pom_macro(
         '''%pom_xpath_disable "/pom:project/pom:groupId='not-there'" submodule''', {
         'submodule': 'minimal_pom.xml'})
     assertIn(self, "Error", stderr)
     assertIn(self, "didn't match", stderr)
     self.assertNotEqual(0, return_value)
示例#10
0
 def test_submodules_partial_match(self):
     return_value, stderr, _ = exec_pom_macro(\
             '%pom_remove_dep :commons-io submodule1 submodule2',
             poms_tree={'submodule1': 'minimal_pom.xml',
                 'submodule2': 'simple_pom.xml'})
     assertIn(self, "Error", stderr)
     assertIn(self, "not found", stderr)
     self.assertNotEqual(0, return_value)
示例#11
0
 def test_usage(self):
     package = Package("usage")
     pompath = os.path.join(WORKDIR, "pom_remove_dep.xml")
     package.add_source(pompath, "pom.xml")
     package.append_to_prep('%pom_remove_dep')
     _, stderr, return_value = package.run_prep()
     self.assertEqual(return_value, 1)
     assertIn(self, "Usage: %pom_remove_dep "\
                   "[groupId]:[artifactId] [POM location]", stderr)
示例#12
0
 def test_usage(self):
     package = Package("usage")
     pompath = os.path.join(WORKDIR, "pom_remove_dep.xml")
     package.add_source(pompath, "pom.xml")
     package.append_to_prep('%pom_remove_dep')
     _, stderr, return_value = package.run_prep()
     self.assertEqual(return_value, 1)
     assertIn(self, "Usage: %pom_remove_dep "\
                   "[groupId]:[artifactId] [POM location]", stderr)
示例#13
0
    def test_xpath_set_fail(self, stdin, stderr, returncode, pom_path):
        self.assertEqual(returncode, 1, stderr)
        assertIn(self, "Error in processing", stderr)

        report, res = check_result(pom_path)
        self.assertEqual(res, True, report)
示例#14
0
 def test_xpath_replace_invalid_xml(self, stdin, stderr,
                                    returncode, pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#15
0
 def test_xpath_inject_fail(self, stdin, stderr, returncode, pom_path):
     # invalid XML code
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
 def test_fail_on_main(self):
     return_value, stderr, _ = exec_pom_macro(
         """%pom_xpath_disable "pom:groupId='com.example'" """,
         poms_tree=example_tree)
     assertIn(self, "Main POM satisfies the condition", stderr)
     self.assertNotEqual(0, return_value)
示例#17
0
 def test_configuration(self, stdout, stderr, return_value):
     self.assertEqual(return_value, 0, stderr)
     sout = [x for x in stdout.split('\n') if x]
     self.assertEqual(len(sout), 1)
     assertIn(self, "MYNS-javapackages-tools", sout)
示例#18
0
    def test_xpath_set_fail(self, stdin, stderr, returncode, pom_path):
        self.assertEqual(returncode, 1, stderr)
        assertIn(self, "Error in processing", stderr)

        report, res = check_result(pom_path)
        self.assertEqual(res, True, report)
示例#19
0
 def test_recursive_no_match(self):
     return_value, stderr, _ = exec_pom_macro('%pom_remove_dep -r :not-there',
             poms_tree=example_tree)
     assertIn(self, "Error", stderr)
     assertIn(self, "not found", stderr)
     self.assertNotEqual(0, return_value)
示例#20
0
 def test_recursive_partial_match(self):
     return_value, stderr, _ = exec_pom_macro('%pom_remove_dep -r commons-ioX intermediate common',
             poms_tree=example_tree)
     assertIn(self, "Error", stderr)
     assertIn(self, "not found", stderr)
     self.assertNotEqual(0, return_value)
示例#21
0
 def test_configuration(self, stdout, stderr, return_value):
     self.assertEqual(return_value, 0, stderr)
     sout = [x for x in stdout.split('\n') if x]
     self.assertEqual(len(sout), 1)
     assertIn(self, "SCL-javapackages-tools", sout)
示例#22
0
 def test_xpath_inject_fail(self, stdin, stderr, returncode, pom_path):
     # invalid XML code
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#23
0
 def test_unparsable_xml(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#24
0
 def test_unparsable_xml(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#25
0
 def test_remove_plugin_ret1(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1)
     assertIn(self, "Error in processing", stderr)
示例#26
0
 def test_disable_module_no_effect(self, stdin, stderr, returncode,
                                   pom_path):
     self.assertEqual(returncode, 1)
     assertIn(self, "Error in processing", stderr)
示例#27
0
 def test_xpath_remove_fail(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#28
0
 def test_missing_jar(self):
     p = Package('test')
     p.append_to_prep("%add_maven_depmap g:a:1 this/file/doesnt/exist.jar")
     _, stderr, return_value = p.run_prep()
     self.assertEqual(1, return_value, 'bad return value')
     assertIn(self, 'file not found', stderr)
示例#29
0
 def test_xpath_replace_invalid_xml(self, stdin, stderr, returncode,
                                    pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
 def test_fail_on_main(self):
     return_value, stderr, _ = exec_pom_macro(
             """%pom_xpath_disable "pom:groupId='com.example'" """,
            poms_tree=example_tree)
     assertIn(self, "Main POM satisfies the condition", stderr)
     self.assertNotEqual(0, return_value)
示例#31
0
 def test_remove_dep_no_effect(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#32
0
 def test_submodule_nonexistent(self):
     return_value, stderr, _ = exec_pom_macro('%pom_remove_parent submodule', {})
     assertIn(self, "Couldn't locate ", stderr)
     self.assertNotEqual(0, return_value)
示例#33
0
 def test_missing_jar(self):
     p = Package('test')
     p.append_to_prep("%add_maven_depmap g:a:1 this/file/doesnt/exist.jar")
     _, stderr, return_value = p.run_prep()
     self.assertEqual(1, return_value, 'bad return value')
     assertIn(self, 'file not found', stderr)
 def test_nonexistent(self):
     return_value, stderr, _ = exec_pom_macro('%pom_xpath_disable nothing', {})
     assertIn(self, "Couldn't locate ", stderr)
     self.assertNotEqual(0, return_value)
示例#35
0
 def test_remove_dep_no_effect(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#36
0
 def test_remove_plugin_ret1(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1)
     assertIn(self, "Error in processing", stderr)
示例#37
0
 def test_unknown_dep(self, stdout, stderr, return_value):
     self.assertNotEqual(return_value, 0)
     serr = [x for x in stderr.split("\n") if x]
     want = "org.apache.maven:maven-project:2.2.1"
     assertIn(self, want, serr)
示例#38
0
 def test_unknown_dep(self, stdout, stderr, return_value):
     self.assertNotEqual(return_value, 0)
     serr = [x for x in stderr.split('\n') if x]
     want = ("org.apache.maven:maven-project:2.2.1")
     assertIn(self, want, serr)
示例#39
0
 def test_xpath_remove_fail(self, stdin, stderr, returncode, pom_path):
     self.assertEqual(returncode, 1, stderr)
     assertIn(self, "Error in processing", stderr)
示例#40
0
 def test_disable_module_no_effect(self, stdin, stderr,
                                   returncode, pom_path):
     self.assertEqual(returncode, 1)
     assertIn(self, "Error in processing", stderr)
 def test_nonexistent(self):
     return_value, stderr, _ = exec_pom_macro('%pom_xpath_disable nothing',
                                              {})
     assertIn(self, "Couldn't locate ", stderr)
     self.assertNotEqual(0, return_value)