You are on page 1of 28

Service Oriented Architecture

LAB MANUAL
Staff :Kiran k. Joshi
CREATION OF ADDITION WEB SERICE:
Ai!:
To create a web service for adding few numbers using NetBeans.
A"#orith!:
1. Using the Netbeans API create a proect of the t!pe web app"ication.
#. $reate a web service in the proect.
%. $"ic& on the 'esign tab and design the protot!pe of the web service.
(. $"ic& on source tab and modif! the app"ication "ogic of the web service.
). Save the proect.
*. +ight c"ic& on the proect and c"ic& on dep"o! and undep"o!.
,. Then test the web service.
STE$S TO CREATE ADDITION WEB SERICE:
I.ST-PS .O+ $+-ATIN/ S-+0-+ SI'- P+O1-$T2
1.OP-N .i"e34New34NewProect345eb345eb App..c"ic& ne6t
#./ive Proect name34addserver7then c"ic& finish
%.The addserver proect wi"" be created in right side.+ight c"ic& it and choose the
fo""owing.
/ive the web service name as addweb.
(.After this in "eft side 8the design window choose the add operation
). /ive the fo""owing in the opened window for creating operation
Name34add
*.Then in the source add the fo""owing code and save it.
pac&age org9
import ava6.ws.5eb:ethod9
import ava6.ws.5ebParam9
import ava6.ws.5ebService9
;5ebService<=
pub"ic c"ass addweb >
?@@
@ 5eb service operation
@?
;5eb:ethod<operationName A BaddB=
pub"ic int add<;5ebParam<name A BaB=
int a8 ;5ebParam<name A BbB=
int b= >
int &AaCb9
return &9
D
D
,.Then right c"ic& on add addserver and perform undep"o! and dep"o!7after that right
c"ic& on addweb and do test web service to see the SOAP reEuest and response message.
/ive some integers and c"ic& add.
CREATION OF WEB SERICE CLIENT
Ai!:
To create a web service for adding few numbers using NetBeans and write c"ient side
code to invo&e the web service.
A"#orith!:
1. Using the Netbeans API create a proect of the t!pe web app"ication.
#. $reate a web service in the proect.
%. $"ic& on the 'esign tab and design the protot!pe of the web service.
(. $"ic& on source tab and modif! the app"ication "ogic of the web service.
). Save the proect.
*. +ight c"ic& on the proect and c"ic& on dep"o! and undep"o!.
,. Then test the web service.
F. $reate another web app"ication proect and create a sp fi"e.
G. +ight c"ic& on proect and c"ic& on create web service c"ient.
1H. Browse and choose the web service created i.e wsd" ur"
11. 'rag and drop the web service reference to the source code window.
1#. Then pass the appropriate parameters to the web service c"ient and invo&e the web
service.
STE$S TO CREATE CLIENT SIDE $ROJECT:
1.create the new proect as above and give the name as addc"ient.
#. addc"ient proect wi"" be created. right c"ic& it and choose the fo""owing.
%.Then browse and choose the addweb wsd" fi"e
(.Then choose the fo""owing and add the source code in inde6.sp and save it.
Inde6.sp source code
IJ;page contentT!peABte6t?htm"B page-ncodingABUT.3FBJ4
IK'O$TLP- MT:N PUBNI$ B3??5%$??'T' MT:N (.H1 Transitiona"??-NB
Bhttp2??www.w%.org?T+?htm"(?"oose.dtdB4
Ihtm"4
Ihead4
Imeta http3eEuivAB$ontent3T!peB contentABte6t?htm"9 charsetAUT.3FB4
Itit"e41SP PageI?tit"e4
I?head4
Ibod!4
Ih14Me""o 5or"dKI?h14
Iform nameABB actionABactionn.spB methodABpostB4
-nter 1st No2Iinput nameABfstB t!peABte6tB ?4Ibr?4
-nter #nd No2Iinput nameABsndB t!peABte6tB ?4Ibr?4
Iinput nameABo&B t!peABsubmitB va"ueABAddB ?4
I?form4
I?bod!4
I?htm"4
).Then create an action.sp as fo""ows.
+ight c"ic& web page in addc"ient and choose new34sp
Name2action
$"ic& finish
*.c"ic& on the actionn.sp page..then right c"ic& in it and choose web service c"ient
reference 34ca"" web service
,.The invo&e the add service.
F. add the fo""owing code in the action.sp
IJ;page contentT!peABte6t?htm"B page-ncodingABUT.3FBJ4
IK'O$TLP- MT:N PUBNI$ B3??5%$??'T' MT:N (.H1 Transitiona"??-NB
Bhttp2??www.w%.org?T+?htm"(?"oose.dtdB4
Ihtm"4
Ihead4
Imeta http3eEuivAB$ontent3T!peB contentABte6t?htm"9 charsetAUT.3FB4
Itit"e41SP PageI?tit"e4
I?head4
Ibod!4
Ih14Me""o 5or"dKI?h14
IJ
String a1AreEuest.getParameter<BfstB=9
String b1AreEuest.getParameter<BsndB=9
int aaAInteger.parseInt<a1=9
int bbAInteger.parseInt<b1=9
J4
IJ33 start web service invocation 33J4Ihr?4
IJ
tr! >
org.AddwebService service A new org.AddwebService<=9
org.Addweb port A service.getAddwebPort<=9
?? TO'O initia"iOe 5S operation arguments here
int a A aa9
int b A bb9
?? TO'O process resu"t here
int resu"t A port.add<a8 b=9
out.print"n<B+esu"t A BCresu"t=9
D catch <-6ception e6= >
?? TO'O hand"e custom e6ceptions here
D
J4
IJ33 end web service invocation 33J4Ihr?4
I?bod!4
I?htm"4
F.fina""! undep"o! and dep"o! the addc"ient and run it.
CREATION OF A WEB SERICE WIT% DATABASE CONNECTIIT&
Ai!:
To create a web service for adding few numbers using NetBeans and write c"ient side
code to invo&e the web service.
A"#orith!:
1. Using the Netbeans API create a proect of the t!pe web app"ication.
#. -stab"ish connectivit! with the database a"ong with the necessar! authentication
parameters.
%. $reate a web service in the proect.
(. $"ic& on the 'esign tab and design the protot!pe of the web service.
). $"ic& on source tab and modif! the app"ication "ogic of the web service.
*. Save the proect.
,. +ight c"ic& on the proect and c"ic& on dep"o! and undep"o!.
F. Then test the web service.
G. $reate another web app"ication proect and create a sp fi"e.
1H. +ight c"ic& on proect and c"ic& on create web service c"ient.
11. Browse and choose the web service created i.e wsd" ur"
1#. 'rag and drop the web service reference to the source code window.
1%. Then pass the appropriate parameters to the web service c"ient and invo&e the web
service.
STE$S FOR CREATIN' TRAEL WEB SERICE
R()*ir(!(nts:
+,M-s)"
+,n(t.(ans /ith #"ass fish01 s(r0(r
I.B(for( 2r(atin# 3ro4(2t in n(t .(ans 5o th( fo""o/in#:
1.insta"" :!sE" setup fi"e and the gui too"s .
#.Then open the m!sE" browser in the start34programs34m!sE"34m!sE" browser
Then restore the bac& up<newproect#H117= as fo""ows
1.choose too"s34m!sE" administrator
#.Then choose restore in that window..Then c"ic& open bac&up in the bottom7open the
bac&up fi"e<newproect#H17.= which is in the attachment7.then c"ic& start restore..
%.now the schema is created in the m!sE"7..
Now strat the coding in netbeans7
SERER SIDE:
1.create the server proect as before and with the fo""owing changes.
Proect name2 PPNBusTrave"s
#.web service name2PPNBusTrave"s
Pac&age name2&pnpac&
%.in design window
Operation name2getBus
Parameters2
Source and destination with the t!pe as String.
(.Add the fo""owing code in source
pac&age &pnpac&9
import ava.sE".$onnection9
import ava.sE".'river:anager9
import ava.sE".+esu"tSet9
import ava.sE".Statement9
import ava.uti".Arra!Nist9
import ava.uti".Mashtab"e9
import ava6.ws.5eb:ethod9
import ava6.ws.5ebParam9
import ava6.ws.5ebService9
?@@
@
@ ;author user
@?
;5ebService<=
pub"ic c"ass PPNBusTrave"s5S >
?@@
@ 5eb service operation
@?
;5eb:ethod<operationName A BgetBusB=
pub"ic String getBus<;5ebParam<name A BsourceB=
String source8 ;5ebParam<name A BdestinationB=
String destination= >
??TO'O write !our imp"ementation code here2
Arra!NistIString4 serviceQname A new Arra!NistIString4<=9
Arra!NistIString4 departureQtime A new Arra!NistIString4<=9
Arra!NistIString4 arriva"Qtime A new Arra!NistIString4<=9
Arra!NistIString4 busQfare A new Arra!NistIString4<=9
Arra!NistIString4 busQt!pe A new Arra!NistIString4<=9
Arra!NistIString4 busQcategor!Anew Arra!NistIString4<=9
tr! >
$"ass.forName<Bcom.m!sE".dbc.'riverB=9
$onnection
conA'river:anager.get$onnection<Bdbc2m!sE"2??"oca"host2%%H*?EosB8BrootB8BrootB=9
Statement st1Acon1.createStatement<=9
st1.e6ecuteUpdate<Binsert into Eostab"e<webname8
e6etime8price8compute8avai"time= va"ues<RBCwnCBR8RBCetCBR8RBCprCBR8RBCctCBR8RBCatCBR=B=9
Statement stAcon.createStatement<=9
+esu"tSet rs A st.e6ecuteSuer!<sE"=9
int iAH9
whi"e <rs.ne6t<== >
departureQtime.add<rs.getString<%==9
arriva"Qtime.add<rs.getString<(==9
busQfare.add<rs.getString<)==9
busQt!pe.add<rs.getString<G==9
busQcategor!.add<rs.getString<11==9
serviceQname.add<rs.getString<1#==9
?? serviceQname.add<rs.getString<BServicenameB==9
D
D catch < -6ception e= >
e.printStac&Trace<=9
Dsoa too"s p"atform
String concatBus A serviceQname.toString<=CBTBCdepartureQtime.toString<=
CBTBCarriva"Qtime.toString<= CBTBCbusQfare.toString<= CBTBC
busQt!pe.toString<= CBTBCbusQcategor!.toString<= CB8B9
return concatBus9
D
D
).Then dep"o! the service and test the web service as before.
/ive input as $hennai and $oimbatore .then c"ic& getbus.
soa
too"s p"atform
$NI-NT SI'-2
1.create new proect
Name2c"ient1
#.As before in addition program create web service reference.
%.The source code for inde6.sp and action8sp are as fo""ow.
Inde6.sp2
IJ;page contentT!peABte6t?htm"B page-ncodingABUT.3FBJ4
IK'O$TLP- MT:N PUBNI$ B3??5%$??'T' MT:N (.H1 Transitiona"??-NB
Bhttp2??www.w%.org?T+?htm"(?"oose.dtdB4
Ihtm"4
Ihead4
Imeta http3eEuivAB$ontent3T!peB contentABte6t?htm"9 charsetAUT.3FB4
Itit"e41SP PageI?tit"e4
I?head4
Ibod!4
Ih#4Me""o 5or"dKI?h#4
Iform nameABB actionABactionn.spB methodABpostB4
-nter Source2Iinput nameABsourceB t!peABte6tB ?4Ibr?4
-nter 'estination2Iinput nameABdestinationB t!peABte6tB ?4Ibr?4
Iinput nameABo&B t!peABsubmitB va"ueABB ?4
I?form4
I?bod!4
I?htm"4
A2tion.4s3
IJ;page contentT!peABte6t?htm"B page-ncodingABUT.3FBJ4
IK'O$TLP- MT:N PUBNI$ B3??5%$??'T' MT:N (.H1 Transitiona"??-NB
Bhttp2??www.w%.org?T+?htm"(?"oose.dtdB4
Ihtm"4
Ihead4
Imeta http3eEuivAB$ontent3T!peB contentABte6t?htm"9 charsetAUT.3FB4
Itit"e41SP PageI?tit"e4
I?head4
Ibod!4
Ih#4Me""o 5or"dKI?h#4
IJ
String a1AreEuest.getParameter<BsourceB=9
String b1AreEuest.getParameter<BdestinationB=9
J4
IJ33 start web service invocation 33J4Ihr?4
IJ33 end web service invocation 33J4Ihr?4
IJ33 start web service invocation 33J4Ihr?4
IJ
StringUV res8commasp"itAnu""8"brsp"itAnu""8rbrsp"itAnu""9
StringUVUV f"ightQtransAnew StringU1HHVU1HHV9
int rowAH8co"AH9
int trowAH8tco"AH9
int midrowAH8midco"AH9
?? 1agson
StringUV agres8agcommasp"itAnu""8ag"brsp"itAnu""8agrbrsp"itAnu""9
StringUVUV agf"ightQtransAnew StringU1HHVU1HHV9
int agrowAH8agco"AH9
??Air India
StringUV airres8aircommasp"itAnu""9
StringUVUV airf"ightQtransAnew StringU1HHVU1HHV9
int airrowAH8airco"AH9
tr! >
&pnpac&.PPNBusTrave"s5SService service A new
&pnpac&.PPNBusTrave"s5SService<=9
&pnpac&.PPNBusTrave"s5S port A service.getPPNBusTrave"s5SPort<=9
?? TO'O initia"iOe 5S operation arguments heresoa too"s p"atform
ava."ang.String source A Ba1B9
ava."ang.String destination A Bb1B9
?? TO'O process resu"t here
ava."ang.String resu"t A port.getBus<source8 destination=9
out.print"n<B+esu"t A BCresu"t=9
resAresu"t.sp"it<BTB=9
S!stem.out.print"n<B1et Sp"it2BCres=9
for<int iAH9iIres."ength9iCC=
>
int AH9
rowAres."ength9
String "brAresUiV.rep"ace<BUB8 BB=9
String rbrA"br.rep"ace<BVB8 BB=9
commasp"itArbr.sp"it<B8B=9
for< AH9Icommasp"it."ength9CC=
>
co"Acommasp"it."ength9
S!stem.out.print"n<Bf"ightQtransUiVUVBCiCB?BC=9
if<commasp"itUVKAnu""=
f"ightQtransUVUiVAcommasp"itUV9
D
?? if< f"ightQtransUiVUVAAnu""=
?? co"AH9
D
?? out.print"n<B+es A BCresUHV=9
S!stem.out.print"n<BT+B=9
S!stem.out.print"n<Bet+ow2BCrow=9
S!stem.out.print"n<Bet$o"umn2BCco"=9
for<int rAH9rIrow9rCC=
>
for<int cAH9cIco"9cCC=
>
if<f"ightQtransUrVUcVKAnu""=
S!stem.out.print<Btr2BCf"ightQtransUrVUcV=9
D
S!stem.out.print"n<=9
D

D catch <-6ception e6= >
?? TO'O hand"e custom e6ceptions here
D
J4
IJ33 end web service invocation 33J4Ihr?4
I?bod!4
I?htm"4
(.Then fina""! undep"o! and dep"o! the c"ient and run it77777..
CREATION OF A B$EL MODULE AND A COM$OSITE A$$LICATION
Aim2
$reate a SOA proect with BP-N :odu"e to compose a web service.
ST-PS TO $+-AT- A BP-N :O'UN-
Cr(atin# a n(/ B$EL Mo5*"( $ro4(2t
The fo""owing sections use the S!nchronous samp"e proect8 and provide step3b!3step
directions for creating a simp"e BP-N modu"e proect8 using the S!nchronous samp"e
proect.
To Cr(at( a B$EL Mo5*"( $ro4(2t
1. In the NetBeans I'-8 choose .i"e 4 New Proect.
The New Proects wiOard appears.
#. Under $ategories8 se"ect Service Oriented Architecture.
%. Under Proects8 se"ect BP-N :odu"eand c"ic& Ne6t.
(. In the Name and Nocation page8 enter the proect name <for this e6amp"e
Me""o5or"d= and specif! the proect "ocation or accept the defau"ts.
). $"ic& .inish.
The Proects window now contains a proect node for the BP-N :odu"e proect.
Cr(atin# a B$EL $ro2(ss Usin# th( B$EL D(si#n(r
Now that !ou have created !our W:N Schema and 5S'N 'ocument8 !ou can create
!our BP-N process.
To Cr(at( th( B$EL $ro2(ss
1. In the Proects window8 e6pand !our BP-N modu"e proect node8 right3c"ic& the
Process .i"es node8 and choose New 34 BP-N Process.
The New BP-N Process dia"og bo6 appears.
#. -nter a name for the process fi"e name <Me""o5or"dProcess for this e6amp"e=8 and
c"ic& .inish.
The new BP-N fi"e opens in the 'esign view of the BP-N 'esigner.
If the Pa"ette and Properties windows are not disp"a!ed in !our current view8 c"ic&
5indows 34 +eset 5indows on the NetBeans menu.
%. Add a partner "in& to the BP-N Process.
a. In the Proects window8 e6pand !our proectRs Process .i"es node and
se"ect the .wsd" fi"e <S!nchronous.wsd" for this e6amp"e=.
b. 'rag the 5S'N fi"e from the Proects window to the "eft side of the
'esign view canvas.
The I'- provides visua" prompts to show !ou where !ou can drop the se"ection.
The BP-N -ditor adds a partner "in& to the canvas.
(. Add a +eceive activit! to the BP-N Process.
a. .rom the 5eb Service section of the Pa"ette window8 se"ect the +eceive
activit!.
b. 'rag the +eceive activit! to the Me""o5or"dProcess process bo6 in the
'esign view canvas8 between the Process Start and the Process -nd
activities.
The +eceive1 activit! is added to the process bo6.
c. $"ic& the +eceive1 activit!Rs -dit icon.
The +eceive1 Propert! -ditor appears.
d. On the :ain tab8 change the va"ue in the Name fie"d to start.
e. .rom the Partner Nin& drop3down "ist8 choose $artn(rLink6.
The I'- popu"ates the Operation fie"d with New5S'NOperation.
f. $"ic& the $reate button ne6t to the Input 0ariab"e .ie"d.
The New Input 0ariab"e dia"og bo6 appears.
g. $"ic& OP to accept the defau"t va"ues.
h. $"ic& OP to c"ose the +eceive1 Propert! -ditor.
The 'esign view disp"a!s the new connection between PartnerNin&1 and the Start
activit! in the process bo6.
). Add a +ep"! activit! to the BP-N Process.
a. Se"ect the +ep"! activit! in the 5eb Service section of the Pa"ette. 'rag
and drop the +ep"! to the prompt between the Start activit! and the
Process -nd activit! in the process bo6 on the design view canvas.
A +ep"!1 activit! is added to the design view canvas.
b. $"ic& the +ep"!1 activit!Rs -dit icon.
The +ep"!1 Propert! -ditor appears.
c. On the :ain tab8 change the va"ue in the Name fie"d to -nd.
d. .rom the Partner Nin& drop3down "ist8 choose PartnerNin&1.
The I'- popu"ates the Operation fie"d with New5S'NOperation.
e. To create anew output variab"e8 ma&e sure that Norma" +esponse is
se"ected8 and c"ic& the $reate button ne6t to the Input 0ariab"e .ie"d.
The New Input 0ariab"e dia"og bo6 appears. $"ic& OP to accept the defau"t va"ues.
f. $"ic& OP to c"ose the +ep"!1 Propert! -ditor.
The 'esign view disp"a!s the new connection between the -nd activit! in the process
bo6 and PartnerNin&1.
*. Add a Assign activit! to the BP-N Process.
a. Se"ect the Assign activit! in the Basic Activities section of the Pa"ette.
'rag and drop the Assign to the prompt between the Start activit! and the
-nd activit! in the process bo6 on the design view canvas.
The Assign1 activit! is added to the design view canvas.
b. Se"ect the Assign1 activit! and c"ic& the :apper button on the editors
too"bar.
The BP-N :apper appears.
c. :ap the paramA node under 0ariab"es 34 New5S'NOperationIn 34
inputT!pe in the Output pane of the BP-N :apper8 to the paramA node
under 0ariab"es 34 New5S'NOperationOut 34 resu"tT!pe in the Input
pane of the :apper. To do this8 se"ect theparamA node under 0ariab"es 34
New5S'NOperationIn 34 inputT!pe in the Output pane8 and drag !our
cursor to the paramA node under 0ariab"es 34 New5S'NOperationOut
34 resu"tT!pe in the Input pane.
This assignment copies the input statement into the output.
,. To save !our changes c"ic& the Save A"" icon in the I'- menu bar.
Cr(atin# a Co!3osit( A33"i2ation $ro4(2t
A BP-N :odu"e proect is not direct"! dep"o!ab"e. Lou must first add a BP-N :odu"e
proect8 as a 1BI modu"e8 to a $omposite App"ication proect. Lou can then dep"o! the
$omposite App"ication proect. 'ep"o!ing the proect ma&es the service assemb"!
avai"ab"e to the app"ication server and enab"es its service units to run.
To Cr(at( a N(/ Co!3osit( A33"i2ation $ro4(2t
1. $hoose .i"e 4 New Proect <$tr"3Shift3N=.
#. In the $ategories "ist choose Service Oriented Architecture8 in the Proects "ist
choose $omposite App"ication8 and c"ic& Ne6t.
%. In the Name and Nocation page8 change the proect name to
Me""o5or"dApp"ication8 and specif! the "ocation of proect fi"es.
(. To set the new $omposite App"ication the main proect as main8 "eave the Set as
:ain Proect chec&bo6 se"ected8 and c"ic& .inish.
). To add the BP-N :odu"e as a 1BI modu"e to the $omposite App"ication proect8
right3c"ic& the new $omposite App"ication and choose Add 1BI :odu"e.
The Se"ect Proect dia"og bo6 opens.
*. Se"ect the Me""o5or"d proect !ou created ear"ier and c"ic& Add Proect 1A+
.i"es.
The Se"ect Proect dia"og bo6 c"oses and the Me""o5or"d.ar fi"e is added to the 1BI
:odu"es node of the Me""o5or"dApp"ication $omposite App"ication
B*i"5in# an5 D(3"o-in# th( Co!3osit( A33"i2ation $ro4(2t
Bui"ding a proect compi"es the BP-N source fi"e and pac&ages the BP-N fi"e and web
service artifacts8 inc"uding 5S'N and WS' fi"es8 into a 1A+ archive. 'ep"o!ing the
proect compi"es the fi"es in the $omposite App"ication proect8 pac&ages the compi"ed
BP-N and re"ated web service artifacts <inc"uding 5S'N and WS' fi"es= into an archive8
and dep"o!s them to the App"ication Server.
To B*i"5 an5 D(3"o- th( Co!3osit( A33"i2ation $ro4(2t
1. +ight3c"ic& the $omposite App"ication proectRs node8 and choose Bui"d.
5hen the bui"d is comp"ete the Output window reports Bui"d Successfu". If the Output
window is not visib"e8 choose 5indow 34 Output 34 Output.
#. +ight3c"ic& the $omposite App"ication proectRs node8 and choose 'ep"o!.
%. 'ep"o!ment has succeeded when !ou see a Bui"d successfu" message in the
/"ass.ish tab of the Output window.
(. Open the Services window and e6pand Servers 34 /"ass.ish 0# 34 1BI 34 Service
Assemb"ies to see !our new dep"o!ed Service Assemb"!.
If !ou do not see the dep"o!ed proect8 right3c"ic& the Service Assemb"ies node and
choose +efresh.
T(stin# th( Co!3osit( A33"i2ation
Lou can test !our $omposite App"ication proect b! adding test cases8 binding to the
operation8 supp"!ing input8 and then using the tester.
T(st th( %(""oWor"5A33"i2ation Co!3osit( A33"i2ation $ro4(2t
1. In the Proects window8 e6pand the Me""o5or"dApp"ication proect node8 right3
c"ic& the Test node8 and choose New Test $ase.
The New Test $ase wiOard opens.
#. Accept the defau"t test case name8 Test$ase18 and c"ic& Ne6t.
%. .rom the Se"ect the 5S'N 'ocument page8 e6pand the Me""o5or"d 3 Proecss
.i"es node8 se"ect S!nchronous.wsd"8 and c"ic& Ne6t.
(. .rom the Se"ect the Operation to Test page8 se"ect the Operation1 and c"ic&
.inish.
A new Test$ase1 node is added under the proectRs Test node in the Proects window8
containing two subnodes8 Input and Output.
The Source -ditor appears containing the Input fi"e8 Input.6m"
Not( 7
If the Source -ditor does not contain a tab for Input.6m"8 doub"e3c"ic& the Input node in
the Proects window to open the fi"e.
). .rom the Input.6m" tab of the Source -ditor8 do the fo""owing2
a. Nocate the "ine2
Is!n2paramA4XstringXIs!n2paramA4
b. +ep"ace XstringX with Me""o 5or"d8 so that the "ine appears as fo""ows2
Is!n2paramA4Me""o 5or"dIs!n2paramA4
c. .rom the NetBeans I'- menu bar8 c"ic& Save A"".
*. In the Proects window8 doub"e3c"ic& the Output node under Test 34 Test$ase1.
Output.6m" is opened in the Source -ditor. Initia""!8 Output.6m" is empt! unti" the first
test run popu"ates the fi"e.
,. In the Proects window8 right3c"ic& the Test$ase1 node and choose +un from the
pop3up menu.
5hen the Overwrite -mpt! Output dia"og bo6 appears8 c"ic& Les to accept new output.
The first test run popu"ates the Output.6m" fi"e disp"a!ed in the Source -ditor.
The test compares the output to the contents of the output fi"e. Because the first run of the
test has nothing to compare itse"f to8 the first test fai"s. SubseEuent test runs wi"" compare
their output with the contents of Output.6m" and shou"d succeed.
F. +un the test again.
The test case is compared to the current output fi"e and succeeds.

You might also like