07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

520 Zhen Ru Dai<br />

(1) /* test case */<br />

testcase TestRoam<strong>in</strong>g noWarn<strong>in</strong>g ()<br />

runs on TestCoord<strong>in</strong>ator CType system SUT CType {<br />

// TestCoord<strong>in</strong>ator is assigned to MTC<br />

(5) var SlaveApplication CType sa;<br />

var Hardware CType hw;<br />

var Master CType m1, m2, m3, m4;<br />

var TestCoord<strong>in</strong>ator CType co;<br />

timer T1, T2;<br />

(10) BluetoothSuite Configuration (system, mtc, sa, hw, m1, m2, m3, m4);<br />

var default coord def := activate (Coord Default ());<br />

// component-specific default<br />

hw.start (NoWarn<strong>in</strong>g hw);<br />

sa.start (NoWarn<strong>in</strong>g sa);<br />

(15) m1.start (NoWarn<strong>in</strong>g master (”M1”));<br />

m2.start (NoWarn<strong>in</strong>g master (”M2”));<br />

m3.start (NoWarn<strong>in</strong>g master (”M3”));<br />

T1.start (6.0);<br />

Connect To Master co m1 ();<br />

(20) p co.receive (con request) from m2; // first request to m2<br />

T2.start (2.0);<br />

p co.receive (con request) from m3; // second request to m3<br />

T2.stop;<br />

var default conf def := activate (Conf Default ());<br />

(25) // event-specific default<br />

p co.receive (con confirm Type: {”M3”}) fromm3;<br />

deactivate (conf def);<br />

var roam<strong>in</strong>gList Type RList := makeList ();<br />

p co.send (roam<strong>in</strong>gList Type: RList) to m3;<br />

(30) Disconnect co ();<br />

T1.stop;<br />

deactivate (coord def);<br />

setverdict (pass);<br />

}<br />

(35) /* module control part */<br />

control {<br />

if (execute (TestRoam<strong>in</strong>g noWarn<strong>in</strong>g ()) == pass) {<br />

execute (TestRoam<strong>in</strong>g withWarn<strong>in</strong>g ())<br />

}<br />

(40) }<br />

}<br />

/* end of Bluetooth Roam<strong>in</strong>g Test module */<br />

Fig. 17.17. Bluetooth Test Module (ctnd.): TTCN-3 Test Cases and Control Part<br />

system model may be re-used for test<strong>in</strong>g purposes. This enhances the cooperation<br />

between system designers and test designers. Furthermore, exist<strong>in</strong>g system

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!