Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Why org.eclipse.m2e.tests.common exported as x-internal?

Hi Igor,

Thanks for the quick reply.  I'm trying to do just that, write tests for an m2e extension.

I see what you're saying about org.eclipse.m2e.tests.common not being public API for M2E.  Though in a sense it is public API for the org.eclipse.m2e.tests.common bundle itself is it not?  With org.eclipse.m2e.tests.common being the only package in the bundle of the same name the warning essentially reads as, "Use of anything in this bundle in discouraged."  This had me searching for whether the bundle had been deprecated for something else.  

I know different people will have different approaches to this, but I follow broken windows theory and generally strive for no IDE warnings in my projects.  Suppressing the warning at the class level isn't ideal because that may obscure warnings for packages that I really should not be using in those tests.  

I would say that the bundle and package names having "tests.common" in them is adequate forewarning that the API is only intended for testing.  I went ahead and made the trivial pull request in case you agree:

https://github.com/eclipse/m2e-core/pull/2

Thanks,

Ian


On Jul 16, 2012, at 12:14 PM, Igor Fedorenko wrote:

> What are you trying to do?
> 
> Classes from org.eclipse.m2e.tests.common are meant to help testing m2e
> extensions but we do not consider them part of m2e API and may change
> that in incompatible manner in the future. We believe this is acceptable
> for test code but use x-internal as a warning.
> 
> --
> Regards,
> Igor
> 
> On 12-07-16 2:26 PM, Ian Brandt wrote:
>> 
>> Greetings,
>> 
>> Is org.eclipse.m2e.tests.common exported as x-internal intentionally?
>> 
>> <http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.tests.common/META-INF/MANIFEST.MF?id=releases/1.1/1.1.0.20120530-0009>
>> 
>> I'm getting the following Eclipse warning trying to write a m2e connector test:
>> 
>> 	Discouraged access: The type AbstractMavenProjectTestCase is not accessible due to restriction on required library /Applications/Eclipse/plugins/org.eclipse.m2e.tests.common_1.1.0.20120530-0009.jar
>> 
>> I tried to modify the access rules for the bundle via Java Build Path > Libraries > Plun-in Dependencies, but the settings changes don't seem to survive a restart of Eclipse.  Alternatively I can mask the warning with '@SuppressWarnings("restriction")', but that has to be done at the class level with the offending API in the extends clause.
>> 
>> Thanks,
>> 
>> Ian
>> 
>> _______________________________________________
>> m2e-dev mailing list
>> m2e-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/m2e-dev
>> 
> 
> _______________________________________________
> m2e-dev mailing list
> m2e-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/m2e-dev



Back to the top