質問
FlashBuilder4でFlexUnit4を使用しています。私がユニットテストしているクラスの多くは フラッシュロガー.
メインアプリでは、使用します TraceTarget ロギングがトレースウィンドウに表示され、デバッグが大幅に役立つようになります。
<!-- route logging to the trace window -->
<mx:TraceTarget includeTime="true"/>
FlashBuilderが生成するユニットテストランナー(FlexUnitApplication.mxml)についても同じことをしたいのですが、どうすればいいのかわかりません。もちろん、TracetargetをFlexUnitApplication.mxmlに追加することもできますが、ファイルの上部にある警告が言うように、
<!-- This is an auto generated file and is not intended for modification. -->
それを変更することはおそらく良い考えではありません。
私の質問は、FlashBuilderとFlexUnitでロギングにトレースを取得するにはどうすればよいですか?
解決
上記の方法からキューを取りました この記事 FlexUnitApplicationから継承するUnittestrunner.mxmlを作成しました。
<?xml version="1.0" encoding="utf-8"?>
<local:FlexUnitApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*"
minWidth="955" minHeight="600">
<fx:Declarations>
<!-- send log messages to trace window -->
<s:TraceTarget includeTime="true"/>
</fx:Declarations>
</local:FlexUnitApplication>
次に、Flash Builder設定を設定して、FlexUnitApplicationの代わりにUnittestrunnerを実行するように設定します(設定 - > Flash Builder-> FlexUnit->カスタムアプリケーション名)。
所属していません StackOverflow