Question

Since we upgraded the flex sdk in our application to 4.10 we've been running into Verify Errors while running unit tests that use mockolate.

They seem to occur when mocking an interface where a ByteArray is used in a method signature.

Example interface:

public interface IFileSystemHelper {

    function loadFileContents(path:String):ByteArray;

}

Example test class:

public class SomeTest {

    [Rule]
    public var mockolateRule:MockolateRule = new MockolateRule();

    [Mock]
    public var fileHelper:IFileSystemHelper;

    public function SomeTest() {
    }

    [Test]
    public function testMethod():void {
        // ...
    }
}

When compiling and running the test with flexmojos 6.0.1 the following error is thrown:

VerifyError: Error #1053: Illegal override of IFileSystemHelper8F2B5D281827800A824B85B588C6F2A08AE814ED in mockolate.generated.IFileSystemHelper8F2B5D281827800A824B85B588C6F2A08AE814ED

My initial suspicion was an sdk version problem with playerglobal (or airglobal in our case) so i recompiled mockolate (and flexunit) with sdk 4.10, without any result.

The only thing that seems to work is to remove the ByteArray type from the method signature... but that's not really an option :-) (and this has never been a problem before)

Is there anyone who has had a similar issue?

Thanks

Was it helpful?

Solution

This problem usually occurs when compiling different parts of your application with different versions of the sdk.

I would recommend to have a look at the output of "mvn dependency:tree" as this should output all dependencies (direct and transitive ones). Perhaps this will help you find where the wrong version is comming from.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top