<?xml version="1.0" encoding="Shift_JIS"?>

<!DOCTYPE document SYSTEM "./dtd/document-v10.dtd">

<document>
  <header>
    <title>JUnitEE Howto</title>
    <authors>
      <person name="Kaarle Kaila" email="kaarle.kaila@iki.fi"/>
      <person name="Vincent Massol" email="vmassol@apache.org"/>
    </authors>
    <translators><person name="漆島賢二"/></translators>
  </header>

  <body>

    <s1 title="JUnitEE,コンテナ内のTestRunner/JUnitEE, a TestRunner inside the Container">

	  <p>
		You can use the
        <link href="http://junitee.sourceforge.net">JUnitEE</link> user
        interface to run your all your tests inside the Container. JUnitEE is
        a JUnit TestRunner that has been written as a servlet with the user
        interface in HTML format.
	  </p>
	  <p>
	コンテナ中で行われる全てのテストを実行するのに
	<link href="http://junitee.sourceforge.net">JUnitEE</link>
	ユーザーインターフェースが使えます。
	JUnitEE は
	HTML フォーマットのユーザインターフェースを持つ、
	サーブレットとして記述された
	JUnit の TestRunner です。
	  </p>

	  <p>
		You cannot achieve all features of Cactus using JUnitEE as
		part of them depend on being executed on the client side.
		Executing JUnitEE from ANT commands will probably not be possible.
		Some benefits however of JUnitEE are:
	  </p>
	  <p>
		一部はクライアント側での実行に依存しているので、
		JUnitEE を用いて Cactus の全ての機能を達成することはできません。
		JUnitEE を Ant コマンドから実行することは、
		おそらくできないでしょう。
		しかしながら、JUnitEE には幾つかのメリットがあります : 
	  </p>

	  <ul>
	   <li>
	   	  <strong>All class files are in one place</strong> :  Install all your
          TestCase class-files only in your container classpath. Both
          TestCases derived from
		  <code>junit.framework.TestCase</code> and from
          <code>org.apache.cactus.JspTestCase</code>
		  will be located in the same place and only once.
	   </li>
	   <li>
	   	  <strong>全てのクラスが一箇所に置ける</strong> :  
		自分のテストケースを全てコンテナのクラスパスにインストールします。
		<code>junit.framework.TestCase</code> および
        	<code>org.apache.cactus.JspTestCase</code> から
		派生したテストケースは、
		同じたった一つの場所に置かれるのです。
	   </li>
	   <li>
          <strong>Run all TestCases in the container</strong> : You can mix
          both types of TestCases mentioned above in your test. All tests are
          executed inside the Container. You can use testcases derived from
          <code>junit.framework.TestCase</code> to test methods that do not
          require the http objects such as the
		  <code>HttpServletRequest</code> or
          <code>HttpServletResponse</code> objects.
	   </li>
	   <li>
          <strong>全てのテストケースをコンテナで実行します</strong> : 
	  開発者はテスト中に上述のテストケースのどちらを混ぜて使っても構いません。
	  全てのテストはコンテナ上で行われます。
	  <code>HttpServletRequest</code> や
          <code>HttpServletResponse</code> オブジェクトのような HTTP
	  オブジェクトを必要としないメソッドをテストするために、
	  <code>junit.framework.TestCase</code> から派生したテストケースを
	  使うことができます。
	   </li>
	  </ul>

	  <p>
	    Using JUnitEE is (relatively) simple. Assuming you have a container
        such as Weblogic, Tomcat or Orion functioning and you know how to
        configure Servlets and adding libraries to the Containers classpath and
        you are familiar with the basics of Cactus then the rest is easy.
	  </p>
	  <p>
	JUnitEE を使うのは(比較的)簡単です。
	正しく動作する Weblogic、Tomcat、Orion のようなコンテナがあり、
	サーブレットやライブラリをコンテナのクラスパスに設定する方法を知っており、
	Cactus の基本について知っていれば、
	残りは簡単です。
	  </p>

	  <ul>
	  	<li>
	  	  One good reason to use JUnitEE would be when you want to try Cactus
          quickly and are not concerned with automatic unit testing.
		</li>
	  	<li>
		<suspect>JUnitEE を使う一つの良い理由は、
		Cactus をすぐ試してみたく、
		自動的な単体テストに関心が無い時でしょう。</suspect>
		</li>
		<li>
		  Usage of standard JUnit testrunner (textui,swingui, ...) will not be
          possible if cactus is configured this way and thus the ant junit task
          cannot be used to automate the test.
		</li>
		<li>
		Cactus がこの方法で設定された場合、
		標準の JUnit のテストランナー(textui、swinguiなど)は使えないので、Ant の junit タスクをテスト自動化に使う事はできません。
		</li>
	  </ul>

    </s1>

    <s1 title="JUnitEE のインストール法/How to install JUnitEE">

	  <p>
		Download the <link href="http://junitee.sourceforge.net">JUnitEE</link>
		zip-file. Add a reference to junitee.jar to your Container classpath.
        Add also references to <code>junit.jar</code>, <code>httpunit.jar</code>
        <code>cactus.jar</code> and <code>aspectjrt.jar</code> if you have not
        already done that.
	  </p>
	  <p>
	  <link href="http://junitee.sourceforge.net">JUnitEE</link> 
	  ZIPファイルをダウンロードし、
	  コンテナのクラスパスに、junitee.jar を参照できるよう加えます。
	  まだ加えてない場合には、
	  <code>junit.jar</code>、<code>httpunit.jar</code>、
          <code>cactus.jar</code>および<code>aspectjrt.jar</code>
	  も参照できるように加えます。
	  </p>

	  <note>
        add <code>junitee.jar</code> in the same way as cactus.jar is added.
	  </note>
	  <note>
	  cactus.jar を加えたのと同じ方法で <code>junitee.jar</code>
	  を加えます。
	  </note>

	  <p>
	  	Configure TestServlet in your Container. You may use the example servlet
		<code>org.infohazard.servlet.TestServlet</code> that
		comes with JUnitEE. Check JUnitEE documentation. TestServlet extends
		<code>junit.htmlui.TestServletBase</code> that executes
        <code>junit.htmlui.TestRunner</code>
		i.e. the JUnitEE interface.
	  </p>
	  <p>
	  コンテナ中の TestServlet を設定します。
	  JUnitEE にある、
	  <code>org.infohazard.servlet.TestServlet</code> サンプルサーブレットが利用できます。
	  JUnitEE のドキュメントをご覧ください。
	  TestServlet は
	  JUnitEE のインターフェースである
	  <code>junit.htmlui.TestRunner</code> を実行する
	  <code>junit.htmlui.TestServletBase</code> を拡張します。
	  </p>

	 </s1>

     <s1 title="JUnitEE でのテストの実行/Executing the tests with JUnitEE">
		<p>
           You request the tests from an html-page in your container. You can
           write the name of your testclasses according to the examples with
           JUnitEE as:
		</p>
		<p>
	   コンテナにある HTML ページからテストを要求します。
	   JUnitEE のサンプルに従って自分のテストクラスの名前を書くことができます : 
		</p>

		<ul>
		   <li>
		   	a commandstring parameter such as
			"<code>/TestServlet?suite=fi.iki.kaila.MyTests&amp;list=yes</code>"
		   </li>
		   <li>
		"<code>/TestServlet?suite=fi.iki.kaila.MyTests&amp;list=yes</code>" といったコマンド文字列パラメーターとして
		   </li>
		   <li>
		   	as input using
            <code>&lt;input type="text" name="suite" size=60 /&gt;</code> in
            a form element that requests TestServlet
		   </li>
		   <li>
		TestServlet を要求する FORM 要素にある
		<code>&lt;input type="text" name="suite" size=60 /&gt;</code>
		を用いた入力として
		   </li>
		   <li>
		    as one or more option elements in a select element in the
            form-element
		   </li>
		   <li>
	FORM 要素中の SELECT 要素の中の
	一つあるいはそれ以上の OPTION 要素として
		   </li>
		</ul>
      </s1>

      <s1 title="JUnitEE に Cactus リダイレクタを使うよう指示する/Tell JUnitEE to use Cactus redirector">

         <p>
		   The <code>cactus.properties</code> file must be located so that your
           container can find it e.g. in your containers classpath.
         </p>
         <p>
	   <code>cactus.properties</code> ファイルはコンテナが見付けられるような場所に置かなければなりません。
	例えば、コンテナのクラスパスの中など、
         </p>

      </s1>

  </body>
</document>
