Lines 305-311
Link Here
|
305 |
use spec.version.base (see below). |
305 |
use spec.version.base (see below). |
306 |
|
306 |
|
307 |
Specify your test dependencies on other modules [since 5.0u2, requires /3 |
307 |
Specify your test dependencies on other modules [since 5.0u2, requires /3 |
308 |
schema]: |
308 |
schema]. Runtime module dependencies are added on compile and runtime classpath of |
|
|
309 |
tests for compatibility with /2 schema. The tags in project.xml are |
310 |
described bellow: |
309 |
|
311 |
|
310 |
<test-dependencies> |
312 |
<test-dependencies> |
311 |
<test-type> |
313 |
<test-type> |
Lines 318-332
Link Here
|
318 |
<test-dependency> |
320 |
<test-dependency> |
319 |
<!-- Identification of module our tests depend upon. --> |
321 |
<!-- Identification of module our tests depend upon. --> |
320 |
<code-name-base>org.netbeans.modules.java.project</code-name-base> |
322 |
<code-name-base>org.netbeans.modules.java.project</code-name-base> |
321 |
<!-- Include also transitive dependencies of that module. --> |
323 |
<!-- Include also transitive module dependencies of that module. --> |
322 |
<recursive/> |
324 |
<recursive/> |
323 |
<!-- Always available when running, but to include at compile time also: --> |
325 |
<!-- Always available when running, but to include at compile time also. --> |
324 |
<compile-dependency/> |
326 |
<compile-dependency/> |
325 |
<!-- To request the tests of that module, rather than the module itself: --> |
327 |
<!-- To request the tests of that module, rather than the module itself. --> |
326 |
<test/> |
328 |
<test/> |
327 |
</test-dependency> |
329 |
</test-dependency> |
328 |
</test-type> |
330 |
</test-type> |
329 |
</test-dependencies> |
331 |
</test-dependencies> |
|
|
332 |
|
333 |
For example we have three modules with code name bases A,B,C. A depends on B, B depends on C. |
334 |
|
335 |
Use case 1: |
336 |
|
337 |
<test-type> |
338 |
<name>unit</name> |
339 |
<test-dependency> |
340 |
<code-name-base>A</code-name-base> |
341 |
</test-dependency> |
342 |
</testtype> |
343 |
|
344 |
Runtime classpath is A. |
345 |
Compile classpath is not defined. |
346 |
|
347 |
Use case 2: |
348 |
|
349 |
<test-type> |
350 |
<name>unit</name> |
351 |
<test-dependency> |
352 |
<code-name-base>A</code-name-base> |
353 |
<recursive/> |
354 |
</test-dependency> |
355 |
</testtype> |
356 |
|
357 |
Runtime classpath is A,B,C. |
358 |
|
359 |
Use case 3: |
360 |
|
361 |
<test-type> |
362 |
<name>unit</name> |
363 |
<test-dependency> |
364 |
<code-name-base>A</code-name-base> |
365 |
<compile-dependency/> |
366 |
<recursive/> |
367 |
</test-dependency> |
368 |
</testtype> |
369 |
|
370 |
Runtime classpath is A,B,C. |
371 |
Compile classpath is A,B,C. |
372 |
|
373 |
Use case 4: |
374 |
|
375 |
<test-type> |
376 |
<name>unit</name> |
377 |
<test-dependency> |
378 |
<code-name-base>A</code-name-base> |
379 |
<compile-dependency/> |
380 |
<recursive/> |
381 |
<test/> |
382 |
</test-dependency> |
383 |
</testtype> |
384 |
|
385 |
Runtime classpath is A,B,C, unittests of A. |
386 |
Compile classpath is A,B,C, unittests of A. |
387 |
|
388 |
Source roots for tests are placed at: |
389 |
|
390 |
${project.dir}/test/unit/src/ - source folder for unit testtype |
391 |
${project.dir}/test/qa-functional/src - source folder for qa-functional testtype |
330 |
|
392 |
|
331 |
As an example, to ensure that FileUtil.toFileObject(File) will work when your |
393 |
As an example, to ensure that FileUtil.toFileObject(File) will work when your |
332 |
unit tests are run: |
394 |
unit tests are run: |