You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by szheigh <sh...@gmail.com> on 2013/10/14 21:34:36 UTC

Custom runner class org.flexunit.runners.Suite cannot be instantiated

I'm trying to build my first Flex project in FlashDevelop. It's a mobile app
for Android and iOS. I am trying to set up FlexUnit for testing, but I am
running into a lot of problems. I finally got it to compile, but when I try
to run it, I get the following error:



Here is my code in Tests.mxml:


And here is AllTestsSuite.as:




-----
Beware of Newbie - I'm new to AS3 and Flex.
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Custom-runner-class-org-flexunit-runners-Suite-cannot-be-instantiated-tp3173.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Custom runner class org.flexunit.runners.Suite cannot be instantiated

Posted by szheigh <sh...@gmail.com>.
I figured out a fix, and this is rather strange.
The problem was that I had "public class AllTestsSuite extends TestSuite"
where it shouldn't have been inheriting from TestSuite. I removed "extends
TestSuite" and now it works fine.
I'm not sure why I had it there in the first place, it's probably something
I had to do with a different testing framework at one time.

It would be nice if FlexUnit would give somewhat more helpful error messages
though...



-----
Beware of Newbie - I'm new to AS3 and Flex.
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Custom-runner-class-org-flexunit-runners-Suite-cannot-be-instantiated-tp3173p3222.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Custom runner class org.flexunit.runners.Suite cannot be instantiated

Posted by szheigh <sh...@gmail.com>.
I posted this on the Nabble forum, and it looks like the code didn't come
through on the mailing list. Here it is again:

------The error:

tests::AllTestsSuite.initializationError .
tests::AllTestsSuite.initializationError E
Time: 0
There was 1 failure:
1 tests::AllTestsSuite.initializationError Error: Custom runner class
org.flexunit.runners.Suite cannot be instantiated
	at
org.flexunit.internals.runners::InitializationError()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\InitializationError.as:50]
....
FAILURES!!! Tests run: 1, 1 Failures:

------Tests.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                       
xmlns:s="library://ns.adobe.com/flex/spark"
					xmlns:flexunit="http://www.adobe.com/2009/flexUnitUIRunner"
					creationComplete="runTests()"
					firstView="com.myapp.views.HomeView">

	<fx:Script>
		
	</fx:Script>
	
	<fx:Declarations>
		
	</fx:Declarations>
	
</s:ViewNavigatorApplication>

------AllTestsSuite.as:

package tests 
{
	import flexunit.framework.TestSuite;
	import org.flexunit.runners.Suite;

	[Suite]
	[RunWith("org.flexunit.runners.Suite")]
	public class AllTestsSuite extends TestSuite 
	{
		// Add all the tests
		public var testCase1:FirstTestCase;
	}

}



-----
Beware of Newbie - I'm new to AS3 and Flex.
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Custom-runner-class-org-flexunit-runners-Suite-cannot-be-instantiated-tp3173p3193.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.