Ejemplo n.º 1
0
    def test_run_junit(self):
        junit = JUnit(self.java, self.classpath)

        output = junit.exec(self.suite_dir, self.suite_classes_dir,
                            self.sut_class, self.suite_classes[0])

        self.assertTrue(output.ok_tests_number > 0)
        self.assertTrue(output.fail_tests == 0)
        self.assertTrue(len(output.fail_test_set) == 0)
        self.assertTrue(output.run_time > 0)
Ejemplo n.º 2
0
    def test_run_junit_timeout(self):
        junit = JUnit(self.java, self.classpath)

        result = junit.exec(self.suite_dir, self.suite_classes_dir,
                            self.sut_class, self.suite_classes[0], 0)

        self.assertEqual(0, result.ok_tests)
        self.assertEqual(0, result.fail_tests)
        self.assertEqual(0, len(result.fail_test_set))
        self.assertEqual(0, result.run_time)
        self.assertIsNone(result.coverage)
        self.assertTrue(result.timeout)
Ejemplo n.º 3
0
    def test_run_junit_timeout(self):
        junit = JUnit(self.java, self.classpath)

        with self.assertRaises(subprocess.TimeoutExpired):
            junit.exec(self.suite_dir, self.suite_classes_dir,
                       self.sut_class, self.suite_classes[0], 0)