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

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.

Cheers,
Pawel

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?
 
Thanks
 

 

Marc Khouzam
Software Designer, Methods and Tools

 

Ericsson Canada Inc

EMC/Q
8500 Decarie Blvd.
H4P 2N2, Mont-Royal, Qc, Canada
www.ericsson.com

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 https://dev.eclipse.org/mailman/listinfo/dsdp-dd-dev


Back to the top