erikandersen-pariveda / fluint

Automatically exported from code.google.com/p/fluint
0 stars 0 forks source link

Stack trace unavailable when error is thrown during setUp() in TestCase #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write a TestCase that has a setUp() method that includes:

  throw( new Error() );

2. Run the TestRunner

What is the expected output? What do you see instead?

The test fails as it should and the stack trace section says 'Setup or
Teardown Failed for this TestCase. Method is invalid. Review Testcase for
stackTrace information'.  However I can't seem to find anywhere where the
stack trace information is accessible.  

A temporary solution, as mentioned in the google groups is to wrap your
setUp code in a try/catch statement so that the error can be inspected. 
(http://groups.google.com/group/fluint-discussions/browse_thread/thread/7b0048fd
6e394d30)

What version of the product are you using? On what operating system?

version: svn revision #94 from trunk.  Running Ubuntu 8.10

Please provide any additional information below.

I'm submitting this as a ticket since I didn't see any comments in the
google group from anyone active on this project.  Hope thats the right
thing to do.

Original issue reported on code.google.com by schi...@gmail.com on 16 Jan 2009 at 6:04

GoogleCodeExporter commented 8 years ago
Issues will be fixed in next version. It is now fixed in the code in the trunk. 
Issue was the the testrunnerdisplay class was swallowing an error in 
databinding. 
Fluint was capturing this data, just not displaying it correctly due to an RTE 
when 
clicking on the test case in the tree

Original comment by malabri...@gmail.com on 20 Jan 2009 at 10:01

GoogleCodeExporter commented 8 years ago
I think this was supposed to be resolved with revision 95.  But I've updated and
built my source to revision 97 and I'm still getting the same problem.  Am I 
missing
something?

Also sorry about duping ticket #6.

Original comment by schi...@gmail.com on 20 Jan 2009 at 10:38

GoogleCodeExporter commented 8 years ago
This issue is still present in fluint-1.1.0.swc.

EX: MyComponent ONLY extends EventDispatcher (and never added to stage). Hence, 
no
CREATION_COMPLETE dispatches. However, my catch() block is never hit:
<code>
    override protected function setUp():void
    {
        try {
            super.setUp();          

            myComponent = new MyComponent();

            //Create a ..., add it to the testEnvironment. Wait until it is created, then run
tests on it
            myComponent.addEventListener( FlexEvent.CREATION_COMPLETE, asyncHandler(
handleSetupComplete, 100 ), false, 0, true );
            //addChild( DisplayObject( myComponent) );

        } catch (e:Error ) {
            Alert.show( e.message );
        }
    }
</code>
And error message printed in TestRunner is not helpful!:

Setup or Teardown Failed for this TestCase. Method is invalid. Review Testcase 
for
stackTrace information
Error: Setup/Teardown Error
    at
net.digitalprimates.fluint.tests::TestCase/protect()[C:\temp\fluintrc2\1.1RC2\fl
uint\src\main\flex\net\digitalprimates\fluint\tests\TestCase.as:336]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at
net.digitalprimates.fluint.tests::TestCase/executeMethodWhileProtected()[C:\temp
\fluintrc2\1.1RC2\fluint\src\main\flex\net\digitalprimates\fluint\tests\TestCase
.as:353]
    at
net.digitalprimates.fluint.tests::TestCase/runTestMethod()[C:\temp\fluintrc2\1.1
RC2\fluint\src\main\flex\net\digitalprimates\fluint\tests\TestCase.as:143]
    at
net.digitalprimates.fluint.ui::TestRunner/runTestMethod()[C:\temp\fluintrc2\1.1R
C2\fluint\src\main\flex\net\digitalprimates\fluint\ui\TestRunner.as:342]
    at
net.digitalprimates.fluint.ui::TestRunner/handleTestProcess()[C:\temp\fluintrc2\
1.1RC2\fluint\src\main\flex\net\digitalprimates\fluint\ui\TestRunner.as:374]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
net.digitalprimates.fluint.tests::TestCase/handleAsyncTimeOut()[C:\temp\fluintrc
2\1.1RC2\fluint\src\main\flex\net\digitalprimates\fluint\tests\TestCase.as:281]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
net.digitalprimates.fluint.async::AsyncHandler/handleTimeout()[C:\temp\fluintrc2
\1.1RC2\fluint\src\main\flex\net\digitalprimates\fluint\async\AsyncHandler.as:17
9]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.utils::Timer/tick()

Original comment by slangeb...@gmail.com on 2 Mar 2009 at 5:42

GoogleCodeExporter commented 8 years ago
Why do you think this would ever get to your catch block? The testrunenr 
message is 
100% right. Setup or TearDown failed because you have an async event which will 
never fire.

Original comment by malabri...@gmail.com on 2 Mar 2009 at 5:59

GoogleCodeExporter commented 8 years ago
Regardless of the catch block, I have no way of knowing what's wrong!

How are we supposed to:

>Review Testcase for stackTrace information

Original comment by slangeb...@gmail.com on 2 Mar 2009 at 8:26

GoogleCodeExporter commented 8 years ago
Yeah, sorry - trying to do 5 things at once, and didn't word the previous very 
well. 
Better question would be shouldn't we see a timeout error, or something to let 
us
know what caused the problem?

Original comment by slangeb...@gmail.com on 2 Mar 2009 at 8:32

GoogleCodeExporter commented 8 years ago
I understand your point, and we might be able to do something, but the setUp() 
and 
tearDown() aren't methods under test, so when they fail it just says 'Setup or 
Teardown Failed for this TestCase' Methods under test are run in such a way 
that it 
is easier to gain more insight into the problem.

I will create an enhancement request for better error descriptions on this

Original comment by malabri...@gmail.com on 2 Mar 2009 at 11:50