<?xml version="1.0" encoding="Shift_JIS"?>

<!DOCTYPE document SYSTEM "./dtd/document-v10.dtd">

<document>
  <header>
    <title>Sample Howto</title>
    <authors>
      <person name="Vincent Massol" email="vmassol@apache.org"/>
    </authors>
    <translators><person name="漆島賢二"/></translators>
  </header>

  <body>

    <s1 title="はじめに/Introduction">

      <p>
        This tutorial explains where to get Cactus samples and how to use
        them.
      </p>
      <p>
        本チュートリアルでは Cactus のサンプルの場所と使い方について説明します。
      </p>
      <p>
        There are some samples available as part of the documentation. The
        samples depend on the kind of test case you are writing (Servlet,
        Taglibs, Filters, ...). For this reason you'll find some samples
        in the <link href="howto_testcase.html">TestCase Howto</link>
        tutorial.
      </p>
      <p>
	ドキュメントの一部としてサンプルが幾つかあります。
	そのサンプルは自分が書こうとしているテストケースの種類によります。
	(サーブレット,タグライブラリ,フィルター、など)
	こうした理由から、
	<link href="howto_testcase.html">TestCase Howto</link>
	に幾つかサンプルがあります。
      </p>
      <p>
        However, the majority of Cactus samples are in the form of source
        samples. These samples are part of the Cactus distribution that
        you have downloaded (in the <code>sample/src</code> directory).
      </p>
      <p>
        しかしながら、Cactus のサンプルの多くはサンプルソースの形式になっています。
	これらのサンプルはダウンロードした Cactus ディストリビューションの一部となっています。
	(<code>sample/src</code> ディレクトリにあります。)
      </p>
      <p>
        The following section explains how to execute the Cactus Samples
        using Ant (the Samples are packaged to be executed with Ant).
        If you wish to integrate them in your own build system or in your
        favorite IDE, you'll have to understand the principles first and
        manually install them (read the
        <link href="getting_started.html">Getting Started</link>
        and the <link href="howto_config.html">Configuration Howto</link>
        tutorials). Some detailed explanations for IDE integration
        are also available in the <link href="howto_ide.html">IDE Howto</link>
        tutorial.
      </p>
      <p>
	次節では、Ant を使って Cactus のサンプルをどのように実行するか説明します。
	(サンプルは Ant で実行されるようにパッケージ化されています)
	サンプルを自分のビルドシステムや好みのIDEと統合したい場合には、
	その原理を先に理解し、マニュアルによりインストールしなければなりません。
	(<link href="getting_started.html">Getting Started</link> および
	<link href="howto_config.html">Configuration Howto</link> を読んでください)
	IDE との統合に関する詳しい情報は
	<link href="howto_ide.html">IDE Howto</link> チュートリアルにもあります。
      </p>

    </s1>

    <s1 title="AntによるCactusの例題の実行/Running the Cactus Samples using Ant">

      <s2 title="準備/Prerequisites">

        <p>
          You need to install the following items prior to building the Cactus
          Sample application :
        </p>
        <p>
	  Cactus サンプルアプリケーションをビルドする前に、次の物をインストールしなければなりません :
        </p>
        <ul>
          <li>
            A JVM (1.2 or above),
          </li>
          <li>
            A Servlet Engine (Servlet API 2.2 or above). The Cactus Sample
            Ant build script supports automatic running the Cactus unit
            tests on several Servlet Engines.
          </li>
          <li>
            サーブレットエンジン (Servlet API 2.2 以上)。
	    複数のサーブレットエンジンでの Cactus 
	    ユニットテストを自動実行をサポートした
	    Cactus サンプル用 Ant ビルドスクリプト。
          </li>
          <li>
            Ant (see the <link href="howto_ant_install.html">"Installing
            Ant"</link> tutorial).
          </li>
          <li>
            Ant (<link href="howto_ant_install.html">"Antのインストール"
	    </link>のチュートリアルを参照してください)
          </li>
          <li>
            A Servlet/J2EE API jar corresponding to the Cactus Sample release
            you have downloaded (J2EE 1.2 or 1.3). You can download the
            jar from :<br/>
	    ダウンロードした Cactus サンプルに、相当する Servlet/J2EE API jar
	    ファイル(J2EE 1.2 あるいは 1.3)。
	    次のサイトからダウンロードできます:<br/>
            <ul>
              <li>
                Servlet API 2.2
                <ul>
                  <li>
                    From
                    <link href="http://java.sun.com/products/servlet/download.html">
                    Sun</link> or from the
                    <link href="http://jakarta.apache.org/builds/jakarta-servletapi/">
                    Jakarta reference implementation</link>
                  </li>
                  <li>
                    <link href="http://java.sun.com/products/servlet/download.html">
                    Sun</link> あるいは
                    <link href="http://jakarta.apache.org/builds/jakarta-servletapi/">
                    Jakarta リファレンス実装</link>より
                  </li>
                </ul>
              </li>
              <li>
                Servlet API 2.3
                <ul>
                  <li>
                    From
                    <link href="http://java.sun.com/products/servlet/download.html">
                    Sun</link> or from the
                    <link href="http://jakarta.apache.org/builds/jakarta-servletapi-4/">
                    Jakarta reference implementation</link>
                  </li>
                  <li>
                    <link href="http://java.sun.com/products/servlet/download.html">
                    Sun</link> あるいは
                    <link href="http://jakarta.apache.org/builds/jakarta-servletapi-4/">
                    Jakarta リファレンス実装</link>より
                  </li>
                </ul>
              </li>
              <li>
                J2EE jar
                <ul>
                  <li>
                    From
                    <link href="http://java.sun.com/j2ee/download.html">J2EE
                    download page</link>
                  </li>
                  <li>
                    <link href="http://java.sun.com/j2ee/download.html">
		    J2EEダウンロードページ</link>より
                  </li>
                </ul>
              </li>
            </ul>
            You can put these libraries anywhere you want on your hard disk.
            You'll just have to specify the location where they are in the
            <code>build.properties</code> file, as described below.<br/>
	    これらのライブラリはハードディスク上のどこにでも置きたい場所に置く事ができます。
	    次に述べるように、<code>build.properties</code>ファイルで、
	    ライブラリの場所を指定しなければならないだけです。<br/>
          </li>
        </ul>

      </s2>

      <s2 title="Cactusの例題のインストール/Installing the Cactus Sample">

        <p>
          Follow these steps :
        </p>
        <p>
          次の手順で行います :
        </p>
        <ul>
          <li>
            Download the <link href="downloads.html">Cactus Sample</link> and
            unzip it in a directory. Let's call this directory
            <em><code>sampleroot</code></em>.
          </li>
          <li>
	    <link href="downloads.html">Cactusの例題</link>をダウンロードし、
	    任意のディレクトリに解凍します。
	    このディレクトリを<em><code>sampleroot</code></em>とします。
          </li>
          <li>
            Rename (or copy) the
            <em><code>sampleroot</code></em>
            <code>/build/build.properties.sample</code> file
            to <code>build.properties</code>. This file defines the dependencies
            between the Cactus Sample build process and your environment
            (location of external jars, home directory for installed servlet
            engine(s), ...). Edit this file to reflect your environment values.
          </li>
          <li>
            <em><code>sampleroot</code></em><code>/build/build.properties.sample</code>
            ファイルを<code>build.properties</code>にリネームあるいはコピーします。
	    このファイルは Cactus の例題のビルド手順と、
	    自分の環境(外部 jar アーカイブ、(1つ以上の)サーブレットエンジンホームディレクトリの場所、など)との依存関係を定義します。
	    あなたの環境に従って、このファイルを編集してください。
          </li>
        </ul>

      </s2>

      <s2 title="サンプルの実行/Running the samples">

        <p>
          Open a shell, cd to the <em><code>sampleroot</code></em>
          <code>/build</code> directory and type '<code>ant test.all</code>'.
          The tests will be executed on all the servlet engines you have
          defined in the <code>build.properties</code> file you have edited.
        </p>
        <p>
          シェルウィンドウを開き、
          <em><code>sampleroot</code></em><code>/build</code>に移動し、
	  '<code>ant test.all</code>' と入力します。
          編集した <code>build.properties</code> で定義した全てのサーブレットエンジンに対して、テストが実行されます。
        </p>

      </s2>

    </s1>

  </body>
</document>
