Beispiel #1
0
    def setUp(self):
        os.chdir(orig_wd)
        test_doc_1 = os.getcwd(
        ) + r'\static_files\TEST-org.apache.tika.cli.TikaCLIBatchCommandLineTest.xml'
        test_doc_2 = os.getcwd(
        ) + r'\static_files\MavenProj\sub_mod_2\target\surefire-reports\TEST-p_1.AssafTest.xml'
        self.test_report_1 = TestObjects.TestClassReport(test_doc_1, '')
        try:
            self.test_report_2 = TestObjects.TestClassReport(
                test_doc_2,
                os.getcwd() + r'\static_files\MavenProj\sub_mod_2')
        except TestObjects.TestParserException as e:
            print("Unexpected state of the test driver. Caused excpetion:")
            print(e.msg)
            #resetEnvritonment()

        self.test_1 = TestObjects.TestClass(
            os.getcwd() +
            r'\static_files\MavenProj\sub_mod_2\src\test\java\NaimTest.java')
        self.test_2 = TestObjects.TestClass(
            os.getcwd() +
            r'\static_files\MavenProj\sub_mod_1\src\test\java\p_1\AmitTest.java'
        )
        self.test_2 = TestObjects.TestClass(
            os.getcwd() +
            r'\static_files\MavenProj\sub_mod_1\src\test\java\p_1\AmitTest.java'
        )
        self.test_3 = TestObjects.TestClass(
            os.getcwd() +
            r'\static_files\tika_1\src\test\java\org\apache\tika\parser\AutoDetectParserTest.java'
        )
        self.test_4 = TestObjects.TestClass(
            os.getcwd() +
            r'\static_files\tika_1\src\test\java\org\apache\tika\sax\AppendableAdaptorTest.java'
        )
        self.test_5 = TestObjects.TestClass(
            os.getcwd() +
            r'\static_files\tika_1\src\test\java\org\apache\tika\sax _1\AppendableAdaptorTest.java'
        )
        self.testcase_1 = [
            t for t in self.test_3.testcases
            if t.id.endswith('None_testExcel()')
        ][0]
        self.testcase_2 = [
            t for t in self.test_4.testcases
            if t.id.endswith('None_testAppendChar()')
        ][0]
        self.testcase_3 = [
            t for t in self.test_5.testcases
            if t.id.endswith('None_testAppendChar()')
        ][0]
        self.testcase_4 = [
            t for t in self.test_5.testcases
            if t.id.endswith('None_testAppendString()')
        ][0]
Beispiel #2
0
 def parse_tests_reports(self, path_to_reports, module=None):
     inspected_module = self.repo_dir
     if not module == None:
         inspected_module = module
     ans = []
     for filename in os.listdir(path_to_reports):
         if filename.endswith(".xml"):
             ans.append(
                 TestObjects.TestClassReport(
                     os.path.join(path_to_reports, filename),
                     inspected_module))
     return ans