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.
Tests of Java/freeform module uses datadir of ant/freeform. Execution of tests doesn't works in test distribution. Please remove: # Better to fix by not using a data dir (just generator), or copying required files into java/freeform/test/unit/data test-unit-sys-prop.xtest.data=${nb_all}/ant/freeform/test/unit/data You can fix this problem in two ways: 1) Either don't depends on datadir. For example you can add resource on classpath of tests. You can access to the resource by using Class.resource.asStream in test initialization 2)or ovverride tasks in build.xml of project: <target name="test-build-datajar" depends="do-test-build" if="exists.test.data"> <zip destfile="${test.unit.out.folder}/data.zip" basedir="${test.unit.dir}/data"/> </target> to somethink like ... <target name="test-build-datajar" depends="do-test-build" if="exists.test.data"> <zip destfile="${test.unit.out.folder}/data.zip" basedir="${nb_all}/ant/freeform/test/unit/data"/> </target>
P3 -> P2 We switch daily test runs to binary tests distribution. Please either remove tests from stable test suite or fix it. Thanks. Proposal for stable test suite is available at: http://wiki.netbeans.org/wiki/view/TestAttribsInUse
It isn't easy to use other datadir together for binary distribution and xtest. At xtest side it is necessary to override xtest.data property Unfortunatelly this property is automatically copied to test.properties of bin test dist. NBM harness doesn't know nothing about xtest.data property. It's correct because NBM harness doesn't depends on xtest. I am going to add to common.xml ability to override data dir location <property name="test.unit.data.dir" location="${test.unit.dir}/data"/> I am not sure if is good idea to add some info about test.uit.data.dir to harness/README Jesse, what do you think about my workaround? Finally if some one can use datadir from other project he can do it. If he want to use xtest for test run he needs to override test-unit-sys-prop.xtest.data property in nbproject/project.properties. If he want to use junit he needs to override test.unit.data.dir property in nbproject/project.properties.
Created attachment 38542 [details] patch
fixed Checking in nbbuild/antsrc/org/netbeans/nbbuild/ShorterPaths.java; /cvs/nbbuild/antsrc/org/netbeans/nbbuild/ShorterPaths.java,v <-- ShorterPaths.java new revision: 1.5; previous revision: 1.4 done Checking in nbbuild/templates/common.xml; /cvs/nbbuild/templates/common.xml,v <-- common.xml new revision: 1.56; previous revision: 1.55 done Checking in nbbuild/test/unit/src/org/netbeans/nbbuild/ShorterPathsTest.java; /cvs/nbbuild/test/unit/src/org/netbeans/nbbuild/ShorterPathsTest.java,v <-- ShorterPathsTest.java new revision: 1.3; previous revision: 1.2 done Checking in nbbuild/test/unit/src/org/netbeans/nbbuild/ShorterPathsTest.xml; /cvs/nbbuild/test/unit/src/org/netbeans/nbbuild/ShorterPathsTest.xml,v <-- ShorterPathsTest.xml new revision: 1.3; previous revision: 1.2 done Checking in java/freeform/nbproject/project.properties; /cvs/java/freeform/nbproject/project.properties,v <-- project.properties new revision: 1.16; previous revision: 1.15 done
IMO better would be to delete these old crappy tests that use the data dir and rewrite to generate projects in the workdir.
There are only problems with data dirs. I am for to deprecate : NbTestCase.getDatadir()