Cactus에서 이미 만들어놓은 JUnit 케이스를 재활용할 수 있는데.
만들어놓은 JUnit을 서버로 올려서 TestRunner를 이용하여 브라우져에서 실행하면 그대로 실행된다.
만약 ANT TASK에서 호출하고자 할때는 기존 JUnit케이스를 다음과 같이 ServletTestCase로 묶어야지 호출이 가능하다.
==
본인은 구글 클라우드의 직원이며, 이 블로그에 있는 모든 글은 회사와 관계 없는 개인의 의견임을 알립니다.
만들어놓은 JUnit을 서버로 올려서 TestRunner를 이용하여 브라우져에서 실행하면 그대로 실행된다.
만약 ANT TASK에서 호출하고자 할때는 기존 JUnit케이스를 다음과 같이 ServletTestCase로 묶어야지 호출이 가능하다.
==
Cactus is able to run pure JUnit TestCase on the server side. This is done by using the ServletTestSuite
Test Suite that wraps your existing Test Cases. For example:
public class TestJUnitTestCaseWrapper extends TestCase { public static Test suite() { ServletTestSuite suite = new ServletTestSuite(); suite.addTestSuite(TestJUnitTestCaseWrapper.class); return suite; } public void testXXX() { } } ==
* addTestSuite(원래JUnitCase.class)를 하면 된다.
'ALM > Test Automation' 카테고리의 다른 글
Test Coverage Rate (0) | 2008.02.11 |
---|---|
Cobertura에서 코드 커버러지 분석결과가 잘못 나올때.. (0) | 2008.01.17 |
Cactus에서 JUnit 테스트 케이스 재활용 하기 (2) | 2008.01.17 |
Cobertura를 이용한 커버러지 테스트시 주의할 사항 (1) | 2008.01.17 |
Cactus 테스트시 주의 할점 (0) | 2008.01.17 |
JUnitPerf (0) | 2008.01.16 |
댓글을 달아 주세요
<target name="cactus-test">
<echo> cactus URL = ${cactus.contextURL} </echo>
<junit>
<classpath>
<path refid="cactus.classpath" />
<path refid="master.classpath" />
<pathelement location="${build.dir}"/>
</classpath>
<sysproperty key="cactus.contextURL" value="${cactus.contextURL}" />
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="${project.dir}">
<fileset dir="${test.src.dir}">
<include name="**/*Wrapper.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${project.dir}">
<fileset dir="${project.dir}" includes="TEST*.xml"/>
<report todir="${project.dir}" format="frames"/>
</junitreport>
</target>
<sysproperty>에 URL넣는것 주의할것!!