Пример #1
0
    def run(self, results=None):
        """
		Runs the underlying JUnit TestCase.  First we make sure our
		own test listener is registered with the JUnit results instance
		so we can collect stats for our own reporting.
		"""
        util.startTest(self, results, self.listener)
        debug("Running test: %s" % (self.getName()))

        # inject the function handlers before running the code
        try:
            if results is not None:
                results.removeListener(self.listener)
                results.addListener(self.listener)
            else:
                results = self.createResult()
            self.basetest.run(results)
        except java.lang.AssertionError, ae:
            util.__test_results__.fail(ae.getMessage())
Пример #2
0
    def run(self, results=None):
        '''
		Runs the underlying JUnit TestCase.  First we make sure our
		own test listener is registered with the JUnit results instance
		so we can collect stats for our own reporting.
		'''
        util.startTest(self, results, self.listener)
        debug("Running test: %s" % (self.getName()))

        # inject the function handlers before running the code
        try:
            if results is not None:
                results.removeListener(self.listener)
                results.addListener(self.listener)
            else:
                results = self.createResult()
            self.basetest.run(results)
        except java.lang.AssertionError, ae:
            util.__test_results__.fail(ae.getMessage())
Пример #3
0
    def run(self, results=None):
        """
		Runs the test by importing the jython script.  So any top-level
		code is executed.  In addition, if the script contains a function
		named "run_test()", that function is executed.
		"""
        util.startTest(self, results, self.listener)
        debug("Running test: %s" % (self.mod_name))

        # inject the function handlers before running the code
        testmod = None
        try:
            __import__(self.mod_name, globals(), locals())
            testmod = sys.modules[self.mod_name]

            # setup
            try:
                self.modSetUp(testmod)
            except java.lang.Exception, je:
                util.__test_results__.error(je)
            except Exception, e:
                util.__test_results__.error(e)
Пример #4
0
    def run(self, results=None):
        '''
		Runs the test by importing the jython script.  So any top-level
		code is executed.  In addition, if the script contains a function
		named "run_test()", that function is executed.
		'''
        util.startTest(self, results, self.listener)
        debug("Running test: %s" % (self.mod_name))

        # inject the function handlers before running the code
        testmod = None
        try:
            __import__(self.mod_name, globals(), locals())
            testmod = sys.modules[self.mod_name]

            # setup
            try:
                self.modSetUp(testmod)
            except java.lang.Exception, je:
                util.__test_results__.error(je)
            except Exception, e:
                util.__test_results__.error(e)