[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] [newbie] failure loading test resources from tycho but OK in IDE?

Thanks Pascal - will try this later when back at desk.

- Scott.

On Sep 22, 2012 7:01 PM, "Pascal Rapicault" <pascal@xxxxxxxxxxxxx> wrote:
The platform URL is an extensible URL scheme defined by the eclipse runtime. The runtime itself defines a couple type of these URLs like platform:/configuration,  platform:/base (http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fplatform-scheme-uri.html&cp=2_1_3_14)
Since it is extensible the resources plugin adds support for platform:/resource

I assume taht the tests are failing because you don't have the org.eclipse.core.resources included in the test execution.

On 2012-09-21, at 9:45 AM, Oberlies, Tobias wrote:

> Where does the platform: syntax comes from? It is possible that some bundle contributes this syntax via some extension mechanism, but that bundle is not in Tycho's test runtime. Unlike the PDE, Tycho only includes the transitive dependencies of your test bundle in the test runtime. So if there is something else needed, you need to configure this on the tycho-surefire-plugin.
>
> Regards
> Tobias
>
>> -----Original Message-----
>> From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-
>> bounces@xxxxxxxxxxx] On Behalf Of Scott Finnie
>> Sent: Donnerstag, 20. September 2012 15:55
>> To: tycho-user@xxxxxxxxxxx
>> Subject: [tycho-user] [newbie] failure loading test resources from tycho
>> but OK in IDE?
>>
>> Apologies if this is answered somewhere else.  If so link(s) appreciated.
>>
>> Context: complete newbie to maven & tycho, trying to run junit tests for
>> xtext-based project.
>>
>> I have integration tests that need to load test resources.  When run from
>> the IDE it works fine but fails in tycho
>> because it can't find the test resources.  Code as follows:
>>
>> //...
>> final String pathroot =
>> "org.domainmodels.ooa.tests/testdata/TestOoaStructure/"
>> URI uri = URI.createPlatformResourceURI(pathroot+filename, true);
>> System.out.println("Loading model from URI: " + uri.toString());
>> rootElement = loadModel(resourceSet, uri, getRootObjectType(uri));
>> //...
>>
>> When run from IDE this prints e.g.:
>>
>>   Loading model from URI:
>> platform:/resource/org.domainmodels.ooa.tests/testdata/TestOoaStructure/Te
>> stDomain.ooa
>>
>> and tests run fine.
>>
>> However from tycho it fails:
>>
>> Loading model from URI:
>> platform:/resource/org.domainmodels.ooa.tests/testdata/TestOoaStructure/Te
>> stDomain.ooa
>> ...
>> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Resource
>> '/org.domainmodels.ooa.tests/testdata/TestOoaStructure/ClassTest.ooa' does
>> not exist.
>>
>> I have tried with absolute file-based URLs (using URI.createFileURI) and
>> it works; however absolute paths is obviously
>> not a sustainable solution.
>>
>> So my questions are:
>> 1. Why does the platform-based URI scheme work in the IDE - but not from
>> tycho?
>> 2. Any suggestions for how I solve the problem?  Really don't want to use
>> absolute paths.
>>
>> Thanks,
>> Scott.
>> _______________________________________________
>> tycho-user mailing list
>> tycho-user@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/tycho-user
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user