- 追加された行はこの色です。
- 削除された行はこの色です。
*** Class#getResource() をいろいろな環境で
Tomcatでは
System.out.println(Log4jInitServlet.class.getResource("/"));
System.out.println(Log4jInitServlet.class.getResource("."));
System.out.println(Log4jInitServlet.class.getResource("lib"));
System.out.println(Log4jInitServlet.class.getResource("/../lib/"));
の結果は
file:/C:/Documents and Settings/xxxx/My Documents/IBM/wssd/workspace/xxxx/Web Content/WEB-INF/classes/
null
null
file:/C:/Documents and Settings/xxxx/My Documents/IBM/wssd/workspace/xxxx/Web Content/WEB-INF/lib/
通常のテスト時と、カバレッジを取得するときでは手順がことなる。
WASでは(正確にはWSSD)
file:/C:/Program%20Files/IBM/WebSphere%20Studio/Site%20Developer/v5.1/runtimes/base_v5/properties/
file:/C:/Documents and Settings/m-kino/My Documents/IBM/wssd/workspace/FrameworkWebApplication/Web Content/WEB-INF/classes/kino/servlet/init/
null
file:/C:/Program Files/IBM/WebSphere Studio/Site Developer/v5.1/runtimes/base_v5/java/lib/
おいっっ
カバレッジ取得時の手順としては、
Windows上でAntを実行してJarを作成する
ant clean with.clover test.javac. jar
そのJarをパスを一番上になっていることを確認する
classesではなくjarが先にロードされるようにするのがポイント
WSAD上からサーバを起動する。
WSAD上からAllTestsを実行する <-ここはAntでもよいかも。
Antでclover.htmlでレポートを出力