[TIP] Exclude Tests From Your Jar

When you have a tests in your project you don't want to distribute then with your final jar. It's easy to filter out all the tests in mobility project properties in Mobility Pack. Just check the Exclude Test Sources option. It will filter out \*\*/\*Test.java,\*\*/test,\*\*/test/\*\* files. It means all files ending with Test.java and all test directories.
When you know how to work with configurations then it's easy to check the option in DefaultConfiguration. All configuration will exclude the tests. Then create a new TestConfiguration for testing purposes and uncheck the Use Values from DefaultConfiguration check box and check the Exclude Test Sources.
Comments:

Hi Lukas,

The suggestion to check the "Use values from DefaulfConfiguration" is not really helping me on this matter, since for different phones (configurations) I have different files to be included, most notably images due to different screen-sizes.

It would be nice to have a menu option to not run the MIDlet but to test it, which would do a re-compile and includes the tests. This instead of using a checkbox to include or exclude the test sources.
Similar would be for debug. Since MobPack seems to compile my sources at every go due to the pre-processor stuff, it could just recompile with debug code when you hit F5 (debug). When you hit F6 (run) it would compile without debug code.
For actual deployment to a phone you hardly want debug-code, so now I keep op changing the configurations themselves, because it is too much of a hassle to have configurations for a particular emulator/phone with and without debug code. Especially since you can only check "Use values from DefaultConfiguration. This should be a combobox, where you can select any of the defined configurations or <OVERRIDE> when you want to use specific settings.

Iwan

Posted by Iwan on July 25, 2006 at 02:21 AM CEST #

All seems like valid improvements for me...
The tree structure of configuration with inheritance could solve it probably.

You are right, we should change approach. Default settings should be meant always for distribution build.

Will you fill the enhancements to issuezilla by yourself or should I do it?
  • Add Test Project action to menu
  • tree structure of configuration is filled already
  • Exclude tests from build/run by default
  • Exclude //#mdebug //#debug from build/run by default - leave it only in configurations with DebugLevel set to a value. Enable them automatically when debugging.

    Posted by Lukas on July 25, 2006 at 04:46 AM CEST #

Hi Lukas,
I'll file them asap.

Iwan

Posted by Iwan on July 25, 2006 at 07:00 AM CEST #

thank you

Posted by Lukas on July 25, 2006 at 07:10 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This is the main channel to share news, tips and other stuff related to my work. Sometimes you can find even personal stuff. Enjoy your reading...

Search

Archives
« February 2015
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
       
       
Today
news
Blogroll

No bookmarks in folder

OldNews
MyTrash
NavBar
NetBeans
LinksToBeExpanded