Mockolate Verify Error: Illegal override.. after Flex SDK 4.10 update

232 views Asked by At

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

1

There are 1 answers

4
Christofer Dutz On BEST ANSWER

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.