[ 
https://issues.apache.org/jira/browse/FLEX-34323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14001661#comment-14001661
 ] 

Darrell Loverin commented on FLEX-34323:
----------------------------------------

Mustella tests written in the in the non-standard directory need to have some 
initialization code added to their init() methods so tell mustella where the 
exclude file is located relative to the running test. Below is an example:

<?xml version="1.0" encoding="utf-8"?>
<UnitTester testDir="svt-tests/graph/scripts/"  
xmlns:fx="http://ns.adobe.com/mxml/2009"; 
xmlns:mx="library://ns.adobe.com/flex/mx" 
xmlns:s="library://ns.adobe.com/flex/spark"  
            xmlns:m="http://ns.adobe.com/mxml/2009"; 
            xmlns:svt="http://ns.simplivity.com/svt"; xmlns="*" 
testSWF="GraphView.mxml">
    <!-- this set of lines form a template that must be in each unit test -->
    <fx:Script>
        <![CDATA[
            import com.simplivity.components.Graph;
            
            import mx.core.FlexGlobals;
            import mx.utils.LoaderUtil;
            
            public static function init(o:DisplayObject):void
            {
                // Set the directory where the exclude file loads.
                var url:String =  
LoaderUtil.createAbsoluteURL(o.loaderInfo.url, "../../../");
                if (!url)
                    throw new Error("could not find mustella test directory");

                if (url.charAt(url.length - 1) == "/")
                    url = url.substring(0, url.length - 1);
      
                mustellaTestDir = url;
            }       
         
        ]]>
    </fx:Script>
    ...

</UnitTester>

> Allow the mustella tests directory to be located anywhere
> ---------------------------------------------------------
>
>                 Key: FLEX-34323
>                 URL: https://issues.apache.org/jira/browse/FLEX-34323
>             Project: Apache Flex
>          Issue Type: Improvement
>          Components: Mustella
>    Affects Versions: Apache Flex 4.12.0
>            Reporter: Darrell Loverin
>            Assignee: Darrell Loverin
>            Priority: Minor
>
> I want to use mustella to test my own components but keep mustella in a 
> 'third-party' directory and my mustella tests in another directory.
> This is not currently possible because the 'tests' directory is hard-coded by 
> be a subdirectory of 'mustella'.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to