站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2EE 专题JTracker - J2EE逻辑测试解决方案

JTracker - J2EE逻辑测试解决方案

摘要: jtracker,j2ee test,java test,java debug,logic test,test,debug,java,ejb,servlet

使用蓝图

测试图解:

Java 源文件:

package testservlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class sample extends HttpServlet {
...
static int count=0;
/*<<>>*/ //
<< =============== logical test point,the test ID is TP110
public void init() throws ServletException {
}

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
...
PrintWriter out = response.getWriter();
out.println("");
/*<< >>*/ //
<< =============== logical test point,the test ID is TP211
count++;
out.println("<head>sample</head>");
out.println("<body>");
out.println("

The servlet has received a GET. This is the reply.

");
out.println("</body>");
/*<<>>*/ //
<< =============== logical test point,the test ID is TP222
}
/*<>*/
public void destroy() {
}
}

测试CASE:

TestCase001.tc //Normal CASE001...
TestCase002.tc //NormalCASE002...
...

TestCase001.tc:

////////test CASE info////////
caseInfo{
title = normal basic case; //test case title
path = D:\UnitTest; //test file path
source = Servlet1.java; //source file name
package = testservlet; //package name
class = testservlet.Servlet1; //full class name
}
////////Logic Test Point/////////
MEnter(name=doGet){ //when system entry Servlet1's doGet method, it will take this logic test;
//Logic test content;
title("test1 here is doGet full name"); //display "test1 here is doGet full name";
field.dis(intfield); //display Servlet1's field intfield;
}
MExit(name=doGet){ //when system exit the method Servlet1.doGet ,it willtake this logic test;
//Logic test content;
title("test1 here is doGet method name"); //display "test1 here is doGet method name";
field.dis(stringfield); //display Servlet1's field stringfield;
}
BPoint(TP = TP222){ //when system run at test point TPSLV132, it will take this logic test;
//Logic test content;
title("TP222here"); //display "TP222here";
field.dis(field3); //display Servlet1's field field3;
}

 

测试结果:

TestCase001.tr //Normal CASE001...
TestCase002.tr //NormalCASE002...
...

TestCase001.tr:

*******************************************************************
** JTracker 1.0 standard edition **
** Copyright(c) 2002-2003 Chen ShiMing. All Rights Reserved. **
** http://www.jtracker.net **
*******************************************************************
****************************** START ******************************
**************************** case info ****************************
===== CASE::: testCase001.tc =====
-------ADD::MEnter(name=doGet)
-------ADD::MExit(name=doGet)
-------ADD::BPoint(TP = TP222)
*******************************************************************
***Location::time=10:45.34.158*testservlet.Servlet1*doGet*line=51
*** Module::MEnter(name=doGet)
------------------------------
title:"test1 here is doGet full name"
dis : intfield=1
===================================================================
***Location::time=10:45.34.259*testservlet.Servlet1*doGet*line=99
*** Module::BPoint(TP = TP222)
------------------------------
title:"TP222here"
dis : field3=3
===================================================================
***Location::time=10:45.34.339*testservlet.Servlet1*doGet*line=146
*** Module::MExit(name=doGet)
------------------------------
title:"test1 here is doGet method name"
dis : stringfield=string
===================================================================
******************************** END ******************************



↑返回目录
前一篇: The future of J2EE
后一篇: J2EE逻辑测试解决方案 - JTracker