| 412 | <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}"> |
| 413 | <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2"> |
| 414 | <attribute default="${includes}" name="includes"/> |
| 415 | <attribute default="${excludes}" name="excludes"/> |
| 416 | <attribute default="**" name="testincludes"/> |
| 417 | <attribute default="" name="testmethods"/> |
| 418 | <element name="customize" optional="true"/> |
| 419 | <sequential> |
| 420 | <property name="run.jvmargs.ide" value=""/> |
| 421 | <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}"> |
| 422 | <batchtest todir="${build.test.results.dir}"> |
| 423 | <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> |
| 424 | <filename name="@{testincludes}"/> |
| 425 | </fileset> |
| 426 | <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}"> |
| 427 | <filename name="${test.binarytestincludes}"/> |
| 428 | </fileset> |
| 429 | </batchtest> |
| 430 | <syspropertyset> |
| 431 | <propertyref prefix="test-sys-prop."/> |
| 432 | <mapper from="test-sys-prop.*" to="*" type="glob"/> |
| 433 | </syspropertyset> |
| 434 | <formatter type="brief" usefile="false"/> |
| 435 | <formatter type="xml"/> |
| 436 | <jvmarg value="-ea"/> |
| 437 | <jvmarg line="${run.jvmargs.ide}"/> |
| 438 | <customize/> |
| 439 | </junit> |
| 440 | </sequential> |
| 441 | </macrodef> |
| 442 | </target> |
| 443 | <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/> |
| 444 | <target if="${testng.available}" name="-init-macrodef-testng"> |
| 445 | <macrodef name="testng" uri="http://www.netbeans.org/ns/web-project/2"> |
| 446 | <attribute default="${includes}" name="includes"/> |
| 447 | <attribute default="${excludes}" name="excludes"/> |
| 448 | <attribute default="**" name="testincludes"/> |
| 449 | <attribute default="" name="testmethods"/> |
| 450 | <element name="customize" optional="true"/> |
| 451 | <sequential> |
| 452 | <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}"> |
| 453 | <isset property="test.method"/> |
| 454 | </condition> |
| 455 | <union id="test.set"> |
| 456 | <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}"> |
| 457 | <filename name="@{testincludes}"/> |
| 458 | </fileset> |
| 459 | </union> |
| 460 | <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/> |
| 461 | <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="sql-vyuka" testname="TestNG tests" workingDir="${basedir}"> |
| 462 | <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/> |
| 463 | <propertyset> |
| 464 | <propertyref prefix="test-sys-prop."/> |
| 465 | <mapper from="test-sys-prop.*" to="*" type="glob"/> |
| 466 | </propertyset> |
| 467 | <customize/> |
| 468 | </testng> |
| 469 | </sequential> |
| 470 | </macrodef> |
| 471 | </target> |
| 472 | <target name="-init-macrodef-test-impl"> |
| 473 | <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2"> |
| 474 | <attribute default="${includes}" name="includes"/> |
| 475 | <attribute default="${excludes}" name="excludes"/> |
| 476 | <attribute default="**" name="testincludes"/> |
| 477 | <attribute default="" name="testmethods"/> |
| 478 | <element implicit="true" name="customize" optional="true"/> |
| 479 | <sequential> |
| 480 | <echo>No tests executed.</echo> |
| 481 | </sequential> |
| 482 | </macrodef> |
| 483 | </target> |
| 484 | <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl"> |
| 485 | <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2"> |
| 486 | <attribute default="${includes}" name="includes"/> |
| 487 | <attribute default="${excludes}" name="excludes"/> |
| 488 | <attribute default="**" name="testincludes"/> |
| 489 | <attribute default="" name="testmethods"/> |
| 490 | <element implicit="true" name="customize" optional="true"/> |
| 491 | <sequential> |
| 492 | <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> |
| 493 | <customize/> |
| 494 | </webproject2:junit> |
| 495 | </sequential> |
| 496 | </macrodef> |
| 497 | </target> |
| 498 | <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl"> |
| 499 | <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2"> |
| 500 | <attribute default="${includes}" name="includes"/> |
| 501 | <attribute default="${excludes}" name="excludes"/> |
| 502 | <attribute default="**" name="testincludes"/> |
| 503 | <attribute default="" name="testmethods"/> |
| 504 | <element implicit="true" name="customize" optional="true"/> |
| 505 | <sequential> |
| 506 | <webproject2:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> |
| 507 | <customize/> |
| 508 | </webproject2:testng> |
| 509 | </sequential> |
| 510 | </macrodef> |
| 511 | </target> |
| 512 | <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test"> |
| 513 | <macrodef name="test" uri="http://www.netbeans.org/ns/web-project/2"> |
| 514 | <attribute default="${includes}" name="includes"/> |
| 515 | <attribute default="${excludes}" name="excludes"/> |
| 516 | <attribute default="**" name="testincludes"/> |
| 517 | <attribute default="" name="testmethods"/> |
| 518 | <sequential> |
| 519 | <webproject2:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> |
| 520 | <customize> |
| 521 | <classpath> |
| 522 | <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/> |
| 523 | </classpath> |
| 524 | <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> |
| 525 | <jvmarg line="${runmain.jvmargs}"/> |
| 526 | </customize> |
| 527 | </webproject2:test-impl> |
| 528 | </sequential> |
| 529 | </macrodef> |
| 530 | </target> |
| 531 | <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}"> |
| 532 | <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2"> |
| 533 | <attribute default="${includes}" name="includes"/> |
| 534 | <attribute default="${excludes}" name="excludes"/> |
| 535 | <attribute default="**" name="testincludes"/> |
| 536 | <attribute default="" name="testmethods"/> |
| 537 | <element name="customize" optional="true"/> |
| 538 | <sequential> |
| 539 | <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}"> |
| 540 | <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/> |
| 541 | <syspropertyset> |
| 542 | <propertyref prefix="test-sys-prop."/> |
| 543 | <mapper from="test-sys-prop.*" to="*" type="glob"/> |
| 544 | </syspropertyset> |
| 545 | <formatter type="brief" usefile="false"/> |
| 546 | <formatter type="xml"/> |
| 547 | <jvmarg value="-ea"/> |
| 548 | <jvmarg line="${debug-args-line}"/> |
| 549 | <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> |
| 550 | <customize/> |
| 551 | </junit> |
| 552 | </sequential> |
| 553 | </macrodef> |
| 554 | </target> |
| 555 | <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch"> |
| 556 | <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2"> |
| 557 | <attribute default="${includes}" name="includes"/> |
| 558 | <attribute default="${excludes}" name="excludes"/> |
| 559 | <attribute default="**" name="testincludes"/> |
| 560 | <attribute default="" name="testmethods"/> |
| 561 | <element name="customize" optional="true"/> |
| 562 | <sequential> |
| 563 | <property name="run.jvmargs.ide" value=""/> |
| 564 | <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}"> |
| 565 | <batchtest todir="${build.test.results.dir}"> |
| 566 | <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> |
| 567 | <filename name="@{testincludes}"/> |
| 568 | </fileset> |
| 569 | <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}"> |
| 570 | <filename name="${test.binarytestincludes}"/> |
| 571 | </fileset> |
| 572 | </batchtest> |
| 573 | <syspropertyset> |
| 574 | <propertyref prefix="test-sys-prop."/> |
| 575 | <mapper from="test-sys-prop.*" to="*" type="glob"/> |
| 576 | </syspropertyset> |
| 577 | <formatter type="brief" usefile="false"/> |
| 578 | <formatter type="xml"/> |
| 579 | <jvmarg value="-ea"/> |
| 580 | <jvmarg line="${run.jvmargs.ide}"/> |
| 581 | <jvmarg line="${debug-args-line}"/> |
| 582 | <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> |
| 583 | <customize/> |
| 584 | </junit> |
| 585 | </sequential> |
| 586 | </macrodef> |
| 587 | </target> |
| 588 | <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl"> |
| 589 | <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/web-project/2"> |
| 590 | <attribute default="${includes}" name="includes"/> |
| 591 | <attribute default="${excludes}" name="excludes"/> |
| 592 | <attribute default="**" name="testincludes"/> |
| 593 | <attribute default="" name="testmethods"/> |
| 594 | <element implicit="true" name="customize" optional="true"/> |
| 595 | <sequential> |
| 596 | <webproject2:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> |
| 597 | <customize/> |
| 598 | </webproject2:junit-debug> |
| 599 | </sequential> |
| 600 | </macrodef> |
| 601 | </target> |
| 602 | <target if="${testng.available}" name="-init-macrodef-testng-debug"> |
| 603 | <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/web-project/2"> |
| 604 | <attribute default="${main.class}" name="testClass"/> |
| 605 | <attribute default="" name="testMethod"/> |
| 606 | <element name="customize2" optional="true"/> |
| 607 | <sequential> |
| 608 | <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}"> |
| 609 | <isset property="test.method"/> |
| 610 | </condition> |
| 611 | <condition else="-suitename sql-vyuka -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}"> |
| 612 | <matches pattern=".*\.xml" string="@{testClass}"/> |
| 613 | </condition> |
| 614 | <delete dir="${build.test.results.dir}" quiet="true"/> |
| 615 | <mkdir dir="${build.test.results.dir}"/> |
| 616 | <webproject1:debug args="${testng.cmd.args}" classname="org.testng.TestNG" classpath="${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}"> |
| 617 | <customize> |
| 618 | <customize2/> |
| 619 | <jvmarg value="-ea"/> |
| 620 | <arg line="${testng.debug.mode}"/> |
| 621 | <arg line="-d ${build.test.results.dir}"/> |
| 622 | <arg line="-listener org.testng.reporters.VerboseReporter"/> |
| 623 | </customize> |
| 624 | </webproject1:debug> |
| 625 | </sequential> |
| 626 | </macrodef> |
| 627 | </target> |
| 628 | <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl"> |
| 629 | <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/web-project/2"> |
| 630 | <attribute default="${main.class}" name="testClass"/> |
| 631 | <attribute default="" name="testMethod"/> |
| 632 | <element implicit="true" name="customize2" optional="true"/> |
| 633 | <sequential> |
| 634 | <webproject2:testng-debug testClass="@{testClass}" testMethod="@{testMethod}"> |
| 635 | <customize2/> |
| 636 | </webproject2:testng-debug> |
| 637 | </sequential> |
| 638 | </macrodef> |
| 639 | </target> |
| 640 | <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit"> |
| 641 | <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2"> |
| 642 | <attribute default="${includes}" name="includes"/> |
| 643 | <attribute default="${excludes}" name="excludes"/> |
| 644 | <attribute default="**" name="testincludes"/> |
| 645 | <attribute default="" name="testmethods"/> |
| 646 | <attribute default="${main.class}" name="testClass"/> |
| 647 | <attribute default="" name="testMethod"/> |
| 648 | <sequential> |
| 649 | <webproject2:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> |
| 650 | <customize> |
| 651 | <classpath> |
| 652 | <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/> |
| 653 | </classpath> |
| 654 | <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> |
| 655 | <jvmarg line="${runmain.jvmargs}"/> |
| 656 | </customize> |
| 657 | </webproject2:test-debug-impl> |
| 658 | </sequential> |
| 659 | </macrodef> |
| 660 | </target> |
| 661 | <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng"> |
| 662 | <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2"> |
| 663 | <attribute default="${includes}" name="includes"/> |
| 664 | <attribute default="${excludes}" name="excludes"/> |
| 665 | <attribute default="**" name="testincludes"/> |
| 666 | <attribute default="" name="testmethods"/> |
| 667 | <attribute default="${main.class}" name="testClass"/> |
| 668 | <attribute default="" name="testMethod"/> |
| 669 | <sequential> |
| 670 | <webproject2:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}"> |
| 671 | <customize2> |
| 672 | <syspropertyset> |
| 673 | <propertyref prefix="test-sys-prop."/> |
| 674 | <mapper from="test-sys-prop.*" to="*" type="glob"/> |
| 675 | </syspropertyset> |
| 676 | </customize2> |
| 677 | </webproject2:testng-debug-impl> |
| 678 | </sequential> |
| 679 | </macrodef> |
| 680 | </target> |
| 681 | <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/> |
896 | | <target if="profiler.loadgen.path" name="start-loadgen"> |
| 1214 | <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72"> |
| 1215 | <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> |
| 1216 | <nbprofiledirect> |
| 1217 | <classpath> |
| 1218 | <path path="${run.test.classpath}"/> |
| 1219 | <path path="${j2ee.platform.classpath}"/> |
| 1220 | </classpath> |
| 1221 | </nbprofiledirect> |
| 1222 | <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true"> |
| 1223 | <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> |
| 1224 | <jvmarg value="${profiler.info.jvmargs.agent}"/> |
| 1225 | <jvmarg line="${profiler.info.jvmargs}"/> |
| 1226 | <test name="${profile.class}"/> |
| 1227 | <classpath> |
| 1228 | <path path="${run.test.classpath}"/> |
| 1229 | <path path="${j2ee.platform.classpath}"/> |
| 1230 | </classpath> |
| 1231 | <syspropertyset> |
| 1232 | <propertyref prefix="test-sys-prop."/> |
| 1233 | <mapper from="test-sys-prop.*" to="*" type="glob"/> |
| 1234 | </syspropertyset> |
| 1235 | <formatter type="brief" usefile="false"/> |
| 1236 | <formatter type="xml"/> |
| 1237 | </junit> |
| 1238 | </target> |
| 1239 | <target if="netbeans.home" name="-profile-check"> |
| 1240 | <condition property="profiler.configured"> |
| 1241 | <or> |
| 1242 | <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/> |
| 1243 | <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/> |
| 1244 | </or> |
| 1245 | </condition> |
| 1246 | </target> |
| 1247 | <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" name="-do-profile"> |
| 1248 | <startprofiler/> |
| 1249 | <nbstartserver profilemode="true"/> |
| 1250 | <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/> |
| 1251 | <antcall target="debug-display-browser"/> |
| 1252 | <antcall target="-profile-start-loadgen"/> |
| 1253 | </target> |
| 1254 | <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent"> |
| 1255 | <antcall target="-do-profile"/> |
| 1256 | </target> |
| 1257 | <target depends="-profile-test-single-pre72" name="profile-test-single"/> |
| 1258 | <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent"> |
| 1259 | <startprofiler/> |
| 1260 | <antcall target="test-single"/> |
| 1261 | </target> |
| 1262 | <target if="profiler.loadgen.path" name="-profile-start-loadgen"> |