Custom Location for Unit Test Classes with 'NetBeans Module'-Projects

View: New views
4 Messages — Rating Filter:   Alert me  

Custom Location for Unit Test Classes with 'NetBeans Module'-Projects

by Q. L. Nguyen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If i want to create JUnit-Test-Classes for my 'NetBeans Module'-Project I cannot specify custom location for my JUnit-test-Classes. The default location "Unit Test Packages" and directory "test/unit/src", respectively, cannot be unset. My task is it to set the location of my JUnit-Test-Classes to the directory "test/src".

It is possible to specify a custom location when working with other projects like normal Java Applications or FreeForm-Projects - but why not with 'NetBeans Module'-Projects?

Is there any property in some build-scripts I can set?

Re: Custom JUnit-Test-Classes-Location with 'NetBeans Module'-Projects

by tomwheel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't think you can change it, at least not without modifications to
the build harness and source code to the IDE.

I've never needed to change the default locations, but I can explain
why they're that way.

Having a package of test/src limits you to one type of test; unit
tests in this case.  NetBeans puts an extra folder in the path to
indicate the type of test, so you have test/unit/src for unit tests
and test/qa-functional/src for functional tests.

On Tue, Oct 20, 2009 at 2:09 AM, Q. L. Nguyen <teklan@...> wrote:

>
> If i want to create JUnit-Test-Classes for my 'NetBeans Module'-Project I
> cannot specify custom location for my JUnit-test-Classes. The default
> location "Unit Test Packages" and directory "test/unit/src", respectively,
> cannot be unset. My task is it to set the location of my JUnit-Test-Classes
> to the directory "test/src".
>
> It is possible to specify a custom location when working with other projects
> like normal Java Applications or FreeForm-Projects - but why not with
> 'NetBeans Module'-Projects?
>
> Is there any property in some build-scripts I can set?
> --
> View this message in context: http://www.nabble.com/Custom-JUnit-Test-Classes-Location-with-%27NetBeans-Module%27-Projects-tp25970660p25970660.html
> Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
>
>



--
Tom Wheeler
http://www.tomwheeler.com/

Re: Custom JUnit-Test-Classes-Location with 'NetBeans Module'-Projects

by Jesse Glick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Q. L. Nguyen wrote:
> If i want to create JUnit-Test-Classes for my 'NetBeans Module'-Project I
> cannot specify custom location for my JUnit-test-Classes. The default
> location "Unit Test Packages" and directory "test/unit/src", respectively,
> cannot be unset. My task is it to set the location of my JUnit-Test-Classes
> to the directory "test/src".
>
> Is there any property in some build-scripts I can set?

Set test.unit.src.dir in project.properties. Probably never been tested but it may work for you.


Re: Custom JUnit-Test-Classes-Location with 'NetBeans Module'-Projects

by Q. L. Nguyen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

@Tom Wheeler
Thank your for the interesting information on the test-directory :)

@Jesse Glick
It works:)
The default directory for the Unit Test Packages is custom now and building the application is still possible without any other modifications to the buildscripts. However, the JUnit-Test-Classes are not generated "cleanly" anymore (e.g. "package xyz"-line is missing) when using the JUnit-Test-Classes-Wizard in the IDE. But that's no real problem. Furthermore, one still needs a folder "test/unit" (can be empty), so that the build can run.