Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Source and Test Folder
Source and Test Folder [message #331503] Wed, 10 September 2008 17:39 Go to next message
Eclipse UserFriend
Originally posted by: mohsen.siahe.com

Hello,

Is this possible to set a source folder as test folder inside Eclipse? I
noticed that in Export tab of Build Path, this is not possible to uncheck a
source folder from being exported.
This is a common requirement that you don't need the test folder to be
exported.

Mohsen.
Re: Source and Test Folder [message #331504 is a reply to message #331503] Wed, 10 September 2008 17:32 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Mohsen Saboorian wrote:
> Hello,
>
> Is this possible to set a source folder as test folder inside Eclipse? I
> noticed that in Export tab of Build Path, this is not possible to uncheck a
> source folder from being exported.
> This is a common requirement that you don't need the test folder to be
> exported.
>
> Mohsen.
>
>
Hi Mohsen,

not sure if that is your question, but yes you can create a separate
folder for test then this is possible:

http://www.vogella.de/articles/JUnit/article.html#juniteclip se

If you just want to avoid exporting the tests I personally use a
different package name, e.g. the orginal packagename.test. This way you
don't have to export it. Or you put your tests into a different plug-in.

Best regards, Lars

--
Lars Vogel
http://www.vogella.de/eclipse.html - Tutorials about Eclipse
http://www.vogella.de/articles/RichClientPlatform/article.ht ml - Eclipse
RCP Tutorial
Re: Source and Test Folder [message #331506 is a reply to message #331504] Wed, 10 September 2008 18:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mohsen.siahe.com

Lars, thanks for the answer.

I know about the possibility of having multiple source folders (and so using
one as the folder of all test files). It's also a good practice to create
test cases in the same package (but different source folder) as the original
class being tested (in order to test package-private and protected methods).

Now suppose you have a project with utility module facet in a Java EE
environmet. You project output classes will be automatically packed into a
jar file, and deployed in a webmodule (which depends on this project). The
only possibility to exclude a source folder from being bundled in the jar is
to unckeck it in export tab in build path of project properties, which is
currently not allowed.

Mohsen.


"Lars Vogel" <Lars.Vogel@gmail.com> wrote in message
news:ga90av$qhn$1@build.eclipse.org...
> Mohsen Saboorian wrote:
>> Hello,
>>
>> Is this possible to set a source folder as test folder inside Eclipse? I
>> noticed that in Export tab of Build Path, this is not possible to uncheck
>> a source folder from being exported.
>> This is a common requirement that you don't need the test folder to be
>> exported.
>>
>> Mohsen.
> Hi Mohsen,
>
> not sure if that is your question, but yes you can create a separate
> folder for test then this is possible:
>
> http://www.vogella.de/articles/JUnit/article.html#juniteclip se
>
> If you just want to avoid exporting the tests I personally use a different
> package name, e.g. the orginal packagename.test. This way you don't have
> to export it. Or you put your tests into a different plug-in.
>
> Best regards, Lars
>
> --
> Lars Vogel
> http://www.vogella.de/eclipse.html - Tutorials about Eclipse
> http://www.vogella.de/articles/RichClientPlatform/article.ht ml - Eclipse
> RCP Tutorial
Re: Source and Test Folder [message #331508 is a reply to message #331506] Wed, 10 September 2008 18:24 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

Lets see what other people may add here, but I changing the package or
putting the tests into a different plug-ins are the only ways I know to
hide test classes.



Mohsen Saboorian wrote:
> Lars, thanks for the answer.
>
> I know about the possibility of having multiple source folders (and so using
> one as the folder of all test files). It's also a good practice to create
> test cases in the same package (but different source folder) as the original
> class being tested (in order to test package-private and protected methods).
>
> Now suppose you have a project with utility module facet in a Java EE
> environmet. You project output classes will be automatically packed into a
> jar file, and deployed in a webmodule (which depends on this project). The
> only possibility to exclude a source folder from being bundled in the jar is
> to unckeck it in export tab in build path of project properties, which is
> currently not allowed.
>
> Mohsen.
>
>
> "Lars Vogel" <Lars.Vogel@gmail.com> wrote in message
> news:ga90av$qhn$1@build.eclipse.org...
>> Mohsen Saboorian wrote:
>>> Hello,
>>>
>>> Is this possible to set a source folder as test folder inside Eclipse? I
>>> noticed that in Export tab of Build Path, this is not possible to uncheck
>>> a source folder from being exported.
>>> This is a common requirement that you don't need the test folder to be
>>> exported.
>>>
>>> Mohsen.
>> Hi Mohsen,
>>
>> not sure if that is your question, but yes you can create a separate
>> folder for test then this is possible:
>>
>> http://www.vogella.de/articles/JUnit/article.html#juniteclip se
>>
>> If you just want to avoid exporting the tests I personally use a different
>> package name, e.g. the orginal packagename.test. This way you don't have
>> to export it. Or you put your tests into a different plug-in.
>>
>> Best regards, Lars
>>
>> --
>> Lars Vogel
>> http://www.vogella.de/eclipse.html - Tutorials about Eclipse
>> http://www.vogella.de/articles/RichClientPlatform/article.ht ml - Eclipse
>> RCP Tutorial
>
>


--
Lars Vogel
http://www.vogella.de/eclipse.html - Tutorials about Eclipse
http://www.vogella.de/articles/RichClientPlatform/article.ht ml - Eclipse
RCP Tutorial
Re: Source and Test Folder [message #331510 is a reply to message #331506] Wed, 10 September 2008 18:31 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

I should perhaps add: I'm taking about the Runtime Tab in the
plugin.xml. From your response it doesn't sound like you are doing
plug-in development....
Re: Source and Test Folder [message #331526 is a reply to message #331503] Thu, 11 September 2008 12:46 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Mohsen Saboorian wrote:
> Hello,
>
> Is this possible to set a source folder as test folder inside Eclipse? I
> noticed that in Export tab of Build Path, this is not possible to uncheck a
> source folder from being exported.
> This is a common requirement that you don't need the test folder to be
> exported.

I'm not sure the Export tab is even used during "physical" export (as in
producing a JAR from the project's code). The settings on that tab are
used to control what is visible to other projects that depend on this
one within Eclipse, but I don't think it will have any affect if you do
an Export.

Eric
Previous Topic:IPackageFragment.getUnderlyingResource() for external folders()?
Next Topic:<visibleWhen checkEnabled=true/> not always working
Goto Forum:
  


Current Time: Tue Oct 01 22:31:19 GMT 2024

Powered by FUDForum. Page generated in 0.04015 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top