From: Alan C. <al...@me...> - 2010-05-20 14:10:26
|
Hi Anton Anton Trapp wrote: > Hi! > > code: > > > So yes/No is working, but line 88 has line coverage but no branch > coverage. I am understanding my question, but I don't understand what > cobertura needs to branch in line 88 where there is not even a control > structure... > If you want to get full green coverage you will have to make sure that the test 'selenium.isTextPresent' returns true in one case and false in the other. What I suspect cobertura is telling you is that there are two possible conditions for 'isTextPresent' and you probably haven't exercised both of them. Regards Alan >> Hi >> >> I'm sorry, but I thikn that I don't understand your question. >> >> If you want to cover the "else" sentence (the sentence you marked >> with "THIS LINE") you only have to do "false" the yesNo expresion. >> >> I don't understand where is the problem. >> >> Regards >> >> >> >> >> 2010/5/20 Anton Trapp <tm...@al... >> <mailto:tm...@al...>> >> >> Hi! >> >> How can I cover the 4 branches of: >> >> if (yesNo) { >> verifyTrue(selenium.isTextPresent("secure page")); >> } else { >> verifyFalse(selenium.isTextPresent("secure page")); <-- >> THIS LINE??? >> } >> >> Code coverage is 100%, this test is called multiple times (yes I >> do perform a code coverage of the tests, please do NOT ask >> why...) with yesNo both true and false. So how can I test the 4 >> branches in the function calls that I don't even see and why are >> there no function calls in the second line which is almost identical. >> >> I always thought that branches are only for control structures >> like if, ...? >> >> Anybody can help me? >> >> Thank you very much in advance! >> >> Regards, >> Anton >> >> ------------------------------------------------------------------------------ >> >> >> _______________________________________________ >> Cobertura-devel mailing list >> Cob...@li... >> <mailto:Cob...@li...> >> https://lists.sourceforge.net/lists/listinfo/cobertura-devel >> >> >> >> >> -- >> Alejandro Pérez García >> Socio fundador de Autentia y www.adictosaltrabajo.com >> <http://www.adictosaltrabajo.com/> >> (Formación, Consultoría, Desarrollo de sistemas transaccionales) >> mailto:ale...@au... <mailto:ale...@au...> >> Tel.: 655 99 11 75 >> >> Autentia Real Business Solutions S.L. >> "Soporte a Desarrollo" >> http://www.autentia.com <http://www.autentia.com/> >> >> >> >> Este mensaje, y en su caso cualquier fichero anexo al mismo, puede >> contener información confidencial y/o privilegiada, siendo para uso >> exclusivo del destinatario. Si Vd. no es el destinatario o lo ha >> recibido por error, por favor, informe inmediatamente al emisor y >> destrúyalo. Está estrictamente prohibido por la legislación vigente >> realizar sin autorización cualquier copia, revelación o distribución >> del contenido de este mensaje sin la autorización expresa del >> remitente. Las opiniones expresadas en este correo son las de su >> autor y no son, necesariamente, compartidas por Autentia Real >> Business Solutions S.L. >> >> This e-mail, and in the case of any file annexed to it, may contain >> confidential and/or privileged information, and it is exclusively for >> the use of the addresses of the message. If you are not the intended >> recipient (or have received this e-mail in error), please notify the >> sender immediately and destroy this e-mail. Any unauthorised copying, >> disclosure or distribution of the material in this e-mail is strictly >> forbidden by current legislation. The points of view expressed in >> this e-mail are solely those of the author and may not necessarily be >> from, or supported by, Autentia Real Business Solutions S.L. >> > > !DSPAM:4bf5415c144214221013052! > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > > !DSPAM:4bf5415c144214221013052! > > ------------------------------------------------------------------------ > > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > > !DSPAM:4bf5415c144214221013052! > |