freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

測(cè)試驅(qū)動(dòng)的設(shè)計(jì)和開發(fā)-閱讀頁(yè)

2024-11-02 17:05本頁(yè)面
  

【正文】 user info,like userName, * password, */ public void addAccount( final Account account ) throws SQLException, AccountAlreadyExistException{ …… } 26 Junit( A sample) Java Class建立一個(gè) TestCase。 package import 。 import 。 } } 27 Junit( A sample) 2. Override setUp() and tearDown() 如果需要,可以在 setUp()中初始化需要的全局變量,資源等(比如 Database Connection, File I/O或 Mock Objects等) 相應(yīng)的,可以在 tearDown()中釋放資源( Database Connection,File I/O和 Mock Objects等) public class AccountDAOmySqlTest extends TestCase { … … private MysqlFixture mysqlFixtureIns = new MysqlFixture()。 } public void tearDown() throws Exception { ()。 Account account = new Account(USER_NAME,charles,)。 Account account_new = ( () )。 assertEquals(Expecting charles,(),() )。 ( () )。 fail(Unexpected exception:: + ())。 Account account = null。 fail(AccountAlreadyExistException expected)。 fail(Unexpected exception:: + ())。 fail(Unexpected exception: + () )。 }catch( final SQLException sql ){ ()。 } } } 30 Junit( A Sample) 運(yùn)行這個(gè) Unit Test。./lib/。./lib/。 public class AllTests { public static void main(String args[]) { (suite())。 // 加入子 package中的 AllTest suite (())。 return suite。 一個(gè)最簡(jiǎn)單的 Sample:測(cè)試一個(gè) Login Screen 35 JFC Unit 代碼片斷:設(shè)置測(cè)試環(huán)境 private LoginScreen loginScreen = null。 public LoginScreenTest( String name ) { super( name )。 helper = new JFCTestHelper( )。 ( true )。 ( this )。 } 代碼片斷:測(cè)試圖形界面 JDialog dialog。 assertNotNull( Could not find the Exit button, exitButton )。 assertNotNull( Could not find the Enter button, enterButton )。 assertNotNull( Could not find the userNameField, userNameField )。 JTextField passwordField = ( JTextField ) ( PasswordTextField, loginScreen, 0 )。 assertEquals( Password field is empty, , ( ) )。 junitreport todir=./reports fileset dir=./reports include name=TEST*.xml/ /fileset report format=frames todir=./report/html/ /junitreport 37 測(cè)試?yán)痈采w率 利用 NOUnit來(lái)獲得測(cè)試?yán)拥母采w率 ( 38 Unit Tests: 100% always 任何時(shí)候如果 Unit Tests的出現(xiàn)錯(cuò)誤( Junit的進(jìn)度指示顯示紅色), XP Team的首要工作就是修補(bǔ) Unit Tests直至 Junit的進(jìn)度指示為綠色。軟件質(zhì)量的基石 就開始崩
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1