Blueprint
Test diagram:
Java source file:
Package TestServlet; import javax.servlet. *; import javax.servlet.http. *; import java.io. *; import java.util. *; public class sample extends httpservlet {... static int count = 0; / * <<< TPID = TP110 >>> * / // << =============== Logical Test Point, the test ID is TP110 public void infit () throws servletexception {} public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {... PrintWriter out = response.getWriter (); out.println ( ""); / * <<< TPID = TP211> >> * / / / << ================ Logical Test Point, the test ; out.println ("
the servlet Has received a get. this is the reply. p>"); out.println (" body> < / html> "); / * <<< TPID = TP222 >>> * / // << =============== Logical test point, the test ID is TP222} / * << Clean Up Resources >> * / public void destroy () {}}
Test CASE:
Testcase001.tc // Normal Case001 ... testcase002.tc // normalcase002 ......
Testcase001.tc:
test CASE info caseInfo {title = normal basic case; // test case titlepath = D: / UnitTest; // test file pathsource = Servlet1.java; // source file namepackage = testservlet; // package name class = testservlet.Servlet1; // full class name} logic test point / mener (name = doget) {//when system entry servlet1's dogt method; "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 "TP2222HERE"; Field.dis (Field3); // Display servlet1's Field Field3;} Test Results:
Testcase001.tr // Normal Case001 ... testcase002.tr // normalcase002 ......
Test case001. Sudden:
*********************************************************** ******************* 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: "TP2222HERE" DIS: Field3 = 3 ========== ============================================================================================================================================================================================================= ====