Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [dsdp-dd-dev] JUnit accessing protected classes

this idea worked great!
I have checked-in a new class under the org.eclipse.dd.dsf.mi.tests plug-in
In this class we can define wrappers for whichever class we need to access from
Thanks for the help.
-----Original Message-----
From: dsdp-dd-dev-bounces@xxxxxxxxxxx [mailto:dsdp-dd-dev-bounces@xxxxxxxxxxx]On Behalf Of Pawel Piech
Sent: Thursday, January 24, 2008 10:32 AM
To: Device Debugging developer discussions
Subject: Re: [dsdp-dd-dev] JUnit accessing protected classes

Hi Marc,
If possible, I would rather try to avoid changing access protection for sake of unit testing.  But if there's no other way, then I think it's OK.

In this case, maybe you can try this technique first:  MIExpressionDMC has protected access, so other classes in the same package can get to it.  So in the test plugin create a org.eclipse.dd.dsf.mi.service package and add a helper class to it to give you access to the protected methods that you need to get to.  I remember someone recently discussing this technique as a good tool for testing.


Marc Khouzam wrote:
Hi Pawel,
in the context refactoring that you did before the new year, you made the context classes of each service protected.
I forgot how we had agreed to deal with this when the JUnit plugin needed to use these classes.
In my case, the ExprssionService tests need to use MIExpresionDMC specifically, because I want to access
the getRelativeExpression() method which is not in IExpressions.
Did we have a solution for this?

Marc Khouzam
Software Designer, Methods and Tools

Ericsson Canada Inc

8500 Decarie Blvd.
H4P 2N2, Mont-Royal, Qc, Canada

Office: +514 345 7900 x42350
Fax: +514 345 6159
Mobile: +514 951 7191
Email: Marc.Khouzam@xxxxxxxxxxxx

Ce courriel est confidentiel et uniquement destiné à son ou ses destinataires. Il est défendu de le consulter, de l'utiliser, de le dévoiler ou de le diffuser sans autorisation. Si ce message vous est parvenu par erreur, merci d'en aviser l'expéditeur par retour de courrier et de le détruire sans le divulguer.  Un courriel et ses pièces jointes peut être sans autorisation corrompu, interrompu, amendé, altéré et infecté. L'entreprise ne reçoit et n'envoie de courriel qu'avec l'entente qu'elle n'est responsable d'aucune corruption, interception, modification, altération, infection ou conséquence possible.

This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you.  E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.


_______________________________________________ dsdp-dd-dev mailing list dsdp-dd-dev@xxxxxxxxxxx

Back to the top