Sample Howto

Last update : July 6 2002
Doc for : v1.3

Cactusについて
  • Cactus とは
  • ニュース
  • 変更履歴
  • 特徴/開発状況
  • 目標
  • ロードマップ/ToDo
  • 協力者
  • 協力者募集
  • Cactus ユーザ
  • テスト済環境 ...
  • ライセンス


  • ダウンロード
  • ダウンロード


  • ドキュメント
  • Cactus の仕組み
  • さぁ始めよう
  • モック対コンテナ
  • Javadocs
  • └Javadocs
  • よくある質問


  • Howto ガイド
  • クラスパス Howto
  • 設定 Howto
  • アップグレードHowto
  • テストケース Howto
  • セキュリティHowto
  • Ant Howto
  • HttpUnit Howto
  • サンプル Howto
  • EJB Howto
  • IDE Howto
  • JUnitEE Howto


  • サポート
  • Bug DB
  • メーリングリスト


  • その他
  • 名前の由来
  • ロゴコンテスト
  • 参考文献
  • アクセス状況
  • └WebAlizer


  • 開発者向け
  • CVS
  • コード規約
  • ビルドの結果


  • はじめに/Introduction

    This tutorial explains where to get Cactus samples and how to use them.

    本チュートリアルでは Cactus のサンプルの場所と使い方について説明します。

    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 TestCase Howto tutorial.

    ドキュメントの一部としてサンプルが幾つかあります。 そのサンプルは自分が書こうとしているテストケースの種類によります。 (サーブレット,タグライブラリ,フィルター、など) こうした理由から、 TestCase Howto に幾つかサンプルがあります。

    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 sample/src directory).

    しかしながら、Cactus のサンプルの多くはサンプルソースの形式になっています。 これらのサンプルはダウンロードした Cactus ディストリビューションの一部となっています。 (sample/src ディレクトリにあります。)

    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 Getting Started and the Configuration Howto tutorials). Some detailed explanations for IDE integration are also available in the IDE Howto tutorial.

    次節では、Ant を使って Cactus のサンプルをどのように実行するか説明します。 (サンプルは Ant で実行されるようにパッケージ化されています) サンプルを自分のビルドシステムや好みのIDEと統合したい場合には、 その原理を先に理解し、マニュアルによりインストールしなければなりません。 (Getting Started および Configuration Howto を読んでください) IDE との統合に関する詳しい情報は IDE Howto チュートリアルにもあります。


    AntによるCactusの例題の実行/Running the Cactus Samples using Ant

    準備/Prerequisites

    You need to install the following items prior to building the Cactus Sample application :

    Cactus サンプルアプリケーションをビルドする前に、次の物をインストールしなければなりません :

    • A JVM (1.2 or above),
    • 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.
    • サーブレットエンジン (Servlet API 2.2 以上)。 複数のサーブレットエンジンでの Cactus ユニットテストを自動実行をサポートした Cactus サンプル用 Ant ビルドスクリプト。
    • Ant (see the "Installing Ant" tutorial).
    • Ant ("Antのインストール" のチュートリアルを参照してください)
    • 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 :
      ダウンロードした Cactus サンプルに、相当する Servlet/J2EE API jar ファイル(J2EE 1.2 あるいは 1.3)。 次のサイトからダウンロードできます:
      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 build.properties file, as described below.
      これらのライブラリはハードディスク上のどこにでも置きたい場所に置く事ができます。 次に述べるように、build.propertiesファイルで、 ライブラリの場所を指定しなければならないだけです。

    Cactusの例題のインストール/Installing the Cactus Sample

    Follow these steps :

    次の手順で行います :

    • Download the Cactus Sample and unzip it in a directory. Let's call this directory sampleroot.
    • Cactusの例題をダウンロードし、 任意のディレクトリに解凍します。 このディレクトリをsamplerootとします。
    • Rename (or copy) the sampleroot /build/build.properties.sample file to build.properties. 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.
    • sampleroot/build/build.properties.sample ファイルをbuild.propertiesにリネームあるいはコピーします。 このファイルは Cactus の例題のビルド手順と、 自分の環境(外部 jar アーカイブ、(1つ以上の)サーブレットエンジンホームディレクトリの場所、など)との依存関係を定義します。 あなたの環境に従って、このファイルを編集してください。

    サンプルの実行/Running the samples

    Open a shell, cd to the sampleroot /build directory and type 'ant test.all'. The tests will be executed on all the servlet engines you have defined in the build.properties file you have edited.

    シェルウィンドウを開き、 sampleroot/buildに移動し、 'ant test.all' と入力します。 編集した build.properties で定義した全てのサーブレットエンジンに対して、テストが実行されます。





    [訳注:これは 漆島賢二 が翻訳しました。日本語訳に対するコメントがあれば こちらに送ってください]
    Copyright © 2000-2002 The Apache Software Foundation. All Rights Reserved.