CFUnit-Ant連携方法

【How to Use CFUnit-Ant】

■環境構築
1.前提条件として、CFEclipseを導入している。
 ※CFEclipseのインストールについてはここでは触れない。
 
2.cfunit_ant.jarファイルをダウンロード(http://sourceforge.net/project/showfiles.php?group_id=145385&package_id=168973)する

3.『CFUnitExample』(CFML)プロジェクトを作成する。
 ※プロジェクトの出力先は『C:\Inetpub\wwwroot\』に指定すること。
 ※ファイル構成については上と同様とする。

4.『Sample1』プロジェクトのフォルダの直下に以下のファイルbuild.xmlを作成する。
<?xml version="1.0"?>

<project name="CFUnit" default="main" basedir=".">
  <taskdef name="CFUnit" classname="net.sourceforge.cfunit.ant.CFUnit"/>
 
  <property name="domain" value="http://localhost/" />
 
  <target name="main">
    <CFUnit testcase="${domain}CFUnitExample/MyCFCTest.cfc" verbose="true" />
  </target>
</project>

■Antの設定
 以下にAnt設定時の操作を示す。
  1. Right click the project and click "properties" (or select "Project" > "Properties" in the tool bar)
  2. Select "Builders" along the left of the properties window, and then click the "New" button
  3. Select "Ant Build", and click "OK"
  4. Give the builder a name in the "Name:" field.
  5. In the "Buildfile" field, enter the location of your build XML file using the "Browse Workspace..." button
  6. Go to the "Targets" Tab, select "Set Targets" button beside the "Auto Build:" section. You can either just click OK (to accept the default target) or select an alternative target.
  7. Select the "Classpath" tab, and click the "Add External JARs..." button (may need to click the "User Entry" icon first to enable the button) *
  8. Browse to the location you downloaded the CFUnit-Ant JAR too, and click the "Open" button *
  9. Select the "Build Options" tab, and check off "Specify working set of relevant resources"
10. Click the "Specify Resources..." button, and select the resources you would like this builder to be associated with. You can either specify specific files, or entire directories, or both.

■Antの実行
1. build.xmlを選択して、右クリックで実行を選択する。

2.コンソールにビルドが成功した内容が表示されることを確認する。

以上
最終更新:2007年01月15日 18:04
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。