This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 47326

Summary: Need unit tests for j2seproject build-impl.xml functionality
Product: java Reporter: Jesse Glick <jglick>
Component: ProjectAssignee: David Konecny <dkonecny>
Status: RESOLVED FIXED    
Severity: blocker CC: tzezula
Priority: P2    
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 41537    

Description Jesse Glick 2004-08-17 16:46:22 UTC
I guess they should call J2SEProjectGenerator with
some parameters, set up a couple of source files,
and then invoke Ant targets. (ActionUtils may be
handy there.)

You can check just the effect of the build - exit
status and any changes on disk - where build
messages will be printed to stdout/err. Or you can
supply a special IOProvider (see
IOProvider.Trivial for ideas) which collects
messages and checks them.

In either case, need a simple InstalledFileLocator
to point to nbbuild/netbeans/ide4/ant/ for the
query "ant" or any query starting with "ant/".

There are existing examples of many of these
techniques in other unit tests; see for example
JavaAntLoggerTest.
Comment 1 David Konecny 2004-09-21 10:53:38 UTC
Two tests added:
* J2SEProjectGeneratorTest - checks that all files and properties are
correctly created
* BuildImplTest (excluded from commit-validation) - checks that basic
target produce expected results based on the properties passed from IDE.

Fixed in:
nbproject/project.properties;
new revision: 1.9; previous revision: 1.8
test/cfg-unit.xml;
new revision: 1.2; previous revision: 1.1
test/unit/src/org/netbeans/modules/java/j2seproject/BuildImplTest.java;
initial revision: 1.1
test/unit/src/org/netbeans/modules/java/j2seproject/J2SEProjectGeneratorTest.java;
initial revision: 1.1